toradex: Switch from ARCH_MISC_INIT to MISC_INIT_R in some cases
Subsystems (5)
PATCH 1/2 toradex: Switch from ARCH_MISC_INIT to MISC_INIT_R in some cases
The hook arch_misc_init was not intended to be used for per-board hooks. This can be done with misc_init_r instead, which is what follows immediately after arch_misc_init. Switch a few platforms.
---
Cc: Francesco Dolcini <[email protected]>
--- board/toradex/apalis-tk1/apalis-tk1.c | 2 +- board/toradex/apalis_t30/apalis_t30.c | 2 +- board/toradex/colibri_t20/colibri_t20.c | 2 +- board/toradex/colibri_t30/colibri_t30.c | 2 +- configs/apalis-tk1_defconfig | 2 +- configs/apalis_t30_defconfig | 2 +- configs/colibri_t20_defconfig | 2 +- configs/colibri_t30_defconfig | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +1 -1
@@ -36,7 +36,7 @@#define VCC_USBO1 TEGRA_GPIO(T, 5)#define VCC_USBO1_V1_0 TEGRA_GPIO(N, 4) -int arch_misc_init (void ) +int misc_init_r (void ) {if (readl (NV_PA_BASE_SRAM +NVBOOTINFOTABLE_BOOTTYPE ) ==NVBOOTTYPE_RECOVERY ) {
board/toradex/apalis_t30/apalis_t30.c +1 -1
@@ -35,7 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;static int pci_reset_status;#endif /* CONFIG_APALIS_T30_PCIE_EVALBOARD_INIT */ -int arch_misc_init (void ) +int misc_init_r (void ) {if (readl (NV_PA_BASE_SRAM +NVBOOTINFOTABLE_BOOTTYPE ) ==NVBOOTTYPE_RECOVERY )
board/toradex/colibri_t20/colibri_t20.c +1 -1
@@ -29,7 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;#define PMU_SUPPLYENE_SYSINEN (1<<5)#define PMU_SUPPLYENE_EXITSLREQ (1<<1) -int arch_misc_init (void ) +int misc_init_r (void ) {/* Disable PMIC sleep mode on low supply voltage */ struct udevice *dev;
board/toradex/colibri_t30/colibri_t30.c +1 -1
@@ -18,7 +18,7 @@#include "pinmux-config-colibri_t30.h" #include "../common/tdx-common.h" -int arch_misc_init (void ) +int misc_init_r (void ) {if (readl (NV_PA_BASE_SRAM +NVBOOTINFOTABLE_BOOTTYPE ) ==NVBOOTTYPE_RECOVERY )
configs/apalis-tk1_defconfig +1 -1
@@ -27,7 +27,7 @@ CONFIG_CONSOLE_MUX=y CONFIG_SYS_STDIO_DEREGISTER=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_ARCH_MISC_INIT=y +CONFIG_MISC_INIT_R=y CONFIG_SPL_FOOTPRINT_LIMIT=y CONFIG_SPL_MAX_FOOTPRINT=0x8000 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
configs/apalis_t30_defconfig +1 -1
@@ -22,7 +22,7 @@ CONFIG_CONSOLE_MUX=y CONFIG_SYS_STDIO_DEREGISTER=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_ARCH_MISC_INIT=y +CONFIG_MISC_INIT_R=y CONFIG_SPL_FOOTPRINT_LIMIT=y CONFIG_SPL_MAX_FOOTPRINT=0x8000 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
configs/colibri_t20_defconfig +1 -1
@@ -20,7 +20,7 @@ CONFIG_SYS_PBSIZE=1055 CONFIG_SYS_STDIO_DEREGISTER=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_ARCH_MISC_INIT=y +CONFIG_MISC_INIT_R=y CONFIG_SPL_FOOTPRINT_LIMIT=y CONFIG_SPL_MAX_FOOTPRINT=0x8000 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
configs/colibri_t30_defconfig +1 -1
@@ -21,7 +21,7 @@ CONFIG_CONSOLE_MUX=y CONFIG_SYS_STDIO_DEREGISTER=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_ARCH_MISC_INIT=y +CONFIG_MISC_INIT_R=y CONFIG_SPL_FOOTPRINT_LIMIT=y CONFIG_SPL_MAX_FOOTPRINT=0x8000 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
Signature · 1 line
2.43.0
PATCH 2/2 global: Make ARCH_MISC_INIT a selected symbol
This symbol is not something that the user should be enabling or disabling but rather the developer for a particular board should select it when required.
This is mostly size neutral, however a few places do have changes. In the case of i.MX6ULL systems, it is always the case that arch_misc_init() could call setup_serial_number() and do useful work, but was not enabled widely, but now is. In the case of i.MX23/28 systems, we should be able to call mx28_fixup_vt() again here, so do so. Finally, some platforms were calling arch_misc_init() and then not doing anything and this results in removing the option.
---
Cc: Stefano Babic <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: "NXP i.MX U-Boot Team" <[email protected]>
--- arch/arm/Kconfig | 7 ++++--- arch/arm/cpu/armv7/ls102xa/Kconfig | 1 + arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 1 + arch/arm/mach-imx/imx9/Kconfig | 2 ++ arch/arm/mach-imx/mx6/Kconfig | 1 + arch/arm/mach-omap2/am33xx/Kconfig | 6 ++++++ arch/mips/mach-octeon/Kconfig | 1 + board/toradex/verdin-imx8mm/spl.c | 2 ++ common/Kconfig | 3 ++- 9 files changed, 20 insertions(+), 4 deletions(-)
arch/arm/Kconfig +4 -3
@@ -905,6 +905,7 @@ config ARCH_IMX8 config ARCH_IMX8M bool "NXP i.MX8M platform" + select ARCH_MISC_INIT if FSL_CAAM select ARM64 select GPIO_EXTRA_HEADER select MACH_IMX
@@ -954,6 +955,7 @@ config ARCH_IMXRT config ARCH_MX23 bool "NXP i.MX23 family" + select ARCH_MISC_INIT select CPU_ARM926EJS select GPIO_EXTRA_HEADER select MACH_IMX
@@ -961,6 +963,7 @@ config ARCH_MX23 config ARCH_MX28 bool "NXP i.MX28 family" + select ARCH_MISC_INIT select CPU_ARM926EJS select GPIO_EXTRA_HEADER select MACH_IMX
@@ -1102,6 +1105,7 @@ config ARCH_QEMU config ARCH_RENESAS bool "Renesas ARM SoCs" + select ARCH_MISC_INIT if DISPLAY_CPUINFO && !(RZA1 || RZN1) select DM select DM_SERIAL select GPIO_EXTRA_HEADER
@@ -1111,7 +1115,6 @@ config ARCH_RENESAS imply FAT_WRITE imply OF_UPSTREAM imply SYS_THUMB_BUILD - imply ARCH_MISC_INIT if DISPLAY_CPUINFO config ARCH_SNAPDRAGON bool "Qualcomm Snapdragon SoCs"
@@ -1540,7 +1543,6 @@ config TARGET_LX2160AQDS config TARGET_LX2162AQDS bool "Support lx2162aqds" select ARCH_LX2162A - select ARCH_MISC_INIT select ARM64 select ARMV8_MULTIENTRY select ARCH_SUPPORT_TFABOOT
@@ -1953,7 +1955,6 @@ config TARGET_SL28 config TARGET_TEN64 bool "Support ten64" select ARCH_LS1088A - select ARCH_MISC_INIT select ARM64 select ARMV8_MULTIENTRY select ARCH_SUPPORT_TFABOOT
arch/arm/cpu/armv7/ls102xa/Kconfig +1 -0
@@ -1,5 +1,6 @@ config ARCH_LS1021A bool + select ARCH_MISC_INIT if FSL_CAAM select FSL_DEVICE_DISABLE select FSL_IFC if !QSPI_BOOT && !SD_BOOT_QSPI select LS102XA_STREAM_ID
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +1 -0
@@ -328,6 +328,7 @@ config ARCH_LX2160A config FSL_LSCH2 bool + select ARCH_MISC_INIT if FSL_CAAM select SKIP_LOWLEVEL_INIT select SYS_FSL_CCSR_GUR_BE select SYS_FSL_CCSR_SCFG_BE
arch/arm/mach-imx/imx9/Kconfig +2 -0
@@ -22,10 +22,12 @@ config IMX93 config IMX91 bool select IMX9 + select ARCH_MISC_INIT select ARMV8_SPL_EXCEPTION_VECTORS config IMX95 bool + select ARCH_MISC_INIT select ARMV8_SPL_EXCEPTION_VECTORS select IMX9 select DM_MAILBOX
arch/arm/mach-imx/mx6/Kconfig +1 -0
@@ -63,6 +63,7 @@ config MX6UL config MX6ULL bool "i.MX 6ULL SoC support" + select ARCH_MISC_INIT select ROM_UNIFIED_SECTIONS select SYSCOUNTER_TIMER select SYS_L2CACHE_OFF
arch/arm/mach-omap2/am33xx/Kconfig +6 -0
@@ -9,6 +9,7 @@ choice config TARGET_AM335X_EVM bool "Support am335x_evm" + select ARCH_MISC_INIT select BOARD_LATE_INIT select DM select DM_GPIO
@@ -70,6 +71,7 @@ config TARGET_AM335X_SHC config TARGET_AM335X_GUARDIAN bool "Support am335x based guardian board from bosch" + select ARCH_MISC_INIT select BOARD_LATE_INIT select DM select DM_SERIAL
@@ -116,6 +118,7 @@ config TARGET_ETAMIN config TARGET_PCM051 bool "Support pcm051" + select ARCH_MISC_INIT select DM select DM_GPIO select DM_SERIAL
@@ -123,6 +126,7 @@ config TARGET_PCM051 config TARGET_PHYCORE_AM335X_R2 bool "Support phyCORE AM335X R2" + select ARCH_MISC_INIT select DM select DM_GPIO select DM_SERIAL
@@ -130,6 +134,7 @@ config TARGET_PHYCORE_AM335X_R2 config TARGET_PXM2 bool "Support pxm2" + select ARCH_MISC_INIT select BOARD_LATE_INIT select DM select DM_GPIO
@@ -148,6 +153,7 @@ config TARGET_RASTABAN config TARGET_RUT bool "Support rut" + select ARCH_MISC_INIT select BOARD_LATE_INIT select DM select DM_GPIO
arch/mips/mach-octeon/Kconfig +1 -0
@@ -42,6 +42,7 @@ config TARGET_OCTEON_EBB7304 config TARGET_OCTEON_NIC23 bool "Marvell Octeon NIC23" + select ARCH_MISC_INIT select OCTEON_CN73XX help Choose this for the Octeon NIC23 board
board/toradex/verdin-imx8mm/spl.c +2 -0
@@ -53,7 +53,9 @@ void spl_dram_init(void)void spl_board_init (void ) { +#if IS_ENABLED (CONFIG_ARCH_MISC_INIT )arch_misc_init (); +#endif }#ifdef CONFIG_SPL_LOAD_FIT
common/Kconfig +2 -1
@@ -704,8 +704,9 @@ config ARCH_EARLY_INIT_R enabled. This can be used to set up architecture-specific devices. config ARCH_MISC_INIT - bool "Call arch-specific init after relocation, when console is ready" + bool help + Call arch-specific init after relocation, when console is ready. With this option U-Boot will call arch_misc_init() after relocation to allow miscellaneous arch-dependent initialisation to be performed. This function should be defined by the board
Signature · 1 line
2.43.0
RE: [PATCH 2/2] global: Make ARCH_MISC_INIT a selected symbol
Quoted 14 lines
Subject: [PATCH 2/2] global: Make
ARCH_MISC_INITa selected symbolThis symbol is not something that the user should be enabling or disabling but rather the developer for a particular board should select it when required.
This is mostly size neutral, however a few places do have changes. In the case of i.MX6ULL systems, it is always the case that
arch_misc_init()could callsetup_serial_number()and do useful work, but was not enabled widely, but now is. In the case of i.MX23/28 systems, we should be able to callmx28_fixup_vt()again here, so do so. Finally, some platforms were callingarch_misc_init()and then not doing anything and this results in removing the option.
Quoted 1 line
Signed-off-by Tom Rini <[email protected]>
Quoted 5 lines · Tom Rini
The hook
arch_misc_initwas not intended to be used for per-board hooks. This can be done withmisc_init_rinstead, which is what follows immediately afterarch_misc_init. Switch a few platforms.Signed-off-by Tom Rini <[email protected]>
Quoted 5 lines · Tom Rini
The hook
arch_misc_initwas not intended to be used for per-board hooks. This can be done withmisc_init_rinstead, which is what follows immediately afterarch_misc_init. Switch a few platforms.
Applied to u-boot/master, thanks!
[1/2] toradex: Switch from ARCH_MISC_INIT to MISC_INIT_R in some cases
commit: 0d50d5fc52f0fe54f5d80bb9543f92f362c8b80a
[2/2] global: Make ARCH_MISC_INIT a selected symbol
commit: d0ed9636902bc5c0d7ea5f73926441241acb6051Signature · 1 line
Tom