Skip to contentSkip to conversation

Fix OSPI bootmode for j7200-evm

PATCH In review Aniket Limaye 4 participants 12 messages Mar 6, 2024 – Mar 20, 2024 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover Fix OSPI bootmode for j7200-evm

Support for OSPI probe and also read/write is broken and/or missing in current master branch.
- sf probe failure from u-boot prompt & OSPI boot failure [0]

This series adds necessary configs, as well as fixes some bugs in the existing u-boot devicetree, to add OSPI boot support for the j7200-evm device.
- sf probe and update in u-boot prompt & successful OSPI boot logs [1]

[0]: https://gist.github.com/aniket-l/f487472baa47e819defc82e5f57b7860
[1]: https://gist.github.com/aniket-l/e5353c4511009d2ebf5f1743ebaab61a

Aniket Limaye (4):
configs: j7200_evm_*_defconfig: Enable OSPI configs
arm: dts: k3-j7200: Fix support for OSPI flash
arm: dts: k3-j7200-r5-common: fix the mcu_timer0 clock frequency
arm: dts: k3-j7200-r5-common: Add missing overrides for ringacc and
udmap

 .../dts/k3-j7200-common-proc-board-u-boot.dtsi    |  4 ++++
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts    | 15 ++++++++++++++-
 configs/j7200_evm_a72_defconfig                   | 10 ++++++++--
 configs/j7200_evm_r5_defconfig                    |  9 +++++++--
 4 files changed, 33 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/4 configs: j7200_evm_*_defconfig: Enable OSPI configs

Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.

---
 configs/j7200_evm_a72_defconfig | 10 ++++++++--
 configs/j7200_evm_r5_defconfig  |  9 +++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)
configs/j7200_evm_a72_defconfig +8 -2
index 2863472794..9ded9b2707 100644
@@ -10,6 +10,8 @@ CONFIG_SOC_K3_J721E=y
 CONFIG_TARGET_J7200_A72_EVM=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
+CONFIG_SF_DEFAULT_SPEED=25000000
+CONFIG_SF_DEFAULT_MODE=0
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
@@ -61,7 +63,7 @@ CONFIG_SPL_RAM_DEVICE=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x300000
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_SYS_MAXARGS=64
 CONFIG_CMD_ASKENV=y
@@ -141,7 +143,11 @@ 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_STMICRO=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_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_MULTIPLEXER=y
configs/j7200_evm_r5_defconfig +7 -2
index 05eea55cfe..de5aaaece8 100644
@@ -10,6 +10,8 @@ CONFIG_K3_EARLY_CONS=y
 CONFIG_TARGET_J7200_R5_EVM=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
+CONFIG_SF_DEFAULT_SPEED=25000000
+CONFIG_SF_DEFAULT_MODE=0
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
@@ -60,7 +62,7 @@ CONFIG_SPL_REMOTEPROC=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=64
@@ -117,7 +119,10 @@ 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_STMICRO=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_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.34.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] configs: j7200_evm_*_defconfig: Enable OSPI configs

Quoted 68 lines · Aniket Limaye

Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.

---
  configs/j7200_evm_a72_defconfig | 10 ++++++++--
  configs/j7200_evm_r5_defconfig  |  9 +++++++--
  2 files changed, 15 insertions(+), 4 deletions(-)
configs/j7200_evm_a72_defconfig +8 -2
index 2863472794..9ded9b2707 100644
@@ -10,6 +10,8 @@ CONFIG_SOC_K3_J721E=y
  CONFIG_TARGET_J7200_A72_EVM=y
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
+CONFIG_SF_DEFAULT_SPEED=25000000
+CONFIG_SF_DEFAULT_MODE=0
  CONFIG_ENV_SIZE=0x20000
  CONFIG_DM_GPIO=y
  CONFIG_SPL_DM_SPI=y
@@ -61,7 +63,7 @@ CONFIG_SPL_RAM_DEVICE=y
  # CONFIG_SPL_SPI_FLASH_TINY is not set
  CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
  CONFIG_SPL_SPI_LOAD=y
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x300000
  CONFIG_SPL_YMODEM_SUPPORT=y
  CONFIG_SYS_MAXARGS=64
  CONFIG_CMD_ASKENV=y
@@ -141,7 +143,11 @@ 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_STMICRO=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_USE_4K_SECTORS is not set
  CONFIG_SPI_FLASH_MTD=y
  CONFIG_MULTIPLEXER=y
configs/j7200_evm_r5_defconfig +3 -1
index 05eea55cfe..de5aaaece8 100644
@@ -10,6 +10,8 @@ CONFIG_K3_EARLY_CONS=y
  CONFIG_TARGET_J7200_R5_EVM=y
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
+CONFIG_SF_DEFAULT_SPEED=25000000
+CONFIG_SF_DEFAULT_MODE=0
  CONFIG_ENV_SIZE=0x20000
  CONFIG_DM_GPIO=y
  CONFIG_SPL_DM_SPI=y
@@ -60,7 +62,7 @@ CONFIG_SPL_REMOTEPROC=y
  # CONFIG_SPL_SPI_FLASH_TINY is not set
  CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
  CONFIG_SPL_SPI_LOAD=y
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
  CONFIG_SPL_YMODEM_SUPPORT=y
  CONFIG_HUSH_PARSER=y
  CONFIG_SYS_MAXARGS=64
@@ -117,7 +119,10 @@ CONFIG_SYS_FLASH_CFI=y
  CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y

configs/j7200_evm_r5_defconfig CONFIG_SYS_FLASH_CFI=y · line 128

Quoted 10 lines
configs/j7200_evm_r5_defconfig +4 -1
  CONFIG_DM_SPI_FLASH=y
  CONFIG_SPI_FLASH_SFDP_SUPPORT=y
-CONFIG_SPI_FLASH_STMICRO=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_PINCTRL=y
  # CONFIG_PINCTRL_GENERIC is not set
  CONFIG_SPL_PINCTRL=y
#3 lore raw

Re: [PATCH 1/4] configs: j7200_evm_*_defconfig: Enable OSPI configs

Quoted 11 lines · Udit
Quoted 9 lines · Aniket Limaye

Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.

---
  configs/j7200_evm_a72_defconfig | 10 ++++++++--
  configs/j7200_evm_r5_defconfig  |  9 +++++++--
  2 files changed, 15 insertions(+), 4 deletions(-)

Could we not do fragments?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#5 lore raw

PATCH 2/4 arm: dts: k3-j7200: Fix support for OSPI flash

In reply to Aniket Limaye

- Add the missing bootph-all property in the flash subnode for ospi
- Add the missing overrides for the ospi node in the r5 devicetree

---
 arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 4 ++++
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts      | 5 +++++
 2 files changed, 9 insertions(+)
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +4 -0
index 60ca6d21ab..c9fee0ea99 100644
@@ -195,6 +195,10 @@
 
 &ospi0 {
 	bootph-all;
+
+	flash@0 {
+		bootph-all;
+	};
 };
 
 &serdes_ln_ctrl {
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +5 -0
index 018faaa13b..195637a836 100644
@@ -83,3 +83,8 @@
 &wkup_vtm0 {
 	bootph-pre-ram;
 };
+
+&ospi0 {
+    reg = <0x0 0x47040000 0x0 0x100>,
+          <0x0 0x50000000 0x0 0x8000000>;
+};
Signature · 1 line
2.34.1
Reviewed-by on v1 2/4
#6 lore raw

Re: [PATCH 2/4] arm: dts: k3-j7200: Fix support for OSPI flash

Quoted 2 lines · Aniket Limaye

- Add the missing bootph-all property in the flash subnode for ospi
- Add the missing overrides for the ospi node in the r5 devicetree

Please see , if you can add more on this why we are adding this

also, if this patch fixes some previous commit

Quoted 12 lines
---
  arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 4 ++++
  arch/arm/dts/k3-j7200-r5-common-proc-board.dts      | 5 +++++
  2 files changed, 9 insertions(+)
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +0 -0
index 60ca6d21ab..c9fee0ea99 100644

arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi line 202

Quoted 8 lines
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +4 -0
@@ -195,6 +195,10 @@
 
  &ospi0 {
  	bootph-all;
+
+	flash@0 {
+		bootph-all;
+	};
  };

Ideally this should come from kernel DT sync or with OF_UPSTREAM, whatever is applicable

As you are fixing broken OSPI boot.

Tom can suggest, if he is ok to pull in this fix for 2024.04 or we need to wait to get this change into kernel first.

Quoted 7 lines
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +0 -0
  &serdes_ln_ctrl {
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +0 -0
index 018faaa13b..195637a836 100644

arch/arm/dts/k3-j7200-r5-common-proc-board.dts line 90

Quoted 8 lines
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +5 -0
@@ -83,3 +83,8 @@
  &wkup_vtm0 {
  	bootph-pre-ram;
  };
+
+&ospi0 {
+    reg = <0x0 0x47040000 0x0 0x100>,
+          <0x0 0x50000000 0x0 0x8000000>;
+};

With change in commit message,

#7 lore raw

Re: [PATCH 2/4] arm: dts: k3-j7200: Fix support for OSPI flash

Quoted 16 lines · Udit
Quoted 2 lines · Aniket Limaye

- Add the missing bootph-all property in the flash subnode for ospi
- Add the missing overrides for the ospi node in the r5 devicetree

Please see , if you can add more on this why we are adding this

also, if this patch fixes some previous commit

Quoted 7 lines
---
  arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 4 ++++
  arch/arm/dts/k3-j7200-r5-common-proc-board.dts      | 5 +++++
  2 files changed, 9 insertions(+)
Quoted 7 lines

arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi line 196

Quoted 7 lines
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +0 -0
index 60ca6d21ab..c9fee0ea99 100644
@@ -195,6 +195,10 @@
  &ospi0 {
  	bootph-all;

You should only use bootph-all property in leaf nodes - at least for
kernel world.

Quoted 10 lines

arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi line 202

Quoted 5 lines
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +4 -0
+
+	flash@0 {
+		bootph-all;
+	};
  };

Ideally this should come from kernel DT sync or with OF_UPSTREAM, whatever is applicable

Quoted 4 lines

As you are fixing broken OSPI boot.

Tom can suggest, if he is ok to pull in this fix for 2024.04 or we need to wait to get this change into kernel first.

Send this change for upstream kernel right away please.

Quoted 23 lines
Quoted 8 lines
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +0 -0
  &serdes_ln_ctrl {
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +0 -0
index 018faaa13b..195637a836 100644

arch/arm/dts/k3-j7200-r5-common-proc-board.dts line 90

Quoted 8 lines
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +5 -0
@@ -83,3 +83,8 @@
  &wkup_vtm0 {
  	bootph-pre-ram;
  };
+
+&ospi0 {
+    reg = <0x0 0x47040000 0x0 0x100>,
+          <0x0 0x50000000 0x0 0x8000000>;
+};

With change in commit message,

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#8 lore raw

PATCH 3/4 arm: dts: k3-j7200-r5-common: fix the mcu_timer0 clock frequency

In reply to Aniket Limaye

Correcting the clock-frequency property of the mcu_timer0 node

Fixes df73e791ce09 ("arm: dts: j7200: dts sync with Linux 6.6-rc1")
---
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +1 -1
index 195637a836..c4ca09b1e0 100644
@@ -52,7 +52,7 @@
 };
 
 &mcu_timer0 {
-	clock-frequency = <25000000>;
+	clock-frequency = <250000000>;
 	bootph-pre-ram;
 };
 
Signature · 1 line
2.34.1
Reviewed-by on v1 3/4
#9 lore raw

Re: [PATCH 3/4] arm: dts: k3-j7200-r5-common: fix the mcu_timer0 clock frequency

Quoted 13 lines · Aniket Limaye

Correcting the clock-frequency property of the mcu_timer0 node

Fixes df73e791ce09 ("arm: dts: j7200: dts sync with Linux 6.6-rc1")
---
  arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +0 -0
index 195637a836..c4ca09b1e0 100644

arch/arm/dts/k3-j7200-r5-common-proc-board.dts line 56

Quoted 6 lines
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +1 -1
@@ -52,7 +52,7 @@
  };
 
  &mcu_timer0 {
-	clock-frequency = <25000000>;
+	clock-frequency = <250000000>;
  	bootph-pre-ram;
Quoted 2 lines
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +0 -0
  };
 
#10 lore raw

PATCH 4/4 arm: dts: k3-j7200-r5-common: Add missing overrides for ringacc and udmap

In reply to Aniket Limaye

Corrects the ti,sci property to point to dm_tifs node for proper functioning of mcu_ringacc and mcu_udmap.

Fixes df73e791ce09 ("arm: dts: j7200: dts sync with Linux 6.6-rc1")
---
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +8 -0
index c4ca09b1e0..fb7e2e5023 100644
@@ -88,3 +88,11 @@
     reg = <0x0 0x47040000 0x0 0x100>,
           <0x0 0x50000000 0x0 0x8000000>;
 };
