aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2017-01-17 10:43:54 +0800
committerYork Sun <york.sun@nxp.com>2017-01-18 09:46:30 -0800
commitfce1e16c55ff9c93c21adad0155e435bcfe2fa6b (patch)
treea275f833ddb9c93c21d1e52324eae0933b6548e5
parentb595662ab991e833bc4ef5160b0fa5b377f67d08 (diff)
downloadu-boot-fce1e16c55ff9c93c21adad0155e435bcfe2fa6b.zip
u-boot-fce1e16c55ff9c93c21adad0155e435bcfe2fa6b.tar.gz
u-boot-fce1e16c55ff9c93c21adad0155e435bcfe2fa6b.tar.bz2
mmc: fsl_esdhc: move 'status' property fixup into a weak function
Move fdt fixup of 'status' property into a weak function. This allows board to define 'status' fdt fixup by themselves. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
-rw-r--r--drivers/mmc/fsl_esdhc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 0ae1cfd..7b7863f 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -911,17 +911,26 @@ void mmc_adapter_card_type_ident(void)
#endif
#ifdef CONFIG_OF_LIBFDT
-void fdt_fixup_esdhc(void *blob, bd_t *bd)
+__weak int esdhc_status_fixup(void *blob, const char *compat)
{
- const char *compat = "fsl,esdhc";
-
#ifdef CONFIG_FSL_ESDHC_PIN_MUX
if (!hwconfig("esdhc")) {
do_fixup_by_compat(blob, compat, "status", "disabled",
- 8 + 1, 1);
- return;
+ sizeof("disabled"), 1);
+ return 1;
}
#endif
+ do_fixup_by_compat(blob, compat, "status", "okay",
+ sizeof("okay"), 1);
+ return 0;
+}
+
+void fdt_fixup_esdhc(void *blob, bd_t *bd)
+{
+ const char *compat = "fsl,esdhc";
+
+ if (esdhc_status_fixup(blob, compat))
+ return;
#ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK
do_fixup_by_compat_u32(blob, compat, "peripheral-frequency",
@@ -934,8 +943,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
do_fixup_by_compat_u32(blob, compat, "adapter-type",
(u32)(gd->arch.sdhc_adapter), 1);
#endif
- do_fixup_by_compat(blob, compat, "status", "okay",
- 4 + 1, 1);
}
#endif