mmc: Board-specific MMC power initializations
v4 cover mmc: Board-specific MMC power initializations
Changelog:
v4:
* Switch board_mmc_power_init to void since there is no return value check
* Add dev_index to twl4030_power_mmc_init, common ramp-up delay
* twl4030_power_mmc_init call with the relevant dev_index on boards
* No check against CONFIG_TWL4030_POWER (an obvious linker error is better than a strange runtime error)
v3: Changes to make v2 apply on master
v2: Implement board_mmc_power_init instead of define
PATCH v4 1/3 mmc: Board-specific MMC power initializations
Some devices may use non-standard combinations of regulators to power MMC:
this allows these devices to provide a board-specific MMC power init function to set everything up in their own way.
--- drivers/mmc/mmc.c | 7 +++++++ include/mmc.h | 1 + 2 files changed, 8 insertions(+)
drivers/mmc/mmc.c +7 -0
@@ -1277,6 +1277,11 @@ block_dev_desc_t *mmc_get_dev(int dev) }#endif +/* board-specific MMC power initializations. */ +__weak void board_mmc_power_init (void ) +{ +} +int mmc_start_init (struct mmc *mmc) {int err;
@@ -1293,6 +1298,8 @@ int mmc_start_init(struct mmc *mmc)if (mmc->has_init)return 0 ; +board_mmc_power_init (); +/* made sure it's not NULL earlier */ err = mmc->cfg->ops->init (mmc);
include/mmc.h +1 -0
@@ -385,6 +385,7 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);int mmc_legacy_init (int verbose);#endif +void board_mmc_power_init (void );int board_mmc_init (bd_t *bis);int cpu_mmc_init (bd_t *bis);int mmc_get_env_addr (struct mmc *mmc,int copy,u32 *env_addr);
Signature · 1 line
1.9.1
PATCH v4 1/3 mmc: Board-specific MMC power initializations
Quoted 5 lines · Paul Kocialkowski
Some devices may use non-standard combinations of regulators to power MMC:
this allows these devices to provide a board-specific MMC power init function to set everything up in their own way.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/8e7458df/attachment.pgp>
PATCH v4 1/3 mmc: Board-specific MMC power initializations
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
Some devices may use non-standard combinations of regulators to power MMC:
this allows these devices to provide a board-specific MMC power init function to set everything up in their own way.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141205/29297492/attachment.pgp>
PATCH v4 2/3 twl4030: device-index-specific MMC power initializations, common ramp-up delay
In reply to Paul KocialkowskiNot every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in omap_hsmmc will enable both VMMC1 and VMMC2, in doubt.
--- drivers/mmc/omap_hsmmc.c | 4 ++-- drivers/power/twl4030.c | 28 +++++++++++++++++----------- include/twl4030.h | 2 +- 3 files changed, 20 insertions(+), 14 deletions(-)
drivers/mmc/omap_hsmmc.c +2 -2
@@ -137,8 +137,8 @@ static unsigned char mmc_board_init(struct mmc *mmc)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 */ +twl4030_power_mmc_init (0 ); +twl4030_power_mmc_init (1 );#endif #if defined(CONFIG_OMAP34XX ) writel(pbias_lite | PBIASLITEPWRDNZ1 |
drivers/power/twl4030.c +17 -11
@@ -91,17 +91,23 @@ void twl4030_power_init(void) TWL4030_PM_RECEIVER_DEV_GRP_P1); } -void twl4030_power_mmc_init (void ) +void twl4030_power_mmc_init (int dev_index) { -/* Set VMMC1 to 3.15 Volts */ -twl4030_pmrecv_vsel_cfg (TWL4030_PM_RECEIVER_VMMC1_DEDICATED , -TWL4030_PM_RECEIVER_VMMC1_VSEL_32 , -TWL4030_PM_RECEIVER_VMMC1_DEV_GRP , -TWL4030_PM_RECEIVER_DEV_GRP_P1 ); +if (dev_index ==0 ) { +/* Set VMMC1 to 3.15 Volts */ +twl4030_pmrecv_vsel_cfg (TWL4030_PM_RECEIVER_VMMC1_DEDICATED , +TWL4030_PM_RECEIVER_VMMC1_VSEL_32 , +TWL4030_PM_RECEIVER_VMMC1_DEV_GRP , +TWL4030_PM_RECEIVER_DEV_GRP_P1 ); -/* Set VMMC2 to 3.15 Volts */ -twl4030_pmrecv_vsel_cfg (TWL4030_PM_RECEIVER_VMMC2_DEDICATED , -TWL4030_PM_RECEIVER_VMMC2_VSEL_32 , -TWL4030_PM_RECEIVER_VMMC2_DEV_GRP , -TWL4030_PM_RECEIVER_DEV_GRP_P1 ); +mdelay (100 );/* ramp-up delay from Linux code */ + }else if (dev_index ==1 ) { +/* Set VMMC2 to 3.15 Volts */ +twl4030_pmrecv_vsel_cfg (TWL4030_PM_RECEIVER_VMMC2_DEDICATED , +TWL4030_PM_RECEIVER_VMMC2_VSEL_32 , +TWL4030_PM_RECEIVER_VMMC2_DEV_GRP , +TWL4030_PM_RECEIVER_DEV_GRP_P1 ); + +mdelay (100 );/* ramp-up delay from Linux code */ + } }
include/twl4030.h +1 -1
@@ -651,7 +651,7 @@ void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val,/* For initializing power device */ void twl4030_power_init (void );/* For initializing mmc power */ -void twl4030_power_mmc_init (void ); +void twl4030_power_mmc_init (int dev_index);/* * LED
Signature · 1 line
1.9.1
PATCH v4 2/3 twl4030: device-index-specific MMC power initializations, common ramp-up delay
Quoted 5 lines · Paul Kocialkowski
Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in
omap_hsmmcwill enable both VMMC1 and VMMC2, in doubt.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/2dd13d93/attachment.pgp>
PATCH v4 2/3 twl4030: device-index-specific MMC power initializations, common ramp-up delay
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in
omap_hsmmcwill enable both VMMC1 and VMMC2, in doubt.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141205/ec2c3e3d/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
In reply to Paul KocialkowskiBoards 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.
--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)
board/comelit/dig297/dig297.c +5 -0
@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif #ifdef CONFIG_CMD_NET
board/compulab/cm_t35/cm_t35.c +7 -0
@@ -382,6 +382,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#ifdef CONFIG_SYS_I2C_OMAP34XX /* * Routine: reset_net_chip
board/corscience/tricorder/tricorder.c +7 -0
@@ -147,6 +147,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +/* * Routine: get_board_mem_timings * Description: If we use SPL then there is no x-loader nor config header
board/isee/igep00x0/igep00x0.c +7 -0
@@ -150,6 +150,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +void set_fdt (void ) {switch (gd->bd->bi_arch_number) {
board/logicpd/omap3som/omap3logic.c +7 -0
@@ -128,6 +128,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#ifdef CONFIG_SMC911X /* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */ static const u32 gpmc_lan92xx_config[] = {
board/logicpd/zoom1/zoom1.c +5 -0
@@ -109,6 +109,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif #ifdef CONFIG_CMD_NET
board/matrix_vision/mvblx/mvblx.c +6 -0
@@ -94,6 +94,12 @@ int board_mmc_init(bd_t *bis)omap_mmc_init (1 ,0 ,0 ,-1 ,-1 ); return 0; } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +twl4030_power_mmc_init (1 ); +}#endif #if defined(CONFIG_CMD_NET )
board/nokia/rx51/rx51.c +6 -0
@@ -659,3 +659,9 @@ int board_mmc_init(bd_t *bis)omap_mmc_init (1 ,0 ,0 ,-1 ,-1 );return 0 ; } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +twl4030_power_mmc_init (1 ); +}
board/overo/overo.c +7 -0
@@ -493,6 +493,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
board/pandora/pandora.c +5 -0
@@ -126,4 +126,9 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif
board/technexion/tao3530/tao3530.c +7 -0
@@ -188,6 +188,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )/* Call usb_stop() before starting the kernel */ void show_boot_progress (int val)
board/ti/beagle/beagle.c +7 -0
@@ -534,6 +534,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )/* Call usb_stop() before starting the kernel */ void show_boot_progress (int val)
board/ti/evm/evm.c +7 -0
@@ -264,3 +264,10 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0, 0, 0, -1, -1); }#endif + +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif
board/ti/sdp3430/sdp.c +5 -0
@@ -195,4 +195,9 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif
board/timll/devkit8000/devkit8000.c +7 -0
@@ -124,6 +124,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_DRIVER_DM9000 ) & !defined(CONFIG_SPL_BUILD )/* * Routine: board_eth_init
drivers/mmc/omap_hsmmc.c +1 -6
@@ -135,12 +135,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 (0 ); -twl4030_power_mmc_init (1 ); -#endif -#if defined(CONFIG_OMAP34XX ) +writel (pbias_lite |PBIASLITEPWRDNZ1 |PBIASSPEEDCTRL0 |PBIASLITEPWRDNZ0 , &t2_base->pbias_lite);
Signature · 1 line
1.9.1
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
Le samedi 08 novembre 2014 ? 20:55 +0100, Paul Kocialkowski a ?crit :
Quoted 30 lines
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)board/comelit/dig297/dig297.c +0
-0
board/comelit/dig297/dig297.c int board_mmc_init(bd_t *bis) · line 138
Quoted 6 lines
board/comelit/dig297/dig297.c +3
-0@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{
I just figured, in the context of the SPL, board_mmc_init will be called from omap3/board.c instead of the board file, so perhaps it would be worth adding, in board_mmc_power_init: #ifdef CONFIG_SPL_BUILD and then checking spl_boot_device to only enable the relevant LDO.
In addition (on v4), board_mmc_init may call omap_mmc_init with a dev_index that is not used in the board's board_mmc_init, hence not listed to be enabled on board_mmc_power_init, leaving the MMC device potentially unpowered in that case. This is why we need to treat SPL context separately.
This should never actually be a problem as spl_boot_device() will return what the BootROM booted the SPL from, so it must have already enabled the relevant LDO. However, I'm using peripheral booting on the Optimus Black so I hardcode omap3_boot_device to MMC 1/2, so the LDOs are not enabled at all in my case. And after all, we shouldn't rely on what the BootROM did or didn't do.
While I'm not suggesting harcoding different behavior should happen on upstream code, we can imagine that omap3's spl_boot_device could become more flexible and return something else than what the BootROM booted the SPL from, hence making that case a valid one.
What do you think?
Quoted 247 lines
board/comelit/dig297/dig297.c +2
-0+ twl4030_power_mmc_init(0); +}#endif #ifdef CONFIG_CMD_NET board/compulab/cm_t35/cm_t35.c +7
-0@@ -382,6 +382,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#ifdef CONFIG_SYS_I2C_OMAP34XX /* * Routine: reset_net_chip board/corscience/tricorder/tricorder.c +7
-0@@ -147,6 +147,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +/* * Routine: get_board_mem_timings * Description: If we use SPL then there is no x-loader nor config header board/isee/igep00x0/igep00x0.c +7
-0@@ -150,6 +150,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +void set_fdt (void ) {switch (gd->bd->bi_arch_number) {board/logicpd/omap3som/omap3logic.c +7
-0@@ -128,6 +128,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#ifdef CONFIG_SMC911X /* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */ static const u32 gpmc_lan92xx_config[] = {board/logicpd/zoom1/zoom1.c +5
-0@@ -109,6 +109,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif #ifdef CONFIG_CMD_NET board/matrix_vision/mvblx/mvblx.c +6
-0@@ -94,6 +94,12 @@ int board_mmc_init(bd_t *bis)omap_mmc_init (1 ,0 ,0 ,-1 ,-1 ); return 0; } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +twl4030_power_mmc_init (1 ); +}#endif #if defined(CONFIG_CMD_NET )board/nokia/rx51/rx51.c +6
-0@@ -659,3 +659,9 @@ int board_mmc_init(bd_t *bis)omap_mmc_init (1 ,0 ,0 ,-1 ,-1 );return 0 ; } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +twl4030_power_mmc_init (1 ); +}board/overo/overo.c +7
-0@@ -493,6 +493,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,board/pandora/pandora.c +5
-0@@ -126,4 +126,9 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif board/technexion/tao3530/tao3530.c +7
-0@@ -188,6 +188,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )/* Call usb_stop() before starting the kernel */ void show_boot_progress (int val)board/ti/beagle/beagle.c +7
-0@@ -534,6 +534,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_USB_EHCI ) && !defined(CONFIG_SPL_BUILD )/* Call usb_stop() before starting the kernel */ void show_boot_progress (int val)board/ti/evm/evm.c +7
-0@@ -264,3 +264,10 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0, 0, 0, -1, -1); }#endif + +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif board/ti/sdp3430/sdp.c +5
-0@@ -195,4 +195,9 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +}#endif board/timll/devkit8000/devkit8000.c +7
-0@@ -124,6 +124,13 @@ int board_mmc_init(bd_t *bis) }#endif +#if defined(CONFIG_GENERIC_MMC ) +void board_mmc_power_init (void ) +{ +twl4030_power_mmc_init (0 ); +} +#endif +#if defined(CONFIG_DRIVER_DM9000 ) & !defined(CONFIG_SPL_BUILD )/* * Routine: board_eth_init drivers/mmc/omap_hsmmc.c +0
-0@@ -135,12 +135,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);
drivers/mmc/omap_hsmmc.c static unsigned char mmc_board_init(struct mmc *mmc) · line 141
Quoted 10 lines
drivers/mmc/omap_hsmmc.c +1
-6-#endif -#if defined(CONFIG_TWL4030_POWER ) -twl4030_power_mmc_init (0 ); -twl4030_power_mmc_init (1 ); -#endif -#if defined(CONFIG_OMAP34XX ) +writel (pbias_lite |PBIASLITEPWRDNZ1 |PBIASSPEEDCTRL0 |PBIASLITEPWRDNZ0 , &t2_base->pbias_lite);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141108/b5e07526/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
Quoted 26 lines · Paul Kocialkowski
Le samedi 08 novembre 2014 ? 20:55 +0100, Paul Kocialkowski a ?crit :
Quoted 25 lines
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)
Quoted 16 lines
board/comelit/dig297/dig297.c int board_mmc_init(bd_t *bis) · line 138
Quoted 11 lines
board/comelit/dig297/dig297.c +3
-0@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{I just figured, in the context of the SPL,
board_mmc_initwill be called fromomap3/board.cinstead of the board file, so perhaps it would be worth adding, inboard_mmc_power_init: #ifdefCONFIG_SPL_BUILDand then checkingspl_boot_deviceto only enable the relevant LDO.
If we get to this point we can do the same thing we do for board_mmc_init which is have one in say arch/arm/cpu/armv7/omap-common/boot-common.c that checks spl_boot_device()
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/15f4744e/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
Le lundi 10 novembre 2014 ? 13:46 -0500, Tom Rini a ?crit :
Quoted 44 lines · Paul Kocialkowski
Quoted 26 lines
Le samedi 08 novembre 2014 ? 20:55 +0100, Paul Kocialkowski a ?crit :
Quoted 25 lines
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)Quoted 16 lines
board/comelit/dig297/dig297.c int board_mmc_init(bd_t *bis) · line 138
Quoted 11 lines
board/comelit/dig297/dig297.c +3
-0@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{I just figured, in the context of the SPL,
board_mmc_initwill be called fromomap3/board.cinstead of the board file, so perhaps it would be worth adding, inboard_mmc_power_init: #ifdefCONFIG_SPL_BUILDand then checkingspl_boot_deviceto only enable the relevant LDO.
Quoted 4 lines
If we get to this point we can do the same thing we do for
board_mmc_initwhich is have one in sayarch/arm/cpu/armv7/omap-common/boot-common.cthat checksspl_boot_device()
That wouldn't work for my use case, on the Optimus Black, where regulators are used in a non-standard way. The whole point of this to me is to not have platform-common code to handle MMC regulators, because the way those are wired to MMC devices is not the same for each platform, but is instead board-specific.
Is there any objection to making a v5 that takes the SPL context in account on each of those boards?
Thanks
Signature · 16 lines
Paul Kocialkowski, Replicant developer Replicant is a fully free Android distribution Website: http://www.replicant.us/ Blog: http://blog.replicant.us/ Wiki/tracker/forums: http://redmine.replicant.us/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141111/4219fe12/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
Quoted 50 lines · Paul Kocialkowski
Le lundi 10 novembre 2014 ? 13:46 -0500, Tom Rini a ?crit :
Quoted 44 lines · Paul Kocialkowski
Quoted 26 lines
Le samedi 08 novembre 2014 ? 20:55 +0100, Paul Kocialkowski a ?crit :
Quoted 25 lines
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)Quoted 16 lines
board/comelit/dig297/dig297.c int board_mmc_init(bd_t *bis) · line 138
Quoted 11 lines
board/comelit/dig297/dig297.c +3
-0@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{I just figured, in the context of the SPL,
board_mmc_initwill be called fromomap3/board.cinstead of the board file, so perhaps it would be worth adding, inboard_mmc_power_init: #ifdefCONFIG_SPL_BUILDand then checkingspl_boot_deviceto only enable the relevant LDO.Quoted 4 lines
If we get to this point we can do the same thing we do for
board_mmc_initwhich is have one in sayarch/arm/cpu/armv7/omap-common/boot-common.cthat checksspl_boot_device()
Quoted 8 lines
That wouldn't work for my use case, on the Optimus Black, where regulators are used in a non-standard way. The whole point of this to me is to not have platform-common code to handle MMC regulators, because the way those are wired to MMC devices is not the same for each platform, but is instead board-specific.
Is there any objection to making a v5 that takes the SPL context in account on each of those boards?
Oh that's right, hmm. I think the answer is that for the SPL case where we _need_ to do something different, the board can already provide that and do it, with v4. The general case is that ROM will have done what needs doing for MMCSD load and in your case you can always go and turn it on in the board code.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141111/8ec35075/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
Le mardi 11 novembre 2014 ? 07:33 -0500, Tom Rini a ?crit :
Quoted 57 lines · Paul Kocialkowski
Quoted 56 lines
Le lundi 10 novembre 2014 ? 13:46 -0500, Tom Rini a ?crit :
Quoted 44 lines · Paul Kocialkowski
Quoted 26 lines
Le samedi 08 novembre 2014 ? 20:55 +0100, Paul Kocialkowski a ?crit :
Quoted 25 lines
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>--- board/comelit/dig297/dig297.c | 5 +++++ board/compulab/cm_t35/cm_t35.c | 7 +++++++ board/corscience/tricorder/tricorder.c | 7 +++++++ board/isee/igep00x0/igep00x0.c | 7 +++++++ board/logicpd/omap3som/omap3logic.c | 7 +++++++ board/logicpd/zoom1/zoom1.c | 5 +++++ board/matrix_vision/mvblx/mvblx.c | 6 ++++++ board/nokia/rx51/rx51.c | 6 ++++++ board/overo/overo.c | 7 +++++++ board/pandora/pandora.c | 5 +++++ board/technexion/tao3530/tao3530.c | 7 +++++++ board/ti/beagle/beagle.c | 7 +++++++ board/ti/evm/evm.c | 7 +++++++ board/ti/sdp3430/sdp.c | 5 +++++ board/timll/devkit8000/devkit8000.c | 7 +++++++ drivers/mmc/omap_hsmmc.c | 7 +------ 16 files changed, 96 insertions(+), 6 deletions(-)Quoted 16 lines
board/comelit/dig297/dig297.c int board_mmc_init(bd_t *bis) · line 138
Quoted 11 lines
board/comelit/dig297/dig297.c +3
-0@@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) {return omap_mmc_init (0 ,0 ,0 ,-1 ,-1 ); } + +void board_mmc_power_init (void ) +{I just figured, in the context of the SPL,
board_mmc_initwill be called fromomap3/board.cinstead of the board file, so perhaps it would be worth adding, inboard_mmc_power_init: #ifdefCONFIG_SPL_BUILDand then checkingspl_boot_deviceto only enable the relevant LDO.Quoted 4 lines
If we get to this point we can do the same thing we do for
board_mmc_initwhich is have one in sayarch/arm/cpu/armv7/omap-common/boot-common.cthat checksspl_boot_device()That wouldn't work for my use case, on the Optimus Black, where regulators are used in a non-standard way. The whole point of this to me is to not have platform-common code to handle MMC regulators, because the way those are wired to MMC devices is not the same for each platform, but is instead board-specific.
Quoted 8 lines
Quoted 2 lines
Is there any objection to making a v5 that takes the SPL context in account on each of those boards?
Oh that's right, hmm. I think the answer is that for the SPL case where we _need_ to do something different, the board can already provide that and do it, with v4. The general case is that ROM will have done what needs doing for MMCSD load and in your case you can always go and turn it on in the board code.
That should indeed cover most use cases. So let's let boards enable all the regulators they may need for MMC in board_mmc_power_init.
I'm good with v4 then!
Signature · 16 lines
Paul Kocialkowski, Replicant developer Replicant is a fully free Android distribution Website: http://www.replicant.us/ Blog: http://blog.replicant.us/ Wiki/tracker/forums: http://redmine.replicant.us/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141111/2109b36c/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/27c2b985/attachment.pgp>
PATCH v4 3/3 omap_hsmmc: Board-specific TWL4030 MMC power initializations
In reply to Paul KocialkowskiQuoted 7 lines · Paul Kocialkowski
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_initfor the default behavior.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141205/95fbc9be/attachment.pgp>