fdt: Implement weak arch_fixup_fdt()
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Wed, 24 Jan 2018 17:47:09 +0000 (20:47 +0300)
committerSimon Glass <sjg@chromium.org>
Sun, 18 Feb 2018 19:53:38 +0000 (12:53 -0700)
Only ARM and in some configs MIPS really implement arch_fixup_fdt().
Others just use the same boilerplate which is not good by itself,
but what's worse if we try to build with disabled CONFIG_CMD_BOOTM
and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was
apparently implemented in arch/xxx/lib/bootm.c.

Now with weak arch_fixup_fdt() right in image-fdt.c where it is
used we get both items highlighted above fixed.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: York Sun <york.sun@nxp.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
arch/arc/lib/bootm.c
arch/microblaze/lib/bootm.c
arch/mips/lib/bootm.c
arch/nds32/lib/bootm.c
arch/powerpc/lib/bootm.c
arch/sandbox/lib/bootm.c
arch/x86/lib/bootm.c
common/image-fdt.c

index 9eef7070cf436f7f2803dc0618cc436c00ef1904..4d4acff239d41ea5ceb77ae8e5a54f24f3146964 100644 (file)
@@ -37,11 +37,6 @@ void arch_lmb_reserve(struct lmb *lmb)
        lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp));
 }
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 static int cleanup_before_linux(void)
 {
        disable_interrupts();
index 93525cc2a523c17c3710b871e14ec76f4b75b655..154671d4802edfa6c5606f37ed756dd58816a7a5 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 int do_bootm_linux(int flag, int argc, char * const argv[],
                   bootm_headers_t *images)
 {
index 5a9a2811ffb5b86e0bb410025c1b6276a93d4c3e..9dc47407684bd64973730c02d8a6ed7f5674453c 100644 (file)
@@ -253,17 +253,15 @@ static int boot_reloc_fdt(bootm_headers_t *images)
 #endif
 }
 
+#if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
 int arch_fixup_fdt(void *blob)
 {
-#if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
        u64 mem_start = virt_to_phys((void *)gd->bd->bi_memstart);
        u64 mem_size = gd->ram_size;
 
        return fdt_fixup_memory_banks(blob, &mem_start, &mem_size, 1);
-#else
-       return 0;
-#endif
 }
+#endif
 
 static int boot_setup_fdt(bootm_headers_t *images)
 {
index 42b15dfcbfc0edf09652bc01b23fa0a86647d5b7..0d7f57851739d660327f6612fda7865c0baf30cf 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
-
 #if defined(CONFIG_SETUP_MEMORY_TAGS) || \
        defined(CONFIG_CMDLINE_TAG) || \
        defined(CONFIG_INITRD_TAG) || \
index b9ae24dc98b6bc334060fe429586d33eeb5c0678..6ef644d85ba3546f07a3732943528f9a890e8925 100644 (file)
@@ -40,11 +40,6 @@ static void set_clocks_in_mhz (bd_t *kbd);
 #define CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE       (768*1024*1024)
 #endif
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 static void boot_jump_linux(bootm_headers_t *images)
 {
        void    (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6,
index 4cdd18fe14b28cb102eb625b78412613d58e76b0..0c9a7979d23142fbc3d96d1722c7d8cd4d6b3c09 100644 (file)
@@ -50,11 +50,6 @@ int bootz_setup(ulong image, ulong *start, ulong *end)
        return ret;
 }
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
        if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
index e548cdbed5923252f67a8f392332e5c38d57df05..8e76ba35aea53ad5655e9e32daae842210cc316e 100644 (file)
@@ -28,11 +28,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define COMMAND_LINE_OFFSET 0x9000
 
-int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 __weak void board_quiesce_devices(void)
 {
 }
index 1e946467e3c762fe03271ad454fab0ece787a207..24e4c7c6c8143f946065dcf5f48bc5c2baf24cdb 100644 (file)
@@ -454,6 +454,11 @@ __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)
 {