Skip to contentSkip to conversation

hwmod fixes for MMC module reset on init

PATCH In review Kevin Hilman 2 participants 4 messages Jul 8, 2009 – Jul 16, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover hwmod fixes for MMC module reset on init

I've started to integrate the new hwmod/omapdev into the PM branch for the next release.

With the new MMC hwmod added, hwmod should do a full reset and idle of the MMC modules on init, so I decided to remove the patch from the PM branch which does the same.

To my surprise, the MMC blocks were preventing retention without the
original patch. In debugging hwmod, I found a couple problems. One
with the MMC sys[cs]_off values themselves, and another in that the reset code was not waiting for RESETDONE.

Kevin Hilman (2):
OMAP2/3: HS-MMC: correct hwmod offsets for SYSCONFIG/SYSSTATUS OMAP2/3/4: omap_hwmod: fix reset bug

 arch/arm/mach-omap2/omap_hwmod.c      |    2 +-
 arch/arm/mach-omap2/omap_hwmod_2430.h |    4 ++--
 arch/arm/mach-omap2/omap_hwmod_34xx.h |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
#1 lore raw

PATCH 1/2 OMAP2/3: HS-MMC: correct hwmod offsets for SYSCONFIG/SYSSTATUS

---
 arch/arm/mach-omap2/omap_hwmod_2430.h |    4 ++--
 arch/arm/mach-omap2/omap_hwmod_34xx.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2430.h +2 -2
index 0ae23f3..48077c7 100644
@@ -170,8 +170,8 @@ static struct omap_hwmod omap2430_mpu_hwmod = {
 /* MMC/SD/SDIO common */
 
 static struct omap_hwmod_sysconfig mmc_if_ctrl = {
-	.rev_offs	= 0x10,
-	.sysc_offs	= 0x14,
+	.sysc_offs	= 0x10,
+	.syss_offs	= 0x14,
 	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
 			   SYSC_HAS_AUTOIDLE | SYSS_MISSING),
arch/arm/mach-omap2/omap_hwmod_34xx.h +2 -2
index afc3cd4..34319c3 100644
@@ -236,8 +236,8 @@ static struct omap_hwmod omap34xx_mpu_hwmod = {
 /* MMC/SD/SDIO common */
 
 static struct omap_hwmod_sysconfig mmc_if_ctrl = {
-	.rev_offs	= 0x10,
-	.sysc_offs	= 0x14,
+	.sysc_offs	= 0x10,
+	.syss_offs      = 0x14,
 	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
 			   SYSC_HAS_AUTOIDLE),
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 2/2 OMAP2/3/4: omap_hwmod: fix reset bug

The _reset() hook should early when _soft_reset() fails, not it if succeeds. Currently, it aborts when _soft_reset() succeeds, resulting in not waiting for RESETDONE.

---
 arch/arm/mach-omap2/omap_hwmod.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +1 -1
index b103797..76b6845 100644
@@ -746,7 +746,7 @@ static int _reset(struct omap_hwmod *oh)
 
 	v = oh->_sysc_cache;
 	r = _set_softreset(oh, &v);
-	if (!r)
+	if (r)
 		return r;
 	_write_sysconfig(v, oh);
 
Signature · 1 line
1.6.3.3
maintainer
#3 lore raw
In reply to Kevin Hilman

Hi Kevin,

Quoted 12 lines · Kevin Hilman

I've started to integrate the new hwmod/omapdev into the PM branch for the next release.

With the new MMC hwmod added, hwmod should do a full reset and idle of the MMC modules on init, so I decided to remove the patch from the PM branch which does the same.

To my surprise, the MMC blocks were preventing retention without the
original patch. In debugging hwmod, I found a couple problems. One
with the MMC sys[cs]_off values themselves, and another in that the reset code was not waiting for RESETDONE.

Quoted 8 lines

Kevin Hilman (2):
OMAP2/3: HS-MMC: correct hwmod offsets for SYSCONFIG/SYSSTATUS OMAP2/3/4: omap_hwmod: fix reset bug

 arch/arm/mach-omap2/omap_hwmod.c      |    2 +-
 arch/arm/mach-omap2/omap_hwmod_2430.h |    4 ++--
 arch/arm/mach-omap2/omap_hwmod_34xx.h |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

thanks very much for these patches; they've both been incorporated.

- Paul