Skip to contentSkip to conversation

arm64: dts: ti: k3-j784s4: Add UFS support

PATCH Superseded Udit Kumar 3 participants 5 messages Jul 25, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Udit Kumar

author
#0 lore raw

cover arm64: dts: ti: k3-j784s4: Add UFS support

This patch series adds UFS support for J784S4 SOC, UFS is kept disabled at SOC level, and enabled in EVM where UFS flash is present.

This patch is tested by enabling below configs on top of defconfig CONFIG_SCSI_UFS_BSG=y
CONFIG_SCSI_UFS_CDNS_PLATFORM=y CONFIG_SCSI_UFS_TI_J721E=y

Test logs
https://gist.github.com/uditkumarti/ab188e4b433058ae86734cd46eff7d94

Udit Kumar (2):
arm64: dts: ti: k3-j784s4-main: Add DT node for UFS
arm64: dts: ti: k3-j784s4-evm: Add Support for UFS peripheral

 arch/arm64/boot/dts/ti/k3-j784s4-evm.dts   |  4 ++++
 arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 24 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/2 arm64: dts: ti: k3-j784s4-main: Add DT node for UFS

This patch adds UFS support present in J784S4 SOC.

UFS is documentend in J784S4 TRM[1]
Section 12.3.7 'Universal Flash Storage (UFS) Interface'

[1] http://www.ti.com/lit/zip/spruj52

---
 arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +24 -0
index 11f163e5cadf..f1db1ca5d6b1 100644
@@ -1370,6 +1370,30 @@ main_spi7: spi@2170000 {
 		status = "disabled";
 	};
 
+	ufs_wrapper: ufs-wrapper@4e80000 {
+		compatible = "ti,j721e-ufs";
+		reg = <0x0 0x4e80000 0x0 0x100>;
+		power-domains = <&k3_pds 387 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 387 3>;
+		assigned-clocks = <&k3_clks 387 3>;
+		assigned-clock-parents = <&k3_clks 387 6>;
+		ranges;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		status = "disabled";
+
+		ufs@4e84000 {
+			compatible = "cdns,ufshc-m31-16nm", "jedec,ufs-2.0";
+			reg = <0x0 0x4e84000 0x0 0x10000>;
+			interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+			freq-table-hz = <250000000 250000000>, <19200000 19200000>,
+					<19200000 19200000>;
+			clocks = <&k3_clks 387 1>, <&k3_clks 387 3>, <&k3_clks 387 3>;
+			clock-names = "core_clk", "phy_clk", "ref_clk";
+			dma-coherent;
+		};
+	};
+
 	main_r5fss0: r5fss@5c00000 {
 		compatible = "ti,j721s2-r5fss";
 		ti,cluster-mode = <1>;
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 2/2 arm64: dts: ti: k3-j784s4-evm: Add Support for UFS peripheral

In reply to Udit Kumar

J784S4 EVM board has 32GB Non-Volatile UFS Memory. So enabling UFS at board level.

UFS flash details are documented in board data sheet[1] Section 1.2 Key Features and Interfaces.

[1] https://www.ti.com/lit/pdf/spruj62

---
 arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +4 -0
index 7ad152a1b90f..1e38a8f1bec5 100644
@@ -430,6 +430,10 @@ &main_uart8 {
 	pinctrl-0 = <&main_uart8_pins_default>;
 };
 
+&ufs_wrapper {
+	status = "okay";
+};
+
 &fss {
 	status = "okay";
 };
Signature · 1 line
2.34.1
Tested-by on v1 2/2
#4 lore raw

RE: [PATCH 2/2] arm64: dts: ti: k3-j784s4-evm: Add Support for UFS peripheral

Quoted 28 lines · On Tue, 25 Jul 2023 at 11:08 Udit Kumar <[email protected]> wrote:

J784S4 EVM board has 32GB Non-Volatile UFS Memory. So enabling UFS at board level.

UFS flash details are documented in board data sheet[1] Section 1.2 Key Features and Interfaces.

[1] https://www.ti.com/lit/pdf/spruj62

---
 arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +4 -1
index 7ad152a1b90f..1e38a8f1bec5 100644
@@ -430,6 +430,10 @@ &main_uart8 {
        pinctrl-0 = <&main_uart8_pins_default>;  };
 
+&ufs_wrapper {
+       status = "okay";
+};
+
 &fss {
        status = "okay";
 };
--
Quoted 1 line

2.34.1

Regards,
Wenle

#2 lore raw

Re: [PATCH 1/2] arm64: dts: ti: k3-j784s4-main: Add DT node for UFS

In reply to Udit Kumar

Hi Udit

Minor nits inline:

Quoted 1 line · Udit Kumar

This patch adds UFS support present in J784S4 SOC.

"This patch" perhaps is redundant

Quoted 2 lines

UFS is documentend in J784S4 TRM[1]

s/documentend/documented

Quoted 15 lines

Section 12.3.7 'Universal Flash Storage (UFS) Interface'

[1] http://www.ti.com/lit/zip/spruj52

---
 arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +0 -0
index 11f163e5cadf..f1db1ca5d6b1 100644

arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi main_spi7: spi@2170000 { · line 1375

Quoted 6 lines
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +3 -0
@@ -1370,6 +1370,30 @@ main_spi7: spi@2170000 {
 		status = "disabled";
 	};
 
+	ufs_wrapper: ufs-wrapper@4e80000 {
+		compatible = "ti,j721e-ufs";
+		reg = <0x0 0x4e80000 0x0 0x100>;

Inline with rest of the file please use 0x00

		reg = <0x00 0x4e80000 0x00 0x100>;

arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi main_spi7: spi@2170000 { · line 1387

Quoted 12 lines
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +12 -0
+		power-domains = <&k3_pds 387 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 387 3>;
+		assigned-clocks = <&k3_clks 387 3>;
+		assigned-clock-parents = <&k3_clks 387 6>;
+		ranges;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		status = "disabled";
+
+		ufs@4e84000 {
+			compatible = "cdns,ufshc-m31-16nm", "jedec,ufs-2.0";
+			reg = <0x0 0x4e84000 0x0 0x10000>;

Same here or perhaps use ranges in the parent node?

Quoted 12 lines
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +9 -0
+			interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+			freq-table-hz = <250000000 250000000>, <19200000 19200000>,
+					<19200000 19200000>;
+			clocks = <&k3_clks 387 1>, <&k3_clks 387 3>, <&k3_clks 387 3>;
+			clock-names = "core_clk", "phy_clk", "ref_clk";
+			dma-coherent;
+		};
+	};
+
 	main_r5fss0: r5fss@5c00000 {
 		compatible = "ti,j721s2-r5fss";
 		ti,cluster-mode = <1>;
Signature · 2 lines
Regards
Vignesh