ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
Subsystems (3)
PATCH 1/1 ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
This ensures that an unused HSMMC block will not interfere with sleep.
--- arch/arm/mach-omap2/hsmmc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/hsmmc.c +8 -0
@@ -280,8 +280,16 @@ static struct omap_mmc_platform_data hsmmc_data = { }, }; +static void __init hsmmc_reset (void ) +{ +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS1_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS2_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS3_SYSCONFIG ); +} +void __init hsmmc_init (void ) { +hsmmc_reset ();omap2_init_mmc (&hsmmc_data); }
Signature · 1 line
1.5.4.3
Quoted 3 lines · ext Kevin Hilman
This ensures that an unused HSMMC block will not interfere with sleep.
Signed-off-by Kevin Hilman <[email protected]>
It was observed that bootrom code initializes mmc in such a way that prevents system from idling.
Quoted 32 lines
--- arch/arm/mach-omap2/hsmmc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)arch/arm/mach-omap2/hsmmc.c +8
-0@@ -280,8 +280,16 @@ static struct omap_mmc_platform_data hsmmc_data = { }, }; +static void __init hsmmc_reset (void ) +{ +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS1_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS2_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS3_SYSCONFIG ); +} +void __init hsmmc_init (void ) { +hsmmc_reset ();omap2_init_mmc (&hsmmc_data); }Signature · 6 lines
1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
balbi
Quoted 7 lines · ext Felipe Balbi
Quoted 3 lines · ext Kevin Hilman
This ensures that an unused HSMMC block will not interfere with sleep.
Signed-off-by Kevin Hilman <[email protected]>It was observed that bootrom code initializes mmc in such a way that prevents system from idling.
This was just my guess, back then when I was debugging it.
The case here is that after bootup mmc parent clock (96 Mhz fck) is not automatically cut off by hw, even if all it's child clocks are gated. This prevents core to enter sleep state. I found out that it is mmc who is guilty for this and resetting it helps. Funny part here is that this doesn't happen with all SDP boards. Again I have guess for this also:) This is sysboot pins. Boot sequence can be selected in SDP board using dip switches. If mmc is selected as a one bootdevice then this problem happens (or vice versa).
Anyway the plan is to have some generic code which resets all omap modules on boot. Maybe even configure them in a way that they do not break PM (or anything else). This would make sure that omap modules that do not have drivers, would still be in a known state. This is planned to be implemented in tiocp code. Paul, am I in line with you in this?
If it is true what I wrote above about tiocp, then this fix is temporary and will be removed as tiocp code gets in.
Quoted 43 lines
Acked-by Felipe Balbi <[email protected]>Quoted 32 lines
--- arch/arm/mach-omap2/hsmmc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)arch/arm/mach-omap2/hsmmc.c +8
-0@@ -280,8 +280,16 @@ static struct omap_mmc_platform_data hsmmc_data = { }, }; +static void __init hsmmc_reset (void ) +{ +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS1_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS2_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS3_SYSCONFIG ); +} +void __init hsmmc_init (void ) { +hsmmc_reset ();omap2_init_mmc (&hsmmc_data); }Signature · 6 lines
1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 5 lines
balbi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Jouni Högander -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello Jouni,
Quoted 6 lines · Högander Jouni
Anyway the plan is to have some generic code which resets all omap modules on boot. Maybe even configure them in a way that they do not break PM (or anything else). This would make sure that omap modules that do not have drivers, would still be in a known state. This is planned to be implemented in tiocp code. Paul, am I in line with you in this?
Yes, that is the plan.
- Paul
----- Original Message -----
From: "Kevin Hilman" <[email protected]>
To: <[email protected]>
Cc: "Kevin Hilman" <[email protected]>
Sent: Thursday, September 18, 2008 5:52 PM
Subject: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
Quoted 12 lines
This ensures that an unused HSMMC block will not interfere with sleep.
Signed-off-by Kevin Hilman <[email protected]>---
arch/arm/mach-omap2/hsmmc.c| 8 ++++++++1 files changed, 8 insertions(+), 0 deletions(-)arch/arm/mach-omap2/hsmmc.c +0
-0
arch/arm/mach-omap2/hsmmc.c static struct omap_mmc_platform_data hsmmc_data = { · line 289
Quoted 10 lines
arch/arm/mach-omap2/hsmmc.c +7
-0@@ -280,8 +280,16 @@ static struct omap_mmc_platform_data hsmmc_data = { }, }; +static void __init hsmmc_reset (void ) +{ +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS1_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS2_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS3_SYSCONFIG ); +} +
Where is MMCHS1_SYSCONFIG defined?
After seting the softreset bit in SYSCONFIG, you might want to poll on the RESETDONE bit in SYSSTATUS to wait for the reset to complete. The interface and functional clocks should be provided before the reset is issued for reset to complete. At this point, I guess the clocks are not enabled yet.
Regards,
Madhu
Quoted 15 lines
arch/arm/mach-omap2/hsmmc.c +1
-0void __init hsmmc_init (void ) { +hsmmc_reset ();omap2_init_mmc (&hsmmc_data); }Signature · 6 lines
1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 23 lines · Madhusudhan Chikkature
----- Original Message -----
From: "Kevin Hilman" <[email protected]>
To: <[email protected]>
Cc: "Kevin Hilman" <[email protected]>
Sent: Thursday, September 18, 2008 5:52 PM
Subject: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on bootQuoted 15 lines
This ensures that an unused HSMMC block will not interfere with sleep.
Signed-off-by Kevin Hilman <[email protected]>---
arch/arm/mach-omap2/hsmmc.c| 8 ++++++++1 files changed, 8 insertions(+), 0 deletions(-)arch/arm/mach-omap2/hsmmc.c +0
-0@@ -280,8 +280,16 @@ static struct omap_mmc_platform_data hsmmc_data = { }, };
Quoted 8 lines
arch/arm/mach-omap2/hsmmc.c static struct omap_mmc_platform_data hsmmc_data = { · line 289
Quoted 7 lines
arch/arm/mach-omap2/hsmmc.c +7
-0+static void __init hsmmc_reset (void ) +{ +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS1_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS2_SYSCONFIG ); +omap_writel (MMCHS_SYSCONFIG_SWRESET ,MMCHS3_SYSCONFIG ); +} +Where is
MMCHS1_SYSCONFIGdefined?
Oops, I sent this prematurely, indeed it doesn't compile. :(
Quoted 2 lines
After seting the softreset bit in SYSCONFIG, you might want to poll on the RESETDONE bit in SYSSTATUS to wait for the reset to complete.
OK, I'll add that.
Quoted 3 lines
The interface and functional clocks should be provided before the reset is issued for reset to complete. At this point, I guess the clocks are not enabled yet.
They're not enabled by the kernel, but I believe they are enabled by the bootloader. Are you suggesting I add explicit clk_enable|disable calls?
Kevin