[PATCH 0/4] 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(-)

Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.
Signed-off-by: Aniket Limaye a-limaye@ti.com --- configs/j7200_evm_a72_defconfig | 10 ++++++++-- configs/j7200_evm_r5_defconfig | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig index 2863472794..9ded9b2707 100644 --- a/configs/j7200_evm_a72_defconfig +++ b/configs/j7200_evm_a72_defconfig @@ -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 diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig index 05eea55cfe..de5aaaece8 100644 --- a/configs/j7200_evm_r5_defconfig +++ b/configs/j7200_evm_r5_defconfig @@ -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

On 3/6/2024 12:07 PM, Aniket Limaye wrote:
Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.
Signed-off-by: Aniket Limaye a-limaye@ti.com
configs/j7200_evm_a72_defconfig | 10 ++++++++-- configs/j7200_evm_r5_defconfig | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig index 2863472794..9ded9b2707 100644 --- a/configs/j7200_evm_a72_defconfig +++ b/configs/j7200_evm_a72_defconfig @@ -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 diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig index 05eea55cfe..de5aaaece8 100644 --- a/configs/j7200_evm_r5_defconfig +++ b/configs/j7200_evm_r5_defconfig @@ -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
Reviewed-by: Udit Kumar u-kumar1@ti.com

On 18:41-20240306, Kumar, Udit wrote:
On 3/6/2024 12:07 PM, Aniket Limaye wrote:
Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.
Signed-off-by: Aniket Limaye a-limaye@ti.com
configs/j7200_evm_a72_defconfig | 10 ++++++++-- configs/j7200_evm_r5_defconfig | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)
Could we not do fragments?

On Wed, Mar 06, 2024 at 12:07:46PM +0530, Aniket Limaye wrote:
Add the necessary configs required for OSPI functionality. Also update the ospi flash partition offsets as per the devicetree.
Signed-off-by: Aniket Limaye a-limaye@ti.com Reviewed-by: Udit Kumar u-kumar1@ti.com
For the series, applied to u-boot/next, thanks!

- Add the missing bootph-all property in the flash subnode for ospi - Add the missing overrides for the ospi node in the r5 devicetree
Signed-off-by: Aniket Limaye a-limaye@ti.com --- 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(+)
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi index 60ca6d21ab..c9fee0ea99 100644 --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi @@ -195,6 +195,10 @@
&ospi0 { bootph-all; + + flash@0 { + bootph-all; + }; };
&serdes_ln_ctrl { diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 018faaa13b..195637a836 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -83,3 +83,8 @@ &wkup_vtm0 { bootph-pre-ram; }; + +&ospi0 { + reg = <0x0 0x47040000 0x0 0x100>, + <0x0 0x50000000 0x0 0x8000000>; +};

On 3/6/2024 12:07 PM, Aniket Limaye wrote:
- 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
Signed-off-by: Aniket Limaye a-limaye@ti.com
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(+)
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi index 60ca6d21ab..c9fee0ea99 100644 --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi @@ -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.
&serdes_ln_ctrl { diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 018faaa13b..195637a836 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -83,3 +83,8 @@ &wkup_vtm0 { bootph-pre-ram; };
+&ospi0 {
- reg = <0x0 0x47040000 0x0 0x100>,
<0x0 0x50000000 0x0 0x8000000>;
+};
With change in commit message,
Reviewed-by: Udit Kumar u-kumar1@ti.com

On 18:47-20240306, Kumar, Udit wrote:
On 3/6/2024 12:07 PM, Aniket Limaye wrote:
- 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
Signed-off-by: Aniket Limaye a-limaye@ti.com
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(+)
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi index 60ca6d21ab..c9fee0ea99 100644 --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi @@ -195,6 +195,10 @@ &ospi0 { bootph-all;
You should only use bootph-all property in leaf nodes - at least for kernel world.
- 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.
Send this change for upstream kernel right away please.
&serdes_ln_ctrl { diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 018faaa13b..195637a836 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -83,3 +83,8 @@ &wkup_vtm0 { bootph-pre-ram; };
+&ospi0 {
- reg = <0x0 0x47040000 0x0 0x100>,
<0x0 0x50000000 0x0 0x8000000>;
+};
With change in commit message,
Reviewed-by: Udit Kumar u-kumar1@ti.com

Correcting the clock-frequency property of the mcu_timer0 node
Fixes: df73e791ce09 ("arm: dts: j7200: dts sync with Linux 6.6-rc1") Signed-off-by: Aniket Limaye a-limaye@ti.com --- arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 195637a836..c4ca09b1e0 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -52,7 +52,7 @@ };
&mcu_timer0 { - clock-frequency = <25000000>; + clock-frequency = <250000000>; bootph-pre-ram; };

On 3/6/2024 12:07 PM, Aniket Limaye wrote:
Correcting the clock-frequency property of the mcu_timer0 node
Fixes: df73e791ce09 ("arm: dts: j7200: dts sync with Linux 6.6-rc1") Signed-off-by: Aniket Limaye a-limaye@ti.com
arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 195637a836..c4ca09b1e0 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -52,7 +52,7 @@ };
&mcu_timer0 {
- clock-frequency = <25000000>;
- clock-frequency = <250000000>; bootph-pre-ram;
Reviewed-by: Udit Kumar u-kumar1@ti.com
};

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") Signed-off-by: Aniket Limaye a-limaye@ti.com --- arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index c4ca09b1e0..fb7e2e5023 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -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>; +};

On 3/6/2024 12:07 PM, Aniket Limaye wrote:
Support for OSPI probe and also read/write is broken and/or missing in current master branch.
Its broken :)
- 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]
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
.../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(-)
participants (4)
-
Aniket Limaye
-
Kumar, Udit
-
Nishanth Menon
-
Tom Rini