Skip to contentSkip to conversation

fsl_esdhc: Fix esdhc disabled problem on some platforms

PATCH Superseded Chenhui Zhao 2 participants 2 messages Dec 28, 2010 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsl_esdhc: Fix esdhc disabled problem on some platforms

Some platform's esdhc pins don't share with other function. The eSDHC shouldn't be disabled, even if "esdhc" isn't defined in hwconfig env variable.

Use CONFIG_FSL_ESDHC_PIN_MUX to fix this problem.

The problem was introduced by this commit:
commit b33433a63fe08c9e723ea15a7c7c7143bf527c6d

Author: Anton Vorontsov <[email protected]>
Date:   Wed Jun 10 00:25:29 2009 +0400

fsl_esdhc: Add device tree fixups

---
 drivers/mmc/fsl_esdhc.c       |    2 ++
 include/configs/MPC837XEMDS.h |    1 +
 include/configs/MPC837XERDB.h |    1 +
 include/configs/MPC8569MDS.h  |    1 +
 4 files changed, 5 insertions(+), 0 deletions(-)
drivers/mmc/fsl_esdhc.c +2 -0
index cd78714..4c8caa9 100644
@@ -527,10 +527,12 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
 	const char *compat = "fsl,esdhc";
 	const char *status = "okay";
 
+#ifdef CONFIG_FSL_ESDHC_PIN_MUX
 	if (!hwconfig("esdhc")) {
 		status = "disabled";
 		goto out;
 	}
+#endif
 
 	do_fixup_by_compat_u32(blob, compat, "clock-frequency",
 			       gd->sdhc_clk, 1);
include/configs/MPC837XEMDS.h +1 -0
index c237991..abccfd6 100644
@@ -509,6 +509,7 @@ extern int board_pci_host_broken(void);
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC83xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
include/configs/MPC837XERDB.h +1 -0
index 385c7c3..ea3056b 100644
@@ -517,6 +517,7 @@
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC83xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
include/configs/MPC8569MDS.h +1 -0
index 9620fd0..f4a3c2f 100644
@@ -561,6 +561,7 @@ extern unsigned long get_clock_freq(void);
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC85xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
Signature · 1 line
1.6.4.1
#1 lore raw

PATCH 1/1 fsl_esdhc: Fix esdhc disabled problem on some platforms

Quoted 7 lines · Chenhui Zhao

Some platform's esdhc pins don't share with other function. The eSDHC shouldn't be disabled, even if "esdhc" isn't defined in hwconfig env variable.

Use CONFIG_FSL_ESDHC_PIN_MUX to fix this problem.

The problem was introduced by this commit:

I would not say 'the problem was introduced'. ;-) Back in 2009 all platforms w/ eSDHC were using muxed eSDHC pins, so disabling eSDHC was a sane choice.

Anyway, the patch looks mostly OK. One comment below though.

Quoted 20 lines

commit b33433a63fe08c9e723ea15a7c7c7143bf527c6d

Author: Anton Vorontsov <[email protected]>
Date:   Wed Jun 10 00:25:29 2009 +0400

fsl_esdhc: Add device tree fixups

---
 drivers/mmc/fsl_esdhc.c       |    2 ++
 include/configs/MPC837XEMDS.h |    1 +
 include/configs/MPC837XERDB.h |    1 +
 include/configs/MPC8569MDS.h  |    1 +
 4 files changed, 5 insertions(+), 0 deletions(-)
drivers/mmc/fsl_esdhc.c +0 -0
index cd78714..4c8caa9 100644

drivers/mmc/fsl_esdhc.c void fdt_fixup_esdhc(void *blob, bd_t *bd) · line 533

Quoted 7 lines
drivers/mmc/fsl_esdhc.c +1 -0
@@ -527,10 +527,12 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
 	const char *compat = "fsl,esdhc";
 	const char *status = "okay";
 
+#ifdef CONFIG_FSL_ESDHC_PIN_MUX
 	if (!hwconfig("esdhc")) {
 		status = "disabled";
 		goto out;

Wouldn't gcc complain about unused "out" label?

drivers/mmc/fsl_esdhc.c void fdt_fixup_esdhc(void *blob, bd_t *bd) · line 538

Quoted 5 lines
drivers/mmc/fsl_esdhc.c +1 -0
 	}
+#endif
 
 	do_fixup_by_compat_u32(blob, compat, "clock-frequency",
 			       gd->sdhc_clk, 1);

Thanks,

Signature · 2 lines
Anton Vorontsov
Email: cbouatmailru at gmail.com