Skip to contentSkip to conversation

mmc: fsl_esdhc: fix f_max retrieval during init

PATCH New Markus Niebel 4 participants 4 messages Oct 24, 2014 – Nov 25, 2014 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc: fix f_max retrieval during init

From: Markus Niebel <[email protected]>

for multi instance API we use struct fsl_esdhc_cfg to pass the clock rate. Do not set f_max from global data, since this is wrong for multi instance case.

---
 drivers/mmc/fsl_esdhc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +1 -1
index 2640607..8a1a461 100644
@@ -610,7 +610,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
 	cfg->cfg.f_min = 400000;
-	cfg->cfg.f_max = min(gd->arch.sdhc_clk, 52000000);
+	cfg->cfg.f_max = min(cfg->sdhc_clk, 52000000);
 
 	cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
Signature · 1 line
2.1.1
#1 lore raw

PATCH 1/1 mmc: fsl_esdhc: fix f_max retrieval during init

Hi Markus,

Quoted 16 lines · Markus Niebel

From: Markus Niebel <[email protected]>

for multi instance API we use struct fsl_esdhc_cfg to pass the clock rate. Do not set f_max from global data, since this is wrong for multi instance case.

---
 drivers/mmc/fsl_esdhc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +0 -0
index 2640607..8a1a461 100644

drivers/mmc/fsl_esdhc.c int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) · line 615

Quoted 7 lines
drivers/mmc/fsl_esdhc.c +1 -1
@@ -610,7 +610,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
 	cfg->cfg.f_min = 400000;
-	cfg->cfg.f_max = min(gd->arch.sdhc_clk, 52000000);
+	cfg->cfg.f_max = min(cfg->sdhc_clk, 52000000);
 
 	cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;

Just a note for PowerPC users: as far I can see, PowerPC boards should continue to work, because fsl_esdhc_mmc_init() backup gd->arch.sdhc into cfg->sdhc_clk. Anyway, it would be not bad if patch could be tested even on those boards.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 mmc: fsl_esdhc: fix f_max retrieval during init

In reply to Markus Niebel

Hi Markus,

Quoted 16 lines · Markus Niebel

From: Markus Niebel <[email protected]>

for multi instance API we use struct fsl_esdhc_cfg to pass the clock rate. Do not set f_max from global data, since this is wrong for multi instance case.

---
 drivers/mmc/fsl_esdhc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +0 -0
index 2640607..8a1a461 100644

drivers/mmc/fsl_esdhc.c int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) · line 616

Quoted 8 lines
drivers/mmc/fsl_esdhc.c +1 -1
@@ -610,7 +610,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
 	cfg->cfg.f_min = 400000;
-	cfg->cfg.f_max = min(gd->arch.sdhc_clk, 52000000);
+	cfg->cfg.f_max = min(cfg->sdhc_clk, 52000000);
 
 	cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 

This seems the right thing to do.

#3 lore raw

PATCH 1/1 mmc: fsl_esdhc: fix f_max retrieval during init

Quoted 25 lines · Eric Nelson

Hi Markus,

Quoted 22 lines · Markus Niebel

From: Markus Niebel <[email protected]>

for multi instance API we use struct fsl_esdhc_cfg to pass the clock rate. Do not set f_max from global data, since this is wrong for multi instance case.

---
 drivers/mmc/fsl_esdhc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +1 -1
index 2640607..8a1a461 100644
@@ -610,7 +610,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
 	cfg->cfg.f_min = 400000;
-	cfg->cfg.f_max = min(gd->arch.sdhc_clk, 52000000);
+	cfg->cfg.f_max = min(cfg->sdhc_clk, 52000000);
 
Quoted 7 lines

drivers/mmc/fsl_esdhc.c int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) · line 616

Quoted 2 lines
drivers/mmc/fsl_esdhc.c +0 -0
 	cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 

This seems the right thing to do.

Applied to u-boot-mpc85xx master. Awaiting upstream. Thanks.

York