Skip to contentSkip to conversation

Fix j721e hs support

PATCH New Manorit Chawdhry 1 participant 4 messages Feb 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fix j721e hs support

The series fixes the j721e HS support upstream along with merging the configs for GP and HS for maintainability

Dave Gerlach (1):
arm: mach-k3: Increase SYSFW max image size

Manorit Chawdhry (2):
Kconfig: j721e: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region
configs: j721e: Merge the HS and non-HS defconfigs

 arch/arm/mach-k3/Kconfig           |   6 +-
 configs/j721e_evm_a72_defconfig    |   3 +-
 configs/j721e_evm_r5_defconfig     |  11 +-
 configs/j721e_hs_evm_a72_defconfig | 209 -----------------------------
 configs/j721e_hs_evm_r5_defconfig  | 177 ------------------------
 5 files changed, 13 insertions(+), 393 deletions(-)
 delete mode 100644 configs/j721e_hs_evm_a72_defconfig
 delete mode 100644 configs/j721e_hs_evm_r5_defconfig
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 Kconfig: j721e: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region

In non-combined boot flow for K3, all the firewalls are locked by default until sysfw comes up. Rom configures some of the firewall for its usage along with the SRAM for R5 but the PSRAM region is still locked.

The K3 MCU Scratchpad for j721e was set to a PSRAM region triggering the firewall exception before sysfw came up. The exception started happening after adding multi dtb support that accesses the scratchpad for reading EEPROM contents.

The commit changes R5 MCU scratchpad for j721e to an SRAM region.

Old Map:

┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c40000 (approx)
│                STACK                │
├─────────────────────────────────────┤ 0x41c85b20
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c85bfc
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x70000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41cf5bfc)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
			                (0x41cffbfc)

New Map:

┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c40000 (approx)
│                EMPTY                │
├─────────────────────────────────────┤ 0x41c81920
│                STACK                │
│ SPL_SIZE_LIMIT_PROVIDE_STACK=0x4000 │
├─────────────────────────────────────┤ 0x41c85920
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c859f0
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x70000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41cf59f0)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
├─────────────────────────────────────┤ 0x41cff9fc
│         NEW MCU SCRATCHPAD          │
│  SYS_K3_MCU_SCRATCHPAD_SIZE = 0x200 │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
			                (0x41cffbfc)
Fixes ab977c8b91b4 ("configs: j721s2_evm_r5: Enable support for building multiple dtbs into FIT")
[[email protected]: SRAM allocation addressing diagram]
---
 arch/arm/mach-k3/Kconfig       |  3 ++-
 configs/j721e_evm_r5_defconfig | 10 +++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)
arch/arm/mach-k3/Kconfig +2 -1
index a8c3a593d570..0991b42423a0 100644
@@ -52,7 +52,8 @@ config SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
 config SYS_K3_MCU_SCRATCHPAD_BASE
 	hex
 	default 0x40280000 if SOC_K3_AM654
-	default 0x40280000 if SOC_K3_J721E || SOC_K3_J721S2
+	default 0x40280000 if SOC_K3_J721S2
+	default 0x41cff9fc if SOC_K3_J721E
 	help
 	  Describes the base address of MCU Scratchpad RAM.
 
configs/j721e_evm_r5_defconfig +7 -3
index 9d333e490562..658f2bc1bc8b 100644
@@ -17,12 +17,16 @@ CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_SPL_SIZE_LIMIT=0xf59f0
+CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
+CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
+CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x4000
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf59f0
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
@@ -31,9 +35,9 @@ CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
-CONFIG_SPL_MAX_SIZE=0xc0000
+CONFIG_SPL_MAX_SIZE=0xf59f0
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x41cf5bfc
+CONFIG_SPL_BSS_START_ADDR=0x41cf59f0
 CONFIG_SPL_BSS_MAX_SIZE=0xa000
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_STACK_R=y
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 arm: mach-k3: Increase SYSFW max image size

In reply to Manorit Chawdhry

From: Dave Gerlach <[email protected]>

When booting with HS silicon, the system firmware image is 278270, which is slightly larger than currently allocated amount.

This can cause unexpected behavior if this overlap interferes with other things in memory, so increase this with a slightly margin added as well to avoid any boot issues that can appear after system firmware gets loaded.

---
 arch/arm/mach-k3/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/mach-k3/Kconfig +1 -2
index 0991b42423a0..bae0a827c29f 100644
@@ -141,8 +141,7 @@ config K3_SYSFW_IMAGE_MMCSD_RAW_MODE_PART
 config K3_SYSFW_IMAGE_SIZE_MAX
 	int "Amount of memory dynamically allocated for loading SYSFW blob"
 	depends on K3_LOAD_SYSFW
-	default 163840 if SOC_K3_AM625 || SOC_K3_AM62A7
-	default	278000
+	default	280000
 	help
 	  Amount of memory (in bytes) reserved through dynamic allocation at
 	  runtime for loading the combined System Firmware and configuration image
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 configs: j721e: Merge the HS and non-HS defconfigs

In reply to Manorit Chawdhry

K3 devices have runtime type board detection. Make the default defconfig include the secure configuration. Then remove the HS specific config.

Non-HS devices will continue to boot due to runtime device type detection. If TI_SECURE_DEV_PKG is not set the build will emit warnings, for non-HS devices these can be ignored.

---
 configs/j721e_evm_a72_defconfig    |   3 +-
 configs/j721e_evm_r5_defconfig     |   1 +
 configs/j721e_hs_evm_a72_defconfig | 209 -----------------------------
 configs/j721e_hs_evm_r5_defconfig  | 177 ------------------------
 4 files changed, 3 insertions(+), 387 deletions(-)
 delete mode 100644 configs/j721e_hs_evm_a72_defconfig
 delete mode 100644 configs/j721e_hs_evm_r5_defconfig
configs/j721e_evm_a72_defconfig +2 -1
index 5efaff26d22a..3e2309b1f112 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_K3=y
+CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_GPIO=y
@@ -30,7 +31,7 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
+CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; 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;"
 CONFIG_LOGLEVEL=7
 CONFIG_SPL_MAX_SIZE=0xc0000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
configs/j721e_evm_r5_defconfig +1 -0
index 658f2bc1bc8b..69df8471de26 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_K3=y
+CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SYS_MALLOC_F_LEN=0x70000
 CONFIG_SPL_GPIO=y
configs/j721e_hs_evm_a72_defconfig deleted +0 -209

209 lines not on this page · raw message

configs/j721e_hs_evm_r5_defconfig deleted +0 -177

177 lines not on this page · raw message

Signature · 1 line
2.34.1