[PATCH 0/5] Cleanup MAIN R5F boot from R5 SPL

Hi Lokesh,
The following series cleans up the code related to booting of Main R5FSS0 Core0 from R5 SPL, and moves it to A72 U-Boot on J721E SoCs. This is no longer supported after the R5 SPL re-architecture that splits the System Firmware functionality onto two separate processors. This functionality has been merged post v2021.07 tag towards v2021.10-rc1. The Main R5FSS0 Core0 is already being booted on A72 U-Boot on J7200 SoCs, the other SoC family that follows this split system firmware architecture.
Following is the patch summary: - Patch 1 skips the booting of Main R5FSS in R5 SPL and moves it to be supported on A72 U-Boot. - Patches 2 and 3 cleanup the start_non_linux_remote_cores() code - Patch 4 removes the Main R5F nodes from R5 SPL dtb - Patch 5 disables the K3 R5F remoteproc driver to be built in R5 SPL (tiboot3.bin size reduces by about 5K).
regards Suman
Suman Anna (5): arm: mach-k3: j721e: Move booting of Main R5FSS Core0 to A72 U-Boot arm: mach-k3: j721e: Cleanup MAIN R5 boot code from R5 SPL arm: mach-k3: Cleanup common start_non_linux_remote_cores() arm: dts: k3-j721e-r5: Remove MAIN R5FSS0 cluster from SPL configs: j721e_evm_r5: Disable K3 R5F remoteproc
.../k3-j721e-r5-common-proc-board-u-boot.dtsi | 14 -------- .../arm/dts/k3-j721e-r5-common-proc-board.dts | 2 -- arch/arm/mach-k3/common.c | 5 --- arch/arm/mach-k3/common.h | 1 - arch/arm/mach-k3/j721e_init.c | 36 ------------------- configs/j721e_evm_r5_defconfig | 1 - include/configs/j721e_evm.h | 3 +- 7 files changed, 1 insertion(+), 61 deletions(-)

The Main R5FSS Core0 on J721E SoCs is originally booted from R5 SPL itself to achieve certain product-level early-boot metrics. This is no longer supported after the R5 SPL re-architecture (support merged for v2021.10-rc1). Move the booting of this core altogether from R5 SPL to A72 U-Boot.
The env variables are left as is for now, and will be cleaned up in a subsequent patch.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/mach-k3/j721e_init.c | 6 +++++- include/configs/j721e_evm.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index e9e076c9e72a..55d738396bd4 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -377,7 +377,11 @@ void start_non_linux_remote_cores(void) int size = 0, ret; u32 loadaddr = 0;
- if (!soc_is_j721e()) + /* + * Skip booting of Main R5FSS Core0 in R5 SPL. This is no longer + * supported after the R5 SPL re-architecture. + */ + if (soc_is_j721e() || soc_is_j7200()) return;
size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load", diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 62da8ff956f7..cc9faae4be83 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -129,6 +129,7 @@
#ifdef CONFIG_TARGET_J721E_A72_EVM #define DEFAULT_RPROCS "" \ + "2 /lib/firmware/j7-main-r5f0_0-fw " \ "3 /lib/firmware/j7-main-r5f0_1-fw " \ "4 /lib/firmware/j7-main-r5f1_0-fw " \ "5 /lib/firmware/j7-main-r5f1_1-fw " \

