From: Ovidiu Panait Date: Tue, 13 Sep 2022 18:31:27 +0000 (+0300) Subject: common/board_f: move CONFIG_MACH_TYPE logic to arch/arm/lib/bdinfo.c X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=85e68ae001d4449f02e6ce99b91e160bd94eb69c;p=u-boot.git common/board_f: move CONFIG_MACH_TYPE logic to arch/arm/lib/bdinfo.c 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 Signed-off-by: Ovidiu Panait --- diff --git a/arch/arm/lib/bdinfo.c b/arch/arm/lib/bdinfo.c index b22ee07b85..826e09e72c 100644 --- a/arch/arm/lib/bdinfo.c +++ b/arch/arm/lib/bdinfo.c @@ -9,9 +9,21 @@ #include #include #include +#include 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; diff --git a/common/board_f.c b/common/board_f.c index 77b7d9e28c..5201ed30cf 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -46,9 +46,6 @@ #include #include #include -#ifdef CONFIG_MACH_TYPE -#include -#endif #if defined(CONFIG_MP) && defined(CONFIG_PPC) #include #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(); }