Skip to contentSkip to conversation

Enable OSPI on j721e

PATCH In review Jonathan Humphreys 3 participants 10 messages Feb 24, 2024 – Mar 5, 2024

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

v2 cover Enable OSPI on j721e

This series enables OSPI storage and boot.

Fixes 58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")

Changes from v1:
- added patch to remove the OSPI phy pattern partition, as it wasn't used

v1: https://patchwork.ozlabs.org/project/uboot/list/?series=396241

Jonathan Humphreys (3):
configs: j721e: Enable OSPI memory
arm: mach-k3: j721e: Enable OSPI boot
arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

 arch/arm/dts/k3-j721e-sk-u-boot.dtsi      | 4 ----
 arch/arm/mach-k3/include/mach/j721e_spl.h | 5 +++--
 arch/arm/mach-k3/j721e_init.c             | 3 ++-
 configs/j721e_evm_a72_defconfig           | 7 +++++++
 configs/j721e_evm_r5_defconfig            | 6 ++++++
 5 files changed, 18 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/3 configs: j721e: Enable OSPI memory

Set config values to enable OSPI functionality.

---
 configs/j721e_evm_a72_defconfig | 7 +++++++
 configs/j721e_evm_r5_defconfig  | 6 ++++++
 2 files changed, 13 insertions(+)
configs/j721e_evm_a72_defconfig +7 -0
index 74af5bebb5..1b39dd7c86 100644
@@ -10,6 +10,7 @@ CONFIG_SOC_K3_J721E=y
 CONFIG_TARGET_J721E_A72_EVM=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
+CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
@@ -142,7 +143,13 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_SOFT_RESET=y
+CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_S28HX_T=y
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MT35XU=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_MULTIPLEXER=y
configs/j721e_evm_r5_defconfig +6 -0
index bc4f35cce1..59c0c4135c 100644
@@ -10,6 +10,7 @@ CONFIG_K3_EARLY_CONS=y
 CONFIG_TARGET_J721E_R5_EVM=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf59f0
+CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
@@ -128,7 +129,12 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_SOFT_RESET=y
+CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_S28HX_T=y
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MT35XU=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.34.1
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] configs: j721e: Enable OSPI memory

Quoted 47 lines · Jonathan Humphreys

Set config values to enable OSPI functionality.

---
  configs/j721e_evm_a72_defconfig | 7 +++++++
  configs/j721e_evm_r5_defconfig  | 6 ++++++
  2 files changed, 13 insertions(+)
configs/j721e_evm_a72_defconfig +7 -0
index 74af5bebb5..1b39dd7c86 100644
@@ -10,6 +10,7 @@ CONFIG_SOC_K3_J721E=y
  CONFIG_TARGET_J721E_A72_EVM=y
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
+CONFIG_SF_DEFAULT_SPEED=25000000
  CONFIG_ENV_SIZE=0x20000
  CONFIG_DM_GPIO=y
  CONFIG_SPL_DM_SPI=y
@@ -142,7 +143,13 @@ CONFIG_FLASH_CFI_MTD=y
  CONFIG_SYS_FLASH_CFI=y
  CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
  CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_SOFT_RESET=y
+CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_S28HX_T=y
  CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MT35XU=y
  # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
  CONFIG_SPI_FLASH_MTD=y
  CONFIG_MULTIPLEXER=y
configs/j721e_evm_r5_defconfig +1 -0
index bc4f35cce1..59c0c4135c 100644
@@ -10,6 +10,7 @@ CONFIG_K3_EARLY_CONS=y
  CONFIG_TARGET_J721E_R5_EVM=y
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf59f0
+CONFIG_SF_DEFAULT_SPEED=25000000
  CONFIG_ENV_SIZE=0x20000
  CONFIG_DM_GPIO=y
  CONFIG_SPL_DM_SPI=y

configs/j721e_evm_r5_defconfig CONFIG_FLASH_CFI_MTD=y · line 137

Quoted 9 lines
configs/j721e_evm_r5_defconfig +5 -0
@@ -128,7 +129,12 @@ CONFIG_FLASH_CFI_MTD=y
  CONFIG_SYS_FLASH_CFI=y
  CONFIG_DM_SPI_FLASH=y
  CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_SOFT_RESET=y
+CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_S28HX_T=y
  CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MT35XU=y
Quoted 3 lines
configs/j721e_evm_r5_defconfig +0 -0
  CONFIG_PINCTRL=y
  # CONFIG_PINCTRL_GENERIC is not set
  CONFIG_SPL_PINCTRL=y
#3 lore raw

PATCH v2 2/3 arm: mach-k3: j721e: Enable OSPI boot

In reply to Jonathan Humphreys

Add boot ROM XSPI bootmode, and set to BOOT_DEVICE_SPI if detected.

---
 arch/arm/mach-k3/include/mach/j721e_spl.h | 5 +++--
 arch/arm/mach-k3/j721e_init.c             | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-k3/include/mach/j721e_spl.h +3 -2
index ed3d7333bd..aaee653537 100644
@@ -24,8 +24,9 @@
 #define BOOT_DEVICE_UFS			0x13
 #define BOOT_DEVIE_GPMC			0x14
 #define BOOT_DEVICE_PCIE		0x15
-#define BOOT_DEVICE_MMC2_2		0x16
-#define BOOT_DEVICE_RAM			0x17
+#define BOOT_DEVICE_XSPI 		0x16
+#define BOOT_DEVICE_RAM 		0x17
+#define BOOT_DEVICE_MMC2_2 		0xFF /* Invalid value */
 
 /* Backup boot modes with MCU Only = 0 */
 #define BACKUP_BOOT_DEVICE_RAM		0x0
arch/arm/mach-k3/j721e_init.c +2 -1
index c2976c4ea0..7ee9b75de4 100644
@@ -346,7 +346,8 @@ static u32 __get_primary_bootmedia(u32 main_devstat, u32 wkup_devstat)
 	bootmode |= (main_devstat & MAIN_DEVSTAT_BOOT_MODE_B_MASK) <<
 			BOOT_MODE_B_SHIFT;
 
-	if (bootmode == BOOT_DEVICE_OSPI || bootmode ==	BOOT_DEVICE_QSPI)
+	if (bootmode == BOOT_DEVICE_OSPI || bootmode == BOOT_DEVICE_QSPI ||
+	    bootmode == BOOT_DEVICE_XSPI)
 		bootmode = BOOT_DEVICE_SPI;
 
 	if (bootmode == BOOT_DEVICE_MMC2) {
Signature · 1 line
2.34.1
Reviewed-by on v2 2/3
#4 lore raw

Re: [PATCH v2 2/3] arm: mach-k3: j721e: Enable OSPI boot

Thanks For fixing this

Quoted 29 lines · Jonathan Humphreys

Add boot ROM XSPI bootmode, and set to BOOT_DEVICE_SPI if detected.

---
  arch/arm/mach-k3/include/mach/j721e_spl.h | 5 +++--
  arch/arm/mach-k3/j721e_init.c             | 3 ++-
  2 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-k3/include/mach/j721e_spl.h +3 -2
index ed3d7333bd..aaee653537 100644
@@ -24,8 +24,9 @@
  #define BOOT_DEVICE_UFS			0x13
  #define BOOT_DEVIE_GPMC			0x14
  #define BOOT_DEVICE_PCIE		0x15
-#define BOOT_DEVICE_MMC2_2		0x16
-#define BOOT_DEVICE_RAM			0x17
+#define BOOT_DEVICE_XSPI 		0x16
+#define BOOT_DEVICE_RAM 		0x17
+#define BOOT_DEVICE_MMC2_2 		0xFF /* Invalid value */
 
  /* Backup boot modes with MCU Only = 0 */
  #define BACKUP_BOOT_DEVICE_RAM		0x0
arch/arm/mach-k3/j721e_init.c +0 -0
index c2976c4ea0..7ee9b75de4 100644

arch/arm/mach-k3/j721e_init.c static u32 __get_primary_bootmedia(u32 main_devstat, u32 wkup_devstat) · line 351

Quoted 7 lines
arch/arm/mach-k3/j721e_init.c +2 -1
@@ -346,7 +346,8 @@ static u32 __get_primary_bootmedia(u32 main_devstat, u32 wkup_devstat)
  	bootmode |= (main_devstat & MAIN_DEVSTAT_BOOT_MODE_B_MASK) <<
  			BOOT_MODE_B_SHIFT;
 
-	if (bootmode == BOOT_DEVICE_OSPI || bootmode ==	BOOT_DEVICE_QSPI)
+	if (bootmode == BOOT_DEVICE_OSPI || bootmode == BOOT_DEVICE_QSPI ||
+	    bootmode == BOOT_DEVICE_XSPI)
  		bootmode = BOOT_DEVICE_SPI;
Quoted 2 lines
arch/arm/mach-k3/j721e_init.c +0 -0
  	if (bootmode == BOOT_DEVICE_MMC2) {
#5 lore raw

PATCH v2 3/3 arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

In reply to Jonathan Humphreys

The phy calibration pattern partition isn't needed as the Cadence driver isn't calibrating the phys.

---
 arch/arm/dts/k3-j721e-sk-u-boot.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -4
index 479b7bcd6f..20b76a84ff 100644
@@ -157,9 +157,5 @@
 
 	flash@0 {
 		bootph-all;
-
-		partition@3fc0000 {
-			bootph-all;
-		};
 	};
 };
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH v2 3/3] arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