+
+&mcu_ringacc {
+    ti,sci = <&dm_tifs>;
+};
+
+&mcu_udmap {
+    ti,sci = <&dm_tifs>;
+};
Signature · 1 line
2.34.1
#11 lore raw
In reply to Aniket Limaye
Quoted 1 line · Aniket Limaye

Support for OSPI probe and also read/write is broken and/or missing in current master branch.

Its broken :)

Quoted 10 lines

- sf probe failure from u-boot prompt & OSPI boot failure [0]

This series adds necessary configs, as well as fixes some bugs in the existing u-boot devicetree, to add OSPI boot support for the j7200-evm device.
- sf probe and update in u-boot prompt & successful OSPI boot logs [1]

[0]: https://gist.github.com/aniket-l/f487472baa47e819defc82e5f57b7860
[1]: https://gist.github.com/aniket-l/e5353c4511009d2ebf5f1743ebaab61a

Quoted 6 lines

Aniket Limaye (4):
configs: j7200_evm_*_defconfig: Enable OSPI configs
arm: dts: k3-j7200: Fix support for OSPI flash
arm: dts: k3-j7200-r5-common: fix the mcu_timer0 clock frequency
arm: dts: k3-j7200-r5-common: Add missing overrides for ringacc and
udmap

Please copy Nishanth in your posting

Quoted 6 lines
  .../dts/k3-j7200-common-proc-board-u-boot.dtsi    |  4 ++++
  arch/arm/dts/k3-j7200-r5-common-proc-board.dts    | 15 ++++++++++++++-
  configs/j7200_evm_a72_defconfig                   | 10 ++++++++--
  configs/j7200_evm_r5_defconfig                    |  9 +++++++--
  4 files changed, 33 insertions(+), 5 deletions(-)