The common J7 specific start_non_linux_remote_cores() override function implements the logic to load and boot the Main R5FSS Core0 from R5 SPL. This won't be supported any more for either J721E or J7200 after the R5 SPL rearchitecture for the System Firmware split into TI Foundation Security (TIFS) and Device Management (DM) firmwares. So, cleanup the corresponding code and the related SPL env variables.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/mach-k3/j721e_init.c | 40 ----------------------------------- include/configs/j721e_evm.h | 2 -- 2 files changed, 42 deletions(-)
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index 55d738396bd4..78d80be1758e 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -370,43 +370,3 @@ void release_resources_for_core_shutdown(void) } } #endif - -#ifdef CONFIG_SYS_K3_SPL_ATF -void start_non_linux_remote_cores(void) -{ - int size = 0, ret; - u32 loadaddr = 0; - - /* - * Skip booting of Main R5FSS Core0 in R5 SPL. This is no longer - * supported after the R5 SPL re-architecture. - */ - if (soc_is_j721e() || soc_is_j7200()) - return; - - size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load", - &loadaddr); - if (size <= 0) - goto err_load; - - /* assuming remoteproc 2 is aliased for the needed remotecore */ - ret = rproc_load(2, loadaddr, size); - if (ret) { - printf("Firmware failed to start on rproc (%d)\n", ret); - goto err_load; - } - - ret = rproc_start(2); - if (ret) { - printf("Firmware init failed on rproc (%d)\n", ret); - goto err_load; - } - - printf("Remoteproc 2 started successfully\n"); - - return; - -err_load: - rproc_reset(2); -} -#endif diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index cc9faae4be83..4bca62ea91ca 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -82,8 +82,6 @@ #ifdef CONFIG_SYS_K3_SPL_ATF #if defined(CONFIG_TARGET_J721E_R5_EVM) #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ - "addr_mainr5f0_0load=0x88000000\0" \ - "name_mainr5f0_0fw=/lib/firmware/j7-main-r5f0_0-fw\0" \ "addr_mcur5f0_0load=0x89000000\0" \ "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0" #elif defined(CONFIG_TARGET_J7200_R5_EVM)

The mach-k3 common code defined a weak start_non_linux_remote_cores() function so that the proper implementation can be plugged in the SoC-specific source files. This won't be needed anymore, so remove the the common code.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/mach-k3/common.c | 5 ----- arch/arm/mach-k3/common.h | 1 - 2 files changed, 6 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index ab6d9bd3d0ee..bb0f64194f4e 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -193,10 +193,6 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr) } #endif
-__weak void start_non_linux_remote_cores(void) -{ -} - void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) { typedef void __noreturn (*image_entry_noargs_t)(void); @@ -214,7 +210,6 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) init_env();
if (!fit_image_info[IMAGE_ID_DM_FW].image_start) { - start_non_linux_remote_cores(); size = load_firmware("name_mcur5f0_0fw", "addr_mcur5f0_0load", &loadaddr); } diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h index f421ed1bb18c..e81b70d7c368 100644 --- a/arch/arm/mach-k3/common.h +++ b/arch/arm/mach-k3/common.h @@ -22,7 +22,6 @@ void setup_k3_mpu_regions(void); int early_console_init(void); void disable_linefill_optimization(void); void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size); -void start_non_linux_remote_cores(void); int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr); void k3_sysfw_print_ver(void); void spl_enable_dcache(void);

