Skip to contentSkip to conversation

arm64: dts: qcom: sm8550: Add UFS host controller and phy nodes

PATCH Superseded Abel Vesa 3 participants 4 messages Jan 12, 2023

Subsystems (3)

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH v2 1/2 arm64: dts: qcom: sm8550: Add UFS host controller and phy nodes

Add UFS host controller and PHY nodes.

---

Changes since v1:
* dropped ufs_mem_phy_lanes child node, like Johan suggested
* addressed Konrad comments.

 arch/arm64/boot/dts/qcom/sm8550.dtsi | 78 ++++++++++++++++++++++++++--
 1 file changed, 75 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +75 -3
index 59756ec11564..d20b5fbcb2c3 100644
@@ -649,9 +649,9 @@ gcc: clock-controller@100000 {
 				 <0>,
 				 <0>,
 				 <0>,
-				 <0>,
-				 <0>,
-				 <0>,
+				 <&ufs_mem_phy 0>,
+				 <&ufs_mem_phy 1>,
+				 <&ufs_mem_phy 2>,
 				 <0>;
 		};
 
@@ -1571,6 +1571,78 @@ crypto: crypto@1de0000 {
 			interconnect-names = "memory";
 		};
 
+		ufs_mem_phy: phy@1d80000 {
+			compatible = "qcom,sm8550-qmp-ufs-phy";
+			reg = <0x0 0x01d80000 0x0 0x2000>;
+			clock-names = "ref", "qref";
+			clocks = <&gcc GCC_UFS_PHY_PHY_AUX_CLK>,
+				 <&tcsr TCSR_UFS_CLKREF_EN>;
+
+			power-domains = <&gcc UFS_MEM_PHY_GDSC>;
+
+			resets = <&ufs_mem_hc 0>;
+			reset-names = "ufsphy";
+
+			#address-cells = <2>;
+			#size-cells = <2>;
+
+			#phy-cells = <0>;
+
+			#clock-cells = <1>;
+
+			ranges;
+
+			status = "disabled";
+		};
+
+		ufs_mem_hc: ufshc@1d84000 {
+			compatible = "qcom,sm8550-ufshc", "qcom,ufshc",
+				     "jedec,ufs-2.0";
+			reg = <0x0 0x01d84000 0x0 0x3000>;
+			interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&ufs_mem_phy>;
+			phy-names = "ufsphy";
+			lanes-per-direction = <2>;
+			#reset-cells = <1>;
+			resets = <&gcc GCC_UFS_PHY_BCR>;
+			reset-names = "rst";
+
+			power-domains = <&gcc UFS_PHY_GDSC>;
+
+			iommus = <&apps_smmu 0x60 0x0>;
+
+			interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI1 0>,
+					<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_UFS_MEM_CFG 0>;
+
+			interconnect-names = "ufs-ddr", "cpu-ufs";
+			clock-names = "core_clk",
+				      "bus_aggr_clk",
+				      "iface_clk",
+				      "core_clk_unipro",
+				      "ref_clk",
+				      "tx_lane0_sync_clk",
+				      "rx_lane0_sync_clk",
+				      "rx_lane1_sync_clk";
+			clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
+				 <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
+				 <&gcc GCC_UFS_PHY_AHB_CLK>,
+				 <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
+				 <&rpmhcc RPMH_LN_BB_CLK3>,
+				 <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
+				 <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
+				 <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
+			freq-table-hz =
+				<75000000 300000000>,
+				<0 0>,
+				<0 0>,
+				<75000000 300000000>,
+				<100000000 403000000>,
+				<0 0>,
+				<0 0>,
+				<0 0>;
+			status = "disabled";
+		};
+
 		tcsr_mutex: hwlock@1f40000 {
 			compatible = "qcom,tcsr-mutex";
 			reg = <0 0x01f40000 0 0x20000>;
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 2/2 arm64: dts: qcom: sm8550-mtp: Add UFS host controller and PHY node

Enable UFS host controller and PHY node on SM8550 MTP board.

---

Changes since v1:
* moved status property last, like Konrad suggested

 arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/qcom/sm8550-mtp.dts +19 -0
index 8586e16d6079..81fcbdc6bdc4 100644
@@ -399,6 +399,25 @@ &uart7 {
 	status = "okay";
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+	vcc-supply = <&vreg_l17b_2p5>;
+	vcc-max-microamp = <1300000>;
+	vccq-supply = <&vreg_l1g_1p2>;
+	vccq-max-microamp = <1200000>;
+	vccq2-supply = <&vreg_l3g_1p2>;
+	vccq2-max-microamp = <100>;
+
+	status = "okay";
+};
+
+&ufs_mem_phy {
+	vdda-phy-supply = <&vreg_l1d_0p88>;
+	vdda-pll-supply = <&vreg_l3e_1p2>;
+
+	status = "okay";
+};
+
 &xo_board {
 	clock-frequency = <76800000>;
 };
Signature · 1 line
2.34.1
maintainer
#2 lore raw
In reply to Abel Vesa
Quoted 43 lines · Abel Vesa

Add UFS host controller and PHY nodes.

---

Changes since v1:
* dropped ufs_mem_phy_lanes child node, like Johan suggested
* addressed Konrad comments.

 arch/arm64/boot/dts/qcom/sm8550.dtsi | 78 ++++++++++++++++++++++++++--
 1 file changed, 75 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +13 -3
index 59756ec11564..d20b5fbcb2c3 100644
@@ -649,9 +649,9 @@ gcc: clock-controller@100000 {
 				 <0>,
 				 <0>,
 				 <0>,
-				 <0>,
-				 <0>,
-				 <0>,
+				 <&ufs_mem_phy 0>,
+				 <&ufs_mem_phy 1>,
+				 <&ufs_mem_phy 2>,
 				 <0>;
 		};
 
@@ -1571,6 +1571,78 @@ crypto: crypto@1de0000 {
 			interconnect-names = "memory";
 		};
 
+		ufs_mem_phy: phy@1d80000 {
+			compatible = "qcom,sm8550-qmp-ufs-phy";
+			reg = <0x0 0x01d80000 0x0 0x2000>;
+			clock-names = "ref", "qref";
+			clocks = <&gcc GCC_UFS_PHY_PHY_AUX_CLK>,
+				 <&tcsr TCSR_UFS_CLKREF_EN>;
+
+			power-domains = <&gcc UFS_MEM_PHY_GDSC>;
+
+			resets = <&ufs_mem_hc 0>;

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1593

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +10 -0
+			reset-names = "ufsphy";
+
+			#address-cells = <2>;
+			#size-cells = <2>;
+
+			#phy-cells = <0>;
+
+			#clock-cells = <1>;
+
+			ranges;

Isn't this a leftover from the older binding?

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1598

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +5 -0
+
+			status = "disabled";
+		};
+
+		ufs_mem_hc: ufshc@1d84000 {

ufs@ I believe.

Quoted 22 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +22 -0
+			compatible = "qcom,sm8550-ufshc", "qcom,ufshc",
+				     "jedec,ufs-2.0";
+			reg = <0x0 0x01d84000 0x0 0x3000>;
+			interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&ufs_mem_phy>;
+			phy-names = "ufsphy";
+			lanes-per-direction = <2>;
+			#reset-cells = <1>;
+			resets = <&gcc GCC_UFS_PHY_BCR>;
+			reset-names = "rst";
+
+			power-domains = <&gcc UFS_PHY_GDSC>;
+
+			iommus = <&apps_smmu 0x60 0x0>;
+
+			interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI1 0>,
+					<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_UFS_MEM_CFG 0>;
+
+			interconnect-names = "ufs-ddr", "cpu-ufs";
+			clock-names = "core_clk",
+				      "bus_aggr_clk",
+				      "iface_clk",

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1630

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +10 -0
+				      "core_clk_unipro",
+				      "ref_clk",
+				      "tx_lane0_sync_clk",
+				      "rx_lane0_sync_clk",
+				      "rx_lane1_sync_clk";
+			clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
+				 <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
+				 <&gcc GCC_UFS_PHY_AHB_CLK>,
+				 <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
+				 <&rpmhcc RPMH_LN_BB_CLK3>,

ref_clk here represents the refclk to the memory device, which I believe is what is the thing you have as <&tcsrcc TCSR_UFS_PAD_CLKREF_EN>.

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1635

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +5 -0
+				 <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
+				 <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
+				 <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
+			freq-table-hz =
+				<75000000 300000000>,

GCC_UFS_PHY_AXI_CLK requires SM8550_CX (UFS_PHY_GDSC) to be voted to nominal, so please ensure that this is done. (e.g. using required-opps)

Thanks,
Bjorn

Quoted 16 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +10 -0
+				<0 0>,
+				<0 0>,
+				<75000000 300000000>,
+				<100000000 403000000>,
+				<0 0>,
+				<0 0>,
+				<0 0>;
+			status = "disabled";
+		};
+
 		tcsr_mutex: hwlock@1f40000 {
 			compatible = "qcom,tcsr-mutex";
 			reg = <0 0x01f40000 0 0x20000>;
Signature · 1 line
2.34.1
#3 lore raw
In reply to Abel Vesa
Quoted 10 lines · Abel Vesa

Add UFS host controller and PHY nodes.

---

Changes since v1:
* dropped ufs_mem_phy_lanes child node, like Johan suggested
* addressed Konrad comments.

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1579

Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +6 -0
@@ -1571,6 +1571,78 @@ crypto: crypto@1de0000 {
 			interconnect-names = "memory";
 		};
 
+		ufs_mem_phy: phy@1d80000 {
+			compatible = "qcom,sm8550-qmp-ufs-phy";
+			reg = <0x0 0x01d80000 0x0 0x2000>;
+			clock-names = "ref", "qref";
+			clocks = <&gcc GCC_UFS_PHY_PHY_AUX_CLK>,
+				 <&tcsr TCSR_UFS_CLKREF_EN>;

So as I just mentioned elsewhere, this should probably be 'ref' and 'ref_aux' (in reverse order).

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1587

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +8 -0
+
+			power-domains = <&gcc UFS_MEM_PHY_GDSC>;
+
+			resets = <&ufs_mem_hc 0>;
+			reset-names = "ufsphy";
+
+			#address-cells = <2>;
+			#size-cells = <2>;

These two should not be here.

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1590

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +3 -0
+
+			#phy-cells = <0>;
+

You can drop the newline here.

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1591

Quoted 1 line
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -0
+			#clock-cells = <1>;

Could be moved above '#phy-cells' to have the provider cells nodes sorted alphabetically.

Review crypto: crypto@1de0000 { · line 1593

Quoted 2 lines
(quoted diff) +2 -0
+
+			ranges;

Drop this one too.

arch/arm64/boot/dts/qcom/sm8550.dtsi crypto: crypto@1de0000 { · line 1596

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +3 -0
+
+			status = "disabled";
+		};

Johan