Skip to contentSkip to conversation

Add support for PCIe3 on x1e80100

PATCH Applied Qiang Yu 4 participants 17 messages Nov 1, 2024 – Nov 14, 2024

Subsystems (8)

v8 of 9 Applied Latest is v9 →

lore
Share & tools
lore

Qiang Yu

author
#0 lore raw

v8 cover Add support for PCIe3 on x1e80100

This series add support for PCIe3 on x1e80100.

PCIe3 needs additional set of clocks, regulators and new set of PCIe QMP PHY configuration compare other PCIe instances on x1e80100. Hence add required resource configuration and usage for PCIe3.

v7->v8:
1. Add Reviewed-by tags
2. Rephrase commit message and remove Fix tags
3. Add Synopsis IP revision and put ops_1_21_0 after ops_1_9_0.
4. Remove [PATCH v7 1/7] and [PATCH v7 4/7] as they were applied
5. Link to v7: https://lore.kernel.org/all/[email protected]/

v6->v7:
1. Add Acked-by and Reviewed-by tags
2. Use 70574511f3f ("PCI: qcom: Add support for SC8280XP") in Fixes tag
3. Keep minItem of interrupt as 8 in buindings
4. Reword commit msg
5. Remove [PATCH v6 5/8] clk: qcom: gcc-x1e80100: Fix halt_check for
pipediv2 clocks as it was applied
6. Link to v6: https://lore.kernel.org/linux-pci/[email protected]/

v5->v6:
1. Add Fixes tag
2. Split [PATCH v5 6/7] into two patches
3. Reword commit msg
4. Link to v5: https://lore.kernel.org/linux-pci/[email protected]/

v4->v5:
1. Add Reviewed-by tag
2. Expand and clarify usage of txz/rxz in commit message
3. Add comments that txz/rxz must be programmed before tx/rx
4. Change the sort order for phy register tbls
5. Use the order defined in struct qmp_phy_cfg_tbls for phy register tbls presented in x1e80100_qmp_gen4x8_pciephy_cfg
6. Add Fixes and CC stable tag
7. Fix ops for SC8280X and X1E80100
8. Document global interrupt in bindings
9. Link to v4: https://lore.kernel.org/all/[email protected]/

v3->v4:
1. Reword commit msg of [PATCH v3 5/6]
2. Drop opp-table property from qcom,pcie-sm8450.yaml
3. Add Reviewed-by tag
4. Link to v3: https://lore.kernel.org/all/[email protected]/

v2->v3:
1. Use 'Gen 4 x8' in commit msg
2. Move opp-table property to qcom,pcie-common.yaml
3. Add Reviewed-by tag
4. Add global interrupt and use GIC_SPI for the parent interrupt specifier
5. Use 0x0 in reg property and use pcie@ for pcie3 device node
6. Show different IP version v6.30 in commit msg
7. Add logic in controller driver to have new ops for x1e80100
8. Link to v2: https://lore.kernel.org/all/[email protected]/

v2->v1:
1. Squash [PATCH 1/8], [PATCH 2/8],[PATCH 3/8] into one patch and make the indentation consistent.
2. Put dts patch at the end of the patchset.
3. Put dt-binding patch at the first of the patchset.
4. Add a new patch where opp-table is added in dt-binding to avoid dtbs checking error.
5. Remove GCC_PCIE_3_AUX_CLK, RPMH_CXO_CLK, put in TCSR_PCIE_8L_CLKREF_EN
as ref.
6. Remove lane_broadcasting.
7. Add 64 bit bar, Remove GCC_PCIE_3_PIPE_CLK_SRC, GCC_CFG_NOC_PCIE_ANOC_SOUTH_AHB_CLK is changed to GCC_CFG_NOC_PCIE_ANOC_NORTH_AHB_CLK.
8. Add Reviewed-by tag.
9. Remove [PATCH 7/8], [PATCH 8/8].
10. Link to v1: https://lore.kernel.org/all/[email protected]/

Qiang Yu (5):
dt-bindings: PCI: qcom: Move OPP table to qcom,pcie-common.yaml
dt-bindings: PCI: qcom,pcie-x1e80100: Add 'global' interrupt
PCI: qcom: Remove BDF2SID mapping config for SC8280X family SoC
PCI: qcom: Disable ASPM L0s for X1E80100
arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

 .../bindings/pci/qcom,pcie-common.yaml        |   4 +
 .../bindings/pci/qcom,pcie-sm8450.yaml        |   4 -
 .../bindings/pci/qcom,pcie-x1e80100.yaml      |   9 +-
 arch/arm64/boot/dts/qcom/x1e80100.dtsi        | 204 +++++++++++++++++-
 drivers/pci/controller/dwc/pcie-qcom.c        |  14 +-
 5 files changed, 225 insertions(+), 10 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v8 1/5 dt-bindings: PCI: qcom: Move OPP table to qcom,pcie-common.yaml

OPP table is a generic property that is also required by other qcom platforms. Hence move this property to qcom,pcie-common.yaml so that PCIe on other qcom platforms is able to adjust power domain performance state and ICC peak bw according to PCIe gen speed and link width.

---
 Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml | 4 ++++
 Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml +4 -0
index e18900c41576..0480c58f7d99 100644
@@ -81,6 +81,10 @@ properties:
   vddpe-3v3-supply:
     description: PCIe endpoint power supply
 
+  operating-points-v2: true
+  opp-table:
+    type: object
+
 required:
   - reg
   - reg-names
Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml +0 -4
index 46bd59eefadb..6e0a6d8f0ed0 100644
@@ -70,10 +70,6 @@ properties:
       - const: msi7
       - const: global
 
-  operating-points-v2: true
-  opp-table:
-    type: object
-
   resets:
     maxItems: 1
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v8 2/5 dt-bindings: PCI: qcom,pcie-x1e80100: Add 'global' interrupt

In reply to Qiang Yu

Qcom PCIe RC controllers are capable of generating 'global' SPI interrupt to the host CPU. This interrupt can be used by the device driver to handle PCIe link specific events such as Link up and Link down, which give the driver a chance to start bus enumeration on its own when link is up and initiate link training if link goes to a bad state. The PCIe driver can still work without this interrupt but it will provide a nice user experience when device gets plugged and removed.

Hence, document it in the binding along with the existing MSI interrupts. Global interrupt is parsed as optional in driver, so adding it in bindings will not break the ABI.

---
 .../devicetree/bindings/pci/qcom,pcie-x1e80100.yaml      | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/qcom,pcie-x1e80100.yaml +6 -3
index a9db0a231563..257068a18264 100644
@@ -47,9 +47,10 @@ properties:
 
   interrupts:
     minItems: 8
-    maxItems: 8
+    maxItems: 9
 
   interrupt-names:
+    minItems: 8
     items:
       - const: msi0
       - const: msi1
@@ -59,6 +60,7 @@ properties:
       - const: msi5
       - const: msi6
       - const: msi7
+      - const: global
 
   resets:
     minItems: 1
@@ -130,9 +132,10 @@ examples:
                          <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
                          <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
                          <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
-                         <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+                         <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
             interrupt-names = "msi0", "msi1", "msi2", "msi3",
-                              "msi4", "msi5", "msi6", "msi7";
+                              "msi4", "msi5", "msi6", "msi7", "global";
             #interrupt-cells = <1>;
             interrupt-map-mask = <0 0 0 0x7>;
             interrupt-map = <0 0 0 1 &intc 0 0 0 149 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v8 3/5 PCI: qcom: Remove BDF2SID mapping config for SC8280X family SoC

In reply to Qiang Yu

The SC8280XP PCIe devicetree nodes do not specify an 'iommu-map' so the config_sid() callback is effectively a no-op. Hence introduce a new ops struct, namely ops_1_21_0 which is same as ops_1_9_0 except that it doesn't have config_sid() callback to clean it up.

---
 drivers/pci/controller/dwc/pcie-qcom.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +11 -1
index ef44a82be058..52e3d71028d8 100644
@@ -1364,6 +1364,16 @@ static const struct qcom_pcie_ops ops_1_9_0 = {
 	.config_sid = qcom_pcie_config_sid_1_9_0,
 };
 
+/* Qcom IP rev.: 1.21.0  Synopsys IP rev.: 5.60a */
+static const struct qcom_pcie_ops ops_1_21_0 = {
+	.get_resources = qcom_pcie_get_resources_2_7_0,
+	.init = qcom_pcie_init_2_7_0,
+	.post_init = qcom_pcie_post_init_2_7_0,
+	.host_post_init = qcom_pcie_host_post_init_2_7_0,
+	.deinit = qcom_pcie_deinit_2_7_0,
+	.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
+};
+
 /* Qcom IP rev.: 2.9.0  Synopsys IP rev.: 5.00a */
 static const struct qcom_pcie_ops ops_2_9_0 = {
 	.get_resources = qcom_pcie_get_resources_2_9_0,
@@ -1411,7 +1421,7 @@ static const struct qcom_pcie_cfg cfg_2_9_0 = {
 };
 
 static const struct qcom_pcie_cfg cfg_sc8280xp = {
-	.ops = &ops_1_9_0,
+	.ops = &ops_1_21_0,
 	.no_l0s = true,
 };
 
Signature · 1 line
2.34.1
Reviewed-by on v8 3/5
#4 lore raw

Re: [PATCH v8 3/5] PCI: qcom: Remove BDF2SID mapping config for SC8280X family SoC

Quoted 2 lines · Qiang Yu

The SC8280XP PCIe devicetree nodes do not specify an 'iommu-map' so the config_sid() callback is effectively a no-op. Hence introduce a new ops

Would have been good to say something about why there are no 'iommu-map' properties on sc8280xp (e.g. since it uses an SMMUv3) as Bjorn suggested.

Quoted 6 lines

struct, namely ops_1_21_0 which is same as ops_1_9_0 except that it doesn't have config_sid() callback to clean it up.

I see that this patch has been picked up now. The above is already much better and I guess this is good enough for now:

#5 lore raw

Re: [PATCH v8 3/5] PCI: qcom: Remove BDF2SID mapping config for SC8280X family SoC

Hello,

[...]

Quoted 3 lines

Would have been good to say something about why there are no 'iommu-map' properties on sc8280xp (e.g. since it uses an SMMUv3) as Bjorn suggested.

Happy to update the commit log directly if there is a consensus about how the final wording should look like.

Quoted 11 lines
Quoted 6 lines

struct, namely ops_1_21_0 which is same as ops_1_9_0 except that it doesn't have config_sid() callback to clean it up.

I see that this patch has been picked up now. The above is already much better and I guess this is good enough for now:

Added. Thank you!

Krzysztof

author
#6 lore raw

PATCH v8 4/5 PCI: qcom: Disable ASPM L0s for X1E80100

In reply to Qiang Yu

Currently, the cfg_1_9_0 which is being used for X1E80100 doesn't disable ASPM L0s. However, hardware team recommends to disable L0s as the PHY init sequence is not tuned support L0s. Hence reuse cfg_sc8280xp for X1E80100.

Note that the config_sid() callback is not present in cfg_sc8280xp, don't concern about this because config_sid() callback is originally a no-op for X1E80100.

---
 drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
index 52e3d71028d8..16af237663ec 100644
@@ -1853,7 +1853,7 @@ static const struct of_device_id qcom_pcie_match[] = {
 	{ .compatible = "qcom,pcie-sm8450-pcie0", .data = &cfg_1_9_0 },
 	{ .compatible = "qcom,pcie-sm8450-pcie1", .data = &cfg_1_9_0 },
 	{ .compatible = "qcom,pcie-sm8550", .data = &cfg_1_9_0 },
-	{ .compatible = "qcom,pcie-x1e80100", .data = &cfg_1_9_0 },
+	{ .compatible = "qcom,pcie-x1e80100", .data = &cfg_sc8280xp },
 	{ }
 };
 
Signature · 1 line
2.34.1
Reviewed-by on v8 4/5
#7 lore raw

Re: [PATCH v8 4/5] PCI: qcom: Disable ASPM L0s for X1E80100

Quoted 11 lines · Qiang Yu

Currently, the cfg_1_9_0 which is being used for X1E80100 doesn't disable ASPM L0s. However, hardware team recommends to disable L0s as the PHY init sequence is not tuned support L0s. Hence reuse cfg_sc8280xp for X1E80100.

Note that the config_sid() callback is not present in cfg_sc8280xp, don't concern about this because config_sid() callback is originally a no-op for X1E80100.

This one should also have been marked for backporting:

Fixes 6d0c39324c5f ("PCI: qcom: Add X1E80100 PCIe support")

Looks much better now either way:

#8 lore raw

Re: [PATCH v8 4/5] PCI: qcom: Disable ASPM L0s for X1E80100

Hello,

[...]

Quoted 4 lines

This one should also have been marked for backporting:

Fixes 6d0c39324c5f ("PCI: qcom: Add X1E80100 PCIe support")

Added.

Quoted 3 lines

Looks much better now either way:

Also added. Thank you!

Krzysztof

author
#9 lore raw

PATCH v8 5/5 arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

In reply to Qiang Yu

Describe PCIe3 controller and PHY. Also add required system resources like regulators, clocks, interrupts and registers configuration for PCIe3.

---
 arch/arm64/boot/dts/qcom/x1e80100.dtsi | 204 ++++++++++++++++++++++++-
 1 file changed, 203 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/x1e80100.dtsi +203 -1
index 99f8bee10a38..c48fb505fb32 100644
@@ -743,7 +743,7 @@ gcc: clock-controller@100000 {
 
 			clocks = <&bi_tcxo_div2>,
 				 <&sleep_clk>,
-				 <0>,
+				 <&pcie3_phy>,
 				 <&pcie4_phy>,
 				 <&pcie5_phy>,
 				 <&pcie6a_phy>,
@@ -2906,6 +2906,208 @@ mmss_noc: interconnect@1780000 {
 			#interconnect-cells = <2>;
 		};
 
+		pcie3: pcie@1bd0000 {
+			device_type = "pci";
+			compatible = "qcom,pcie-x1e80100";
+			reg = <0x0 0x01bd0000 0x0 0x3000>,
+			      <0x0 0x78000000 0x0 0xf1d>,
+			      <0x0 0x78000f40 0x0 0xa8>,
+			      <0x0 0x78001000 0x0 0x1000>,
+			      <0x0 0x78100000 0x0 0x100000>,
+			      <0x0 0x01bd3000 0x0 0x1000>;
+			reg-names = "parf",
+				    "dbi",
+				    "elbi",
+				    "atu",
+				    "config",
+				    "mhi";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+				 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,
+				 <0x03000000 0x7 0x40000000 0x7 0x40000000 0x0 0x40000000>;
+			bus-range = <0x00 0xff>;
+
+			dma-coherent;
+
+			linux,pci-domain = <3>;
+			num-lanes = <8>;
+
+			interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 769 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 836 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 671 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "msi0",
+					  "msi1",
+					  "msi2",
+					  "msi3",
+					  "msi4",
+					  "msi5",
+					  "msi6",
+					  "msi7",
+					  "global";
+
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0x7>;
+			interrupt-map = <0 0 0 1 &intc 0 0 GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 2 &intc 0 0 GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 3 &intc 0 0 GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 4 &intc 0 0 GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
+
+			clocks = <&gcc GCC_PCIE_3_AUX_CLK>,
+				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
+				 <&gcc GCC_PCIE_3_MSTR_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_Q2A_AXI_CLK>,
+				 <&gcc GCC_CFG_NOC_PCIE_ANOC_NORTH_AHB_CLK>,
+				 <&gcc GCC_CNOC_PCIE_NORTH_SF_AXI_CLK>;
+			clock-names = "aux",
+				      "cfg",
+				      "bus_master",
+				      "bus_slave",
+				      "slave_q2a",
+				      "noc_aggr",
+				      "cnoc_sf_axi";
+
+			assigned-clocks = <&gcc GCC_PCIE_3_AUX_CLK>;
+			assigned-clock-rates = <19200000>;
+
+			interconnects = <&pcie_south_anoc MASTER_PCIE_3 QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+					 &cnoc_main SLAVE_PCIE_3 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "pcie-mem",
+					     "cpu-pcie";
+
+			resets = <&gcc GCC_PCIE_3_BCR>,
+				 <&gcc GCC_PCIE_3_LINK_DOWN_BCR>;
+			reset-names = "pci",
+				      "link_down";
+
+			power-domains = <&gcc GCC_PCIE_3_GDSC>;
+
+			phys = <&pcie3_phy>;
+			phy-names = "pciephy";
+
+			operating-points-v2 = <&pcie3_opp_table>;
+
+			status = "disabled";
+
+			pcie3_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				/* GEN 1 x1 */
+				opp-2500000 {
+					opp-hz = /bits/ 64 <2500000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+					opp-peak-kBps = <250000 1>;
+				};
+
+				/* GEN 1 x2 and GEN 2 x1 */
+				opp-5000000 {
+					opp-hz = /bits/ 64 <5000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+					opp-peak-kBps = <500000 1>;
+				};
+
+				/* GEN 1 x4 and GEN 2 x2 */
+				opp-10000000 {
+					opp-hz = /bits/ 64 <10000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+					opp-peak-kBps = <1000000 1>;
+				};
+
+				/* GEN 1 x8 and GEN 2 x4 */
+				opp-20000000 {
+					opp-hz = /bits/ 64 <20000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+					opp-peak-kBps = <2000000 1>;
+				};
+
+				/* GEN 2 x8 */
+				opp-40000000 {
+					opp-hz = /bits/ 64 <40000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+					opp-peak-kBps = <4000000 1>;
+				};
+
+				/* GEN 3 x1 */
+				opp-8000000 {
+					opp-hz = /bits/ 64 <8000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+					opp-peak-kBps = <984500 1>;
+				};
+
+				/* GEN 3 x2 and GEN 4 x1 */
+				opp-16000000 {
+					opp-hz = /bits/ 64 <16000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+					opp-peak-kBps = <1969000 1>;
+				};
+
+				/* GEN 3 x4 and GEN 4 x2 */
+				opp-32000000 {
+					opp-hz = /bits/ 64 <32000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+					opp-peak-kBps = <3938000 1>;
+				};
+
+				/* GEN 3 x8 and GEN 4 x4 */
+				opp-64000000 {
+					opp-hz = /bits/ 64 <64000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+					opp-peak-kBps = <7876000 1>;
+				};
+
+				/* GEN 4 x8 */
+				opp-128000000 {
+					opp-hz = /bits/ 64 <128000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+					opp-peak-kBps = <15753000 1>;
+				};
+			};
+		};
+
+		pcie3_phy: phy@1be0000 {
+			compatible = "qcom,x1e80100-qmp-gen4x8-pcie-phy";
+			reg = <0 0x01be0000 0 0x10000>;
+
+			clocks = <&gcc GCC_PCIE_3_PHY_AUX_CLK>,
+				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
+				 <&tcsr TCSR_PCIE_8L_CLKREF_EN>,
+				 <&gcc GCC_PCIE_3_PHY_RCHNG_CLK>,
+				 <&gcc GCC_PCIE_3_PIPE_CLK>,
+				 <&gcc GCC_PCIE_3_PIPEDIV2_CLK>;
+			clock-names = "aux",
+				      "cfg_ahb",
+				      "ref",
+				      "rchng",
+				      "pipe",
+				      "pipediv2";
+
+			resets = <&gcc GCC_PCIE_3_PHY_BCR>,
+				 <&gcc GCC_PCIE_3_NOCSR_COM_PHY_BCR>;
+			reset-names = "phy",
+				      "phy_nocsr";
+
+			assigned-clocks = <&gcc GCC_PCIE_3_PHY_RCHNG_CLK>;
+			assigned-clock-rates = <100000000>;
+
+			power-domains = <&gcc GCC_PCIE_3_PHY_GDSC>;
+
+			#clock-cells = <0>;
+			clock-output-names = "pcie3_pipe_clk";
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
 		pcie6a: pci@1bf8000 {
 			device_type = "pci";
 			compatible = "qcom,pcie-x1e80100";
Signature · 1 line
2.34.1
#10 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 17 lines · Qiang Yu

Describe PCIe3 controller and PHY. Also add required system resources like regulators, clocks, interrupts and registers configuration for PCIe3.

arch/arm64/boot/dts/qcom/x1e80100.dtsi +9 -0
+		pcie3: pcie@1bd0000 {
+			device_type = "pci";
+			compatible = "qcom,pcie-x1e80100";
+			reg = <0x0 0x01bd0000 0x0 0x3000>,
+			      <0x0 0x78000000 0x0 0xf1d>,
+			      <0x0 0x78000f40 0x0 0xa8>,
+			      <0x0 0x78001000 0x0 0x1000>,
+			      <0x0 0x78100000 0x0 0x100000>,
+			      <0x0 0x01bd3000 0x0 0x1000>;

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2927

Quoted 10 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +10 -0
+			reg-names = "parf",
+				    "dbi",
+				    "elbi",
+				    "atu",
+				    "config",
+				    "mhi";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+				 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

	https://lore.kernel.org/lkml/[email protected]/
Quoted 12 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +11 -0
+				 <0x03000000 0x7 0x40000000 0x7 0x40000000 0x0 0x40000000>;
+			bus-range = <0x00 0xff>;
 
+			clocks = <&gcc GCC_PCIE_3_AUX_CLK>,
+				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
+				 <&gcc GCC_PCIE_3_MSTR_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_Q2A_AXI_CLK>,
+				 <&gcc GCC_CFG_NOC_PCIE_ANOC_NORTH_AHB_CLK>,
+				 <&gcc GCC_CNOC_PCIE_NORTH_SF_AXI_CLK>;
+			clock-names = "aux",
+				      "cfg",

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2980

Quoted 10 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +10 -0
+				      "bus_master",
+				      "bus_slave",
+				      "slave_q2a",
+				      "noc_aggr",
+				      "cnoc_sf_axi";
+
+			assigned-clocks = <&gcc GCC_PCIE_3_AUX_CLK>;
+			assigned-clock-rates = <19200000>;
+
+			interconnects = <&pcie_south_anoc MASTER_PCIE_3 QCOM_ICC_TAG_ALWAYS

This should be &pcie_north_anoc

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2985

Quoted 5 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +5 -0
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+					 &cnoc_main SLAVE_PCIE_3 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "pcie-mem",
+					     "cpu-pcie";

With the above addressed, feel free to keep my Reviewed-by tag.

Johan

author
#11 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 31 lines · Johan Hovold
Quoted 17 lines · Qiang Yu

Describe PCIe3 controller and PHY. Also add required system resources like regulators, clocks, interrupts and registers configuration for PCIe3.

arch/arm64/boot/dts/qcom/x1e80100.dtsi +9 -0
+		pcie3: pcie@1bd0000 {
+			device_type = "pci";
+			compatible = "qcom,pcie-x1e80100";
+			reg = <0x0 0x01bd0000 0x0 0x3000>,
+			      <0x0 0x78000000 0x0 0xf1d>,
+			      <0x0 0x78000f40 0x0 0xa8>,
+			      <0x0 0x78001000 0x0 0x1000>,
+			      <0x0 0x78100000 0x0 0x100000>,
+			      <0x0 0x01bd3000 0x0 0x1000>;

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2927

Quoted 10 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +10 -0
+			reg-names = "parf",
+				    "dbi",
+				    "elbi",
+				    "atu",
+				    "config",
+				    "mhi";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+				 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

Quoted 1 line
	https://lore.kernel.org/lkml/[email protected]/

From memory maps, region of PCIe3 is 64MB, the size here is correct.

Thanks,
Qiang Yu

Quoted 32 lines
Quoted 12 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +11 -0
+				 <0x03000000 0x7 0x40000000 0x7 0x40000000 0x0 0x40000000>;
+			bus-range = <0x00 0xff>;
+			clocks = <&gcc GCC_PCIE_3_AUX_CLK>,
+				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
+				 <&gcc GCC_PCIE_3_MSTR_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_AXI_CLK>,
+				 <&gcc GCC_PCIE_3_SLV_Q2A_AXI_CLK>,
+				 <&gcc GCC_CFG_NOC_PCIE_ANOC_NORTH_AHB_CLK>,
+				 <&gcc GCC_CNOC_PCIE_NORTH_SF_AXI_CLK>;
+			clock-names = "aux",
+				      "cfg",

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2980

Quoted 10 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +10 -0
+				      "bus_master",
+				      "bus_slave",
+				      "slave_q2a",
+				      "noc_aggr",
+				      "cnoc_sf_axi";
+
+			assigned-clocks = <&gcc GCC_PCIE_3_AUX_CLK>;
+			assigned-clock-rates = <19200000>;
+
+			interconnects = <&pcie_south_anoc MASTER_PCIE_3 QCOM_ICC_TAG_ALWAYS

This should be &pcie_north_anoc

arch/arm64/boot/dts/qcom/x1e80100.dtsi mmss_noc: interconnect@1780000 { · line 2985

Quoted 5 lines
arch/arm64/boot/dts/qcom/x1e80100.dtsi +5 -0
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+					 &cnoc_main SLAVE_PCIE_3 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "pcie-mem",
+					     "cpu-pcie";

With the above addressed, feel free to keep my Reviewed-by tag.

Johan

author
#12 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 31 lines · Qiang Yu
Quoted 29 lines · Johan Hovold
Quoted 28 lines · Qiang Yu

Describe PCIe3 controller and PHY. Also add required system resources like regulators, clocks, interrupts and registers configuration for PCIe3.

+        pcie3: pcie@1bd0000 {
+            device_type = "pci";
+            compatible = "qcom,pcie-x1e80100";
+            reg = <0x0 0x01bd0000 0x0 0x3000>,
+                  <0x0 0x78000000 0x0 0xf1d>,
+                  <0x0 0x78000f40 0x0 0xa8>,
+                  <0x0 0x78001000 0x0 0x1000>,
+                  <0x0 0x78100000 0x0 0x100000>,
+                  <0x0 0x01bd3000 0x0 0x1000>;
+            reg-names = "parf",
+                    "dbi",
+                    "elbi",
+                    "atu",
+                    "config",
+                    "mhi";
+            #address-cells = <3>;
+            #size-cells = <2>;
+            ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+                 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Quoted 4 lines
Quoted 4 lines

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

    https://lore.kernel.org/lkml/[email protected]/

BTW, regions of PCIe6a, PCIe4, PCIe5 are 64MB, 32MB, 32MB, respectively. Why range size is set to 0x1d00000 for PCIe6a, any issue is reported on PCIe6a?

Thanks,
Qiang Yu

Quoted 38 lines

From memory maps, region of PCIe3 is 64MB, the size here is correct.

Thanks,
Qiang Yu

Quoted 34 lines
Quoted 23 lines

+                 <0x03000000 0x7 0x40000000 0x7 0x40000000 0x0 0x40000000>;
+            bus-range = <0x00 0xff>;
+            clocks = <&gcc GCC_PCIE_3_AUX_CLK>,
+                 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
+                 <&gcc GCC_PCIE_3_MSTR_AXI_CLK>,
+                 <&gcc GCC_PCIE_3_SLV_AXI_CLK>,
+                 <&gcc GCC_PCIE_3_SLV_Q2A_AXI_CLK>, +                 <&gcc GCC_CFG_NOC_PCIE_ANOC_NORTH_AHB_CLK>, +                 <&gcc GCC_CNOC_PCIE_NORTH_SF_AXI_CLK>; +            clock-names = "aux",
+                      "cfg",
+                      "bus_master",
+                      "bus_slave",
+                      "slave_q2a",
+                      "noc_aggr",
+                      "cnoc_sf_axi";

arch/arm64/boot/dts/qcom/x1e80100.dtsi +5 -0
+
+            assigned-clocks = <&gcc GCC_PCIE_3_AUX_CLK>;
+            assigned-clock-rates = <19200000>;
+
+            interconnects = <&pcie_south_anoc MASTER_PCIE_3 
Quoted 1 line

QCOM_ICC_TAG_ALWAYS

This should be &pcie_north_anoc

Quoted 5 lines

+                     &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, +                    <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS +                     &cnoc_main SLAVE_PCIE_3 QCOM_ICC_TAG_ALWAYS>; +            interconnect-names = "pcie-mem",
+                         "cpu-pcie";

With the above addressed, feel free to keep my Reviewed-by tag.

Johan

#13 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 9 lines · Qiang Yu
Quoted 7 lines · Qiang Yu
Quoted 6 lines · Johan Hovold
Quoted 4 lines · Qiang Yu

+            ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+                 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

    https://lore.kernel.org/lkml/[email protected]/

BTW, regions of PCIe6a, PCIe4, PCIe5 are 64MB, 32MB, 32MB, respectively. Why range size is set to 0x1d00000 for PCIe6a, any issue is reported on PCIe6a?

Thanks for checking. It seems the patch linked to above was broken for PCIe6a then.

We did see PCIe5 probe breaking due to the overlap with PCIe4 but the patch predates PCIe5 support being posted and merged so it was probably just based on inspection.

Could you send a fix for PCIe6a?

Johan

author
#14 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 15 lines · Johan Hovold
Quoted 7 lines · Qiang Yu
Quoted 6 lines · Qiang Yu
Quoted 5 lines · Johan Hovold
Quoted 4 lines · Qiang Yu

+            ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+                 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

    https://lore.kernel.org/lkml/[email protected]/

BTW, regions of PCIe6a, PCIe4, PCIe5 are 64MB, 32MB, 32MB, respectively. Why range size is set to 0x1d00000 for PCIe6a, any issue is reported on PCIe6a?

Quoted 8 lines

Thanks for checking. It seems the patch linked to above was broken for PCIe6a then.

We did see PCIe5 probe breaking due to the overlap with PCIe4 but the patch predates PCIe5 support being posted and merged so it was probably just based on inspection.

Could you send a fix for PCIe6a?

Sure, will send the fix.

Thanks,
Qiang Yu

Quoted 2 lines

Johan

#15 lore raw

Re: [PATCH v8 5/5] arm64: dts: qcom: x1e80100: Add support for PCIe3 on x1e80100

Quoted 20 lines · Qiang Yu
Quoted 18 lines · Johan Hovold
Quoted 7 lines · Qiang Yu
Quoted 6 lines · Qiang Yu
Quoted 5 lines · Johan Hovold
Quoted 4 lines · Qiang Yu

+            ranges = <0x01000000 0x0 0x00000000 0x0 0x78200000 0x0 0x100000>,
+                 <0x02000000 0x0 0x78300000 0x0 0x78300000 0x0 0x3d00000>,

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

Can you double check the size here so that it is indeed correct and not just copied from the other nodes which initially got it wrong:

     https://lore.kernel.org/lkml/[email protected]/

BTW, regions of PCIe6a, PCIe4, PCIe5 are 64MB, 32MB, 32MB, respectively. Why range size is set to 0x1d00000 for PCIe6a, any issue is reported on PCIe6a?

Thanks for checking. It seems the patch linked to above was broken for PCIe6a then.

Quoted 6 lines
Quoted 5 lines

We did see PCIe5 probe breaking due to the overlap with PCIe4 but the patch predates PCIe5 support being posted and merged so it was probably just based on inspection.

Could you send a fix for PCIe6a?

Sure, will send the fix.

So the patch I posted made it match the DSDT/Windows state. I assumed there must have been something wrong as docs suggested the value that you did.

But both work. In case any issues pop up, we can revisit this.

Konrad

#16 lore raw
In reply to Qiang Yu
Quoted 5 lines

This series add support for PCIe3 on x1e80100.

PCIe3 needs additional set of clocks, regulators and new set of PCIe QMP PHY configuration compare other PCIe instances on x1e80100. Hence add required resource configuration and usage for PCIe3.

Applied to controller/qcom, thank you!

[01/04] dt-bindings: PCI: qcom: Move OPP table to qcom,pcie-common.yaml

        https://git.kernel.org/pci/pci/c/39a06b55df6c

[02/04] dt-bindings: PCI: qcom,pcie-x1e80100: Add 'global' interrupt

        https://git.kernel.org/pci/pci/c/66dc205962c5

[03/04] PCI: qcom: Remove BDF2SID mapping config for SC8280X family SoC

        https://git.kernel.org/pci/pci/c/66cc06169fcf

[04/04] PCI: qcom: Disable ASPM L0s for X1E80100

        https://git.kernel.org/pci/pci/c/fc69fb202beb

	Krzysztof