Skip to contentSkip to conversation

arm: k3: Add support for loading main_r5fss0_core0

PATCH Superseded Keerthy 3 participants 15 messages Jan 10, 2020

Subsystems (2)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Keerthy

author
#0 lore raw

cover arm: k3: Add support for loading main_r5fss0_core0

This patch series enables mcu_r5fss0_core0 & main_r5fss0_core0. Tested for firmware loading and execution on J721e.

Faiz Abbas (1):
configs: j721e_evm_r5: Add configs for environment in eMMC

Keerthy (9):
cmd: elf: Export out load_elf_image_phdr
Makefile: Enable CMD_ELF for SPL as well
arm: k3: Add support for loading non linux remote cores
armv7R: K3: r5_mpu: Enable execute permission for MCU0 BTCM
armv7R: K3: Add support for jumping to firmware
arm: dts: k3-j721e-r5: Add fs_loader node
arm: dts: k3-j721e-r5: Enable r5fss0 cluster in SPL
include: configs: j721e_evm: Add env variables for mcu_r5fss0_core0 &

    main_r5fss0_core0

configs: j721e_evm_r5: Enable R5F remoteproc support

 .../arm/dts/k3-j721e-r5-common-proc-board.dts |  20 ++++
 arch/arm/mach-k3/common.c                     | 106 ++++++++++++++++--
 arch/arm/mach-k3/common.h                     |   2 +
 arch/arm/mach-k3/j721e_init.c                 |  34 ++++++
 arch/arm/mach-k3/r5_mpu.c                     |   4 +-
 cmd/Makefile                                  |   2 +-
 cmd/elf.c                                     |   6 +-
 configs/j721e_evm_a72_defconfig               |   3 +
 configs/j721e_evm_r5_defconfig                |   4 +
 include/configs/j721e_evm.h                   |  10 ++
 include/elf.h                                 |   2 +
 11 files changed, 178 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/10 cmd: elf: Export out load_elf_image_phdr

Export out load_elf_image_phdr so that it can be reused to load elf segments outside cmd/elf

---
 cmd/elf.c     | 4 ++--
 include/elf.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
cmd/elf.c +2 -2
index 32f12a72b9..ea76fb42aa 100644
@@ -33,7 +33,7 @@
  * Note if U-Boot is 32-bit, the loader assumes the to segment's
  * physical address and size is within the lower 32-bit address space.
  */
