arm64: qcom: sa8775p: add support for UFS
Subsystems (7)
cover arm64: qcom: sa8775p: add support for UFS
From: Bartosz Golaszewski <[email protected]>
Update relevant DT bindings, add new config to the driver and add UFS and PHY nodes to the .dtsi and enable them in the board .dts for sa8775p-ride.
Bartosz Golaszewski (5):
dt-bindings: ufs: qcom: add compatible for sa8775p
dt-bindings: phy: qmp-ufs: describe the UFS PHY for sa8775p
phy: qualcomm: phy-qcom-qmp-ufs: add definitions for sa8775p
arm64: dts: qcom: sa8775p: add UFS nodes
arm64: dts: qcom: sa8775p-ride: enable UFS
.../phy/qcom,sc8280xp-qmp-ufs-phy.yaml | 34 ++++++++++-- .../devicetree/bindings/ufs/qcom,ufs.yaml | 2 + arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 19 +++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 54 +++++++++++++++++++ drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 38 +++++++++++++ 5 files changed, 143 insertions(+), 4 deletions(-)
Signature · 1 line
2.37.2
PATCH 1/5 dt-bindings: ufs: qcom: add compatible for sa8775p
From: Bartosz Golaszewski <[email protected]>
Add the compatible string for the UFS on sa8775p platforms.
--- Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/ufs/qcom,ufs.yaml +2 -0
@@ -27,6 +27,7 @@ properties: - qcom,msm8996-ufshc - qcom,msm8998-ufshc - qcom,sc8280xp-ufshc + - qcom,sa8775p-ufshc - qcom,sdm845-ufshc - qcom,sm6350-ufshc - qcom,sm8150-ufshc
@@ -106,6 +107,7 @@ allOf: enum: - qcom,msm8998-ufshc - qcom,sc8280xp-ufshc + - qcom,sa8775p-ufshc - qcom,sm8250-ufshc - qcom,sm8350-ufshc - qcom,sm8450-ufshc
Signature · 7 lines
2.37.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 2/5 dt-bindings: phy: qmp-ufs: describe the UFS PHY for sa8775p
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Add a new compatible for the QMP UFS PHY found on sa8775p platforms and update the clocks property to accommodate three clocks.
--- .../phy/qcom,sc8280xp-qmp-ufs-phy.yaml | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +30 -4
@@ -16,6 +16,7 @@ description: properties: compatible: enum: + - qcom,sa8775p-qmp-ufs-phy - qcom,sc8280xp-qmp-ufs-phy - qcom,sm6125-qmp-ufs-phy - qcom,sm8550-qmp-ufs-phy
@@ -24,12 +25,12 @@ properties: maxItems: 1 clocks: - maxItems: 2 + minItems: 2 + maxItems: 3 clock-names: - items: - - const: ref - - const: ref_aux + minItems: 2 + maxItems: 3 power-domains: maxItems: 1
@@ -51,6 +52,31 @@ properties: "#phy-cells": const: 0 +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,sa8775p-qmp-ufs-phy + then: + properties: + clocks: + maxItems: 3 + clock-names: + items: + - const: ref + - const: ref_aux + - const: qref + else: + properties: + clocks: + maxItems: 2 + clock-names: + items: + - const: ref + - const: ref_aux + required: - compatible - reg
Signature · 1 line
2.37.2
PATCH 3/5 phy: qualcomm: phy-qcom-qmp-ufs: add definitions for sa8775p
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Add QMP PHY config for sa8775p and add support for the new compatible.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +38 -0
@@ -823,6 +823,41 @@ static const struct qmp_phy_cfg msm8996_ufsphy_cfg = { .no_pcs_sw_reset = true, }; + +static const struct qmp_phy_cfg sa8775p_ufsphy_cfg = { + .lanes =2 , + + .offsets = &qmp_ufs_offsets, + + .tbls = { + .serdes = sm8350_ufsphy_serdes, + .serdes_num =ARRAY_SIZE (sm8350_ufsphy_serdes), + .tx = sm8350_ufsphy_tx, + .tx_num =ARRAY_SIZE (sm8350_ufsphy_tx), + .rx = sm8350_ufsphy_rx, + .rx_num =ARRAY_SIZE (sm8350_ufsphy_rx), + .pcs = sm8350_ufsphy_pcs, + .pcs_num =ARRAY_SIZE (sm8350_ufsphy_pcs), + }, + .tbls_hs_b = { + .serdes = sm8350_ufsphy_hs_b_serdes, + .serdes_num =ARRAY_SIZE (sm8350_ufsphy_hs_b_serdes), + }, + .tbls_hs_g4 = { + .tx = sm8350_ufsphy_g4_tx, + .tx_num =ARRAY_SIZE (sm8350_ufsphy_g4_tx), + .rx = sm8350_ufsphy_g4_rx, + .rx_num =ARRAY_SIZE (sm8350_ufsphy_g4_rx), + .pcs = sm8350_ufsphy_g4_pcs, + .pcs_num =ARRAY_SIZE (sm8350_ufsphy_g4_pcs), + }, + .clk_list = sm8450_ufs_phy_clk_l, + .num_clks =ARRAY_SIZE (sm8450_ufs_phy_clk_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs =ARRAY_SIZE (qmp_phy_vreg_l), + .regs = ufsphy_v5_regs_layout, +}; +static const struct qmp_phy_cfg sc8280xp_ufsphy_cfg = { .lanes =2 ,
@@ -1542,6 +1577,9 @@ static const struct of_device_id qmp_ufs_of_match_table[] = { }, { .compatible = "qcom,msm8998-qmp-ufs-phy", .data = &sdm845_ufsphy_cfg, + }, { + .compatible = "qcom,sa8775p-qmp-ufs-phy", + .data = &sa8775p_ufsphy_cfg, }, { .compatible = "qcom,sc8180x-qmp-ufs-phy", .data = &sm8150_ufsphy_cfg,
Signature · 7 lines
2.37.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 5/5 arm64: dts: qcom: sa8775p-ride: enable UFS
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Enable the UFS and its PHY on sa8775p-ride.
--- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p-ride.dts +19 -0
@@ -5,6 +5,7 @@ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "sa8775p.dtsi"
@@ -20,6 +21,7 @@ aliases { serial2 = &uart17; i2c18 = &i2c18; spi16 = &spi16; + ufshc1 = &ufs_mem_hc; }; chosen {
@@ -426,6 +428,23 @@ &uart17 { status = "okay"; }; +&ufs_mem_hc { + reset-gpios = <&tlmm 149 GPIO_ACTIVE_LOW>; + vcc-supply = <&vreg_l8a>; + vcc-max-microamp = <1100000>; + vccq-supply = <&vreg_l4c>; + vccq-max-microamp = <1200000>; + + status = "okay"; +}; + +&ufs_mem_phy { + vdda-phy-supply = <&vreg_l4a>; + vdda-pll-supply = <&vreg_l1c>; + + status = "okay"; +}; + &xo_board_clk { clock-frequency = <38400000>; };
Signature · 7 lines
2.37.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 4/5 arm64: dts: qcom: sa8775p: add UFS nodes
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Add nodes for the UFS and its PHY on sa8775p platforms.
--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +54 -0
@@ -586,6 +586,60 @@ &clk_virt SLAVE_QUP_CORE_1 QCOM_ICC_TAG_ALWAYS>, }; }; + ufs_mem_hc: ufs@1d84000 { + compatible = "qcom,sa8775p-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>; + required-opps = <&rpmhpd_opp_nom>; + iommus = <&apps_smmu 0x100 0x0>; + 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_CXO_CLK>, + <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>, + <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>, + <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>; + 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"; + freq-table-hz = <75000000 300000000>, + <0 0>, + <0 0>, + <75000000 300000000>, + <0 0>, + <0 0>, + <0 0>, + <0 0>; + status = "disabled"; + }; + + ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sa8775p-qmp-ufs-phy"; + reg = <0x0 0x01d87000 0x0 0xe10>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, + <&gcc GCC_EDP_REF_CLKREF_EN>; + clock-names = "ref", "ref_aux", "qref"; + power-domains = <&gcc UFS_PHY_GDSC>; + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; + #phy-cells = <0>; + status = "disabled"; + }; + tcsr_mutex: hwlock@1f40000 { compatible = "qcom,tcsr-mutex"; reg = <0x0 0x01f40000 0x0 0x20000>;
Signature · 7 lines
2.37.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 1/5] dt-bindings: ufs: qcom: add compatible for sa8775p
In reply to Bartosz GolaszewskiQuoted 14 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Add the compatible string for the UFS on sa8775p platforms.
Signed-off-by Bartosz Golaszewski <[email protected]>--- Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+)Documentation/devicetree/bindings/ufs/qcom,ufs.yaml +0
-0
Documentation/devicetree/bindings/ufs/qcom,ufs.yaml properties: · line 30
Quoted 4 lines
Documentation/devicetree/bindings/ufs/qcom,ufs.yaml +1
-0@@ -27,6 +27,7 @@ properties: - qcom,msm8996-ufshc - qcom,msm8998-ufshc - qcom,sc8280xp-ufshc + - qcom,sa8775p-ufshc
Please keep the alphabetical order (also in your second hunk).
Best regards,
Krzysztof
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 2/5] dt-bindings: phy: qmp-ufs: describe the UFS PHY for sa8775p
In reply to Bartosz GolaszewskiQuoted 24 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Add a new compatible for the QMP UFS PHY found on sa8775p platforms and update the clocks property to accommodate three clocks.
Signed-off-by Bartosz Golaszewski <[email protected]>--- .../phy/qcom,sc8280xp-qmp-ufs-phy.yaml | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +1
-0@@ -16,6 +16,7 @@ description: properties: compatible: enum: + - qcom,sa8775p-qmp-ufs-phy - qcom,sc8280xp-qmp-ufs-phy - qcom,sm6125-qmp-ufs-phy - qcom,sm8550-qmp-ufs-phy@@ -24,12 +25,12 @@ properties: maxItems: 1
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 32
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +2
-4clocks: - maxItems: 2 + minItems: 2 + maxItems: 3 clock-names: - items: - - const: ref - - const: ref_aux
Keep it here and add qref. We want to encourage the same clocks everywhere it is possible. Otherwise people will add soon 'q_ref' or 'ref_q' for their variants as third clock.
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 32
Quoted 1 line
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +1
-0+ minItems: 2
With this.
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 33
Quoted 1 line
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +1
-0+ maxItems: 3
But without this.
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +3
-0power-domains: maxItems: 1@@ -51,6 +52,31 @@ properties: "#phy-cells": const: 0 +allOf: + - if: + properties:
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 67
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +10
-0+ compatible: + contains: + enum: + - qcom,sa8775p-qmp-ufs-phy + then: + properties: + clocks: + maxItems: 3 + clock-names: + items:
Instead maxItems: 3
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 76
Quoted 9 lines
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +9
-0+ - const: ref + - const: ref_aux + - const: qref + else: + properties: + clocks: + maxItems: 2 + clock-names: + items:
Instead maxItems: 2
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml properties: · line 82
Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml +3
-0+ - const: ref + - const: ref_aux + required: - compatible - reg
Best regards,
Krzysztof
Re: [PATCH 4/5] arm64: dts: qcom: sa8775p: add UFS nodes
In reply to Bartosz GolaszewskiQuoted 53 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Add nodes for the UFS and its PHY on sa8775p platforms.
Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)arch/arm64/boot/dts/qcom/sa8775p.dtsi +36
-0@@ -586,6 +586,60 @@ &clk_virt SLAVE_QUP_CORE_1 QCOM_ICC_TAG_ALWAYS>, }; }; + ufs_mem_hc: ufs@1d84000 { + compatible = "qcom,sa8775p-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>; + required-opps = <&rpmhpd_opp_nom>; + iommus = <&apps_smmu 0x100 0x0>; + 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_CXO_CLK>, + <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>, + <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>, + <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>; + 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"; + freq-table-hz = <75000000 300000000>, + <0 0>, + <0 0>, + <75000000 300000000>, + <0 0>, + <0 0>, + <0 0>,
arch/arm64/boot/dts/qcom/sa8775p.dtsi &clk_virt SLAVE_QUP_CORE_1 QCOM_ICC_TAG_ALWAYS>, · line 634
Quoted 10 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +10
-0+ <0 0>; + status = "disabled"; + }; + + ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sa8775p-qmp-ufs-phy"; + reg = <0x0 0x01d87000 0x0 0xe10>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, + <&gcc GCC_EDP_REF_CLKREF_EN>;
EDP? 0_o
Konrad
Quoted 11 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +8
-0+ clock-names = "ref", "ref_aux", "qref"; + power-domains = <&gcc UFS_PHY_GDSC>; + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; + #phy-cells = <0>; + status = "disabled"; + }; + tcsr_mutex: hwlock@1f40000 { compatible = "qcom,tcsr-mutex"; reg = <0x0 0x01f40000 0x0 0x20000>;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 5/5] arm64: dts: qcom: sa8775p-ride: enable UFS
In reply to Bartosz GolaszewskiQuoted 6 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Enable the UFS and its PHY on sa8775p-ride.
Signed-off-by Bartosz Golaszewski <[email protected]>---
Konrad
Quoted 47 lines
arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)arch/arm64/boot/dts/qcom/sa8775p-ride.dts +19
-0@@ -5,6 +5,7 @@ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "sa8775p.dtsi"@@ -20,6 +21,7 @@ aliases { serial2 = &uart17; i2c18 = &i2c18; spi16 = &spi16; + ufshc1 = &ufs_mem_hc; }; chosen {@@ -426,6 +428,23 @@ &uart17 { status = "okay"; }; +&ufs_mem_hc { + reset-gpios = <&tlmm 149 GPIO_ACTIVE_LOW>; + vcc-supply = <&vreg_l8a>; + vcc-max-microamp = <1100000>; + vccq-supply = <&vreg_l4c>; + vccq-max-microamp = <1200000>; + + status = "okay"; +}; + +&ufs_mem_phy { + vdda-phy-supply = <&vreg_l4a>; + vdda-pll-supply = <&vreg_l1c>; + + status = "okay"; +}; + &xo_board_clk { clock-frequency = <38400000>; };
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy