[PATCH 01/13] arm: nanopi2: Remove unused code

This platform did not ever enable CONFIG_REVISION_TAG, so the code to set the board_rev environment variable was never enabled. This particular symbol is also only for use with the REVISION ATAG and this platform is new enough to have never supported an ATAG-based Linux Kernel.
Cc: Stefan Bosch stefan_b@posteo.net Signed-off-by: Tom Rini trini@konsulko.com --- I'd be happy to see this patch replaced by one that enables what I think you meant to be doing and by default. Thanks! --- board/friendlyarm/nanopi2/board.c | 13 ------------- 1 file changed, 13 deletions(-)
diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c index 68980536abe9..6e546853b863 100644 --- a/board/friendlyarm/nanopi2/board.c +++ b/board/friendlyarm/nanopi2/board.c @@ -294,16 +294,6 @@ static void set_ether_addr(void) env_set("ethaddr", ethaddr); }
-#ifdef CONFIG_REVISION_TAG -static void set_board_rev(void) -{ - char info[64] = {0, }; - - snprintf(info, ARRAY_SIZE(info), "%02x", get_board_rev()); - env_set("board_rev", info); -} -#endif - static void set_dtb_name(void) { char info[64] = {0, }; @@ -435,9 +425,6 @@ int board_late_init(void) { bd_update_env();
-#ifdef CONFIG_REVISION_TAG - set_board_rev(); -#endif set_dtb_name();
set_ether_addr();

The i.MX8 family has never possibly supported ATAGs so we can remove CONFIG_SERIAL_TAG support from that family. Furthermore, the i.MX7 family is new enough to have never supported ATAGs so remove and disable those options as well.
Cc: Stefano Babic sbabic@denx.de Cc: Fabio Estevam festevam@gmail.com Cc: NXP i.MX U-Boot Team uboot-imx@nxp.com Signed-off-by: Tom Rini trini@konsulko.com --- While I strongly suspect i.MX5 and older have board-file based Linux kernel support, I don't know where i.MX6 falls. Especially if you consider non-Linux OSes, so I didn't remove that. But I would like to know if we can also delete this code from there, or not. Thanks! --- arch/arm/mach-imx/imx8/cpu.c | 31 ------------------------- arch/arm/mach-imx/mx7/soc.c | 41 ---------------------------------- arch/arm/mach-imx/mx7ulp/soc.c | 7 ------ include/configs/mx7ulp_com.h | 4 ---- include/configs/mx7ulp_evk.h | 5 ----- include/configs/warp7.h | 3 --- 6 files changed, 91 deletions(-)
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 911d6a51d1e4..31fbe63496bf 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -171,37 +171,6 @@ enum boot_device get_boot_device(void) return boot_dev; }
-#ifdef CONFIG_SERIAL_TAG -#define FUSE_UNIQUE_ID_WORD0 16 -#define FUSE_UNIQUE_ID_WORD1 17 -void get_board_serial(struct tag_serialnr *serialnr) -{ - sc_err_t err; - u32 val1 = 0, val2 = 0; - u32 word1, word2; - - if (!serialnr) - return; - - word1 = FUSE_UNIQUE_ID_WORD0; - word2 = FUSE_UNIQUE_ID_WORD1; - - err = sc_misc_otp_fuse_read(-1, word1, &val1); - if (err != SC_ERR_NONE) { - printf("%s fuse %d read error: %d\n", __func__, word1, err); - return; - } - - err = sc_misc_otp_fuse_read(-1, word2, &val2); - if (err != SC_ERR_NONE) { - printf("%s fuse %d read error: %d\n", __func__, word2, err); - return; - } - serialnr->low = val1; - serialnr->high = val2; -} -#endif /*CONFIG_SERIAL_TAG*/ - #ifdef CONFIG_ENV_IS_IN_MMC __weak int board_mmc_get_env_dev(int devno) { diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index fda25ba66a36..2601ae8ce9c9 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -161,13 +161,6 @@ u32 get_cpu_rev(void) return (type << 12) | reg; }
-#ifdef CONFIG_REVISION_TAG -u32 __weak get_board_rev(void) -{ - return get_cpu_rev(); -} -#endif - static void imx_enet_mdio_fixup(void) { struct iomuxc_gpr_base_regs *gpr_regs = @@ -351,40 +344,6 @@ int arch_misc_init(void) } #endif
-#ifdef CONFIG_SERIAL_TAG -/* - * OCOTP_TESTER - * i.MX 7Solo Applications Processor Reference Manual, Rev. 0.1, 08/2016 - * OCOTP_TESTER describes a unique ID based on silicon wafer - * and die X/Y position - * - * OCOTOP_TESTER offset 0x410 - * 31:0 fuse 0 - * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID - * - * OCOTP_TESTER1 offset 0x420 - * 31:24 fuse 1 - * The X-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID - * 23:16 fuse 1 - * The Y-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID - * 15:11 fuse 1 - * The wafer number of the wafer on which the device was fabricated/SJC - * CHALLENGE/ Unique ID - * 10:0 fuse 1 - * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID - */ -void get_board_serial(struct tag_serialnr *serialnr) -{ - struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; - struct fuse_bank *bank = &ocotp->bank[0]; - struct fuse_bank0_regs *fuse = - (struct fuse_bank0_regs *)bank->fuse_regs; - - serialnr->low = fuse->tester0; - serialnr->high = fuse->tester1; -} -#endif - void set_wdog_reset(struct wdog_regs *wdog) { u32 reg = readw(&wdog->wcr); diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c index 8dd6b4d40e77..c0e7c399bfc4 100644 --- a/arch/arm/mach-imx/mx7ulp/soc.c +++ b/arch/arm/mach-imx/mx7ulp/soc.c @@ -49,13 +49,6 @@ u32 get_cpu_rev(void) return (MXC_CPU_MX7ULP << 12) | (rom_version & 0xFF); }
-#ifdef CONFIG_REVISION_TAG -u32 __weak get_board_rev(void) -{ - return get_cpu_rev(); -} -#endif - enum bt_mode get_boot_mode(void) { u32 bt0_cfg = 0; diff --git a/include/configs/mx7ulp_com.h b/include/configs/mx7ulp_com.h index 28672c4f94c4..7ac445d02cd0 100644 --- a/include/configs/mx7ulp_com.h +++ b/include/configs/mx7ulp_com.h @@ -32,10 +32,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Fixed at 1MHz from TSTMR */
-#define CONFIG_INITRD_TAG -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS - /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M)
diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h index 0c3103082cc8..78b41c789808 100644 --- a/include/configs/mx7ulp_evk.h +++ b/include/configs/mx7ulp_evk.h @@ -22,11 +22,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Fixed at 1Mhz from TSTMR */
-#define CONFIG_INITRD_TAG -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -/*#define CONFIG_REVISION_TAG*/ - /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M)
diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 8eb106027440..3ab42ffc2d48 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -21,9 +21,6 @@ #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
-/* Switch on SERIAL_TAG */ -#define CONFIG_SERIAL_TAG - #define CONFIG_DFU_ENV_SETTINGS \ "dfu_alt_info=boot raw 0x2 0x1000 mmcpart 1\0" \

Hi Tom,
On Wed, Feb 3, 2021 at 11:24 PM Tom Rini trini@konsulko.com wrote:
The i.MX8 family has never possibly supported ATAGs so we can remove
Yes, we don't need ATAGs for the i.MX family as we use devicetree for all i.MX members.
CONFIG_SERIAL_TAG support from that family. Furthermore, the i.MX7
but reading serial identification via fuses is still supported and I am not sure why this gets removed.
I am confused with this patch, as I don't understand the relationship between ATAG and CONFIG_SERIAL_TAG.
family is new enough to have never supported ATAGs so remove and disable those options as well.
Cc: Stefano Babic sbabic@denx.de Cc: Fabio Estevam festevam@gmail.com Cc: NXP i.MX U-Boot Team uboot-imx@nxp.com Signed-off-by: Tom Rini trini@konsulko.com
While I strongly suspect i.MX5 and older have board-file based Linux kernel support, I don't know where i.MX6 falls. Especially if you consider non-Linux OSes, so I didn't remove that. But I would like to know if we can also delete this code from there, or not. Thanks!
You can assume that all i.MX devices boot only via DT.

On Thu, Feb 04, 2021 at 12:02:52AM -0300, Fabio Estevam wrote:
Hi Tom,
On Wed, Feb 3, 2021 at 11:24 PM Tom Rini trini@konsulko.com wrote:
The i.MX8 family has never possibly supported ATAGs so we can remove
Yes, we don't need ATAGs for the i.MX family as we use devicetree for all i.MX members.
CONFIG_SERIAL_TAG support from that family. Furthermore, the i.MX7
but reading serial identification via fuses is still supported and I am not sure why this gets removed.
I am confused with this patch, as I don't understand the relationship between ATAG and CONFIG_SERIAL_TAG.
CONFIG_SERIAL_TAG is only used to configure the ATAG serial record. It does nothing else. On i.MX8* this is already being discarded. On i.MX7 we see things like: warp7 : all -144 rodata +32 text -176 u-boot: add: 0/-2, grow: 0/-2 bytes: 0/-160 (-160) function old new delta params 4 - -4 get_board_serial 20 - -20 board_late_init 96 56 -40 boot_prep_linux 156 60 -96
family is new enough to have never supported ATAGs so remove and disable those options as well.
Cc: Stefano Babic sbabic@denx.de Cc: Fabio Estevam festevam@gmail.com Cc: NXP i.MX U-Boot Team uboot-imx@nxp.com Signed-off-by: Tom Rini trini@konsulko.com
While I strongly suspect i.MX5 and older have board-file based Linux kernel support, I don't know where i.MX6 falls. Especially if you consider non-Linux OSes, so I didn't remove that. But I would like to know if we can also delete this code from there, or not. Thanks!
You can assume that all i.MX devices boot only via DT.
Currently, yes. Historically ever? Or even if so, you're OK just removing all of that code as well? Thanks.

Hi Tom,
[Adding Bryan]
On Thu, Feb 4, 2021 at 12:49 AM Tom Rini trini@konsulko.com wrote:
CONFIG_SERIAL_TAG is only used to configure the ATAG serial record. It does nothing else. On i.MX8* this is already being discarded. On i.MX7 we see things like: warp7 : all -144 rodata +32 text -176 u-boot: add: 0/-2, grow: 0/-2 bytes: 0/-160 (-160) function old new delta params 4 - -4 get_board_serial 20 - -20 board_late_init 96 56 -40 boot_prep_linux 156 60 -96
But then it will remove the support of reading serial number via fuses which was added by:
commit 852cc548b3fdf6d5b46e2a96f876d14608ccdcf4 Author: Bryan O'Donoghue bryan.odonoghue@linaro.org Date: Mon Mar 26 15:27:34 2018 +0100
warp7: Set u-boot serial# based on OTP value
u-boot has a standard "serial#" environment variable that is suitable for storing the iSerial number we will supply via the USB device descriptor. serial# is automatically picked up by the disk subsystem in u-boot - thus providing a handy unique identifier in /dev/disk/by-id as detailed below.
Storing the hardware serial identifier in serial# means we can change the serial# if we want before USB enumeration - thus making iSerial automatic via OTP but overridable if necessary.
This patch reads the defined OTP fuse and sets environment variable "serial#" to the value read.
With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example
/dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0
Signed-off-by: Bryan O'Donoghue bryan.odonoghue@linaro.org Cc: Fabio Estevam fabio.estevam@nxp.com Cc: Rui Miguel Silva rui.silva@linaro.org Cc: Ryan Harkin ryan.harkin@linaro.org Reviewed-by: Fabio Estevam fabio.estevam@nxp.com
Currently, yes. Historically ever? Or even if so, you're OK just removing all of that code as well? Thanks.
mx5 and mx6 used to boot board files in the past (NXP kernel 2.6.35 for mx5 or 3.0.x for mx6).
Such kernels are not even maintained by the NXP, so we should not worry about booting non-DT with i.MX.

On Thu, Feb 04, 2021 at 06:56:47AM -0300, Fabio Estevam wrote:
Hi Tom,
[Adding Bryan]
On Thu, Feb 4, 2021 at 12:49 AM Tom Rini trini@konsulko.com wrote:
CONFIG_SERIAL_TAG is only used to configure the ATAG serial record. It does nothing else. On i.MX8* this is already being discarded. On i.MX7 we see things like: warp7 : all -144 rodata +32 text -176 u-boot: add: 0/-2, grow: 0/-2 bytes: 0/-160 (-160) function old new delta params 4 - -4 get_board_serial 20 - -20 board_late_init 96 56 -40 boot_prep_linux 156 60 -96
But then it will remove the support of reading serial number via fuses which was added by:
commit 852cc548b3fdf6d5b46e2a96f876d14608ccdcf4 Author: Bryan O'Donoghue bryan.odonoghue@linaro.org Date: Mon Mar 26 15:27:34 2018 +0100
warp7: Set u-boot serial# based on OTP value u-boot has a standard "serial#" environment variable that is suitable for storing the iSerial number we will supply via the USB device descriptor. serial# is automatically picked up by the disk subsystem in u-boot - thus providing a handy unique identifier in /dev/disk/by-id as detailed below. Storing the hardware serial identifier in serial# means we can change the serial# if we want before USB enumeration - thus making iSerial automatic via OTP but overridable if necessary. This patch reads the defined OTP fuse and sets environment variable "serial#" to the value read. With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example /dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Rui Miguel Silva <rui.silva@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
I did miss that one. I'm not sure if that's abusing a symbol or clever use of the symbol. I will have to v2 this one then.
Currently, yes. Historically ever? Or even if so, you're OK just removing all of that code as well? Thanks.
mx5 and mx6 used to boot board files in the past (NXP kernel 2.6.35 for mx5 or 3.0.x for mx6).
Such kernels are not even maintained by the NXP, so we should not worry about booting non-DT with i.MX.
So you're OK with removing ATAGs support from i.MX5/6 from mainline? But there's the unresolved question of the best way to populate "serial#". Yes? Thanks.

On Thu, Feb 04, 2021 at 08:26:52AM -0500, Tom Rini wrote:
On Thu, Feb 04, 2021 at 06:56:47AM -0300, Fabio Estevam wrote:
Hi Tom,
[Adding Bryan]
On Thu, Feb 4, 2021 at 12:49 AM Tom Rini trini@konsulko.com wrote:
CONFIG_SERIAL_TAG is only used to configure the ATAG serial record. It does nothing else. On i.MX8* this is already being discarded. On i.MX7 we see things like: warp7 : all -144 rodata +32 text -176 u-boot: add: 0/-2, grow: 0/-2 bytes: 0/-160 (-160) function old new delta params 4 - -4 get_board_serial 20 - -20 board_late_init 96 56 -40 boot_prep_linux 156 60 -96
But then it will remove the support of reading serial number via fuses which was added by:
commit 852cc548b3fdf6d5b46e2a96f876d14608ccdcf4 Author: Bryan O'Donoghue bryan.odonoghue@linaro.org Date: Mon Mar 26 15:27:34 2018 +0100
warp7: Set u-boot serial# based on OTP value u-boot has a standard "serial#" environment variable that is suitable for storing the iSerial number we will supply via the USB device descriptor. serial# is automatically picked up by the disk subsystem in u-boot - thus providing a handy unique identifier in /dev/disk/by-id as detailed below. Storing the hardware serial identifier in serial# means we can change the serial# if we want before USB enumeration - thus making iSerial automatic via OTP but overridable if necessary. This patch reads the defined OTP fuse and sets environment variable "serial#" to the value read. With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example /dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Rui Miguel Silva <rui.silva@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
I did miss that one. I'm not sure if that's abusing a symbol or clever use of the symbol. I will have to v2 this one then.
This should end up under CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG someway or another. I'm going to make an attempt at it, but the biggest hurdle is that most often "serial#" is just the fuse(s) value and not prepended by a board-specific string (OR if it is, it's just in the fdt property we read and set from).

On Thu, Feb 04, 2021 at 11:08:33AM -0500, Tom Rini wrote:
On Thu, Feb 04, 2021 at 08:26:52AM -0500, Tom Rini wrote:
On Thu, Feb 04, 2021 at 06:56:47AM -0300, Fabio Estevam wrote:
Hi Tom,
[Adding Bryan]
On Thu, Feb 4, 2021 at 12:49 AM Tom Rini trini@konsulko.com wrote:
CONFIG_SERIAL_TAG is only used to configure the ATAG serial record. It does nothing else. On i.MX8* this is already being discarded. On i.MX7 we see things like: warp7 : all -144 rodata +32 text -176 u-boot: add: 0/-2, grow: 0/-2 bytes: 0/-160 (-160) function old new delta params 4 - -4 get_board_serial 20 - -20 board_late_init 96 56 -40 boot_prep_linux 156 60 -96
But then it will remove the support of reading serial number via fuses which was added by:
commit 852cc548b3fdf6d5b46e2a96f876d14608ccdcf4 Author: Bryan O'Donoghue bryan.odonoghue@linaro.org Date: Mon Mar 26 15:27:34 2018 +0100
warp7: Set u-boot serial# based on OTP value u-boot has a standard "serial#" environment variable that is suitable for storing the iSerial number we will supply via the USB device descriptor. serial# is automatically picked up by the disk subsystem in u-boot - thus providing a handy unique identifier in /dev/disk/by-id as detailed below. Storing the hardware serial identifier in serial# means we can change the serial# if we want before USB enumeration - thus making iSerial automatic via OTP but overridable if necessary. This patch reads the defined OTP fuse and sets environment variable "serial#" to the value read. With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example /dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Rui Miguel Silva <rui.silva@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
I did miss that one. I'm not sure if that's abusing a symbol or clever use of the symbol. I will have to v2 this one then.
This should end up under CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG someway or another. I'm going to make an attempt at it, but the biggest hurdle is that most often "serial#" is just the fuse(s) value and not prepended by a board-specific string (OR if it is, it's just in the fdt property we read and set from).
So, I see 3 options here: 1. In arch/arm/mach-imx/mx7/soc.c and board/warp7/warp7.c switch from CONFIG_SERIAL_TAG to CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG (and migrate from warp7.h to defconfig to enable). This won't break existing users / documentation where the device showing up by serial number WITH "WaRP7" in the name is expected. The serial ATAG is defined regardless of CONFIG_SERIAL_TAG so it'll still be available, and we're not likely to remove ATAG support globally for some time yet. 2. Adjust arch/arm/mach-imx/mx7/soc.c to follow the common practice of arch_misc_init() calling the function to read the fuse(s) and set "serial#" to match that, without other identifiers. This would enable the feature for all imx7 boards but change the value on new/re-initialized WaRP7 boards and probably break documentation. 3. Do nothing. WaRP7 works as-is, using CONFIG_SERIAL_TAG is something I think was a bit too clever, but I can also see why it was used since after-all it's using the serial tag record, etc.
Option 3 is my least preferred choice, but, if the relevant custodians like that the most, that's fine with me.

On Thu, Feb 4, 2021 at 1:44 PM Tom Rini trini@konsulko.com wrote:
So, I see 3 options here:
- In arch/arm/mach-imx/mx7/soc.c and board/warp7/warp7.c switch from
CONFIG_SERIAL_TAG to CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG (and migrate from warp7.h to defconfig to enable). This won't break existing users / documentation where the device showing up by serial number WITH "WaRP7" in the name is expected. The serial ATAG is defined regardless of CONFIG_SERIAL_TAG so it'll still be available, and we're not likely to remove ATAG support globally for some time yet. 2. Adjust arch/arm/mach-imx/mx7/soc.c to follow the common practice of arch_misc_init() calling the function to read the fuse(s) and set "serial#" to match that, without other identifiers. This would enable the feature for all imx7 boards but change the value on new/re-initialized WaRP7 boards and probably break documentation. 3. Do nothing. WaRP7 works as-is, using CONFIG_SERIAL_TAG is something I think was a bit too clever, but I can also see why it was used since after-all it's using the serial tag record, etc.
Option 3 is my least preferred choice, but, if the relevant custodians like that the most, that's fine with me.
Option 1 is the less intrusive one IMHO, so I would prefer it.
Thanks

Hi Tom,
On Thu, Feb 4, 2021 at 10:26 AM Tom Rini trini@konsulko.com wrote:
So you're OK with removing ATAGs support from i.MX5/6 from mainline?
Yes, I am in favor of this.
But there's the unresolved question of the best way to populate "serial#". Yes? Thanks.
Correct, I just don't want to lose the capability of reading serial identification information via fuses from im7/imx8, etc.
Thanks

On Thu, Feb 04, 2021 at 01:10:47PM -0300, Fabio Estevam wrote:
Hi Tom,
On Thu, Feb 4, 2021 at 10:26 AM Tom Rini trini@konsulko.com wrote:
So you're OK with removing ATAGs support from i.MX5/6 from mainline?
Yes, I am in favor of this.
But there's the unresolved question of the best way to populate "serial#". Yes? Thanks.
Correct, I just don't want to lose the capability of reading serial identification information via fuses from im7/imx8, etc.
Fixing imx8 is the easiest, as it's not used today so we can follow the common path of arch_misc_init() calls something like setup_serial_number() and does so. imx7 is harder and I'm going to follow up with 3 ideas in that side of the thread in a moment.

The layerscape platforms are new enough to have never supported ATAGs, so disable that support.
Cc: Alison Wang alison.wang@nxp.com Cc: Feng Li feng.li_2@nxp.com Cc: Mingkai Hu mingkai.hu@nxp.com Cc: Rajesh Bhagat rajesh.bhagat@nxp.com Cc: Sumit Garg sumit.garg@nxp.com Signed-off-by: Tom Rini trini@konsulko.com --- include/configs/ls1021aiot.h | 2 -- include/configs/ls1021aqds.h | 2 -- include/configs/ls1021atwr.h | 2 -- include/configs/ls1043aqds.h | 6 ------ include/configs/ls1046aqds.h | 2 -- 5 files changed, 14 deletions(-)
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h index cf4d60ad6032..cf49cc1c10c5 100644 --- a/include/configs/ls1021aiot.h +++ b/include/configs/ls1021aiot.h @@ -175,8 +175,6 @@ #define CONFIG_PCI_SCAN_SHOW #endif
-#define CONFIG_CMDLINE_TAG - #define CONFIG_PEN_ADDR_BIG_ENDIAN #define CONFIG_LAYERSCAPE_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200 diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index eb6f1c1e5be6..26b8f8710c6c 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -422,8 +422,6 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_PCI_SCAN_SHOW #endif
-#define CONFIG_CMDLINE_TAG - #define CONFIG_PEN_ADDR_BIG_ENDIAN #define CONFIG_LAYERSCAPE_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200 diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index 3e85bb3850b7..dd088500b08b 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -260,8 +260,6 @@ #define CONFIG_PCI_SCAN_SHOW #endif
-#define CONFIG_CMDLINE_TAG - #define CONFIG_PEN_ADDR_BIG_ENDIAN #define CONFIG_LAYERSCAPE_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200 diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index 1636f0bb8ff0..f2addaca6019 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -391,12 +391,6 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */ #endif
-/* - * Environment - */ - -#define CONFIG_CMDLINE_TAG - #include <asm/fsl_secure_boot.h>
#endif /* __LS1043AQDS_H__ */ diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h index 9102c812b5bc..06e54db8d834 100644 --- a/include/configs/ls1046aqds.h +++ b/include/configs/ls1046aqds.h @@ -410,8 +410,6 @@ unsigned long get_board_ddr_clk(void); * Environment */
-#define CONFIG_CMDLINE_TAG - #undef CONFIG_BOOTCOMMAND #ifdef CONFIG_TFABOOT #define IFC_NAND_BOOTCOMMAND "run distro_bootcmd; run nand_bootcmd; " \

This platform never supported ATAG-based Linux kernels, so disable.
Cc: Thomas Fitzsimmons fitzsim@fitzsim.org Signed-off-by: Tom Rini trini@konsulko.com --- I am assuming, please correct me if wrong. --- board/broadcom/bcmstb/bcmstb.c | 5 ----- include/configs/bcmstb.h | 6 ------ 2 files changed, 11 deletions(-)
diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c index add4285db31d..efdc9c46dc84 100644 --- a/board/broadcom/bcmstb/bcmstb.c +++ b/board/broadcom/bcmstb/bcmstb.c @@ -37,11 +37,6 @@ int board_init(void) return 0; }
-u32 get_board_rev(void) -{ - return 0; -} - void reset_cpu(ulong ignored) { } diff --git a/include/configs/bcmstb.h b/include/configs/bcmstb.h index 2660d18f35a9..5dbef0e17f6a 100644 --- a/include/configs/bcmstb.h +++ b/include/configs/bcmstb.h @@ -117,12 +117,6 @@ extern phys_addr_t prior_stage_fdt_address; */ #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \ 115200} - -/* - * Informational display configuration. - */ -#define CONFIG_REVISION_TAG - /* * Command configuration. */

This platform never supported an ATAGs-based Linux kernel, so remove.
Cc: Philipp Tomsich philipp.tomsich@theobroma-systems.com Cc: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- .../theobroma-systems/puma_rk3399/puma-rk3399.c | 16 ---------------- include/configs/puma_rk3399.h | 2 -- 2 files changed, 18 deletions(-)
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index deeba3084a80..3237a6aa2e1e 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -136,19 +136,3 @@ int misc_init_r(void)
return 0; } - -#ifdef CONFIG_SERIAL_TAG -void get_board_serial(struct tag_serialnr *serialnr) -{ - char *serial_string; - u64 serial = 0; - - serial_string = env_get("serial#"); - - if (serial_string) - serial = simple_strtoull(serial_string, NULL, 16); - - serialnr->high = (u32)(serial >> 32); - serialnr->low = (u32)(serial & 0xffffffff); -} -#endif diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h index f52ea014b5d6..23de326e7208 100644 --- a/include/configs/puma_rk3399.h +++ b/include/configs/puma_rk3399.h @@ -10,6 +10,4 @@
#define SDRAM_BANK_SIZE (2UL << 30)
-#define CONFIG_SERIAL_TAG - #endif

Rather than provide an empty revision tag here, remove the code to generate an empty one and disable the feature.
Cc: Robert Baldyga r.baldyga@samsung.com Signed-off-by: Tom Rini trini@konsulko.com --- I do not know if this platform ever had to support an ATAG-based Linux kernel and if not, there is more cleanup that could be done here. --- board/samsung/goni/goni.c | 5 ----- include/configs/s5p_goni.h | 1 - 2 files changed, 6 deletions(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 2f0ef22c4171..d13347c93ff5 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -23,11 +23,6 @@
DECLARE_GLOBAL_DATA_PTR;
-u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { /* Set Initial global variables */ diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 9688bdc4c035..ca9edaa43855 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -28,7 +28,6 @@
#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG -#define CONFIG_REVISION_TAG #define CONFIG_INITRD_TAG
/* Size of malloc() pool before and after relocation */

Hi Tom,
On 2/4/21 11:24 AM, Tom Rini wrote:
Rather than provide an empty revision tag here, remove the code to generate an empty one and disable the feature.
Cc: Robert Baldyga r.baldyga@samsung.com Signed-off-by: Tom Rini trini@konsulko.com
I do not know if this platform ever had to support an ATAG-based Linux kernel and if not, there is more cleanup that could be done here.
Sorry for late because of holidays. I will check whether it's ATAG-based Linux kernel or not.
Best Regards, Jaehoon Chung
board/samsung/goni/goni.c | 5 ----- include/configs/s5p_goni.h | 1 - 2 files changed, 6 deletions(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 2f0ef22c4171..d13347c93ff5 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -23,11 +23,6 @@
DECLARE_GLOBAL_DATA_PTR;
-u32 get_board_rev(void) -{
- return 0;
-}
int board_init(void) { /* Set Initial global variables */ diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 9688bdc4c035..ca9edaa43855 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -28,7 +28,6 @@
#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG -#define CONFIG_REVISION_TAG #define CONFIG_INITRD_TAG
/* Size of malloc() pool before and after relocation */

This platform never had to support an ATAGs-based Linux kernel, so remove the support for it.
Cc: Ryan Chen ryan_chen@aspeedtech.com Cc: Chia-Wei Wang chiawei_wang@aspeedtech.com Cc: Aspeed BMC SW team BMC-SW@aspeedtech.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/aspeed-common.h | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/include/configs/aspeed-common.h b/include/configs/aspeed-common.h index df0f5d2e76f7..8d666c6ed415 100644 --- a/include/configs/aspeed-common.h +++ b/include/configs/aspeed-common.h @@ -12,11 +12,6 @@
#include <asm/arch/platform.h>
-/* Misc CPU related */ -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG - #define CONFIG_SYS_SDRAM_BASE ASPEED_DRAM_BASE
#ifdef CONFIG_PRE_CON_BUF_SZ

Hi Tom,
I have tested this patch with Aspeed SDK as well as the U-Boot mainline codebase on AST2500/AST2600 EVBs. Both AST2500/AST2600 can boot to kernel normally. Thanks.
Chiawei
Tested-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, February 4, 2021 10:24 AM To: u-boot@lists.denx.de Cc: Ryan Chen ryan_chen@aspeedtech.com; ChiaWei Wang chiawei_wang@aspeedtech.com; BMC-SW BMC-SW@aspeedtech.com Subject: [PATCH 07/13] arm: aspeed: Disable ATAGs support
This platform never had to support an ATAGs-based Linux kernel, so remove the support for it.
Cc: Ryan Chen ryan_chen@aspeedtech.com Cc: Chia-Wei Wang chiawei_wang@aspeedtech.com Cc: Aspeed BMC SW team BMC-SW@aspeedtech.com Signed-off-by: Tom Rini trini@konsulko.com
I'm assuming, please correct me if I'm wrong.
include/configs/aspeed-common.h | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/include/configs/aspeed-common.h b/include/configs/aspeed-common.h index df0f5d2e76f7..8d666c6ed415 100644 --- a/include/configs/aspeed-common.h +++ b/include/configs/aspeed-common.h @@ -12,11 +12,6 @@
#include <asm/arch/platform.h>
-/* Misc CPU related */ -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG
#define CONFIG_SYS_SDRAM_BASE ASPEED_DRAM_BASE
#ifdef CONFIG_PRE_CON_BUF_SZ
2.17.1

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Ryder Lee ryder.lee@mediatek.com Cc: Weijie Gao weijie.gao@mediatek.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/mt7623.h | 4 ---- include/configs/mt7629.h | 4 ---- 2 files changed, 8 deletions(-)
diff --git a/include/configs/mt7623.h b/include/configs/mt7623.h index 9895279749db..613e96e49235 100644 --- a/include/configs/mt7623.h +++ b/include/configs/mt7623.h @@ -12,10 +12,6 @@ #include <linux/sizes.h>
/* Miscellaneous configurable options */ -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_CMDLINE_TAG - #define CONFIG_SYS_MAXARGS 8 #define CONFIG_SYS_BOOTM_LEN SZ_64M #define CONFIG_SYS_CBSIZE SZ_1K diff --git a/include/configs/mt7629.h b/include/configs/mt7629.h index 08a4d01f5524..af9a5bbb6f19 100644 --- a/include/configs/mt7629.h +++ b/include/configs/mt7629.h @@ -12,10 +12,6 @@ #include <linux/sizes.h>
/* Miscellaneous configurable options */ -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_CMDLINE_TAG - #define CONFIG_SYS_MAXARGS 8 #define CONFIG_SYS_BOOTM_LEN SZ_64M #define CONFIG_SYS_CBSIZE SZ_1K

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Stefan Roese sr@denx.de Cc: Marek Behún marek.behun@nic.cz Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/mvebu_armada-37xx.h | 9 --------- include/configs/mvebu_armada-8k.h | 9 --------- include/configs/turris_mox.h | 9 --------- 3 files changed, 27 deletions(-)
diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 0d585606a73a..84772d9fa075 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -20,15 +20,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/* - * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is - * the maximum mapped by the Linux kernel during initialization. - */ -#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */ - #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/* diff --git a/include/configs/mvebu_armada-8k.h b/include/configs/mvebu_armada-8k.h index 38f50468c543..fc42cfd1fb07 100644 --- a/include/configs/mvebu_armada-8k.h +++ b/include/configs/mvebu_armada-8k.h @@ -19,15 +19,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/* - * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is - * the maximum mapped by the Linux kernel during initialization. - */ -#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */ - #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/* diff --git a/include/configs/turris_mox.h b/include/configs/turris_mox.h index 51445ec60ae1..721a78b9baa4 100644 --- a/include/configs/turris_mox.h +++ b/include/configs/turris_mox.h @@ -25,15 +25,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/* - * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is - * the maximum mapped by the Linux kernel during initialization. - */ -#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */ - #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/*

On 04.02.21 03:24, Tom Rini wrote:
These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Stefan Roese sr@denx.de Cc: Marek Behún marek.behun@nic.cz Signed-off-by: Tom Rini trini@konsulko.com
I'm assuming, please correct me if I'm wrong.
Looks good:
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan
include/configs/mvebu_armada-37xx.h | 9 --------- include/configs/mvebu_armada-8k.h | 9 --------- include/configs/turris_mox.h | 9 --------- 3 files changed, 27 deletions(-)
diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 0d585606a73a..84772d9fa075 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -20,15 +20,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/*
- For booting Linux, the board info and command line data
- have to be in the first 8 MB of memory, since this is
- the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/*
diff --git a/include/configs/mvebu_armada-8k.h b/include/configs/mvebu_armada-8k.h index 38f50468c543..fc42cfd1fb07 100644 --- a/include/configs/mvebu_armada-8k.h +++ b/include/configs/mvebu_armada-8k.h @@ -19,15 +19,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/*
- For booting Linux, the board info and command line data
- have to be in the first 8 MB of memory, since this is
- the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/*
diff --git a/include/configs/turris_mox.h b/include/configs/turris_mox.h index 51445ec60ae1..721a78b9baa4 100644 --- a/include/configs/turris_mox.h +++ b/include/configs/turris_mox.h @@ -25,15 +25,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ 115200, 230400, 460800, 921600 }
-/*
- For booting Linux, the board info and command line data
- have to be in the first 8 MB of memory, since this is
- the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
/*
Viele Grüße, Stefan

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Marek Vasut marek.vasut@gmail.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/grpeach.h | 1 - include/configs/rcar-gen2-common.h | 4 ---- include/configs/rcar-gen3-common.h | 6 ------ 3 files changed, 11 deletions(-)
diff --git a/include/configs/grpeach.h b/include/configs/grpeach.h index 4d5eab09f09b..3087cab44c04 100644 --- a/include/configs/grpeach.h +++ b/include/configs/grpeach.h @@ -13,7 +13,6 @@
/* Miscellaneous */ #define CONFIG_SYS_PBSIZE 256 -#define CONFIG_CMDLINE_TAG
/* Internal RAM Size (RZ/A1=3M, RZ/A1M=5M, RZ/A1H=10M) */ #define CONFIG_SYS_SDRAM_BASE 0x20000000 diff --git a/include/configs/rcar-gen2-common.h b/include/configs/rcar-gen2-common.h index f94e9d89799f..6634fe4d3cd9 100644 --- a/include/configs/rcar-gen2-common.h +++ b/include/configs/rcar-gen2-common.h @@ -10,10 +10,6 @@
#include <asm/arch/rmobile.h>
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG - #ifdef CONFIG_SPL #define CONFIG_SPL_TARGET "spl/u-boot-spl.srec" #endif diff --git a/include/configs/rcar-gen3-common.h b/include/configs/rcar-gen3-common.h index b9762f5bebbd..34f3005f97cb 100644 --- a/include/configs/rcar-gen3-common.h +++ b/include/configs/rcar-gen3-common.h @@ -17,12 +17,6 @@ #define CONFIG_SPL_TARGET "spl/u-boot-spl.scif" #endif
-/* boot option */ - -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG - /* Generic Interrupt Controller Definitions */ #define CONFIG_GICV2 #define GICD_BASE 0xF1010000

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Eddy Petrișor eddy.petrisor@gmail.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/s32v234evb.h | 3 --- 1 file changed, 3 deletions(-)
diff --git a/include/configs/s32v234evb.h b/include/configs/s32v234evb.h index 275d92eff783..b6fba3191584 100644 --- a/include/configs/s32v234evb.h +++ b/include/configs/s32v234evb.h @@ -34,9 +34,6 @@
#define CONFIG_SKIP_LOWLEVEL_INIT
-/* Enable passing of ATAGs */ -#define CONFIG_CMDLINE_TAG - /* SMP Spin Table Definitions */ #define CPU_RELEASE_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0)

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Holger Brunck holger.brunck@hitachi-powergrids.com Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/socfpga_arria5_secu1.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/socfpga_arria5_secu1.h b/include/configs/socfpga_arria5_secu1.h index c25d6bd82be2..90d4bb55a3f1 100644 --- a/include/configs/socfpga_arria5_secu1.h +++ b/include/configs/socfpga_arria5_secu1.h @@ -43,7 +43,6 @@ "setenv altbootcmd 'setenv bootnum b && saveenv && boot;' && " \ "saveenv && saveenv && boot;"
-#define CONFIG_CMDLINE_TAG #define CONFIG_SYS_BOOTM_LEN (64 << 20)
/* Environment settings */

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Holger Brunck holger.brunck@hitachi-powergrids.com Signed-off-by: Tom Rini trini@konsulko.com
I'm assuming, please correct me if I'm wrong.
you are right, this can be removed.
Reviewed-By: Holger Brunck holger.brunck@hitachi-powergrids.com
Best regards Holger

These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Kamil Lulko kamil.lulko@gmail.com Cc: Patrick Delaunay patrick.delaunay@foss.st.com Cc: Patrice Chotard patrice.chotard@foss.st.com Cc: Vikas Manocha vikas.manocha@st.com Cc: Marek Vasut marex@denx.de Signed-off-by: Tom Rini trini@konsulko.com --- I'm assuming, please correct me if I'm wrong. --- include/configs/stm32f429-discovery.h | 5 ----- include/configs/stm32f429-evaluation.h | 5 ----- include/configs/stm32f469-discovery.h | 5 ----- include/configs/stm32f746-disco.h | 5 ----- include/configs/stm32h743-disco.h | 5 ----- include/configs/stm32h743-eval.h | 5 ----- include/configs/stm32mp1.h | 5 ----- 7 files changed, 35 deletions(-)
diff --git a/include/configs/stm32f429-discovery.h b/include/configs/stm32f429-discovery.h index 9d029fbcc6f0..dbbce494759f 100644 --- a/include/configs/stm32f429-discovery.h +++ b/include/configs/stm32f429-discovery.h @@ -27,11 +27,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SYS_MALLOC_LEN (2 << 20) diff --git a/include/configs/stm32f429-evaluation.h b/include/configs/stm32f429-evaluation.h index fefdb2dd1525..29a41e80676a 100644 --- a/include/configs/stm32f429-evaluation.h +++ b/include/configs/stm32f429-evaluation.h @@ -29,11 +29,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024) diff --git a/include/configs/stm32f469-discovery.h b/include/configs/stm32f469-discovery.h index ba9f05a61b40..b9b932c65107 100644 --- a/include/configs/stm32f469-discovery.h +++ b/include/configs/stm32f469-discovery.h @@ -29,11 +29,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024) diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h index 08d050adfa51..b72b989c2c21 100644 --- a/include/configs/stm32f746-disco.h +++ b/include/configs/stm32f746-disco.h @@ -36,11 +36,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024) diff --git a/include/configs/stm32h743-disco.h b/include/configs/stm32h743-disco.h index 6e10dbdfe945..e5bb08eec719 100644 --- a/include/configs/stm32h743-disco.h +++ b/include/configs/stm32h743-disco.h @@ -24,11 +24,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_MAXARGS 16 #define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024)
diff --git a/include/configs/stm32h743-eval.h b/include/configs/stm32h743-eval.h index 268d39c7ad6a..89169f85d5ba 100644 --- a/include/configs/stm32h743-eval.h +++ b/include/configs/stm32h743-eval.h @@ -24,11 +24,6 @@
#define CONFIG_SYS_HZ_CLOCK 1000000
-#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG -#define CONFIG_REVISION_TAG - #define CONFIG_SYS_MAXARGS 16 #define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024)
diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 863b652ca4f7..e2e8a5d1a325 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -33,11 +33,6 @@ #define CONFIG_LOADADDR 0xc2000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
-/* ATAGs */ -#define CONFIG_CMDLINE_TAG -#define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_INITRD_TAG - /* * For booting Linux, use the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization.

Hi Tom,
On 2/4/21 3:24 AM, Tom Rini wrote:
These platforms never had to support an ATAGs-based Linux Kernel, so remove the options.
Cc: Kamil Lulko kamil.lulko@gmail.com Cc: Patrick Delaunay patrick.delaunay@foss.st.com Cc: Patrice Chotard patrice.chotard@foss.st.com Cc: Vikas Manocha vikas.manocha@st.com Cc: Marek Vasut marex@denx.de Signed-off-by: Tom Rini trini@konsulko.com
I'm assuming, please correct me if I'm wrong.
include/configs/stm32f429-discovery.h | 5 ----- include/configs/stm32f429-evaluation.h | 5 ----- include/configs/stm32f469-discovery.h | 5 ----- include/configs/stm32f746-disco.h | 5 ----- include/configs/stm32h743-disco.h | 5 ----- include/configs/stm32h743-eval.h | 5 ----- include/configs/stm32mp1.h | 5 ----- 7 files changed, 35 deletions(-)
Yes you are right.
It is inherited of the first U-boot porting (before full DM and FDT support).
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
For information the initialization parts can be removed in boards support (as no more used):
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
in ./board/st/
- stm32f429-evaluation/stm32f429-evaluation.c:54: - stm32h743-disco/stm32h743-disco.c:55: - stm32f429-discovery/stm32f429-discovery.c:60: - stm32mp1/stm32mp1.c:644: - stm32f746-disco/stm32f746-disco.c:129: - stm32f469-discovery/stm32f469-discovery.c:54: - stm32h743-eval/stm32h743-eval.c:55:
But I will push a separate patch for this point.
Just one question for other part of generic code which can be removed....
bi_boot_params should be under compilation BOOTM_ENABLE_TAGS flags ?
In include/asm-generic/u-boot.h:70 struct bd_info {
.... ulong bi_boot_params; /* where this board expects params */
...
};
and also params global variables, only used in setup_XXX functions ?
arch/arm/lib/bootm.c:44: static struct tag *params;
Regards
Thanks
Patrick

On Mon, Feb 08, 2021 at 05:34:50PM +0100, Patrick DELAUNAY wrote:
[snip]
Just one question for other part of generic code which can be removed....
bi_boot_params should be under compilation BOOTM_ENABLE_TAGS flags ?
In include/asm-generic/u-boot.h:70 struct bd_info {
.... ulong bi_boot_params; /* where this board expects params */
...
};
and also params global variables, only used in setup_XXX functions ?
arch/arm/lib/bootm.c:44: static struct tag *params;
With some further cleanup work to introduce a single symbol to say yes/no to ATAGS support, we could then cleanly condition out a few more bits of code and save some space, yes.

Hi,
thanks for the info, I'll have a look at this.
Regards Stefan
On 04.02.21 03:24, Tom Rini wrote:
This platform did not ever enable CONFIG_REVISION_TAG, so the code to set the board_rev environment variable was never enabled. This particular symbol is also only for use with the REVISION ATAG and this platform is new enough to have never supported an ATAG-based Linux Kernel.
Cc: Stefan Bosch stefan_b@posteo.net Signed-off-by: Tom Rini trini@konsulko.com
I'd be happy to see this patch replaced by one that enables what I think you meant to be doing and by default. Thanks!
board/friendlyarm/nanopi2/board.c | 13 ------------- 1 file changed, 13 deletions(-)
diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c index 68980536abe9..6e546853b863 100644 --- a/board/friendlyarm/nanopi2/board.c +++ b/board/friendlyarm/nanopi2/board.c @@ -294,16 +294,6 @@ static void set_ether_addr(void) env_set("ethaddr", ethaddr); }
-#ifdef CONFIG_REVISION_TAG -static void set_board_rev(void) -{
- char info[64] = {0, };
- snprintf(info, ARRAY_SIZE(info), "%02x", get_board_rev());
- env_set("board_rev", info);
-} -#endif
- static void set_dtb_name(void) { char info[64] = {0, };
@@ -435,9 +425,6 @@ int board_late_init(void) { bd_update_env();
-#ifdef CONFIG_REVISION_TAG
- set_board_rev();
-#endif set_dtb_name();
set_ether_addr();

Hi Tom,
CONFIG_REVISION_TAG has originally been defined in s5p4418_nanopi2.h. But this gets lost sometime in the past. Below my proposal for a patch which uses CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG instead.
Regards Stefan
Signed-off-by: Stefan Bosch stefan_b@posteo.net ---
board/friendlyarm/nanopi2/board.c | 4 ++-- configs/s5p4418_nanopi2_defconfig | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c index c0fe2d546f..9e724e1095 100644 --- a/board/friendlyarm/nanopi2/board.c +++ b/board/friendlyarm/nanopi2/board.c @@ -295,7 +295,7 @@ static void set_ether_addr(void) env_set("ethaddr", ethaddr); }
-#ifdef CONFIG_REVISION_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG static void set_board_rev(void) { char info[64] = {0, }; @@ -436,7 +436,7 @@ int board_late_init(void) { bd_update_env();
-#ifdef CONFIG_REVISION_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set_board_rev(); #endif set_dtb_name(); diff --git a/configs/s5p4418_nanopi2_defconfig b/configs/s5p4418_nanopi2_defconfig index c5537bac34..82b057751d 100644 --- a/configs/s5p4418_nanopi2_defconfig +++ b/configs/s5p4418_nanopi2_defconfig @@ -57,3 +57,4 @@ CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_SPLASH_SOURCE=y CONFIG_BMP_24BPP=y CONFIG_ERRNO_STR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y

On Sat, Apr 10, 2021 at 07:14:31PM +0200, Stefan Bosch wrote:
Hi Tom,
CONFIG_REVISION_TAG has originally been defined in s5p4418_nanopi2.h. But this gets lost sometime in the past. Below my proposal for a patch which uses CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG instead.
Regards Stefan
Signed-off-by: Stefan Bosch stefan_b@posteo.net
Reviewed-by: Tom Rini trini@konsulko.com
participants (8)
-
ChiaWei Wang
-
Fabio Estevam
-
Holger Brunck
-
Jaehoon Chung
-
Patrick DELAUNAY
-
Stefan Bosch
-
Stefan Roese
-
Tom Rini