Message ID | 1414838144-4270-2-git-send-email-contact@paulk.fr |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
On Sat, Nov 01, 2014 at 11:35:44AM +0100, Paul Kocialkowski wrote: > Boards using the TWL4030 regulator may not all use the LDOs the same way > (e.g. MMC2 power can be controlled by another LDO than VMMC2). > This delegates TWL4030 MMC power initializations to board-specific functions, > that may still call twl4030_power_mmc_init for the default behavior. [snip] > +int board_mmc_power_init(void) > +{ > +#if defined(CONFIG_TWL4030_POWER) > + twl4030_power_mmc_init(); > + mdelay(100); /* ramp-up delay from Linux code */ > +#endif > + return 0; > +} > #endif I think we can do away with the #if defined(CONFIG_TWL4030_POWER) part here since all of these boards will fail pretty spectacularly without that being set and if someone does remove that a link error is better than a crazy runtime problem. [snip] > diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c > index 5b0c302..6e93a07 100644 > --- a/drivers/mmc/omap_hsmmc.c > +++ b/drivers/mmc/omap_hsmmc.c > @@ -130,12 +130,7 @@ static unsigned char mmc_board_init(struct mmc *mmc) > pbias_lite = readl(&t2_base->pbias_lite); > pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0); > writel(pbias_lite, &t2_base->pbias_lite); > -#endif > -#if defined(CONFIG_TWL4030_POWER) > - twl4030_power_mmc_init(); > - mdelay(100); /* ramp-up delay from Linux code */ > -#endif > -#if defined(CONFIG_OMAP34XX) > + > writel(pbias_lite | PBIASLITEPWRDNZ1 | > PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0, > &t2_base->pbias_lite); Since it's not clear from the context here, it's OK to drop the check on CONFIG_OMAP34XX here since there's already a test on it above where diff cut us off? Thanks!
> > Boards using the TWL4030 regulator may not all use the LDOs the same way > > (e.g. MMC2 power can be controlled by another LDO than VMMC2). > > This delegates TWL4030 MMC power initializations to board-specific functions, > > that may still call twl4030_power_mmc_init for the default behavior. > [snip] > > +int board_mmc_power_init(void) > > +{ > > +#if defined(CONFIG_TWL4030_POWER) > > + twl4030_power_mmc_init(); > > + mdelay(100); /* ramp-up delay from Linux code */ > > +#endif > > + return 0; > > +} > > #endif > > I think we can do away with the #if defined(CONFIG_TWL4030_POWER) part > here since all of these boards will fail pretty spectacularly without > that being set and if someone does remove that a link error is better > than a crazy runtime problem. That makes sense, I'll do that in v5. > [snip] > > diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c > > index 5b0c302..6e93a07 100644 > > --- a/drivers/mmc/omap_hsmmc.c > > +++ b/drivers/mmc/omap_hsmmc.c > > @@ -130,12 +130,7 @@ static unsigned char mmc_board_init(struct mmc *mmc) > > pbias_lite = readl(&t2_base->pbias_lite); > > pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0); > > writel(pbias_lite, &t2_base->pbias_lite); > > -#endif > > -#if defined(CONFIG_TWL4030_POWER) > > - twl4030_power_mmc_init(); > > - mdelay(100); /* ramp-up delay from Linux code */ > > -#endif > > -#if defined(CONFIG_OMAP34XX) > > + > > writel(pbias_lite | PBIASLITEPWRDNZ1 | > > PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0, > > &t2_base->pbias_lite); > > Since it's not clear from the context here, it's OK to drop the check on > CONFIG_OMAP34XX here since there's already a test on it above where diff > cut us off? Thanks! Indeed, that's the case (not sure this was actually more of a question than a statement). Thanks for the review!
diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c index 2b826df..784483b 100644 --- a/board/comelit/dig297/dig297.c +++ b/board/comelit/dig297/dig297.c @@ -133,6 +133,15 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} #endif #ifdef CONFIG_CMD_NET diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 0944903..93de1de 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -473,6 +473,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + /* * Routine: setup_net_chip_gmpc * Description: Setting up the configuration GPMC registers specific to the diff --git a/board/corscience/tricorder/tricorder.c b/board/corscience/tricorder/tricorder.c index 9e81bf3..9ade210 100644 --- a/board/corscience/tricorder/tricorder.c +++ b/board/corscience/tricorder/tricorder.c @@ -147,6 +147,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + /* * Routine: get_board_mem_timings * Description: If we use SPL then there is no x-loader nor config header diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 3b2b1f1..dd88b75 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -137,6 +137,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + void set_fdt(void) { switch (gd->bd->bi_arch_number) { diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 075fe94..8e19b6b 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -128,6 +128,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + #ifdef CONFIG_SMC911X /* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */ static const u32 gpmc_lan92xx_config[] = { diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c index 461a852..c06299c 100644 --- a/board/logicpd/zoom1/zoom1.c +++ b/board/logicpd/zoom1/zoom1.c @@ -96,6 +96,15 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} #endif #ifdef CONFIG_CMD_NET diff --git a/board/matrix_vision/mvblx/mvblx.c b/board/matrix_vision/mvblx/mvblx.c index a69359f..1f4ca47 100644 --- a/board/matrix_vision/mvblx/mvblx.c +++ b/board/matrix_vision/mvblx/mvblx.c @@ -94,6 +94,15 @@ int board_mmc_init(bd_t *bis) omap_mmc_init(1, 0, 0, -1, -1); return 0; } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} #endif #if defined(CONFIG_CMD_NET) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index c2e07db..e313fc2 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -659,3 +659,12 @@ int board_mmc_init(bd_t *bis) omap_mmc_init(1, 0, 0, -1, -1); return 0; } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} diff --git a/board/overo/overo.c b/board/overo/overo.c index 13220c5..d86eca4 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -437,3 +437,14 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0, 0, 0, -1, -1); } #endif + +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c index 146dcea..8fa0119 100644 --- a/board/pandora/pandora.c +++ b/board/pandora/pandora.c @@ -126,4 +126,13 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} #endif diff --git a/board/technexion/tao3530/tao3530.c b/board/technexion/tao3530/tao3530.c index 44a8240..64f2313 100644 --- a/board/technexion/tao3530/tao3530.c +++ b/board/technexion/tao3530/tao3530.c @@ -188,6 +188,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + #if defined(CONFIG_USB_EHCI) && !defined(CONFIG_SPL_BUILD) /* Call usb_stop() before starting the kernel */ void show_boot_progress(int val) diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 94b99bf..b47e44b 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -521,6 +521,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + #if defined(CONFIG_USB_EHCI) && !defined(CONFIG_SPL_BUILD) /* Call usb_stop() before starting the kernel */ void show_boot_progress(int val) diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 81dd081..c41a760 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -264,3 +264,14 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0, 0, 0, -1, -1); } #endif + +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif diff --git a/board/ti/sdp3430/sdp.c b/board/ti/sdp3430/sdp.c index 957940d..44e0418 100644 --- a/board/ti/sdp3430/sdp.c +++ b/board/ti/sdp3430/sdp.c @@ -195,4 +195,13 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } + +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} #endif diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index bcbee73..ef7fd0c 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -124,6 +124,17 @@ int board_mmc_init(bd_t *bis) } #endif +#if defined(CONFIG_GENERIC_MMC) +int board_mmc_power_init(void) +{ +#if defined(CONFIG_TWL4030_POWER) + twl4030_power_mmc_init(); + mdelay(100); /* ramp-up delay from Linux code */ +#endif + return 0; +} +#endif + #if defined(CONFIG_DRIVER_DM9000) & !defined(CONFIG_SPL_BUILD) /* * Routine: board_eth_init diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 5b0c302..6e93a07 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -130,12 +130,7 @@ static unsigned char mmc_board_init(struct mmc *mmc) pbias_lite = readl(&t2_base->pbias_lite); pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0); writel(pbias_lite, &t2_base->pbias_lite); -#endif -#if defined(CONFIG_TWL4030_POWER) - twl4030_power_mmc_init(); - mdelay(100); /* ramp-up delay from Linux code */ -#endif -#if defined(CONFIG_OMAP34XX) + writel(pbias_lite | PBIASLITEPWRDNZ1 | PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0, &t2_base->pbias_lite);
Boards using the TWL4030 regulator may not all use the LDOs the same way (e.g. MMC2 power can be controlled by another LDO than VMMC2). This delegates TWL4030 MMC power initializations to board-specific functions, that may still call twl4030_power_mmc_init for the default behavior. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> --- board/comelit/dig297/dig297.c | 9 +++++++++ board/compulab/cm_t35/cm_t35.c | 11 +++++++++++ board/corscience/tricorder/tricorder.c | 11 +++++++++++ board/isee/igep00x0/igep00x0.c | 11 +++++++++++ board/logicpd/omap3som/omap3logic.c | 11 +++++++++++ board/logicpd/zoom1/zoom1.c | 9 +++++++++ board/matrix_vision/mvblx/mvblx.c | 9 +++++++++ board/nokia/rx51/rx51.c | 9 +++++++++ board/overo/overo.c | 11 +++++++++++ board/pandora/pandora.c | 9 +++++++++ board/technexion/tao3530/tao3530.c | 11 +++++++++++ board/ti/beagle/beagle.c | 11 +++++++++++ board/ti/evm/evm.c | 11 +++++++++++ board/ti/sdp3430/sdp.c | 9 +++++++++ board/timll/devkit8000/devkit8000.c | 11 +++++++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 154 insertions(+), 6 deletions(-)