diff options
author | Pedro Perez de Heredia <pedro.perez@digi.com> | 2010-06-26 18:43:43 +0200 |
---|---|---|
committer | Pedro Perez de Heredia <pedro.perez@digi.com> | 2010-06-26 18:47:31 +0200 |
commit | bd075b1c30b6d1ab1aae519210ad41e10bae8df9 (patch) | |
tree | 0d53fcaa8cb71d455782cdea22b24f8018208ee6 | |
parent | 6bef037f0b3e41936980d707284f487df40ab085 (diff) |
ccwmx51: reset external module peripherals
This commit resets all the (built in the kernel) external module
peripherals (external mac, fec phy and wireless module).
Recent versions of u-boot doesnt touch the reset lines if the
peripherals are not used by the boot loader and the kernel needs
to set to high the peripherals reset lines.
This code should be move to a different place (peripheral
initialization code would be preferred)
Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
-rw-r--r-- | arch/arm/mach-mx5/mx51_ccwmx51js_pmic_mc13892.c | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/arch/arm/mach-mx5/mx51_ccwmx51js_pmic_mc13892.c b/arch/arm/mach-mx5/mx51_ccwmx51js_pmic_mc13892.c index 88864efe3b56..c230d1506071 100644 --- a/arch/arm/mach-mx5/mx51_ccwmx51js_pmic_mc13892.c +++ b/arch/arm/mach-mx5/mx51_ccwmx51js_pmic_mc13892.c @@ -20,6 +20,8 @@ #include <linux/pmic_external.h> #include <linux/regulator/machine.h> #include <linux/mfd/mc13892/core.h> +#include <linux/delay.h> +#include <asm/mach-types.h> #include "iomux.h" #include <mach/irqs.h> #include "mx51_pins.h" @@ -262,30 +264,6 @@ static struct regulator_init_data vgen3_init = { } }; -static struct regulator_init_data gpo1_init = { - .constraints = { - .name = "GPO1", - } -}; - -static struct regulator_init_data gpo2_init = { - .constraints = { - .name = "GPO2", - } -}; - -static struct regulator_init_data gpo3_init = { - .constraints = { - .name = "GPO3", - } -}; - -static struct regulator_init_data gpo4_init = { - .constraints = { - .name = "GPO4", - } -}; - static int mc13892_regulator_init(struct mc13892 *mc13892) { unsigned int value, register_mask; @@ -334,10 +312,25 @@ static int mc13892_regulator_init(struct mc13892 *mc13892) mc13892_register_regulator(mc13892, MC13892_VGEN2, &vgen2_init); mc13892_register_regulator(mc13892, MC13892_VGEN3, &vgen3_init); mc13892_register_regulator(mc13892, MC13892_VUSB, &vusb_init); - mc13892_register_regulator(mc13892, MC13892_GPO1, &gpo1_init); - mc13892_register_regulator(mc13892, MC13892_GPO2, &gpo2_init); - mc13892_register_regulator(mc13892, MC13892_GPO3, &gpo3_init); - mc13892_register_regulator(mc13892, MC13892_GPO4, &gpo4_init); + + /* FIXME Move the code below to the corresponding initialization functions */ + pmic_read_reg(REG_POWER_MISC, &value, 0xffffff); + value &= ~((3 << 8) | (3 << 10) | (3 << 12)); + pmic_write_reg(REG_POWER_MISC, value, (3 << 8) | (3 << 10) | (3 << 12)); + udelay(250); +#if defined(CONFIG_SMSC9118) || defined(CONFIG_SMSC9118_MODULE) + /* Set to high external mac reset line */ + value |= (1 << 8); +#endif +#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) + /* Set to high fec phy reset line */ + value |= (1 << 10); +#endif + if (machine_is_ccwmx51js() || machine_is_ccwmx51()) + /* Set to high wireless module reset line */ + value |= (1 << 12); + + pmic_write_reg(REG_POWER_MISC, value, (3 << 8) | (3 << 10) | (3 << 12)); return 0; } |