]> git.sur5r.net Git - u-boot/commitdiff
libfdt: Introduce new ARCH_FIXUP_FDT option
authorMichal Simek <michal.simek@xilinx.com>
Thu, 28 Jul 2016 07:06:41 +0000 (09:06 +0200)
committerSimon Glass <sjg@chromium.org>
Mon, 1 Aug 2016 01:37:08 +0000 (19:37 -0600)
Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
U-Boot shouldn't update memory setup in DTB file.
One example of usage of this option is to boot OS with different memory
setup than U-Boot use.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Simon Glass <sjg@chromium.org>
Kconfig
arch/arm/lib/bootm-fdt.c
arch/arm/lib/bootm.c
arch/mips/lib/bootm.c
common/image-fdt.c

diff --git a/Kconfig b/Kconfig
index ef12f9fbee403c2e9786764f64ff2070f6e336cb..626e82f88dfe6cf5c945e2acc3895b7a76af50c2 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -342,6 +342,15 @@ config SYS_CLK_FREQ
        help
          TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
 
+config ARCH_FIXUP_FDT
+       bool "Enable arch_fixup_fdt() call"
+       depends on ARM || MIPS
+       default y
+       help
+         Enable FDT memory map syncup before OS boot. This feature can be
+         used for booting OS with different memory setup where the part of
+         the memory location should be used for different purpose.
+
 endmenu                # Boot images
 
 source "common/Kconfig"
index 4481f9e2fa9ceb26f2f54f21e67f6b825c016601..a51755070bc93bad6cb4e05618613afb07c58d9c 100644 (file)
@@ -25,6 +25,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_ARCH_FIXUP_FDT
 int arch_fixup_fdt(void *blob)
 {
        bd_t *bd = gd->bd;
@@ -60,3 +61,4 @@ int arch_fixup_fdt(void *blob)
 
        return 0;
 }
+#endif
index c20ef227fb4e7afd48e051cf50b36380db1fa5da..f9ed7fe38ab8d790a0b712341a5af2ef576c0ed8 100644 (file)
@@ -367,8 +367,10 @@ void boot_prep_vxworks(bootm_headers_t *images)
        if (images->ft_addr) {
                off = fdt_path_offset(images->ft_addr, "/memory");
                if (off < 0) {
+#ifdef CONFIG_ARCH_FIXUP_FDT
                        if (arch_fixup_fdt(images->ft_addr))
                                puts("## WARNING: fixup memory failed!\n");
+#endif
                }
        }
 #endif
index aa0475a4954e5920e2fad7a785175bb71c5af28e..0c6a4ab3b329ba10d889384463acc23e5d75e1d9 100644 (file)
@@ -253,6 +253,7 @@ static int boot_reloc_fdt(bootm_headers_t *images)
 #endif
 }
 
+#ifdef CONFIG_ARCH_FIXUP_FDT
 int arch_fixup_fdt(void *blob)
 {
 #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
@@ -264,6 +265,7 @@ int arch_fixup_fdt(void *blob)
        return 0;
 #endif
 }
+#endif
 
 static int boot_setup_fdt(bootm_headers_t *images)
 {
index 6cac7dbb7f8b2ff0fe5114b9d65ba655e3bf2fc3..d6ee225d409e4446ab8e9eb008e8f79c33769f11 100644 (file)
@@ -458,11 +458,6 @@ __weak int ft_verify_fdt(void *fdt)
        return 1;
 }
 
-__weak int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 int image_setup_libfdt(bootm_headers_t *images, void *blob,
                       int of_size, struct lmb *lmb)
 {
@@ -479,10 +474,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                printf("ERROR: /chosen node create failed\n");
                goto err;
        }
+#ifdef CONFIG_ARCH_FIXUP_FDT
        if (arch_fixup_fdt(blob) < 0) {
                printf("ERROR: arch-specific fdt fixup failed\n");
                goto err;
        }
+#endif
        if (IMAGE_OF_BOARD_SETUP) {
                fdt_ret = ft_board_setup(blob, gd->bd);
                if (fdt_ret) {