]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: convert arch_fixup_memory_node to a generic FDT fixup function
authorMa Haijun <mahaijuns@gmail.com>
Sat, 12 Jul 2014 13:24:06 +0000 (14:24 +0100)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 28 Jul 2014 15:19:49 +0000 (17:19 +0200)
Some architecture needs extra device tree setup. Instead of adding
yet another hook, convert arch_fixup_memory_node to be a generic
FDT fixup function.

[maz: collapsed 3 patches into one, rewrote commit message]

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
arch/arm/lib/bootm-fdt.c
arch/arm/lib/bootm.c
common/image-fdt.c
include/common.h

index e40691d15f90e5ab8098f99faafdd17ba75e11fe..8394e15b7e3822d3d3132deb5b13df0a61c407bd 100644 (file)
@@ -20,7 +20,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int arch_fixup_memory_node(void *blob)
+int arch_fixup_fdt(void *blob)
 {
        bd_t *bd = gd->bd;
        int bank;
index a08586f1eb51c9b797eb69208b5a9e6a05528ace..178e8fb9e4ab88a23cffa1ba21a8413a5d42f4f5 100644 (file)
@@ -359,7 +359,7 @@ void boot_prep_vxworks(bootm_headers_t *images)
        if (images->ft_addr) {
                off = fdt_path_offset(images->ft_addr, "/memory");
                if (off < 0) {
-                       if (arch_fixup_memory_node(images->ft_addr))
+                       if (arch_fixup_fdt(images->ft_addr))
                                puts("## WARNING: fixup memory failed!\n");
                }
        }
index 7795b80ccf8f3d4cf591d4d32a944e57d6248d82..db6e39556277323a522761827bea9d5516e07e23 100644 (file)
@@ -450,7 +450,7 @@ __weak int ft_verify_fdt(void *fdt)
        return 1;
 }
 
-__weak int arch_fixup_memory_node(void *blob)
+__weak int arch_fixup_fdt(void *blob)
 {
        return 0;
 }
@@ -467,7 +467,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                puts(" - must RESET the board to recover.\n");
                return -1;
        }
-       arch_fixup_memory_node(blob);
+       if (arch_fixup_fdt(blob) < 0) {
+               puts("ERROR: arch specific fdt fixup failed");
+               return -1;
+       }
        if (IMAGE_OF_BOARD_SETUP)
                ft_board_setup(blob, gd->bd);
        fdt_fixup_ethernet(blob);
index a75fc25c5f6aeefeba4d46800c8eb7377086178b..1d6cb48ff0787f1260366530f989d6d656b95be4 100644 (file)
@@ -318,14 +318,14 @@ int arch_early_init_r(void);
 void board_show_dram(ulong size);
 
 /**
- * arch_fixup_memory_node() - Write arch-specific memory information to fdt
+ * arch_fixup_fdt() - Write arch-specific information to fdt
  *
- * Defined in arch/$(ARCH)/lib/bootm.c
+ * Defined in arch/$(ARCH)/lib/bootm-fdt.c
  *
  * @blob:      FDT blob to write to
  * @return 0 if ok, or -ve FDT_ERR_... on failure
  */
-int arch_fixup_memory_node(void *blob);
+int arch_fixup_fdt(void *blob);
 
 /* common/flash.c */
 void flash_perror (int);