* [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
@ 2008-09-18 12:22 Kevin Hilman
2008-09-18 12:45 ` Felipe Balbi
2008-09-18 12:46 ` Madhusudhan Chikkature
0 siblings, 2 replies; 6+ messages in thread
From: Kevin Hilman @ 2008-09-18 12:22 UTC (permalink / raw)
To: linux-omap; +Cc: Kevin Hilman
This ensures that an unused HSMMC block will not interfere with sleep.
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-omap2/hsmmc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 7334d86..03fe820 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -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);
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
2008-09-18 12:22 [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot Kevin Hilman
@ 2008-09-18 12:45 ` Felipe Balbi
2008-09-19 5:21 ` Högander Jouni
2008-09-18 12:46 ` Madhusudhan Chikkature
1 sibling, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2008-09-18 12:45 UTC (permalink / raw)
To: ext Kevin Hilman; +Cc: linux-omap
On Thu, Sep 18, 2008 at 03:22:32PM +0300, ext Kevin Hilman wrote:
> This ensures that an unused HSMMC block will not interfere with sleep.
>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
It was observed that bootrom code initializes mmc in such a way that
prevents system from idling.
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
> arch/arm/mach-omap2/hsmmc.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 7334d86..03fe820 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -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);
> }
>
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
balbi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
2008-09-18 12:22 [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot Kevin Hilman
2008-09-18 12:45 ` Felipe Balbi
@ 2008-09-18 12:46 ` Madhusudhan Chikkature
2008-09-18 13:33 ` Kevin Hilman
1 sibling, 1 reply; 6+ messages in thread
From: Madhusudhan Chikkature @ 2008-09-18 12:46 UTC (permalink / raw)
To: linux-omap; +Cc: Kevin Hilman
----- Original Message -----
From: "Kevin Hilman" <khilman@deeprootsystems.com>
To: <linux-omap@vger.kernel.org>
Cc: "Kevin Hilman" <khilman@deeprootsystems.com>
Sent: Thursday, September 18, 2008 5:52 PM
Subject: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
> This ensures that an unused HSMMC block will not interfere with sleep.
>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/hsmmc.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 7334d86..03fe820 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -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
> void __init hsmmc_init(void)
> {
> + hsmmc_reset();
> omap2_init_mmc(&hsmmc_data);
> }
>
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
2008-09-18 12:46 ` Madhusudhan Chikkature
@ 2008-09-18 13:33 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2008-09-18 13:33 UTC (permalink / raw)
To: Madhusudhan Chikkature; +Cc: linux-omap
"Madhusudhan Chikkature" <madhu.cr@ti.com> writes:
> ----- Original Message -----
> From: "Kevin Hilman" <khilman@deeprootsystems.com>
> To: <linux-omap@vger.kernel.org>
> Cc: "Kevin Hilman" <khilman@deeprootsystems.com>
> Sent: Thursday, September 18, 2008 5:52 PM
> Subject: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
>
>
>> This ensures that an unused HSMMC block will not interfere with sleep.
>>
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>> ---
>> arch/arm/mach-omap2/hsmmc.c | 8 ++++++++
>> 1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
>> index 7334d86..03fe820 100644
>> --- a/arch/arm/mach-omap2/hsmmc.c
>> +++ b/arch/arm/mach-omap2/hsmmc.c
>> @@ -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?
Oops, I sent this prematurely, indeed it doesn't compile. :(
> 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.
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
2008-09-18 12:45 ` Felipe Balbi
@ 2008-09-19 5:21 ` Högander Jouni
2008-09-22 5:26 ` Paul Walmsley
0 siblings, 1 reply; 6+ messages in thread
From: Högander Jouni @ 2008-09-19 5:21 UTC (permalink / raw)
To: felipe.balbi; +Cc: ext Kevin Hilman, linux-omap, ext Paul Walmsley
"ext Felipe Balbi" <felipe.balbi@nokia.com> writes:
> On Thu, Sep 18, 2008 at 03:22:32PM +0300, ext Kevin Hilman wrote:
>> This ensures that an unused HSMMC block will not interfere with sleep.
>>
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>
> 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.
>
> Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
>> ---
>> arch/arm/mach-omap2/hsmmc.c | 8 ++++++++
>> 1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
>> index 7334d86..03fe820 100644
>> --- a/arch/arm/mach-omap2/hsmmc.c
>> +++ b/arch/arm/mach-omap2/hsmmc.c
>> @@ -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);
>> }
>>
>> --
>> 1.5.4.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> balbi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Jouni Högander
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot
2008-09-19 5:21 ` Högander Jouni
@ 2008-09-22 5:26 ` Paul Walmsley
0 siblings, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2008-09-22 5:26 UTC (permalink / raw)
To: Högander Jouni; +Cc: felipe.balbi, ext Kevin Hilman, linux-omap
[-- Attachment #1: Type: TEXT/PLAIN, Size: 466 bytes --]
Hello Jouni,
On Fri, 19 Sep 2008, Högander Jouni wrote:
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-22 5:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 12:22 [PATCH PM-0] ARM: OMAP3: HSMMC: Ensure HSMMC is fully reset on boot Kevin Hilman
2008-09-18 12:45 ` Felipe Balbi
2008-09-19 5:21 ` Högander Jouni
2008-09-22 5:26 ` Paul Walmsley
2008-09-18 12:46 ` Madhusudhan Chikkature
2008-09-18 13:33 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox