Skip to contentSkip to conversation

ke-am62x-sk_evm: add ospi support

PATCH In review Dhruva Gole 2 participants 7 messages Sep 27, 2022 – Oct 20, 2022 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover ke-am62x-sk_evm: add ospi support

There's a S28HS512T Flash (by Cypress) on the AM625 SK EVM.
- Add necessary DT nodes to enable OSPI interface with this flash.
- Enable all configs that enable the OSPI related drivers and commands like SF probe.

Tested on my AM62 SK EVM, attaching logs below.

Logs:
------------------------------------------------------------------------
U-Boot SPL 2022.10-rc5-00012-g435596d57f8b-dirty (Sep 26 2022 - 16:27:48 +0530)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.4.6--v08.04.06 (Jolly Jellyfi') Trying to boot from MMC2
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.7(release):v2.7.0-dirty
NOTICE:  BL31: Built : 14:30:02, Aug 27 2022

U-Boot SPL 2022.10-rc5-00012-g435596d57f8b-dirty (Sep 26 2022 - 17:51:27 +0530)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.4.6--v08.04.06 (Jolly Jellyfi') Trying to boot from MMC2

U-Boot 2022.10-rc5-00012-g435596d57f8b-dirty (Sep 26 2022 - 17:51:27 +0530)

SoC:   AM62X SR1.0 GP
Model: Texas Instruments AM625 SK
DRAM:  2 GiB
Core:  37 devices, 18 uclasses, devicetree: separate
MMC:   mmc@fa10000: 2, mmc@fa00000: 1, mmc@fa20000: 3
Loading Environment from nowhere... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   No ethernet found.
Hit any key to stop autoboot:  0

=> sf probe
SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
=> fatload mmc 1 $loadaddr tiboot3.bin
285482 bytes read in 17 ms (16 MiB/s)
=> sf update $loadaddr 0x0 $filesize
device 0 offset 0x0, size 0x45b2a
285482 bytes written, 0 bytes skipped in 2.623s, speed 111322 B/s => sf read 0x90000000 0x0 $filesize
device 0 offset 0x0, size 0x45b2a
SF: 285482 bytes @ 0x0 Read: OK
=> md $loadaddr

82000000: 94048230 fd038230 010203a0 64140202  0...0..........d
82000010: 3f829a45 85bb6dd8 232b5568 f8f4176f  E..?.m..hU+#o...
82000020: 309fb7ff 2a09060d f7864886 0d01010d  ...0...*.H......
82000030: 81300005 300b319d 55030609 02130604  ..0..1.0...U....
82000040: 0b315355 03060930 0c080455 31585402  US1.0...U....TX1
82000050: 060d300f 07045503 6144060c 73616c6c  .0...U....Dallas
82000060: 25302731 04550306 541e0c0a 73617865  1'0%..U....Texas
82000070: 736e4920 6d757274 73746e65 636e4920   Instruments Inc
82000080: 6f70726f 65746172 30133164 55030611  orporated1.0...U
82000090: 0a0c0b04 636f7250 6f737365 13317372  ....Processors1.
820000a0: 03061130 0c030455 2049540a 70707553  0...U....TI Supp
820000b0: 3174726f 061b301d 48862a09 010df786  ort1.0...*.H....
820000c0: 0e160109 70707573 4074726f 632e6974  [email protected]
820000d0: 1e306d6f 32320d17 36323930 38353031  om0...2209261058
820000e0: 175a3331 3132320d 31363230 31383530  13Z..22102610581
820000f0: 81305a33 300b319d 55030609 02130604  3Z0..1.0...U....
=> md 0x90000000
90000000: 94048230 fd038230 010203a0 64140202  0...0..........d
90000010: 3f829a45 85bb6dd8 232b5568 f8f4176f  E..?.m..hU+#o...
90000020: 309fb7ff 2a09060d f7864886 0d01010d  ...0...*.H......
90000030: 81300005 300b319d 55030609 02130604  ..0..1.0...U....
90000040: 0b315355 03060930 0c080455 31585402  US1.0...U....TX1
90000050: 060d300f 07045503 6144060c 73616c6c  .0...U....Dallas
90000060: 25302731 04550306 541e0c0a 73617865  1'0%..U....Texas
90000070: 736e4920 6d757274 73746e65 636e4920   Instruments Inc
90000080: 6f70726f 65746172 30133164 55030611  orporated1.0...U
90000090: 0a0c0b04 636f7250 6f737365 13317372  ....Processors1.
900000a0: 03061130 0c030455 2049540a 70707553  0...U....TI Supp
900000b0: 3174726f 061b301d 48862a09 010df786  ort1.0...*.H....
900000c0: 0e160109 70707573 4074726f 632e6974  [email protected]
900000d0: 1e306d6f 32320d17 36323930 38353031  om0...2209261058
900000e0: 175a3331 3132320d 31363230 31383530  13Z..22102610581
900000f0: 81305a33 300b319d 55030609 02130604  3Z0..1.0...U....

=> cmp.b $loadaddr 0x90000000 $filesize
Total of 285482 byte(s) were the same
------------------------------------------------------------------------

Thus tested read, write and probe flash from u-boot prompt

Dhruva Gole (2):
arm: dts: k3-am625-sk: Add OSPI support
configs: am62x_evm_a53: Enable OSPI Flash support

 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
 arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
 configs/am62x_evm_a53_defconfig      | 13 +++++
 3 files changed, 114 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 arm: dts: k3-am625-sk: Add OSPI support

Add DT nodes to enable S28HS512T OSPI flash on the SK board.

---
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
 arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)
arch/arm/dts/k3-am625-sk-u-boot.dtsi +24 -0
index 159fa36bbe9f..92788bae3e09 100644
@@ -102,3 +102,27 @@
 &main_mmc1_pins_default {
 	u-boot,dm-spl;
 };
+
+&fss {
+	u-boot,dm-spl;
+};
+
+&ospi0_pins_default {
+	u-boot,dm-spl;
+};
+
+&ospi0 {
+	u-boot,dm-spl;
+
+	flash@0 {
+		u-boot,dm-spl;
+
+		partitions {
+			u-boot,dm-spl;
+
+			partition@3fc0000 {
+				u-boot,dm-spl;
+			};
+		};
+	};
+};
arch/arm/dts/k3-am625-sk.dts +77 -0

92 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/2] arm: dts: k3-am625-sk: Add OSPI support

Quoted 6 lines · Dhruva Gole

Add DT nodes to enable S28HS512T OSPI flash on the SK board.

---
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
 arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++

What is the status of the non u-boot.dtsi portion of this patch with upstream Linux? Thanks.

Signature · 1 line
Tom
#3 lore raw

Re: [EXTERNAL] Re: [PATCH 1/2] arm: dts: k3-am625-sk: Add OSPI support

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 6 lines · Dhruva Gole

Add DT nodes to enable S28HS512T OSPI flash on the SK board.

---
  arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
  arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++

What is the status of the non u-boot.dtsi portion of this patch with upstream Linux? Thanks.

In upstream, please refer to https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24

spi0 = &ospi0;

and pinmux is all done in a similar fashion as I have done in these patches.

Quoted 1 line
Signature · 2 lines
Thanks and Regards,
Dhruva Gole
#4 lore raw

Re: [EXTERNAL] Re: [PATCH 1/2] arm: dts: k3-am625-sk: Add OSPI support

Quoted 12 lines · Dhruva Gole

Hi Tom,

Quoted 9 lines · Tom Rini
Quoted 6 lines · Dhruva Gole

Add DT nodes to enable S28HS512T OSPI flash on the SK board.

---
  arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
  arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 2 lines

What is the status of the non u-boot.dtsi portion of this patch with upstream Linux? Thanks.

In upstream, please refer to https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24

spi0 = &ospi0;

and pinmux is all done in a similar fashion as I have done in these patches.

The preferred way to do this then is to post a patch syncing the whole of the DTS files with a given upstream tag then, so that it's clear and also so the trees stay up to date. This also applies to the patches you posted today.

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH 1/2] arm: dts: k3-am625-sk: Add OSPI support

Quoted 18 lines · Tom Rini
Quoted 17 lines · Dhruva Gole

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 6 lines · Dhruva Gole

Add DT nodes to enable S28HS512T OSPI flash on the SK board.

---
   arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
   arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++

What is the status of the non u-boot.dtsi portion of this patch with upstream Linux? Thanks.

In upstream, please refer to https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24

Quoted 8 lines
Quoted 3 lines

spi0 = &ospi0;

and pinmux is all done in a similar fashion as I have done in these patches.

The preferred way to do this then is to post a patch syncing the whole of the DTS files with a given upstream tag then, so that it's clear and also so the trees stay up to date. This also applies to the patches you posted today.

Okay noted, I will be sending out a new series where I will sync up the DTS files with kernel upstream.

Quoted 1 line

Also kindly note that the series https://lore.kernel.org/u-boot/[email protected]/ supersedes this series.

I will also be re-spinning that series based on the suggestions given so far.

Signature · 2 lines
Thanks and Regards,
Dhruva Gole
#6 lore raw

PATCH 2/2 configs: am62x_evm_a53: Enable OSPI Flash support

In reply to Dhruva Gole

Set the necessary config options that help to build the necessary drivers that support spansion S28HS512T Flash

---
 configs/am62x_evm_a53_defconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)
configs/am62x_evm_a53_defconfig +13 -0
index 2c0bd4d2e10c..2a670449408f 100644
@@ -31,7 +31,11 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
 CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_DOMAIN=y
+# CONFIG_SPL_SPI_FLASH_TINY is not set
+CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_SYS_BOOTM_LEN=0x800000
 CONFIG_CMD_MMC=y
@@ -57,6 +61,12 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_SPL_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_AM654=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_S28HS512T=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
@@ -70,6 +80,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
 CONFIG_SOC_DEVICE_TI_K3=y
 CONFIG_SOC_TI=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_CADENCE_QSPI=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
Signature · 1 line
2.25.1