[PATCH 6/7] Remove CONFIG_BOARDNAME and CONFIG_BOARD_NAME

Tom Rini trini at konsulko.com
Tue Mar 22 02:33:32 CET 2022


Both of these variables are used in a few hard-coded ways to set some
string values or print something to the user.  In almost all cases, it's
just as useful to hard-code the value used.  The exception here is
printing something closer to correct board name for p1_p2_rdb machines.
This can be done using something from the device tree, but for now
hard-code a non-CONFIG based value instead.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 11 ++++++++++-
 board/ge/bx50v3/bx50v3.c                    |  2 +-
 include/configs/T102xRDB.h                  | 17 +++++++++--------
 include/configs/el6x_common.h               |  6 +-----
 include/configs/ge_bx50v3.h                 |  2 --
 include/configs/opos6uldev.h                |  9 ++++-----
 include/configs/p1_p2_rdb_pc.h              |  3 ---
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
index 19ece1229631..b6f0d2042677 100644
--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
+++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
@@ -160,6 +160,14 @@ int board_early_init_f(void)
 	return 0;
 }
 
+#if defined(CONFIG_TARGET_P1020RDB_PC)
+#define BOARD_NAME "P1020RDB-PC"
+#elif defined(CONFIG_TARGET_P1020RDB_PD)
+#define BOARD_NAME "P1020RDB-PD"
+#elif defined(CONFIG_TARGET_P2020RDB)
+#define BOARD_NAME "P2020RDB-PC"
+#endif
+
 int checkboard(void)
 {
 	struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
@@ -167,7 +175,8 @@ int checkboard(void)
 	u8 in, out, io_config, val;
 	int bus_num = CONFIG_SYS_SPD_BUS_NUM;
 
-	printf("Board: %s CPLD: V%d.%d PCBA: V%d.0\n", CONFIG_BOARDNAME,
+	/* FIXME: This should just use the model from the device tree or similar */
+	printf("Board: %s CPLD: V%d.%d PCBA: V%d.0\n", BOARD_NAME,
 		in_8(&cpld_data->cpld_rev_major) & 0x0F,
 		in_8(&cpld_data->cpld_rev_minor) & 0x0F,
 		in_8(&cpld_data->pcba_rev) & 0x0F);
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index ed700f4e1da5..4e9d841fe291 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -547,7 +547,7 @@ int last_stage_init(void)
 
 int checkboard(void)
 {
-	printf("BOARD: %s\n", CONFIG_BOARD_NAME);
+	printf("BOARD: General Electric Bx50v3\n");
 	return 0;
 }
 
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index dfb9e9120aea..a244daf0ae72 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -531,20 +531,21 @@
 #define __USB_PHY_TYPE		utmi
 
 #ifdef CONFIG_ARCH_T1024
-#define CONFIG_BOARDNAME t1024rdb
-#define BANK_INTLV cs0_cs1
+#define ARCH_EXTRA_ENV_SETTINGS \
+	"bank_intlv=cs0_cs1\0"			\
+	"ramdiskfile=t1024rdb/ramdisk.uboot\0"	\
+	"fdtfile=t1024rdb/t1024rdb.dtb\0"
 #else
-#define CONFIG_BOARDNAME t1023rdb
-#define BANK_INTLV  null
+#define ARCH_EXTRA_ENV_SETTINGS \
+	"bank_intlv=null\0"			\
+	"ramdiskfile=t1023rdb/ramdisk.uboot\0"	\
+	"fdtfile=t1023rdb/t1023rdb.dtb\0"
 #endif
 
 #define	CONFIG_EXTRA_ENV_SETTINGS				\
+	ARCH_EXTRA_ENV_SETTINGS					\
 	"hwconfig=fsl_ddr:ctlr_intlv=cacheline,"		\
-	"bank_intlv=" __stringify(BANK_INTLV) "\0"		\
 	"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"  \
-	"ramdiskfile=" __stringify(CONFIG_BOARDNAME) "/ramdisk.uboot\0" \
-	"fdtfile=" __stringify(CONFIG_BOARDNAME) "/"		\
-	__stringify(CONFIG_BOARDNAME) ".dtb\0"			\
 	"uboot=" __stringify(CONFIG_UBOOTPATH) "\0"		\
 	"ubootaddr=" __stringify(CONFIG_SYS_TEXT_BASE) "\0"	\
 	"bootargs=root=/dev/ram rw console=ttyS0,115200\0" \
diff --git a/include/configs/el6x_common.h b/include/configs/el6x_common.h
index 4764d22520ac..bcd7b84cf382 100644
--- a/include/configs/el6x_common.h
+++ b/include/configs/el6x_common.h
@@ -10,8 +10,6 @@
 
 #include <linux/stringify.h>
 
-#define CONFIG_BOARD_NAME		EL6Q
-
 #include "mx6_common.h"
 
 #ifdef CONFIG_SPL
@@ -30,10 +28,8 @@
 
 #define CONFIG_MXC_UART_BASE	UART2_BASE
 
-#define CONFIG_BOARD_NAME	EL6Q
-
 #define CONFIG_EXTRA_ENV_SETTINGS                                               \
-	"board="__stringify(CONFIG_BOARD_NAME)"\0"                              \
+	"board=EL6Q\0"								\
 	"cma_size="__stringify(EL6Q_CMA_SIZE)"\0"                               \
 	"chp_size="__stringify(EL6Q_COHERENT_POOL_SIZE)"\0"                     \
 	"console=" CONSOLE_DEV "\0"					\
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 402c5bfacbe3..8d467e420f1c 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -14,8 +14,6 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/mach-imx/gpio.h>
 
-#define CONFIG_BOARD_NAME	"General Electric Bx50v3"
-
 #include "mx6_common.h"
 #include <linux/sizes.h>
 
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index 54b1a78affb6..bb2408c1e218 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -45,18 +45,17 @@
 /* Environment is stored in the eMMC boot partition */
 
 #define CONFIG_ENV_VERSION	100
-#define CONFIG_BOARD_NAME	opos6ul
 #define ACFG_CONSOLE_DEV        ttymxc0
 #define CONFIG_SYS_AUTOLOAD     "no"
-#define CONFIG_ROOTPATH         "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
+#define CONFIG_ROOTPATH         "/tftpboot/opos6ul-root"
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"env_version="          __stringify(CONFIG_ENV_VERSION)         "\0"                    \
 	"consoledev="           __stringify(ACFG_CONSOLE_DEV)           "\0"                    \
-	"board_name="           __stringify(CONFIG_BOARD_NAME)          "\0"                    \
+	"board_name=opos6ul\0"                                                                  \
 	"fdt_addr=0x88000000\0"                                                                 \
 	"fdt_high=0xffffffff\0"                                                                 \
-	"fdt_name="           __stringify(CONFIG_BOARD_NAME)          "dev\0"                   \
+	"fdt_name=opos6uldev\0"                                                                 \
 	"initrd_high=0xffffffff\0"                                                              \
 	"ip_dyn=yes\0"                                                                          \
 	"stdin=serial\0"                                                                        \
@@ -66,7 +65,7 @@
 	"mmcpart=2\0"                                                                           \
 	"mmcroot=/dev/mmcblk0p2 ro\0"                                                           \
 	"mmcrootfstype=ext4 rootwait\0"                                                         \
-	"kernelimg="           __stringify(CONFIG_BOARD_NAME)          "-linux.bin\0"           \
+	"kernelimg=opos6ul-linux.bin\0"                                                         \
 	"splashpos=0,0\0"									\
 	"splashimage="		__stringify(CONFIG_SYS_LOAD_ADDR)	"\0"			\
 	"videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0\0" \
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 64a5269076af..a6523753d5ca 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -13,7 +13,6 @@
 #include <linux/stringify.h>
 
 #if defined(CONFIG_TARGET_P1020RDB_PC)
-#define CONFIG_BOARDNAME "P1020RDB-PC"
 #define CONFIG_VSC7385_ENET
 #define CONFIG_SLIC
 #define __SW_BOOT_MASK		0x03
@@ -39,7 +38,6 @@
  * 011101 800 800 400 667 PCIe-2 Core0 boot; Core1 hold-off
  */
 #if defined(CONFIG_TARGET_P1020RDB_PD)
-#define CONFIG_BOARDNAME "P1020RDB-PD"
 #define CONFIG_VSC7385_ENET
 #define CONFIG_SLIC
 #define __SW_BOOT_MASK		0x03
@@ -55,7 +53,6 @@
 #endif
 
 #if defined(CONFIG_TARGET_P2020RDB)
-#define CONFIG_BOARDNAME "P2020RDB-PC"
 #define CONFIG_VSC7385_ENET
 #define __SW_BOOT_MASK		0x03
 #define __SW_BOOT_NOR		0xc8
-- 
2.25.1



More information about the U-Boot mailing list