Thanks Jon

Quoted 2 lines · Jonathan Humphreys

The phy calibration pattern partition isn't needed as the Cadence driver isn't calibrating the phys.

Please do mention Fixes tag here

58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")

Quoted 10 lines
---
  arch/arm/dts/k3-j721e-sk-u-boot.dtsi | 4 ----
  1 file changed, 4 deletions(-)
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -0
index 479b7bcd6f..20b76a84ff 100644

arch/arm/dts/k3-j721e-sk-u-boot.dtsi line 160

Quoted 8 lines
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -4
@@ -157,9 +157,5 @@
 
  	flash@0 {
  		bootph-all;
-
-		partition@3fc0000 {
-			bootph-all;
-		};
  	};

This Patch LTGM,

+ Neha

For further cleanup, we should not have these ospi nodes in u-boot dts file.

should be in board dts (k3-j721e-sk.dts) with right bootph properties ,

and comes via kernel DT.

Quoted 1 line
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -0
  };
#7 lore raw

Re: [PATCH v2 3/3] arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

Quoted 10 lines · Udit

Thanks Jon

Quoted 2 lines · Jonathan Humphreys

The phy calibration pattern partition isn't needed as the Cadence driver isn't calibrating the phys.

Please do mention Fixes tag here

58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")

Please note that patchwork will just pick up:

Fixes 58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")
Signature · 1 line
Tom
#8 lore raw

Re: [PATCH v2 3/3] arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

In reply to Kumar, Udit
Quoted 11 lines · Udit

Thanks Jon

Quoted 2 lines · Jonathan Humphreys

The phy calibration pattern partition isn't needed as the Cadence driver isn't calibrating the phys.

Please do mention Fixes tag here

58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")

I put the fixes tag on the cover letter. Is there a 'correct' way - to add to the cover letter or the individual patches?

In the case of this particular patch, I don't think the fixes tag is appropriate as this isn't changing any observable behavior, it is a clean up.

Jon

Quoted 35 lines
Quoted 11 lines
---
  arch/arm/dts/k3-j721e-sk-u-boot.dtsi | 4 ----
  1 file changed, 4 deletions(-)
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -0
index 479b7bcd6f..20b76a84ff 100644

arch/arm/dts/k3-j721e-sk-u-boot.dtsi line 160

Quoted 8 lines
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -4
@@ -157,9 +157,5 @@
 
  	flash@0 {
  		bootph-all;
-
-		partition@3fc0000 {
-			bootph-all;
-		};
  	};

This Patch LTGM,

+ Neha

For further cleanup, we should not have these ospi nodes in u-boot dts file.

should be in board dts (k3-j721e-sk.dts) with right bootph properties ,

and comes via kernel DT.

Quoted 1 line
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +0 -0
  };
#9 lore raw
In reply to Jonathan Humphreys
Quoted 8 lines · Jonathan Humphreys

This series enables OSPI storage and boot.

Fixes 58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")

Changes from v1:
- added patch to remove the OSPI phy pattern partition, as it wasn't used

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom