diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-06-10 00:25:29 +0400 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-07-16 22:24:06 +0200 |
commit | b33433a63fe08c9e723ea15a7c7c7143bf527c6d (patch) | |
tree | ec16d0a8649862b41c26fcc07374350e53077a5d /drivers/mmc | |
parent | 93f9dcf9e8b8182e97aeb7965c687176cbd0b933 (diff) | |
download | u-boot-b33433a63fe08c9e723ea15a7c7c7143bf527c6d.tar.gz u-boot-b33433a63fe08c9e723ea15a7c7c7143bf527c6d.tar.xz u-boot-b33433a63fe08c9e723ea15a7c7c7143bf527c6d.zip |
fsl_esdhc: Add device tree fixups
This patch implements fdt_fixup_esdhc() function that is used to fixup
the device tree.
The function adds status = "disabled" propery if esdhc pins muxed away,
otherwise it fixups clock-frequency for esdhc nodes.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/fsl_esdhc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 8274af5610..c6e9e6e782 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -28,11 +28,13 @@ #include <config.h> #include <common.h> #include <command.h> +#include <hwconfig.h> #include <mmc.h> #include <part.h> #include <malloc.h> #include <mmc.h> #include <fsl_esdhc.h> +#include <fdt_support.h> #include <asm/io.h> @@ -346,3 +348,20 @@ int fsl_esdhc_mmc_init(bd_t *bis) { return esdhc_initialize(bis); } + +void fdt_fixup_esdhc(void *blob, bd_t *bd) +{ + const char *compat = "fsl,esdhc"; + const char *status = "okay"; + + if (!hwconfig("esdhc")) { + status = "disabled"; + goto out; + } + + do_fixup_by_compat_u32(blob, compat, "clock-frequency", + gd->sdhc_clk, 1); +out: + do_fixup_by_compat(blob, compat, "status", status, + strlen(status) + 1, 1); +} |