Commit a6da8b8195f47a70106f743948f2729d94157b32

Authored by Chenhui Zhao
Committed by Kumar Gala
1 parent afabe4b94e

fsl_esdhc: Fix esdhc disabled problem on some platforms

Some new 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.

Signed-off-by: Chenhui Zhao <b26998@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Showing 4 changed files with 11 additions and 6 deletions Side-by-side Diff

drivers/mmc/fsl_esdhc.c
... ... @@ -508,18 +508,20 @@
508 508 void fdt_fixup_esdhc(void *blob, bd_t *bd)
509 509 {
510 510 const char *compat = "fsl,esdhc";
511   - const char *status = "okay";
512 511  
  512 +#ifdef CONFIG_FSL_ESDHC_PIN_MUX
513 513 if (!hwconfig("esdhc")) {
514   - status = "disabled";
515   - goto out;
  514 + do_fixup_by_compat(blob, compat, "status", "disabled",
  515 + 8 + 1, 1);
  516 + return;
516 517 }
  518 +#endif
517 519  
518 520 do_fixup_by_compat_u32(blob, compat, "clock-frequency",
519 521 gd->sdhc_clk, 1);
520   -out:
521   - do_fixup_by_compat(blob, compat, "status", status,
522   - strlen(status) + 1, 1);
  522 +
  523 + do_fixup_by_compat(blob, compat, "status", "okay",
  524 + 4 + 1, 1);
523 525 }
524 526 #endif
include/configs/MPC837XEMDS.h
... ... @@ -509,6 +509,7 @@
509 509  
510 510 #ifdef CONFIG_MMC
511 511 #define CONFIG_FSL_ESDHC
  512 +#define CONFIG_FSL_ESDHC_PIN_MUX
512 513 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
513 514 #define CONFIG_CMD_MMC
514 515 #define CONFIG_GENERIC_MMC
include/configs/MPC837XERDB.h
... ... @@ -517,6 +517,7 @@
517 517  
518 518 #ifdef CONFIG_MMC
519 519 #define CONFIG_FSL_ESDHC
  520 +#define CONFIG_FSL_ESDHC_PIN_MUX
520 521 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
521 522 #define CONFIG_CMD_MMC
522 523 #define CONFIG_GENERIC_MMC
include/configs/MPC8569MDS.h
... ... @@ -554,6 +554,7 @@
554 554  
555 555 #ifdef CONFIG_MMC
556 556 #define CONFIG_FSL_ESDHC
  557 +#define CONFIG_FSL_ESDHC_PIN_MUX
557 558 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC85xx_ESDHC_ADDR
558 559 #define CONFIG_CMD_MMC
559 560 #define CONFIG_GENERIC_MMC