From 9557d46107926b8346e4dcb3a0842c87e0fcbf7a Mon Sep 17 00:00:00 2001 From: Emanuele Ghidoli Date: Thu, 24 Aug 2023 10:08:49 +0200 Subject: verdin-am62: add u-boot update wrappers Add update_tiboot3, update_tispl and update_uboot wrappers to update R5 SPL, A53 SPL and A53 U-boot respectively. Usage example: > tftpboot ${loadaddr} tiboot3-am62x-gp-verdin.bin > run update_tiboot3 > tftpboot ${loadaddr} tispl.bin > run update_tispl > tftpboot ${loadaddr} u-boot.img > run update_uboot Signed-off-by: Emanuele Ghidoli Acked-by: Francesco Dolcini --- include/configs/verdin-am62.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/verdin-am62.h b/include/configs/verdin-am62.h index 7990ea83102..91fc0f03a81 100644 --- a/include/configs/verdin-am62.h +++ b/include/configs/verdin-am62.h @@ -46,10 +46,20 @@ "fdt_board=dev\0" \ "setup=setenv setupargs console=tty1 console=${console},${baudrate} " \ "consoleblank=0 earlycon=ns16550a,mmio32,0x02800000\0" \ - "update_uboot=askenv confirm Did you load flash.bin (y/N)?; " \ + "update_tiboot3=askenv confirm Did you load tiboot3.bin (y/N)?; " \ "if test \"$confirm\" = \"y\"; then " \ "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \ "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \ + "${blkcnt}; fi\0" \ + "update_tispl=askenv confirm Did you load tispl.bin (y/N)?; " \ + "if test \"$confirm\" = \"y\"; then " \ + "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \ + "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x400 " \ + "${blkcnt}; fi\0" \ + "update_uboot=askenv confirm Did you load u-boot.img (y/N)?; " \ + "if test \"$confirm\" = \"y\"; then " \ + "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \ + "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x1400 " \ "${blkcnt}; fi\0" #endif /* __VERDIN_AM62_H */ -- cgit v1.2.3 From 6e869e104a489cb399042233cdce325d9773eacc Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:46 -0500 Subject: include: env: ti: mmc: envboot/mmcboot: Check result of mmc dev before proceeding If mmc dev reports that the device is not present, there is no point in proceeding further to attempt to load the files. Signed-off-by: Nishanth Menon Reviewed-by: Tom Rini Reviewed-by: Mattijs Korpershoek --- include/env/ti/mmc.env | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/env/ti/mmc.env b/include/env/ti/mmc.env index 6fb47fb2667..b8eb51ca174 100644 --- a/include/env/ti/mmc.env +++ b/include/env/ti/mmc.env @@ -15,7 +15,7 @@ loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile} loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile} loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile} get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt} -envboot=mmc dev ${mmcdev}; +envboot=if mmc dev ${mmcdev}; then if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadbootscript; then @@ -31,6 +31,7 @@ envboot=mmc dev ${mmcdev}; fi; fi; fi; + fi; mmcloados= if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then @@ -45,7 +46,7 @@ mmcloados= else bootz; fi; -mmcboot=mmc dev ${mmcdev}; +mmcboot=if mmc dev ${mmcdev}; then devnum=${mmcdev}; devtype=mmc; if mmc rescan; then @@ -58,7 +59,8 @@ mmcboot=mmc dev ${mmcdev}; run mmcloados; fi; fi; -fi; + fi; + fi; init_mmc=run args_all args_mmc get_overlay_mmc= -- cgit v1.2.3 From 88419bb2d6c232020cfdd01091531c4602d1d412 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:47 -0500 Subject: include: env: ti: mmc: envboot: Only attempt boot.scr if BOOTSTD is not enabled 'script' bootmethod that should be used with CONFIG_BOOTSTD. Signed-off-by: Nishanth Menon Reviewed-by: Tom Rini Reviewed-by: Mattijs Korpershoek --- include/env/ti/mmc.env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/env/ti/mmc.env b/include/env/ti/mmc.env index b8eb51ca174..0256a2d2aac 100644 --- a/include/env/ti/mmc.env +++ b/include/env/ti/mmc.env @@ -5,7 +5,9 @@ args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype} +#ifndef CONFIG_BOOTSTD loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr +#endif bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr} bootenvfile=uEnv.txt @@ -18,7 +20,7 @@ get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt} envboot=if mmc dev ${mmcdev}; then if mmc rescan; then echo SD/MMC found on device ${mmcdev}; - if run loadbootscript; then + if test -n "${loadbootscript}" && run loadbootscript; then run bootscript; else if run loadbootenv; then -- cgit v1.2.3 From fb2b32059328d284660c0db3e08acd4218c54c9f Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:48 -0500 Subject: include: configs: ti_armv7_common: Add documentation for protected section Make the section protected by CONFIG_DISTRO_DEFAULTS macro clear. Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon --- include/configs/ti_armv7_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index dbbeff34ba8..4e30d0d2ddf 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -200,7 +200,7 @@ #define CFG_EXTRA_ENV_SETTINGS \ BOOTENV -#endif +#endif /* CONFIG_DISTRO_DEFAULTS */ #endif /* CONFIG_ARM64 */ -- cgit v1.2.3 From 8b7b16f0e2b8f319b27e5bd90e236a540e5564ba Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:49 -0500 Subject: include: configs: am62x_evm: Drop unused SDRAM address Drop unused macro. This was meant for a second region of DDR which we do not need for AM62x evm configurations. Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Mattijs Korpershoek --- include/configs/am62x_evm.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 44180dc7687..379e0c13a39 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -12,9 +12,6 @@ #include #include -/* DDR Configuration */ -#define CFG_SYS_SDRAM_BASE1 0x880000000 - /* Now for the remaining common defines */ #include -- cgit v1.2.3 From 610cd4106e9b6cda619d6c6a86fb01690ba087e1 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:50 -0500 Subject: include: configs: am62x_evm: Wrap distroboot with CONFIG_DISTRO_DEFAULTS Wrap the distro_boot options with CONFIG_DISTRO_DEFAULTS. This is an intermediate step for us to switch over to CONFIG_BOOTSTD_DEFAULTS and drop this section in follow on patches. Reviewed-by: Tom Rini Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Mattijs Korpershoek --- include/configs/am62x_evm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 379e0c13a39..81d7658cdb0 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -9,8 +9,10 @@ #ifndef __CONFIG_AM625_EVM_H #define __CONFIG_AM625_EVM_H +#ifdef CONFIG_DISTRO_DEFAULTS #include #include +#endif /* Now for the remaining common defines */ #include -- cgit v1.2.3 From 99ab84b57ffe4fbbc7f90803679516e6d733a785 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:53 -0500 Subject: include: configs: am62x_evm: Drop distro_bootcmd usage Now that BOOTSTD is used by default, drop un-used header file inclusion. Reviewed-by: Tom Rini Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Mattijs Korpershoek --- include/configs/am62x_evm.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 81d7658cdb0..c8fe59b7531 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -9,11 +9,6 @@ #ifndef __CONFIG_AM625_EVM_H #define __CONFIG_AM625_EVM_H -#ifdef CONFIG_DISTRO_DEFAULTS -#include -#include -#endif - /* Now for the remaining common defines */ #include -- cgit v1.2.3 From bf9c61acb6caed97114029d2dc1e91b148cd9b8a Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:54 -0500 Subject: include: env: ti: ti_armv7_common.env: Rename to ti_common.env ti_armv7_common does not make any more sense as it is used by armv7 and armv8 TI based platforms. Reported-by: Tom Rini Reviewed-by: Mattijs Korpershoek Reviewed-by: Tom Rini Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon --- include/env/ti/ti_armv7_common.env | 34 ---------------------------------- include/env/ti/ti_common.env | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 include/env/ti/ti_armv7_common.env create mode 100644 include/env/ti/ti_common.env (limited to 'include') diff --git a/include/env/ti/ti_armv7_common.env b/include/env/ti/ti_armv7_common.env deleted file mode 100644 index e87a41a6590..00000000000 --- a/include/env/ti/ti_armv7_common.env +++ /dev/null @@ -1,34 +0,0 @@ -loadaddr=0x82000000 -kernel_addr_r=0x82000000 -fdtaddr=0x88000000 -dtboaddr=0x89000000 -fdt_addr_r=0x88000000 -fdtoverlay_addr_r=0x89000000 -rdaddr=0x88080000 -ramdisk_addr_r=0x88080000 -scriptaddr=0x80000000 -pxefile_addr_r=0x80100000 -bootm_size=0x10000000 -boot_fdt=try - -boot_fit=0 -addr_fit=0x90000000 -name_fit=fitImage -update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit} -get_overlaystring= - for overlay in $name_overlays; - do; - setenv overlaystring ${overlaystring}'#'${overlay}; - done; -get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile} -run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring} -bootcmd_ti_mmc= - run findfdt; run init_${boot}; -#if CONFIG_CMD_REMOTEPROC - run main_cpsw0_qsgmii_phyinit; run boot_rprocs; -#endif - if test ${boot_fit} -eq 1; - then run get_fit_${boot}; run get_overlaystring; run run_fit; - else; - run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; - fi; diff --git a/include/env/ti/ti_common.env b/include/env/ti/ti_common.env new file mode 100644 index 00000000000..e87a41a6590 --- /dev/null +++ b/include/env/ti/ti_common.env @@ -0,0 +1,34 @@ +loadaddr=0x82000000 +kernel_addr_r=0x82000000 +fdtaddr=0x88000000 +dtboaddr=0x89000000 +fdt_addr_r=0x88000000 +fdtoverlay_addr_r=0x89000000 +rdaddr=0x88080000 +ramdisk_addr_r=0x88080000 +scriptaddr=0x80000000 +pxefile_addr_r=0x80100000 +bootm_size=0x10000000 +boot_fdt=try + +boot_fit=0 +addr_fit=0x90000000 +name_fit=fitImage +update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit} +get_overlaystring= + for overlay in $name_overlays; + do; + setenv overlaystring ${overlaystring}'#'${overlay}; + done; +get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile} +run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring} +bootcmd_ti_mmc= + run findfdt; run init_${boot}; +#if CONFIG_CMD_REMOTEPROC + run main_cpsw0_qsgmii_phyinit; run boot_rprocs; +#endif + if test ${boot_fit} -eq 1; + then run get_fit_${boot}; run get_overlaystring; run run_fit; + else; + run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; + fi; -- cgit v1.2.3 From 03eb84c632fcfe68ffb6121870e32a92100203c7 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:55 -0500 Subject: include: env: ti: Add a generic default_findfdt.env ti_mmc bootmethod uses a findfdt routine that is expected to be implemented by all platforms. Define a default findfdt based on configured DEFAULT_DEVICE_TREE option for u-boot. This saves duplication across multiple boards and handles architecture folder location changes centrally. TI ARMV7 platforms will need to override default_device_tree_subarch in the env file to point to the appropriate platform. Note: default "omap" is used to cater to "most common" default. Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Tom Rini Reviewed-by: Mattijs Korpershoek --- include/env/ti/default_findfdt.env | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 include/env/ti/default_findfdt.env (limited to 'include') diff --git a/include/env/ti/default_findfdt.env b/include/env/ti/default_findfdt.env new file mode 100644 index 00000000000..a2b51dd923b --- /dev/null +++ b/include/env/ti/default_findfdt.env @@ -0,0 +1,12 @@ +default_device_tree=CONFIG_DEFAULT_DEVICE_TREE +default_device_tree_arch=ti +#ifdef CONFIG_ARM64 +findfdt= + setenv name_fdt ${default_device_tree_arch}/${default_device_tree}.dtb; + setenv fdtfile ${name_fdt} +#else +default_device_tree_subarch=omap +findfdt= + setenv name_fdt ${default_device_tree_arch}/${default_device_tree_subarch}/${default_device_tree}.dtb; + setenv fdtfile ${name_fdt} +#endif -- cgit v1.2.3 From 7dee63faccbcea41c9c0c2d177391438d5725da2 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Mon, 28 Aug 2023 23:50:37 +0200 Subject: include: configs: verdin-am62: drop unused sdram address Drop unused macro. This was copied straight from the AM62x EVM but while meant for a second region of DDR this is not even needed for the AM62x EVM configurations and has meanwhile also been dropped there. Note that on the Verdin AM62, we do auto-detect the amount of SDRAM. While at it also update the comment noting that CFG_SYS_SDRAM_SIZE is the maximum which is only used for such auto-detection. Signed-off-by: Marcel Ziswiler Reviewed-by: Mattijs Korpershoek --- include/configs/verdin-am62.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/verdin-am62.h b/include/configs/verdin-am62.h index 91fc0f03a81..9d2e37f2d96 100644 --- a/include/configs/verdin-am62.h +++ b/include/configs/verdin-am62.h @@ -13,8 +13,7 @@ /* DDR Configuration */ #define CFG_SYS_SDRAM_BASE 0x80000000 -#define CFG_SYS_SDRAM_BASE1 0x880000000 -#define CFG_SYS_SDRAM_SIZE SZ_2G /* Maximum supported size */ +#define CFG_SYS_SDRAM_SIZE SZ_2G /* Maximum supported size, auto-detection is used */ #define MEM_LAYOUT_ENV_SETTINGS \ "fdt_addr_r=0x90200000\0" \ -- cgit v1.2.3