The MAIN R5FSS0 cluster and corresponding nodes are no longer required to be enabled in R5 SPL after removing the support for booting any core from this cluster on R5 SPL. So, remove these from the relevant dts files.
This is essentially a revert of the additions done in commit 2984b82b3b76 ("arm: dts: k3-j721e-r5: Enable r5fss0 cluster in SPL").
Signed-off-by: Suman Anna s-anna@ti.com --- .../dts/k3-j721e-r5-common-proc-board-u-boot.dtsi | 14 -------------- arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 2 -- 2 files changed, 16 deletions(-)
diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi index f346bb31634e..48c6ddf67280 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi @@ -13,8 +13,6 @@ aliases { remoteproc0 = &sysctrler; remoteproc1 = &a72_0; - remoteproc2 = &main_r5fss0_core0; - remoteproc3 = &main_r5fss0_core1; };
fs_loader0: fs_loader@0 { @@ -23,18 +21,6 @@ }; };
-&main_r5fss0 { - u-boot,dm-spl; -}; - -&main_r5fss0_core0 { - u-boot,dm-spl; -}; - -&main_r5fss0_core1 { - u-boot,dm-spl; -}; - &tps659413a { esm: esm { compatible = "ti,tps659413-esm"; diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts index 0542b2f8b883..a12607dc2f75 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts @@ -13,8 +13,6 @@ aliases { remoteproc0 = &sysctrler; remoteproc1 = &a72_0; - remoteproc2 = &main_r5fss0_core0; - remoteproc3 = &main_r5fss0_core1; };
chosen {

The J721E R5 SPL will no longer support booting of the Main R5FSS Core0 after the R5 SPL re-architecture for System Firmware split. The MCU R5F branch-only boot does not use the K3 R5F remoteproc driver, and relies only on the filesystem (FS) support for now. The K3 R5F remoteproc driver is therefore no longer needed in R5 SPL, so drop it from the J721E R5 defconfig.
Signed-off-by: Suman Anna s-anna@ti.com --- configs/j721e_evm_r5_defconfig | 1 - 1 file changed, 1 deletion(-)
diff --git a/configs/j721e_evm_r5_defconfig b/configs/j721e_evm_r5_defconfig index 72140852f3be..33ec0c06d155 100644 --- a/configs/j721e_evm_r5_defconfig +++ b/configs/j721e_evm_r5_defconfig @@ -112,7 +112,6 @@ CONFIG_SPL_DM_REGULATOR=y CONFIG_DM_REGULATOR_TPS65941=y CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_REMOTEPROC_TI_K3_ARM64=y -CONFIG_REMOTEPROC_TI_K3_R5F=y CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_DM_SERIAL=y

On 7/26/21 4:13 PM, Suman Anna wrote:
Hi Lokesh,
The following series cleans up the code related to booting of Main R5FSS0 Core0 from R5 SPL, and moves it to A72 U-Boot on J721E SoCs. This is no longer supported after the R5 SPL re-architecture that splits the System Firmware functionality onto two separate processors. This functionality has been merged post v2021.07 tag towards v2021.10-rc1. The Main R5FSS0 Core0 is already being booted on A72 U-Boot on J7200 SoCs, the other SoC family that follows this split system firmware architecture.
Following is the patch summary:
- Patch 1 skips the booting of Main R5FSS in R5 SPL and moves it to be supported on A72 U-Boot.
- Patches 2 and 3 cleanup the start_non_linux_remote_cores() code
- Patch 4 removes the Main R5F nodes from R5 SPL dtb
- Patch 5 disables the K3 R5F remoteproc driver to be built in R5 SPL (tiboot3.bin size reduces by about 5K).
Forgot to mention that patches are on top of your for-rc HEAD, commit cd096aa47423 ("configs: am335x_evm: Support GbE PHYs")
regards Suman
regards Suman
Suman Anna (5): arm: mach-k3: j721e: Move booting of Main R5FSS Core0 to A72 U-Boot arm: mach-k3: j721e: Cleanup MAIN R5 boot code from R5 SPL arm: mach-k3: Cleanup common start_non_linux_remote_cores() arm: dts: k3-j721e-r5: Remove MAIN R5FSS0 cluster from SPL configs: j721e_evm_r5: Disable K3 R5F remoteproc
.../k3-j721e-r5-common-proc-board-u-boot.dtsi | 14 -------- .../arm/dts/k3-j721e-r5-common-proc-board.dts | 2 -- arch/arm/mach-k3/common.c | 5 --- arch/arm/mach-k3/common.h | 1 - arch/arm/mach-k3/j721e_init.c | 36 ------------------- configs/j721e_evm_r5_defconfig | 1 - include/configs/j721e_evm.h | 3 +- 7 files changed, 1 insertion(+), 61 deletions(-)

On Mon, 26 Jul 2021 16:13:06 -0500, Suman Anna wrote:
The following series cleans up the code related to booting of Main R5FSS0 Core0 from R5 SPL, and moves it to A72 U-Boot on J721E SoCs. This is no longer supported after the R5 SPL re-architecture that splits the System Firmware functionality onto two separate processors. This functionality has been merged post v2021.07 tag towards v2021.10-rc1. The Main R5FSS0 Core0 is already being booted on A72 U-Boot on J7200 SoCs, the other SoC family that follows this split system firmware architecture.
[...]
Applied to https://source.denx.de/u-boot/custodians/u-boot-ti.git for-rc, thanks! [1/5] arm: mach-k3: j721e: Move booting of Main R5FSS Core0 to A72 U-Boot https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/05e858aefe [2/5] arm: mach-k3: j721e: Cleanup MAIN R5 boot code from R5 SPL https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/536f633d8a [3/5] arm: mach-k3: Cleanup common start_non_linux_remote_cores() https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/ea985f6d92 [4/5] arm: dts: k3-j721e-r5: Remove MAIN R5FSS0 cluster from SPL https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/24f3fb6547 [5/5] configs: j721e_evm_r5: Disable K3 R5F remoteproc https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/bcad620f68
-- Thanks and Regards, Lokesh
participants (2)
-
Lokesh Vutla
-
Suman Anna