]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common/board_f: move CONFIG_MACH_TYPE logic to arch/arm/lib/bdinfo.c
authorOvidiu Panait <ovpanait@gmail.com>
Tue, 13 Sep 2022 18:31:27 +0000 (21:31 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 7 Oct 2022 01:05:17 +0000 (21:05 -0400)
asm/mach_type.h header and CONFIG_MACH_TYPE macro are arm-specific, so move
related bdinfo logic to arch_setup_bdinfo() in arch/arm/lib/bdinfo.c.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
arch/arm/lib/bdinfo.c
common/board_f.c

index b22ee07b859d5620b29ff6b550b3932ec84d31cf..826e09e72c09555ca9a872b44e3f3f7d3456eaf1 100644 (file)
@@ -9,9 +9,21 @@
 #include <common.h>
 #include <init.h>
 #include <asm/global_data.h>
+#include <asm/mach-types.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int arch_setup_bdinfo(void)
+{
+#ifdef CONFIG_MACH_TYPE
+       struct bd_info *bd = gd->bd;
+
+       bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
+#endif
+
+       return 0;
+}
+
 void arch_print_bdinfo(void)
 {
        struct bd_info *bd = gd->bd;
index 77b7d9e28cba06d400b4e3a3bb3114ae49f59d8f..5201ed30cf3676a44c0cb49de86a439a817145ab 100644 (file)
@@ -46,9 +46,6 @@
 #include <video.h>
 #include <watchdog.h>
 #include <asm/cache.h>
-#ifdef CONFIG_MACH_TYPE
-#include <asm/mach-types.h>
-#endif
 #if defined(CONFIG_MP) && defined(CONFIG_PPC)
 #include <asm/mp.h>
 #endif
@@ -624,10 +621,6 @@ int setup_bdinfo(void)
                bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;  /* size  of SRAM */
        }
 
-#ifdef CONFIG_MACH_TYPE
-       bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
-#endif
-
        return arch_setup_bdinfo();
 }