[PATCH 0/3] Update env support for Am62x

This patch series aims at updating the env support on Am62x by adding necessary config, updating env variables, update to using CONFIG_IS_ENABLED.
Nikhil M Jain (3): board: ti: am62x: Kconfig: Add ENV_SOIRCE_FILE for am62x board: ti: am62x: am62x: Update args_all env variable include: configs: am62x_evm: Use CONFIG_IS_ENABLED
board/ti/am62x/Kconfig | 6 ++++++ board/ti/am62x/am62x.env | 3 +-- include/configs/am62x_evm.h | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-)

Set the base name for am62x to use am62x.env file, for setting environment variable.
Signed-off-by: Nikhil M Jain n-jain1@ti.com --- board/ti/am62x/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index 5e8dfa3cc4..b681d8e589 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -34,6 +34,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "am62x_evm"
+config ENV_SOURCE_FILE + default "am62x" + source "board/ti/common/Kconfig"
endif @@ -52,6 +55,9 @@ config SYS_CONFIG_NAME config SPL_LDSCRIPT default "arch/arm/mach-omap2/u-boot-spl.lds"
+config ENV_SOURCE_FILE + default "am62x" + source "board/ti/common/Kconfig"
endif

On Fri, Apr 28, 2023 at 01:23:34PM +0530, Nikhil M Jain wrote:
Set the base name for am62x to use am62x.env file, for setting environment variable.
Signed-off-by: Nikhil M Jain n-jain1@ti.com
board/ti/am62x/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index 5e8dfa3cc4..b681d8e589 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -34,6 +34,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "am62x_evm"
+config ENV_SOURCE_FILE
default "am62x"
source "board/ti/common/Kconfig"
endif
Ugh, I see I didn't catch this on j721* in time. Please set this in the defconfig when needed. If we can't use CONFIG_SYS_BOARD.env for the common one, we should probably think a bit harder on what's named what.

Remove the earlycon settings from args_all.
Signed-off-by: Nikhil M Jain n-jain1@ti.com --- board/ti/am62x/am62x.env | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index e4e64fa637..cdd30b08ed 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -7,8 +7,7 @@ findfdt= setenv fdtfile ${name_fdt} name_kern=Image console=ttyS2,115200n8 -args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 - ${mtdparts} +args_all=setenv optargs ${optargs} ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
boot=mmc

On 4/28/2023 1:23 PM, Nikhil M Jain wrote:
Remove the earlycon settings from args_all.
Could you explain why is it okay to drop earlycon?
Note, earlycon helps us to debug kernel crashes "before" kernel initializes UART driver ... Its very useful to have it on by default
Regards Vignesh
Signed-off-by: Nikhil M Jain n-jain1@ti.com
board/ti/am62x/am62x.env | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index e4e64fa637..cdd30b08ed 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -7,8 +7,7 @@ findfdt= setenv fdtfile ${name_fdt} name_kern=Image console=ttyS2,115200n8 -args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
- ${mtdparts}
+args_all=setenv optargs ${optargs} ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
boot=mmc

Update to using CONFIG_IS_ENABLED and change DISTRO_BOOT_DEV_MMC to first attempt SD card boot and next emmc boot.
Signed-off-by: Nikhil M Jain n-jain1@ti.com --- include/configs/am62x_evm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 7bf07809b0..55ed2bc68f 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -15,19 +15,19 @@ /* DDR Configuration */ #define CFG_SYS_SDRAM_BASE1 0x880000000
-#ifdef CONFIG_CMD_MMC -#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) +#if CONFIG_IS_ENABLED(CMD_MMC) +#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 1) func(MMC, mmc, 0) #else #define DISTRO_BOOT_DEV_MMC(func) #endif
-#ifdef CONFIG_CMD_PXE +#if CONFIG_IS_ENABLED(CMD_PXE) #define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na) #else #define DISTRO_BOOT_DEV_PXE(func) #endif
-#ifdef CONFIG_CMD_DHCP +#if CONFIG_IS_ENABLED(CMD_DHCP) #define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na) #else #define DISTRO_BOOT_DEV_DHCP(func)

On Fri, Apr 28, 2023 at 01:23:36PM +0530, Nikhil M Jain wrote:
Update to using CONFIG_IS_ENABLED and change DISTRO_BOOT_DEV_MMC to first attempt SD card boot and next emmc boot.
Signed-off-by: Nikhil M Jain n-jain1@ti.com
include/configs/am62x_evm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 7bf07809b0..55ed2bc68f 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -15,19 +15,19 @@ /* DDR Configuration */ #define CFG_SYS_SDRAM_BASE1 0x880000000
-#ifdef CONFIG_CMD_MMC -#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) +#if CONFIG_IS_ENABLED(CMD_MMC) +#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 1) func(MMC, mmc, 0) #else #define DISTRO_BOOT_DEV_MMC(func) #endif
-#ifdef CONFIG_CMD_PXE +#if CONFIG_IS_ENABLED(CMD_PXE) #define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na) #else #define DISTRO_BOOT_DEV_PXE(func) #endif
-#ifdef CONFIG_CMD_DHCP +#if CONFIG_IS_ENABLED(CMD_DHCP) #define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na) #else #define DISTRO_BOOT_DEV_DHCP(func)
Using CONFIG_IS_ENABLED is bad here, there's no context outside of full U-Boot where we have CMD_foo being possible.
participants (3)
-
Nikhil M Jain
-
Raghavendra, Vignesh
-
Tom Rini