From 589812f232a7a07873a74e5506153977ce11dce2 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Fri, 23 Dec 2016 12:01:06 +0800 Subject: MLK-13645 mx7ulp: Modify FDT file to disable SD3.0 for mfgtool Since the SD3.0 kernel driver needs M4 image support, this causes problem to mfgtool. To decouple the relationship, we modify the FDT file in u-boot to disable SD3.0 when booting for mfgtool. So the kernel won't depend on M4 image. Signed-off-by: Ye Li Tested-by: Fugang Duan (cherry picked from commit 1826d6e4dc732521190c742f812193be95eea211) --- arch/arm/cpu/armv7/mx7ulp/soc.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'arch/arm/cpu/armv7/mx7ulp') diff --git a/arch/arm/cpu/armv7/mx7ulp/soc.c b/arch/arm/cpu/armv7/mx7ulp/soc.c index d0f4897..a6118af 100644 --- a/arch/arm/cpu/armv7/mx7ulp/soc.c +++ b/arch/arm/cpu/armv7/mx7ulp/soc.c @@ -9,6 +9,7 @@ #include #include #include +#include static char *get_reset_cause(char *); @@ -288,3 +289,40 @@ int mmc_get_env_dev(void) return board_mmc_get_env_dev(devno); } #endif + +#ifdef CONFIG_OF_SYSTEM_SETUP +int ft_system_setup(void *blob, bd_t *bd) +{ +#if !defined(CONFIG_FSL_FASTBOOT) && defined(is_boot_from_usb) + if (is_boot_from_usb()) { + int rc; + int nodeoff = fdt_path_offset(blob, "/ahb-bridge0@40000000/usdhc@40370000"); + if (nodeoff < 0) + return 0; /* Not found, skip it */ + + printf("Found usdhc0 node\n"); + if (fdt_get_property(blob, nodeoff, "vqmmc-supply", NULL) != NULL) { + rc = fdt_delprop(blob, nodeoff, "vqmmc-supply"); + if (!rc) { + printf("Removed vqmmc-supply property\n"); + +add: + rc = fdt_setprop(blob, nodeoff, "no-1-8-v", NULL, 0); + if (rc == -FDT_ERR_NOSPACE) { + rc = fdt_increase_size(blob, 32); + if (!rc) + goto add; + } else if (rc) { + printf("Failed to add no-1-8-v property, %d\n", rc); + } else { + printf("Added no-1-8-v property\n"); + } + } else { + printf("Failed to remove vqmmc-supply property, %d\n", rc); + } + } + } +#endif + return 0; +} +#endif -- cgit v1.1