OMAP4: HSMMC cmd line reset change
Subsystems (2)
PATCH 1/1 OMAP4: HSMMC cmd line reset change
OMAP4: HSMMC cmd line reset change
The cmd line reset logic is changed in OMAP4 ES2. The new procedure is to monitor a 0->1 transition and then 1->0 transition.The earlier logic would fail on ES2 chips because the loop could exit even before the reset is actually complete.
--- drivers/mmc/host/omap_hsmmc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/mmc/host/omap_hsmmc.c +0 -0
@@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct
omap_hsmmc_host *host,
unsigned long bit)
{
unsigned long i = 0;
+ unsigned long j = 0;
unsigned long limit = (loops_per_jiffy *
msecs_to_jiffies(MMC_TIMEOUT_MS));
OMAP_HSMMC_WRITE(host->base, SYSCTL,
OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
+ if (cpu_is_omap44xx() && bit == SRC) {
+ while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
+ && (j++ < limit))
+ cpu_relax();
+ }
+
while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
(i++ < limit))
cpu_relax();
Signature · 1 line
1.7.0.4
Hi Madhu,
Quoted 1 line · Madhusudhan Chikkature
OMAP4: HSMMC cmd line reset change
Please don't repeat the subject line like this -- "git am" will put it into the patch twice. You can either leave the subject line out of the body of the mail altogether, or put "Subject: " in front of it.
Quoted 15 lines
The cmd line reset logic is changed in OMAP4 ES2. The new procedure is to monitor a 0->1 transition and then 1->0 transition.The earlier logic would fail on ES2 chips because the loop could exit even before the reset is actually complete.
Signed-off-by Madhusudhan Chikkature <[email protected]>--- drivers/mmc/host/omap_hsmmc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)drivers/mmc/host/omap_hsmmc.c +0
-0
drivers/mmc/host/omap_hsmmc.c static inline void omap_hsmmc_reset_controller_fsm(struct · line 976
Quoted 1 line
drivers/mmc/host/omap_hsmmc.c +0
-0@@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,
(This was line-wrapped, I fixed it.)
Quoted 18 lines
drivers/mmc/host/omap_hsmmc.c +7
-0unsigned long bit) {unsigned long i =0 ; +unsigned long j =0 ;unsigned long limit = (loops_per_jiffy *msecs_to_jiffies (MMC_TIMEOUT_MS ));OMAP_HSMMC_WRITE (host->base,SYSCTL ,OMAP_HSMMC_READ (host->base,SYSCTL ) | bit); +if (cpu_is_omap44xx () && bit ==SRC ) { +while ((!(OMAP_HSMMC_READ (host->base,SYSCTL ) & bit)) + && (j++ < limit)) +cpu_relax (); + } +while ((OMAP_HSMMC_READ (host->base,SYSCTL ) & bit) && (i++ < limit))
Quoted 3 lines
cpu_relax();Signature · 1 line
1.7.0.4
Thanks, pushed to mmc-next.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
Quoted 36 lines · Madhusudhan Chikkature
OMAP4: HSMMC cmd line reset change
The cmd line reset logic is changed in OMAP4 ES2. The new procedure is to monitor a 0->1 transition and then 1->0 transition.The earlier logic would fail on ES2 chips because the loop could exit even before the reset is actually complete.
Signed-off-by Madhusudhan Chikkature <[email protected]>--- drivers/mmc/host/omap_hsmmc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)drivers/mmc/host/omap_hsmmc.c +7
-0@@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host, unsigned long bit) {unsigned long i =0 ; +unsigned long j =0 ;unsigned long limit = (loops_per_jiffy *msecs_to_jiffies (MMC_TIMEOUT_MS ));OMAP_HSMMC_WRITE (host->base,SYSCTL ,OMAP_HSMMC_READ (host->base,SYSCTL ) | bit); +if (cpu_is_omap44xx () && bit ==SRC ) { +while ((!(OMAP_HSMMC_READ (host->base,SYSCTL ) & bit)) + && (j++ < limit)) +cpu_relax (); + } +while ((OMAP_HSMMC_READ (host->base,SYSCTL ) & bit) && (i++ < limit))
Quoted 1 line
cpu_relax();
Please don't use cpu_is_omapxxxx tests in the drivers, drivers should be generic.
Instead, just pass a feature flag in the platform_data for this feature like HSMMC_REVERSE_RESET_LOGIC or similar.
Even better, look at the mmc silicon revision number and set this flag automatically during the driver init if possible.
Regards,
Tony
Quoted 54 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, September 17, 2010 10:48 AM
To: Madhusudhan Chikkature
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset changeQuoted 7 lines · Madhusudhan Chikkature
OMAP4: HSMMC cmd line reset change
The cmd line reset logic is changed in OMAP4 ES2. The new procedure is to monitor a 0->1 transition and then 1->0 transition.The earlier logic would fail on ES2 chips because the loop could exit even before the reset is actually complete.
Review
Quoted 6 lines
Signed-off-by Madhusudhan Chikkature <[email protected]>--- drivers/mmc/host/omap_hsmmc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cdrivers/mmc/host/omap_hsmmc.c static inline void
Quoted 4 lines
index 4526d27..750ba7d 100644
drivers/mmc/host/omap_hsmmc.c +0
-0@@ -976,12 +976,19 @@ static inline voidomap_hsmmc_reset_controller_fsm(struct
Quoted 19 lines
drivers/mmc/host/omap_hsmmc.c +7
-0omap_hsmmc_host *host, unsigned long bit) {unsigned long i =0 ; +unsigned long j =0 ;unsigned long limit = (loops_per_jiffy *msecs_to_jiffies (MMC_TIMEOUT_MS ));OMAP_HSMMC_WRITE (host->base,SYSCTL ,OMAP_HSMMC_READ (host->base,SYSCTL ) | bit); +if (cpu_is_omap44xx () && bit ==SRC ) { +while ((!(OMAP_HSMMC_READ (host->base,SYSCTL ) & bit)) + && (j++ < limit)) +cpu_relax (); + } +while ((OMAP_HSMMC_READ (host->base,SYSCTL ) & bit) && (i++ < limit))Quoted 1 line
cpu_relax();Please don't use
cpu_is_omapxxxxtests in the drivers, drivers should be generic.
Quoted 3 lines
Instead, just pass a feature flag in the
platform_datafor this feature likeHSMMC_REVERSE_RESET_LOGICor similar.
This is not a feature. It is like an ERRATA fix. I am yet to receive an errata number though. How about dealing with this like an errata fix similar to the way in arch/mach-omap2/serial.c done for the uart case?
The mmc ip revision will not help because it really does not change to distinguish such issues.
Regards,
Madhu
Quoted 6 lines
Even better, look at the mmc silicon revision number and set this flag automatically during the driver init if possible.
Regards,
Tony
Quoted 11 lines · Madhusudhan
Quoted 7 lines
Please don't use
cpu_is_omapxxxxtests in the drivers, drivers should be generic.Instead, just pass a feature flag in the
platform_datafor this feature likeHSMMC_REVERSE_RESET_LOGICor similar.This is not a feature. It is like an ERRATA fix. I am yet to receive an errata number though. How about dealing with this like an errata fix similar to the way in
arch/mach-omap2/serial.cdone for the uart case?
Yes setting some HSMMC_ERRATA_XYZ flag works too.
Quoted 2 lines
The mmc ip revision will not help because it really does not change to distinguish such issues.
OK. Then I guess your only option is to pass the errata flag in the platform_data.
Regards,
Tony
Quoted 24 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Tuesday, September 21, 2010 9:47 AM
To: Madhusudhan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset changeQuoted 10 lines · Madhusudhan
Quoted 7 lines
Please don't use
cpu_is_omapxxxxtests in the drivers, drivers should be generic.Instead, just pass a feature flag in the
platform_datafor this feature likeHSMMC_REVERSE_RESET_LOGICor similar.This is not a feature. It is like an ERRATA fix. I am yet to receive an errata number though. How about dealing with this like an errata fix
similar
Quoted 1 line
to the way in
arch/mach-omap2/serial.cdone for the uart case?
Quoted 8 lines
Yes setting some
HSMMC_ERRATA_XYZflag works too.Quoted 2 lines
The mmc ip revision will not help because it really does not change to distinguish such issues.
OK. Then I guess your only option is to pass the errata flag in the
platform_data.
Chris,
Can you please drop this patch? Sorry, I spoke bit too early on this patch. I need to sort out some stuff internally (seems like it will not be released as an errata). I will post a revised version a bit later.
Regards,
Madhu
Quoted 3 lines
Regards,
Tony
Hi Madhu,
Quoted 3 lines · Madhusudhan
Can you please drop this patch? Sorry, I spoke bit too early on this patch. I need to sort out some stuff internally (seems like it will not be released as an errata). I will post a revised version a bit later.
No problem, I dropped this after seeing Tony's comments. I'll keep an eye out for a new patch with his ACK.
Thanks,
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child