-static unsigned long load_elf64_image_phdr(unsigned long addr)
+unsigned long load_elf64_image_phdr(unsigned long addr)
 {
 	Elf64_Ehdr *ehdr; /* Elf header structure pointer */
 	Elf64_Phdr *phdr; /* Program header structure pointer */
@@ -145,7 +145,7 @@ static unsigned long load_elf64_image_shdr(unsigned long addr)
  * The loader firstly reads the EFI class to see if it's a 64-bit image.
  * If yes, call the ELF64 loader. Otherwise continue with the ELF32 loader.
  */
-static unsigned long load_elf_image_phdr(unsigned long addr)
+unsigned long load_elf_image_phdr(unsigned long addr)
 {
 	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
 	Elf32_Phdr *phdr; /* Program header structure pointer */
include/elf.h +2 -0
index 81f40191d7..a951570686 100644
@@ -692,6 +692,8 @@ unsigned long elf_hash(const unsigned char *name);
 
 #ifndef __ASSEMBLER__
 int valid_elf_image(unsigned long addr);
+unsigned long load_elf_image_phdr(unsigned long addr);
+unsigned long load_elf64_image_phdr(unsigned long addr);
 #endif
 
 #endif /* _ELF_H */
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/10 Makefile: Enable CMD_ELF for SPL as well

In reply to Keerthy

Enable CMD_ELF for SPL as well. While at it stub out code not relevant for SPL.

---
 cmd/Makefile | 2 +-
 cmd/elf.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
cmd/Makefile +1 -1
index 8df39f3a19..95bb87c6db 100644
@@ -53,7 +53,6 @@ obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
 obj-$(CONFIG_CMD_EEPROM) += eeprom.o
 obj-$(CONFIG_EFI_STUB) += efi.o
 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
-obj-$(CONFIG_CMD_ELF) += elf.o
 obj-$(CONFIG_HUSH_PARSER) += exit.o
 obj-$(CONFIG_CMD_EXT4) += ext4.o
 obj-$(CONFIG_CMD_EXT2) += ext2.o
@@ -187,6 +186,7 @@ endif # !CONFIG_SPL_BUILD
 # core command
 obj-y += nvedit.o
 
+obj-$(CONFIG_CMD_ELF) += elf.o
 obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/
 
 filechk_data_gz = (echo "static const char data_gz[] ="; cat $< | scripts/bin2c; echo ";")
cmd/elf.c +2 -0
index ea76fb42aa..8b3889f134 100644
@@ -322,6 +322,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return rcode;
 }
 
+#ifndef CONFIG_SPL_BUILD
 /*
  * Interpreter command to boot VxWorks from a memory image.  The image can
  * be either an ELF image or a raw binary.  Will attempt to setup the
@@ -542,3 +543,4 @@ U_BOOT_CMD(
 	"Boot vxWorks from an ELF image",
 	" [address] - load address of vxWorks ELF image."
 );
+#endif
Signature · 1 line
2.17.1
#3 lore raw

PATCH 2/10 Makefile: Enable CMD_ELF for SPL as well

Quoted 35 lines · Keerthy

Enable CMD_ELF for SPL as well. While at it stub out code not relevant for SPL.

---
 cmd/Makefile | 2 +-
 cmd/elf.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
cmd/Makefile +1 -1
index 8df39f3a19..95bb87c6db 100644
@@ -53,7 +53,6 @@ obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
 obj-$(CONFIG_CMD_EEPROM) += eeprom.o
 obj-$(CONFIG_EFI_STUB) += efi.o
 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
-obj-$(CONFIG_CMD_ELF) += elf.o
 obj-$(CONFIG_HUSH_PARSER) += exit.o
 obj-$(CONFIG_CMD_EXT4) += ext4.o
 obj-$(CONFIG_CMD_EXT2) += ext2.o
@@ -187,6 +186,7 @@ endif # !CONFIG_SPL_BUILD
 # core command
 obj-y += nvedit.o
 
+obj-$(CONFIG_CMD_ELF) += elf.o
 obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/
 
 filechk_data_gz = (echo "static const char data_gz[] ="; cat $< | scripts/bin2c; echo ";")
cmd/elf.c +0 -0
index ea76fb42aa..8b3889f134 100644

cmd/elf.c int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 325

Quoted 4 lines
cmd/elf.c +1 -0
@@ -322,6 +322,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return rcode;
 }
 
+#ifndef CONFIG_SPL_BUILD

Unless I read it wrong, what you want is the elf parsing code, but not the commands?

This patch and 2/10 look to me as it would be much cleaner to separate the upper half of this file into a different file that does not live in cmd/.

Regards,
Simon

Quoted 11 lines
cmd/elf.c +1 -1
 /*
  * Interpreter command to boot VxWorks from a memory image.  The image can
  * be either an ELF image or a raw binary.  Will attempt to setup the
@@ -542,3 +543,4 @@ U_BOOT_CMD(
        "Boot vxWorks from an ELF image",
        " [address] - load address of vxWorks ELF image."
 );
+#endif
--

2.17.1

author
#4 lore raw

PATCH 2/10 Makefile: Enable CMD_ELF for SPL as well

Quoted 39 lines · Simon Goldschmidt
Quoted 38 lines · Keerthy

Enable CMD_ELF for SPL as well. While at it stub out code not relevant for SPL.

---
  cmd/Makefile | 2 +-
  cmd/elf.c    | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
cmd/Makefile +1 -1
index 8df39f3a19..95bb87c6db 100644
@@ -53,7 +53,6 @@ obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
  obj-$(CONFIG_CMD_EEPROM) += eeprom.o
  obj-$(CONFIG_EFI_STUB) += efi.o
  obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
-obj-$(CONFIG_CMD_ELF) += elf.o
  obj-$(CONFIG_HUSH_PARSER) += exit.o
  obj-$(CONFIG_CMD_EXT4) += ext4.o
  obj-$(CONFIG_CMD_EXT2) += ext2.o
@@ -187,6 +186,7 @@ endif # !CONFIG_SPL_BUILD
  # core command
  obj-y += nvedit.o
 
+obj-$(CONFIG_CMD_ELF) += elf.o
  obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/
 
  filechk_data_gz = (echo "static const char data_gz[] ="; cat $< | scripts/bin2c; echo ";")
cmd/elf.c +0 -0
index ea76fb42aa..8b3889f134 100644
@@ -322,6 +322,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         return rcode;
  }
 
Quoted 4 lines

cmd/elf.c int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 325

Quoted 1 line
cmd/elf.c +1 -0
+#ifndef CONFIG_SPL_BUILD

Unless I read it wrong, what you want is the elf parsing code, but not the commands?

Yes. We will not need commands in SPL.

Quoted 3 lines

This patch and 2/10 look to me as it would be much cleaner to separate the upper half of this file into a different file that does not live in cmd/.

Any specific place you recommend? Something under lib?

Quoted 15 lines

Regards,
Simon

Quoted 11 lines
cmd/elf.c +1 -1
  /*
   * Interpreter command to boot VxWorks from a memory image.  The image can
   * be either an ELF image or a raw binary.  Will attempt to setup the
@@ -542,3 +543,4 @@ U_BOOT_CMD(
         "Boot vxWorks from an ELF image",
         " [address] - load address of vxWorks ELF image."
  );
+#endif
--

2.17.1

#5 lore raw

PATCH 2/10 Makefile: Enable CMD_ELF for SPL as well

Quoted 43 lines · keerthy
Quoted 39 lines · Simon Goldschmidt
Quoted 38 lines · Keerthy

Enable CMD_ELF for SPL as well. While at it stub out code not relevant for SPL.

---
  cmd/Makefile | 2 +-
  cmd/elf.c    | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
cmd/Makefile +1 -1
index 8df39f3a19..95bb87c6db 100644
@@ -53,7 +53,6 @@ obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
  obj-$(CONFIG_CMD_EEPROM) += eeprom.o
  obj-$(CONFIG_EFI_STUB) += efi.o
  obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
-obj-$(CONFIG_CMD_ELF) += elf.o
  obj-$(CONFIG_HUSH_PARSER) += exit.o
  obj-$(CONFIG_CMD_EXT4) += ext4.o
  obj-$(CONFIG_CMD_EXT2) += ext2.o
@@ -187,6 +186,7 @@ endif # !CONFIG_SPL_BUILD
  # core command
  obj-y += nvedit.o
 
+obj-$(CONFIG_CMD_ELF) += elf.o
  obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/
 
  filechk_data_gz = (echo "static const char data_gz[] ="; cat $< | scripts/bin2c; echo ";")
cmd/elf.c +0 -0
index ea76fb42aa..8b3889f134 100644
@@ -322,6 +322,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         return rcode;
  }
 
Quoted 6 lines
Quoted 4 lines

cmd/elf.c int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 325

Quoted 1 line
cmd/elf.c +1 -0
+#ifndef CONFIG_SPL_BUILD

Unless I read it wrong, what you want is the elf parsing code, but not the commands?

Yes. We will not need commands in SPL.

Still you need to enable CMD_ELF in the config. That looks indeed wrong.

There were (and still are) bogus dependencies like this in the code, but please don't add a new one.

Quoted 6 lines
Quoted 4 lines

This patch and 2/10 look to me as it would be much cleaner to separate the upper half of this file into a different file that does not live in cmd/.

Any specific place you recommend? Something under lib?

Yes, lib should be good.

Regards,
Simon

Quoted 16 lines
Quoted 16 lines

Regards,
Simon

Quoted 11 lines
cmd/elf.c +1 -1
  /*
   * Interpreter command to boot VxWorks from a memory image.  The image can
   * be either an ELF image or a raw binary.  Will attempt to setup the
@@ -542,3 +543,4 @@ U_BOOT_CMD(
         "Boot vxWorks from an ELF image",
         " [address] - load address of vxWorks ELF image."
  );
+#endif
--

2.17.1

author
#6 lore raw

PATCH 3/10 arm: k3: Add support for loading non linux remote cores

In reply to Keerthy

Add MAIN domain R5FSS0 remoteproc support from spl. This enables loading the elf firmware in SPL and starting the remotecore.

In order to start the core, there should be a file with path "/lib/firmware/j7-main-r5f0_0-fw" under filesystem of respective boot mode.

[Guard start_non_linux_remote_cores under CONFIG_FS_LOADER]
---
 arch/arm/mach-k3/common.c     | 84 ++++++++++++++++++++++++++++++++---
 arch/arm/mach-k3/common.h     |  2 +
 arch/arm/mach-k3/j721e_init.c | 34 ++++++++++++++
 3 files changed, 115 insertions(+), 5 deletions(-)
arch/arm/mach-k3/common.c +79 -5
index 50f5b81dfe..377fcbe80b 100644
@@ -16,6 +16,10 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
+#include <fs_loader.h>
+#include <fs.h>
+#include <env.h>
+#include <elf.h>
 
 struct ti_sci_handle *get_ti_sci_handle(void)
 {
@@ -57,6 +61,74 @@ int early_console_init(void)
 #endif
 
 #ifdef CONFIG_SYS_K3_SPL_ATF
+
+void init_env(void)
+{
+#ifdef CONFIG_SPL_ENV_SUPPORT
+	char *part;
+
+	env_init();
+	env_load();
+	switch (spl_boot_device()) {
+	case BOOT_DEVICE_MMC2:
+		part = env_get("bootpart");
+		env_set("storage_interface", "mmc");
+		env_set("fw_dev_part", part);
+		break;
+	case BOOT_DEVICE_SPI:
+		env_set("storage_interface", "ubi");
+		env_set("fw_ubi_mtdpart", "UBI");
+		env_set("fw_ubi_volume", "UBI0");
+		break;
+	default:
+		printf("%s from device %u not supported!\n",
+		       __func__, spl_boot_device());
+		return;
+	}
+#endif
+}
+
+#ifdef CONFIG_FS_LOADER
+int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr)
+{
+	struct udevice *fsdev;
+	char *name = NULL;
+	int size = 0;
+
+	*loadaddr = 0;
+#ifdef CONFIG_SPL_ENV_SUPPORT
+	switch (spl_boot_device()) {
+	case BOOT_DEVICE_MMC2:
+		name = env_get(name_fw);
+		*loadaddr = env_get_hex(name_loadaddr, *loadaddr);
+		break;
+	default:
+		printf("Loading rproc fw image from device %u not supported!\n",
+		       spl_boot_device());
+		return 0;
+	}
+#endif
+	if (!*loadaddr)
+		return 0;
+
+	if (!uclass_get_device(UCLASS_FS_FIRMWARE_LOADER, 0, &fsdev)) {
+		size = request_firmware_into_buf(fsdev, name, (void *)*loadaddr,
+						 0, 0);
+	}
+
+	return size;
+}
+#else
+int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr)
+{
+	return 0;
+}
+#endif
+
+__weak void start_non_linux_remote_cores(void)
+{
+}
+
 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 {
 	struct ti_sci_handle *ti_sci = get_ti_sci_handle();
@@ -65,15 +137,17 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 	/* Release all the exclusive devices held by SPL before starting ATF */
 	ti_sci->ops.dev_ops.release_exclusive_devices(ti_sci);
 
+	ret = rproc_init();
+	if (ret)
+		panic("rproc failed to be initialized (%d)\n", ret);
+
+	init_env();
+	start_non_linux_remote_cores();
+
 	/*
 	 * It is assumed that remoteproc device 1 is the corresponding
 	 * Cortex-A core which runs ATF. Make sure DT reflects the same.
 	 */
-	ret = rproc_dev_init(1);
-	if (ret)
-		panic("%s: ATF failed to initialize on rproc (%d)\n", __func__,
-		      ret);
-
 	ret = rproc_load(1, spl_image->entry_point, 0x200);
 	if (ret)
 		panic("%s: ATF failed to load on rproc (%d)\n", __func__, ret);
arch/arm/mach-k3/common.h +2 -0
index 35d1609cdc..f6a1e3aa01 100644
@@ -17,3 +17,5 @@
 void setup_k3_mpu_regions(void);
 int early_console_init(void);
 void disable_linefill_optimization(void);
+void start_non_linux_remote_cores(void);
+int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
arch/arm/mach-k3/j721e_init.c +34 -0
index 4758739266..e9ca5baf8f 100644
@@ -18,6 +18,7 @@
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <dm/pinctrl.h>
+#include <remoteproc.h>
 
 #ifdef CONFIG_SPL_BUILD
 static void mmr_unlock(u32 base, u32 partition)
@@ -240,3 +241,36 @@ 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;
+
+	size = load_firmware("mainr5f0_0fwname", "mainr5f0_0loadaddr",
+			     &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
Signature · 1 line
2.17.1
author
#7 lore raw

PATCH 4/10 armv7R: K3: r5_mpu: Enable execute permission for MCU0 BTCM

In reply to Keerthy

Enable execute permission for mcu_r5fss0_core0 BTCM so that we can jump to a firmware directly from SPL.

---
 arch/arm/mach-k3/r5_mpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-k3/r5_mpu.c +3 -1
index ee076ed877..3d2ff6775a 100644
@@ -26,7 +26,9 @@ struct mpu_region_config k3_mpu_regions[16] = {
 	/* U-Boot's code area marking it as WB and Write allocate */
 	{CONFIG_SYS_SDRAM_BASE, REGION_2, XN_DIS, PRIV_RW_USR_RW,
 	 O_I_WB_RD_WR_ALLOC, REGION_2GB},
-	{0x0, 3, 0x0, 0x0, 0x0, 0x0},
+	/* mcu_r5fss0_core0 BTCM area marking it as WB and Write allocate. */
+	{0x41010000, 3, XN_DIS, PRIV_RW_USR_RW, O_I_WB_RD_WR_ALLOC,
+	 REGION_8MB},
 	{0x0, 4, 0x0, 0x0, 0x0, 0x0},
 	{0x0, 5, 0x0, 0x0, 0x0, 0x0},
 	{0x0, 6, 0x0, 0x0, 0x0, 0x0},
Signature · 1 line
2.17.1
author
#8 lore raw

PATCH 5/10 armv7R: K3: Add support for jumping to firmware

In reply to Keerthy

MCU Domain rf50 is currently shutting down after loading the ATF. Load elf firmware and jump to firmware post loading ATF.

ROM doesn't enable ATCM memory, so make sure that firmware that is being loaded doesn't use ATCM memory or override SPL.

---
 arch/arm/mach-k3/common.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
arch/arm/mach-k3/common.c +16 -6
index 377fcbe80b..47a1f96ae1 100644
@@ -131,8 +131,10 @@ __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);
 	struct ti_sci_handle *ti_sci = get_ti_sci_handle();
-	int ret;
+	u32 loadaddr = 0;
+	int ret, size;
 
 	/* Release all the exclusive devices held by SPL before starting ATF */
 	ti_sci->ops.dev_ops.release_exclusive_devices(ti_sci);
@@ -143,6 +145,9 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 
 	init_env();
 	start_non_linux_remote_cores();
+	size = load_firmware("mcur5f0_0fwname", "mcur5f0_0loadaddr",
+			     &loadaddr);
+
 
 	/*
 	 * It is assumed that remoteproc device 1 is the corresponding
@@ -158,13 +163,18 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 	ret = rproc_start(1);
 	if (ret)
 		panic("%s: ATF failed to start on rproc (%d)\n", __func__, ret);
+	if (!(size > 0 && valid_elf_image(loadaddr))) {
+		debug("Shutting down...\n");
+		release_resources_for_core_shutdown();
+
+		while (1)
+			asm volatile("wfe");
+	}
 
-	debug("Releasing resources...\n");
-	release_resources_for_core_shutdown();
+	image_entry_noargs_t image_entry =
+		(image_entry_noargs_t)load_elf_image_phdr(loadaddr);
 
-	debug("Finalizing core shutdown...\n");
-	while (1)
-		asm volatile("wfe");
+	image_entry();
 }
 #endif
 
Signature · 1 line
2.17.1
author
#9 lore raw

PATCH 6/10 arm: dts: k3-j721e-r5: Add fs_loader node

In reply to Keerthy

Add fs_loader node which will be needed for loading firmwares from the boot media/filesystem.

---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +6 -0
index 41af48214f..27df704ce0 100644
@@ -18,6 +18,12 @@
 	chosen {
 		stdout-path = "serial2:115200n8";
 		tick-timer = &timer1;
+		firmware-loader = &fs_loader0;
+	};
+
+	fs_loader0: fs_loader at 0 {
+		u-boot,dm-pre-reloc;
+		compatible = "u-boot,fs-loader";
 	};
 
 	a72_0: a72 at 0 {
Signature · 1 line
2.17.1
author
#10 lore raw

PATCH 7/10 arm: dts: k3-j721e-r5: Enable r5fss0 cluster in SPL

In reply to Keerthy

Enable MAIN domain r5fss0 cluster and its core0 in R5 spl.

---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +14 -0
index 27df704ce0..d7d149a509 100644
@@ -13,6 +13,8 @@
 	aliases {
 		remoteproc0 = &sysctrler;
 		remoteproc1 = &a72_0;
+		remoteproc2 = &main_r5fss0_core0;
+		remoteproc3 = &main_r5fss0_core1;
 	};
 
 	chosen {
@@ -190,4 +192,16 @@
 	u-boot,dm-spl;
 };
 
+&main_r5fss0 {
+	u-boot,dm-spl;
+};
+
+&main_r5fss0_core0 {
+	u-boot,dm-spl;
+};
+
+&main_r5fss0_core1 {
+	u-boot,dm-spl;
+};
+
 #include "k3-j721e-common-proc-board-u-boot.dtsi"
Signature · 1 line
2.17.1
author
#11 lore raw

PATCH 8/10 include: configs: j721e_evm: Add env variables for mcu_r5fss0_core0 & main_r5fss0_core0

In reply to Keerthy

Add env variables for mcu_r5fss0_core0 & main_r5fss0_core0 firmware loadaddr and name.

---
 include/configs/j721e_evm.h | 4 ++++
 1 file changed, 4 insertions(+)
include/configs/j721e_evm.h +4 -0
index 84518786c7..d3a9330069 100644
@@ -76,6 +76,10 @@
 	"mmcdev=1\0"							\
 	"bootpart=1:2\0"						\
 	"bootdir=/boot\0"						\
+	"mainr5f0_0loadaddr=88000000\0"					\
+	"mainr5f0_0fwname=/lib/firmware/j7-main-r5f0_0-fw\0"		\
+	"mcur5f0_0loadaddr=89000000\0"					\
+	"mcur5f0_0fwname=/lib/firmware/j7-mcu-r5f0_0-fw\0"		\
 	"rd_spec=-\0"							\
 	"init_mmc=run args_all args_mmc\0"				\
 	"get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Signature · 1 line
2.17.1
author
#12 lore raw

PATCH 9/10 configs: j721e_evm_r5: Add configs for environment in eMMC

In reply to Keerthy

From: Faiz Abbas <[email protected]>

Add config to save and read back environment from eMMC.

---
 configs/j721e_evm_a72_defconfig | 3 +++
 configs/j721e_evm_r5_defconfig  | 2 ++
 include/configs/j721e_evm.h     | 6 ++++++
 3 files changed, 11 insertions(+)
configs/j721e_evm_a72_defconfig +3 -0
index daa661384d..a9ede538eb 100644
@@ -9,6 +9,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
@@ -24,6 +25,7 @@ CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs;
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_RESET=y
@@ -50,6 +52,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-common-proc-board"
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
configs/j721e_evm_r5_defconfig +2 -0
index 10f4f00699..c92be8e513 100644
@@ -10,6 +10,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
@@ -46,6 +47,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board"
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
include/configs/j721e_evm.h +6 -0
index d3a9330069..caeea2da62 100644
@@ -115,4 +115,10 @@
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
+/* MMC ENV related defines */
+#ifdef CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_SYS_MMC_ENV_PART	1
+#endif
+
 #endif /* __CONFIG_J721E_EVM_H */
Signature · 1 line
2.17.1
#13 lore raw

PATCH 9/10 configs: j721e_evm_r5: Add configs for environment in eMMC

Quoted 6 lines · Keerthy

From: Faiz Abbas <[email protected]>

Add config to save and read back environment from eMMC.

This is already posted. https://patchwork.ozlabs.org/patch/1197305/

Thanks and regards,
Lokesh

Quoted 70 lines
---
 configs/j721e_evm_a72_defconfig | 3 +++
 configs/j721e_evm_r5_defconfig  | 2 ++
 include/configs/j721e_evm.h     | 6 ++++++
 3 files changed, 11 insertions(+)
configs/j721e_evm_a72_defconfig +3 -0
index daa661384d..a9ede538eb 100644
@@ -9,6 +9,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
@@ -24,6 +25,7 @@ CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs;
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_RESET=y
@@ -50,6 +52,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-common-proc-board"
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
configs/j721e_evm_r5_defconfig +2 -0
index 10f4f00699..c92be8e513 100644
@@ -10,6 +10,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
@@ -46,6 +47,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board"
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
include/configs/j721e_evm.h +6 -0
index d3a9330069..caeea2da62 100644
@@ -115,4 +115,10 @@
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
+/* MMC ENV related defines */
+#ifdef CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_SYS_MMC_ENV_PART	1
+#endif
+
 #endif /* __CONFIG_J721E_EVM_H */
author
#14 lore raw

PATCH 10/10 configs: j721e_evm_r5: Enable R5F remoteproc support

In reply to Keerthy

Enable r5f remoteproc support in r5 defconfig so that r5s can be started in spl.

---
 configs/j721e_evm_r5_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/j721e_evm_r5_defconfig +2 -0
index c92be8e513..2c0082aaf7 100644
@@ -25,6 +25,7 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_EARLY_BSS=y
 CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_RESET=y
@@ -89,6 +90,7 @@ 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
Signature · 1 line
2.17.1