Add PCIe support for IPQ9574
Subsystems (8)
v5 cover Add PCIe support for IPQ9574
This series adds support for enabling the PCIe host devices (PCIe0, PCIe1, PCIe2, PCIe3) found on IPQ9574 platform.
The PCIe0 & PCIe1 are 1-lane Gen3 host and PCIe2 & PCIe3
are 2-lane Gen3 host.
[V5]
Change logs are added to the respective patches
This series depends on the below series which adds support for
Interconnect driver[1] and fetching clocks from the Device Tree[2]
[1] - https://lore.kernel.org/linux-arm-msm/[email protected]/
[2] - https://lore.kernel.org/linux-pci/[email protected]/
[V4]
https://lore.kernel.org/linux-arm-msm/20230528142111.GC2814@thinkpad/
[V3]
https://lore.kernel.org/linux-arm-msm/[email protected]/
- Dropped the phy driver and binding patches as they have been posted as a separate series.
- Dropped the pinctrl binding fix patch as it is unrelated to the series
dt-bindings: pinctrl: qcom: Add few missing functions.
- Rebased on linux-next/master.
- Detailed change logs are added to the respective patches.
[V2]
https://lore.kernel.org/linux-arm-msm/[email protected]/
- Reordered the patches and split the board DT changes into a separate patch as suggested
- Detailed change logs are added to the respective patches
[V1]
https://lore.kernel.org/linux-arm-msm/[email protected]/
devi priya (6):
Add PCIe pipe clock definitions for IPQ9574 SoC.
clk: qcom: gcc-ipq9574: Add PCIe pipe clocks
dt-bindings: PCI: qcom: Document the IPQ9574 PCIe controller.
arm64: dts: qcom: ipq9574: Add PCIe PHYs and controller nodes
arm64: dts: qcom: ipq9574: Enable PCIe PHYs and controllers
PCI: qcom: Add support for IPQ9574
.../devicetree/bindings/pci/qcom,pcie.yaml | 37 ++ arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 113 ++++++ arch/arm64/boot/dts/qcom/ipq9574.dtsi | 365 +++++++++++++++++- drivers/clk/qcom/gcc-ipq9574.c | 76 ++++ drivers/pci/controller/dwc/pcie-qcom.c | 36 +- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 4 + 6 files changed, 623 insertions(+), 8 deletions(-)
base-commit: e7b4ef8fffaca247809337bb78daceb406659f2d
prerequisite-patch-id: 513cb089a74b49996b46345595d1aacf60dcda64
prerequisite-patch-id: ce7a8e9bac53fd5f02921bff6bc54149fb92f996
prerequisite-patch-id: c26478e61e583eb879385598f26b42b8271036f5
prerequisite-patch-id: a5c15da6a968e673737dc5aa962f31576903f8aa
prerequisite-patch-id: 353eb53cd192489d5b0c4654a0b922f23e1f7217
prerequisite-patch-id: d282ba7948460ae4d2f541c8c25ff5089ff6507e
prerequisite-patch-id: 5141131d46f7789b50ac806f10b63869d15d709f
prerequisite-patch-id: f9d936541ba730ad6383b4ccab85964b853eb241
prerequisite-patch-id: 7382bed435a31877deb5d02dd105cc4b9cf31abc
Signature · 1 line
2.34.1
PATCH v5 1/6 Add PCIe pipe clock definitions for IPQ9574 SoC.
---
Changes in V5:
- No changes
include/dt-bindings/clock/qcom,ipq9574-gcc.h | 4 ++++ 1 file changed, 4 insertions(+)
include/dt-bindings/clock/qcom,ipq9574-gcc.h +4 -0
@@ -216,4 +216,8 @@#define GCC_CRYPTO_AHB_CLK 207#define GCC_USB0_PIPE_CLK 208#define GCC_USB0_SLEEP_CLK 209 +#define GCC_PCIE0_PIPE_CLK 210 +#define GCC_PCIE1_PIPE_CLK 211 +#define GCC_PCIE2_PIPE_CLK 212 +#define GCC_PCIE3_PIPE_CLK 213#endif
Signature · 1 line
2.34.1
Re: [PATCH V5 1/6] Add PCIe pipe clock definitions for IPQ9574 SoC.
On Sun, May 12, 2024 at 01:58:53PM +0530, devi priya wrote:
Please run "git log --oneline include/dt-bindings/clock/qcom,ipq9574-gcc.h" and follow the subject line style there:
- prefix "dt-bindings: clock: "
- no trailing period
- perhaps add commit log text if there's anything else useful to put there
Quoted 28 lines
Acked-by Stephen Boyd <[email protected]>Co-developed-by Anusha Rao <[email protected]>Signed-off-by Anusha Rao <[email protected]>Signed-off-by devi priya <[email protected]>---
Changes in V5:
- No changesinclude/dt-bindings/clock/qcom,ipq9574-gcc.h | 4 ++++ 1 file changed, 4 insertions(+)include/dt-bindings/clock/qcom,ipq9574-gcc.h +4
-0@@ -216,4 +216,8 @@#define GCC_CRYPTO_AHB_CLK 207#define GCC_USB0_PIPE_CLK 208#define GCC_USB0_SLEEP_CLK 209 +#define GCC_PCIE0_PIPE_CLK 210 +#define GCC_PCIE1_PIPE_CLK 211 +#define GCC_PCIE2_PIPE_CLK 212 +#define GCC_PCIE3_PIPE_CLK 213#endif Signature · 1 line
2.34.1
PATCH v5 2/6 clk: qcom: gcc-ipq9574: Add PCIe pipe clocks
In reply to devi priyaAdd the PCIe pipe clocks needed for enabling PCIe in IPQ9574.
---
Changes in V5:
- No changes
drivers/clk/qcom/gcc-ipq9574.c | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
drivers/clk/qcom/gcc-ipq9574.c +76 -0
@@ -1572,6 +1572,24 @@ static struct clk_regmap_phy_mux pcie0_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie0_pipe_clk = { + .halt_reg =0x28044 , + .halt_check =BRANCH_HALT_DELAY , + .clkr = { + .enable_reg =0x28044 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_pcie0_pipe_clk" , + .parent_hws = (const struct clk_hw *[]) { + &pcie0_pipe_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { .reg =0x29064 , .clkr = {
@@ -1586,6 +1604,24 @@ static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie1_pipe_clk = { + .halt_reg =0x29044 , + .halt_check =BRANCH_HALT_DELAY , + .clkr = { + .enable_reg =0x29044 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_pcie1_pipe_clk" , + .parent_hws = (const struct clk_hw *[]) { + &pcie1_pipe_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { .reg =0x2a064 , .clkr = {
@@ -1600,6 +1636,24 @@ static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie2_pipe_clk = { + .halt_reg =0x2a044 , + .halt_check =BRANCH_HALT_DELAY , + .clkr = { + .enable_reg =0x2a044 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_pcie2_pipe_clk" , + .parent_hws = (const struct clk_hw *[]) { + &pcie2_pipe_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { .reg =0x2b064 , .clkr = {
@@ -1614,6 +1668,24 @@ static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie3_pipe_clk = { + .halt_reg =0x2b044 , + .halt_check =BRANCH_HALT_DELAY , + .clkr = { + .enable_reg =0x2b044 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_pcie3_pipe_clk" , + .parent_hws = (const struct clk_hw *[]) { + &pcie3_pipe_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static const struct freq_tbl ftbl_pcie_rchng_clk_src[] = {F (24000000 ,P_XO ,1 ,0 ,0 ),F (100000000 ,P_GPLL0 ,8 ,0 ,0 ),
@@ -4007,9 +4079,13 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_PCIE3_AXI_S_BRIDGE_CLK] = &gcc_pcie3_axi_s_bridge_clk.clkr, [GCC_PCIE3_AXI_S_CLK] = &gcc_pcie3_axi_s_clk.clkr, [PCIE0_PIPE_CLK_SRC] = &pcie0_pipe_clk_src.clkr, + [GCC_PCIE0_PIPE_CLK] = &gcc_pcie0_pipe_clk.clkr, [PCIE1_PIPE_CLK_SRC] = &pcie1_pipe_clk_src.clkr, + [GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr, [PCIE2_PIPE_CLK_SRC] = &pcie2_pipe_clk_src.clkr, + [GCC_PCIE2_PIPE_CLK] = &gcc_pcie2_pipe_clk.clkr, [PCIE3_PIPE_CLK_SRC] = &pcie3_pipe_clk_src.clkr, + [GCC_PCIE3_PIPE_CLK] = &gcc_pcie3_pipe_clk.clkr, [PCIE_AUX_CLK_SRC] = &pcie_aux_clk_src.clkr, [GCC_PCIE0_AUX_CLK] = &gcc_pcie0_aux_clk.clkr, [GCC_PCIE1_AUX_CLK] = &gcc_pcie1_aux_clk.clkr,
Signature · 1 line
2.34.1
PATCH v5 3/6 dt-bindings: PCI: qcom: Document the IPQ9574 PCIe controller.
In reply to devi priyaDocument the PCIe controller on IPQ9574 platform.
---
Changes in V5:
- Dropped msi-parent for pcie node, as it is handled by "msi" IRQ
.../devicetree/bindings/pci/qcom,pcie.yaml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +37 -0
@@ -26,6 +26,7 @@ properties: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-msm8996 - qcom,pcie-qcs404 - qcom,pcie-sdm845
@@ -161,6 +162,7 @@ allOf: enum: - qcom,pcie-ipq6018 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 then: properties: reg:
@@ -397,6 +399,39 @@ allOf: - const: axi_m_sticky # AXI Master Sticky reset - const: axi_s_sticky # AXI Slave Sticky reset + - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq9574 + then: + properties: + clocks: + minItems: 6 + maxItems: 6 + clock-names: + items: + - const: ahb # AHB clock + - const: aux # Auxiliary clock + - const: axi_m # AXI Master clock + - const: axi_s # AXI Slave clock + - const: axi_bridge # AXI bridge clock + - const: rchng + resets: + minItems: 8 + maxItems: 8 + reset-names: + items: + - const: pipe # PIPE reset + - const: sticky # Core Sticky reset + - const: axi_s_sticky # AXI Slave Sticky reset + - const: axi_s # AXI Slave reset + - const: axi_m_sticky # AXI Master Sticky reset + - const: axi_m # AXI Master reset + - const: aux # AUX Reset + - const: ahb # AHB Reset + - if: properties: compatible:
@@ -507,6 +542,7 @@ allOf: - qcom,pcie-ipq8064v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: required:
@@ -566,6 +602,7 @@ allOf: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: properties:
Signature · 1 line
2.34.1
Re: [PATCH V5 3/6] dt-bindings: PCI: qcom: Document the IPQ9574 PCIe controller.
Quoted 10 lines · devi priya
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +9
-0+ - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq9574 + then: + properties: + clocks:
Documentation/devicetree/bindings/pci/qcom,pcie.yaml allOf: · line 420
Quoted 10 lines
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +10
-0+ minItems: 6 + maxItems: 6 + clock-names: + items: + - const: ahb # AHB clock + - const: aux # Auxiliary clock + - const: axi_m # AXI Master clock + - const: axi_s # AXI Slave clock + - const: axi_bridge # AXI bridge clock + - const: rchng
That's introducing one more order of clocks... Please keep it consistent. The only existing case with ahb has it at after axi_m and others. Why making things everytime differently?
I also to propose to finally drop the obvious comments, like "AHB clock". It cannot be anything else. AXI Master / slave are descriptive, so should stay.
Best regards,
Krzysztof
Re: [PATCH V5 3/6] dt-bindings: PCI: qcom: Document the IPQ9574 PCIe controller.
Quoted 23 lines · Krzysztof Kozlowski
Quoted 10 lines · devi priya
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +9
-0+ - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq9574 + then: + properties: + clocks:Documentation/devicetree/bindings/pci/qcom,pcie.yaml allOf: · line 420
Quoted 10 lines
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +10
-0+ minItems: 6 + maxItems: 6 + clock-names: + items: + - const: ahb # AHB clock + - const: aux # Auxiliary clock + - const: axi_m # AXI Master clock + - const: axi_s # AXI Slave clock + - const: axi_bridge # AXI bridge clock + - const: rchng
Quoted 8 lines
That's introducing one more order of clocks... Please keep it consistent. The only existing case with ahb has it at after
axi_mand others. Why making things everytime differently?I also to propose to finally drop the obvious comments, like "AHB clock". It cannot be anything else. AXI Master / slave are descriptive, so should stay.
+1 to drop the names.
- Mani
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Re: [PATCH V5 3/6] dt-bindings: PCI: qcom: Document the IPQ9574 PCIe controller.
In reply to Krzysztof KozlowskiQuoted 23 lines · Krzysztof Kozlowski
Quoted 10 lines · devi priya
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +9
-0+ - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq9574 + then: + properties: + clocks:Documentation/devicetree/bindings/pci/qcom,pcie.yaml allOf: · line 420
Quoted 10 lines
Documentation/devicetree/bindings/pci/qcom,pcie.yaml +10
-0+ minItems: 6 + maxItems: 6 + clock-names: + items: + - const: ahb # AHB clock + - const: aux # Auxiliary clock + - const: axi_m # AXI Master clock + - const: axi_s # AXI Slave clock + - const: axi_bridge # AXI bridge clock + - const: rchng
Quoted 7 lines
That's introducing one more order of clocks... Please keep it consistent. The only existing case with ahb has it at after
axi_mand others. Why making things everytime differently?I also to propose to finally drop the obvious comments, like "AHB clock". It cannot be anything else. AXI Master / slave are descriptive, so should stay.
Sure okay, will update this in next spin.
Thanks,
Devi Priya
Quoted 4 lines
Best regards,
Krzysztof
PATCH v5 4/6 arm64: dts: qcom: ipq9574: Add PCIe PHYs and controller nodes
In reply to devi priyaAdd PCIe0, PCIe1, PCIe2, PCIe3 (and corresponding PHY) devices found on IPQ9574 platform. The PCIe0 & PCIe1 are 1-lane Gen3 host whereas PCIe2 & PCIe3 are 2-lane Gen3 host.
---
Changes in V5:
- Dropped anoc and snoc lane clocks from Phy nodes and enabled them via interconnect.
- Dropped msi-parent as it is handled via msi IRQ
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 365 +++++++++++++++++++++++++- 1 file changed, 361 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +361 -4
@@ -226,6 +226,52 @@ rpm_msg_ram: sram@60000 { reg = <0x00060000 0x6000>; }; + pcie0_phy: phy@84000 { + compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy"; + reg = <0x00084000 0x1000>; + + clocks = <&gcc GCC_PCIE0_AUX_CLK>, + <&gcc GCC_PCIE0_AHB_CLK>, + <&gcc GCC_PCIE0_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "pipe"; + + assigned-clocks = <&gcc GCC_PCIE0_AUX_CLK>; + assigned-clock-rates = <20000000>; + + resets = <&gcc GCC_PCIE0_PHY_BCR>, + <&gcc GCC_PCIE0PHY_PHY_BCR>; + reset-names = "phy", "common"; + + #clock-cells = <0>; + clock-output-names = "gcc_pcie0_pipe_clk_src"; + + #phy-cells = <0>; + status = "disabled"; + }; + + pcie2_phy: phy@8c000 { + compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; + reg = <0x0008c000 0x2000>; + + clocks = <&gcc GCC_PCIE2_AUX_CLK>, + <&gcc GCC_PCIE2_AHB_CLK>, + <&gcc GCC_PCIE2_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "pipe"; + + assigned-clocks = <&gcc GCC_PCIE2_AUX_CLK>; + assigned-clock-rates = <20000000>; + + resets = <&gcc GCC_PCIE2_PHY_BCR>, + <&gcc GCC_PCIE2PHY_PHY_BCR>; + reset-names = "phy", "common"; + + #clock-cells = <0>; + clock-output-names = "gcc_pcie2_pipe_clk_src"; + + #phy-cells = <0>; + status = "disabled"; + }; + rng: rng@e3000 { compatible = "qcom,prng-ee"; reg = <0x000e3000 0x1000>;
@@ -233,6 +279,52 @@ rng: rng@e3000 { clock-names = "core"; }; + pcie3_phy: phy@f4000 { + compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; + reg = <0x000f4000 0x2000>; + + clocks = <&gcc GCC_PCIE3_AUX_CLK>, + <&gcc GCC_PCIE3_AHB_CLK>, + <&gcc GCC_PCIE3_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "pipe"; + + assigned-clocks = <&gcc GCC_PCIE3_AUX_CLK>; + assigned-clock-rates = <20000000>; + + resets = <&gcc GCC_PCIE3_PHY_BCR>, + <&gcc GCC_PCIE3PHY_PHY_BCR>; + reset-names = "phy", "common"; + + #clock-cells = <0>; + clock-output-names = "gcc_pcie3_pipe_clk_src"; + + #phy-cells = <0>; + status = "disabled"; + }; + + pcie1_phy: phy@fc000 { + compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy"; + reg = <0x000fc000 0x1000>; + + clocks = <&gcc GCC_PCIE1_AUX_CLK>, + <&gcc GCC_PCIE1_AHB_CLK>, + <&gcc GCC_PCIE1_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "pipe"; + + assigned-clocks = <&gcc GCC_PCIE1_AUX_CLK>; + assigned-clock-rates = <20000000>; + + resets = <&gcc GCC_PCIE1_PHY_BCR>, + <&gcc GCC_PCIE1PHY_PHY_BCR>; + reset-names = "phy", "common"; + + #clock-cells = <0>; + clock-output-names = "gcc_pcie1_pipe_clk_src"; + + #phy-cells = <0>; + status = "disabled"; + }; + qfprom: efuse@a4000 { compatible = "qcom,ipq9574-qfprom", "qcom,qfprom"; reg = <0x000a4000 0x5a1>;
@@ -299,10 +391,10 @@ gcc: clock-controller@1800000 { clocks = <&xo_board_clk>, <&sleep_clk>, <0>, - <0>, - <0>, - <0>, - <0>, + <&pcie0_phy>, + <&pcie1_phy>, + <&pcie2_phy>, + <&pcie3_phy>, <0>; #clock-cells = <1>; #reset-cells = <1>;
@@ -747,6 +839,271 @@ frame@b128000 { status = "disabled"; }; }; + + pcie1: pci@10000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x10000000 0xf1d>, + <0x10000F20 0xa8>, + <0x10001000 0x1000>, + <0x000F8000 0x4000>, + <0x10100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <2>; + bus-range = <0x00 0xff>; + num-lanes = <1>; + #address-cells = <3>; + #size-cells = <2>; + + ranges = <0x01000000 0x0 0x00000000 0x10200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x10300000 0x10300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi"; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 35 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 49 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 84 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 85 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */ + clocks = <&gcc GCC_PCIE1_AHB_CLK>, + <&gcc GCC_PCIE1_AUX_CLK>, + <&gcc GCC_PCIE1_AXI_M_CLK>, + <&gcc GCC_PCIE1_AXI_S_CLK>, + <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE1_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE1_PIPE_ARES>, + <&gcc GCC_PCIE1_CORE_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_ARES>, + <&gcc GCC_PCIE1_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_M_ARES>, + <&gcc GCC_PCIE1_AUX_ARES>, + <&gcc GCC_PCIE1_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + + phys = <&pcie1_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE1 &gcc SLAVE_ANOC_PCIE1>, + <&gcc MASTER_SNOC_PCIE1 &gcc SLAVE_SNOC_PCIE1>; + interconnect-names = "pcie-mem", "cpu-pcie"; + status = "disabled"; + }; + + pcie3: pci@18000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x18000000 0xf1d>, + <0x18000F20 0xa8>, + <0x18001000 0x1000>, + <0x000F0000 0x4000>, + <0x18100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <4>; + bus-range = <0x00 0xff>; + num-lanes = <2>; + #address-cells = <3>; + #size-cells = <2>; + + ranges = <0x01000000 0x0 0x00000000 0x18200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x18300000 0x18300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi"; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 189 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 190 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 191 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 192 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */ + clocks = <&gcc GCC_PCIE3_AHB_CLK>, + <&gcc GCC_PCIE3_AUX_CLK>, + <&gcc GCC_PCIE3_AXI_M_CLK>, + <&gcc GCC_PCIE3_AXI_S_CLK>, + <&gcc GCC_PCIE3_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE3_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE3_PIPE_ARES>, + <&gcc GCC_PCIE3_CORE_STICKY_ARES>, + <&gcc GCC_PCIE3_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE3_AXI_S_ARES>, + <&gcc GCC_PCIE3_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE3_AXI_M_ARES>, + <&gcc GCC_PCIE3_AUX_ARES>, + <&gcc GCC_PCIE3_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + + phys = <&pcie3_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE3 &gcc SLAVE_ANOC_PCIE3>, + <&gcc MASTER_SNOC_PCIE3 &gcc SLAVE_SNOC_PCIE3>; + interconnect-names = "pcie-mem", "cpu-pcie"; + status = "disabled"; + }; + + pcie2: pci@20000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x20000000 0xf1d>, + <0x20000F20 0xa8>, + <0x20001000 0x1000>, + <0x00088000 0x4000>, + <0x20100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <3>; + bus-range = <0x00 0xff>; + num-lanes = <2>; + #address-cells = <3>; + #size-cells = <2>; + + ranges = <0x01000000 0x0 0x00000000 0x20200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x20300000 0x20300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi"; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 164 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 165 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 186 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 187 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */ + clocks = <&gcc GCC_PCIE2_AHB_CLK>, + <&gcc GCC_PCIE2_AUX_CLK>, + <&gcc GCC_PCIE2_AXI_M_CLK>, + <&gcc GCC_PCIE2_AXI_S_CLK>, + <&gcc GCC_PCIE2_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE2_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE2_PIPE_ARES>, + <&gcc GCC_PCIE2_CORE_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_S_ARES>, + <&gcc GCC_PCIE2_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_M_ARES>, + <&gcc GCC_PCIE2_AUX_ARES>, + <&gcc GCC_PCIE2_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + + phys = <&pcie2_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE2 &gcc SLAVE_ANOC_PCIE2>, + <&gcc MASTER_SNOC_PCIE2 &gcc SLAVE_SNOC_PCIE2>; + interconnect-names = "pcie-mem", "cpu-pcie"; + status = "disabled"; + }; + + pcie0: pci@28000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x28000000 0xf1d>, + <0x28000F20 0xa8>, + <0x28001000 0x1000>, + <0x00080000 0x4000>, + <0x28100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <1>; + bus-range = <0x00 0xff>; + num-lanes = <1>; + #address-cells = <3>; + #size-cells = <2>; + + ranges = <0x01000000 0x0 0x00000000 0x28200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x28300000 0x28300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi"; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 75 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 78 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 79 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 83 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */ + clocks = <&gcc GCC_PCIE0_AHB_CLK>, + <&gcc GCC_PCIE0_AUX_CLK>, + <&gcc GCC_PCIE0_AXI_M_CLK>, + <&gcc GCC_PCIE0_AXI_S_CLK>, + <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE0_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE0_PIPE_ARES>, + <&gcc GCC_PCIE0_CORE_STICKY_ARES>, + <&gcc GCC_PCIE0_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE0_AXI_S_ARES>, + <&gcc GCC_PCIE0_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE0_AXI_M_ARES>, + <&gcc GCC_PCIE0_AUX_ARES>, + <&gcc GCC_PCIE0_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + + phys = <&pcie0_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE0 &gcc SLAVE_ANOC_PCIE0>, + <&gcc MASTER_SNOC_PCIE0 &gcc SLAVE_SNOC_PCIE0>; + interconnect-names = "pcie-mem", "cpu-pcie"; + status = "disabled"; + }; + }; thermal-zones {
Signature · 1 line
2.34.1
Re: [PATCH V5 4/6] arm64: dts: qcom: ipq9574: Add PCIe PHYs and controller nodes
Quoted 18 lines · devi priya
Add PCIe0, PCIe1, PCIe2, PCIe3 (and corresponding PHY) devices found on IPQ9574 platform. The PCIe0 & PCIe1 are 1-lane Gen3 host whereas PCIe2 & PCIe3 are 2-lane Gen3 host.
Signed-off-by devi priya <[email protected]>---
Changes in V5:
- Dropped anoc and snoc lane clocks from Phy nodes and enabled them via interconnect.
- Dropped msi-parent as it is handled via msi IRQarch/arm64/boot/dts/qcom/ipq9574.dtsi | 365 +++++++++++++++++++++++++- 1 file changed, 361 insertions(+), 4 deletions(-)arch/arm64/boot/dts/qcom/ipq9574.dtsi +0
-0
[...]
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 843
Quoted 1 line
arch/arm64/boot/dts/qcom/ipq9574.dtsi +1
-0+ pcie1: pci@10000000 {
'pcie@' since this is a PCIe controller.
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 846
Quoted 3 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +3
-0+ compatible = "qcom,pcie-ipq9574"; + reg = <0x10000000 0xf1d>, + <0x10000F20 0xa8>,
Please use lower case for hex everywhere.
Quoted 6 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +6
-0+ <0x10001000 0x1000>, + <0x000F8000 0x4000>, + <0x10100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <2>;
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 862
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +10
-0+ bus-range = <0x00 0xff>; + num-lanes = <1>; + #address-cells = <3>; + #size-cells = <2>; + + ranges = <0x01000000 0x0 0x00000000 0x10200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x10300000 0x10300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi";
Are you sure that this platform only has single MSI SPI IRQ?
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 870
Quoted 8 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +8
-0+ #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 35 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 49 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 84 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 85 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */
This comment is redundant.
Quoted 24 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +24
-0+ clocks = <&gcc GCC_PCIE1_AHB_CLK>, + <&gcc GCC_PCIE1_AUX_CLK>, + <&gcc GCC_PCIE1_AXI_M_CLK>, + <&gcc GCC_PCIE1_AXI_S_CLK>, + <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE1_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE1_PIPE_ARES>, + <&gcc GCC_PCIE1_CORE_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_ARES>, + <&gcc GCC_PCIE1_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_M_ARES>, + <&gcc GCC_PCIE1_AUX_ARES>, + <&gcc GCC_PCIE1_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky",
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 904
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +10
-0+ "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + + phys = <&pcie1_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE1 &gcc SLAVE_ANOC_PCIE1>, + <&gcc MASTER_SNOC_PCIE1 &gcc SLAVE_SNOC_PCIE1>;
Is this really the interconnect paths between PCIe-DDR and PCIe-CPU? I doubt...
- Mani
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Re: [PATCH V5 4/6] arm64: dts: qcom: ipq9574: Add PCIe PHYs and controller nodes
Quoted 22 lines · Manivannan Sadhasivam
Quoted 18 lines · devi priya
Add PCIe0, PCIe1, PCIe2, PCIe3 (and corresponding PHY) devices found on IPQ9574 platform. The PCIe0 & PCIe1 are 1-lane Gen3 host whereas PCIe2 & PCIe3 are 2-lane Gen3 host.
Signed-off-by devi priya <[email protected]>---
Changes in V5:
- Dropped anoc and snoc lane clocks from Phy nodes and enabled them via interconnect.
- Dropped msi-parent as it is handled via msi IRQarch/arm64/boot/dts/qcom/ipq9574.dtsi | 365 +++++++++++++++++++++++++- 1 file changed, 361 insertions(+), 4 deletions(-)arch/arm64/boot/dts/qcom/ipq9574.dtsi +0
-0[...]
Quoted 3 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 843
Quoted 1 line
arch/arm64/boot/dts/qcom/ipq9574.dtsi +1
-0+ pcie1: pci@10000000 {'pcie@' since this is a PCIe controller.
okay
Quoted 6 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 846
Quoted 4 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +3
-0+ compatible = "qcom,pcie-ipq9574"; + reg = <0x10000000 0xf1d>, + <0x10000F20 0xa8>,Please use lower case for hex everywhere.
okay
Quoted 11 lines
Quoted 11 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +10
-0+ <0x10001000 0x1000>, + <0x000F8000 0x4000>, + <0x10100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + device_type = "pci"; + linux,pci-domain = <2>; + bus-range = <0x00 0xff>; + num-lanes = <1>; + #address-cells = <3>; + #size-cells = <2>;
Quoted 8 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 862
Quoted 6 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +6
-0+ + ranges = <0x01000000 0x0 0x00000000 0x10200000 0x0 0x100000>, /* I/O */ + <0x02000000 0x0 0x10300000 0x10300000 0x0 0x7d00000>; /* MEM */ + + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi";Are you sure that this platform only has single MSI SPI IRQ?
It has 8 MSI SPI IRQs, will define all of them
Quoted 11 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 870
Quoted 9 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +8
-0+ #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 35 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 0 49 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 84 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 85 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + /* clocks and clock-names are used to enable the clock in CBCR */This comment is redundant.
okay
Quoted 29 lines
Quoted 29 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +28
-0+ clocks = <&gcc GCC_PCIE1_AHB_CLK>, + <&gcc GCC_PCIE1_AUX_CLK>, + <&gcc GCC_PCIE1_AXI_M_CLK>, + <&gcc GCC_PCIE1_AXI_S_CLK>, + <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>, + <&gcc GCC_PCIE1_RCHNG_CLK>; + clock-names = "ahb", + "aux", + "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE1_PIPE_ARES>, + <&gcc GCC_PCIE1_CORE_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_S_ARES>, + <&gcc GCC_PCIE1_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE1_AXI_M_ARES>, + <&gcc GCC_PCIE1_AUX_ARES>, + <&gcc GCC_PCIE1_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux",
Quoted 8 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi frame@b128000 { · line 904
Quoted 6 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +6
-0+ "ahb"; + + phys = <&pcie1_phy>; + phy-names = "pciephy"; + interconnects = <&gcc MASTER_ANOC_PCIE1 &gcc SLAVE_ANOC_PCIE1>, + <&gcc MASTER_SNOC_PCIE1 &gcc SLAVE_SNOC_PCIE1>;Is this really the interconnect paths between PCIe-DDR and PCIe-CPU? I doubt...
We actually designed a minimalistic ICC driver for enabling the NoC clocks based on the suggestions received from the community. Please find the link to the discussions that went in for introducing the ICC driver for NoC clock enablement
https://lore.kernel.org/linux-arm-msm/[email protected]/
Thanks,
Devi Priya
Quoted 3 lines
- Mani
PATCH v5 5/6 arm64: dts: qcom: ipq9574: Enable PCIe PHYs and controllers
In reply to devi priyaEnable the PCIe controller and PHY nodes corresponding to RDP 433.
---
Changes in V5:
- No change
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 113 ++++++++++++++++++++ 1 file changed, 113 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +113 -0
@@ -8,6 +8,7 @@ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> #include "ipq9574-rdp-common.dtsi" / {
@@ -15,6 +16,45 @@ / { compatible = "qcom,ipq9574-ap-al02-c7", "qcom,ipq9574"; }; +&pcie1_phy { + status = "okay"; +}; + +&pcie1 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_default>; + + perst-gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&pcie2_phy { + status = "okay"; +}; + +&pcie2 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie2_default>; + + perst-gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&pcie3_phy { + status = "okay"; +}; + +&pcie3 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie3_default>; + + perst-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + &sdhc_1 { pinctrl-0 = <&sdc_default_state>; pinctrl-names = "default";
@@ -28,6 +68,79 @@ &sdhc_1 { }; &tlmm { + + pcie1_default: pcie1-default-state { + clkreq-n-pins { + pins = "gpio25"; + function = "pcie1_clk"; + drive-strength = <6>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio26"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + output-low; + }; + + wake-n-pins { + pins = "gpio27"; + function = "pcie1_wake"; + drive-strength = <6>; + bias-pull-up; + }; + }; + + pcie2_default: pcie2-default-state { + clkreq-n-pins { + pins = "gpio28"; + function = "pcie2_clk"; + drive-strength = <6>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio29"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + output-low; + }; + + wake-n-pins { + pins = "gpio30"; + function = "pcie2_wake"; + drive-strength = <6>; + bias-pull-up; + }; + }; + + pcie3_default: pcie3-default-state { + clkreq-n-pins { + pins = "gpio31"; + function = "pcie3_clk"; + drive-strength = <6>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio32"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + output-low; + }; + + wake-n-pins { + pins = "gpio33"; + function = "pcie3_wake"; + drive-strength = <6>; + bias-pull-up; + }; + }; + sdc_default_state: sdc-default-state { clk-pins { pins = "gpio5";
Signature · 1 line
2.34.1
PATCH v5 6/6 PCI: qcom: Add support for IPQ9574
In reply to devi priyaThe IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70a
The Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and 'ops_1_27_0' which reuses all the members of 'ops_2_9_0' except for the post_init as the SLV_ADDR_SPACE_SIZE configuration differs between 2_9_0 and 1_27_0.
---
Changes in V5:
- Rebased on top of the below series which adds support for fetching clocks from the device tree
https://lore.kernel.org/linux-pci/[email protected]/
drivers/pci/controller/dwc/pcie-qcom.c | 36 +++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +32 -4
@@ -106,6 +106,7 @@/* PARF_SLV_ADDR_SPACE_SIZE register value */ #define SLV_ADDR_SPACE_SZ 0x10000000 +#define SLV_ADDR_SPACE_SZ_1_27_0 0x08000000/* PARF_MHI_CLOCK_RESET_CTRL register fields */ #define AHB_CLK_EN BIT(0)
@@ -1095,16 +1096,13 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie)return clk_bulk_prepare_enable (res->num_clks, res->clks); } -static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +static int qcom_pcie_post_init (struct qcom_pcie *pcie) {struct dw_pcie *pci = pcie->pci;u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );u32 val;int i; -writel (SLV_ADDR_SPACE_SZ , - pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); - val =readl (pcie->parf +PARF_PHY_CTRL ); val &= ~PHY_TEST_PWR_DOWN ;writel (val, pcie->parf +PARF_PHY_CTRL );
@@ -1144,6 +1142,22 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie)return 0 ; } +static int qcom_pcie_post_init_1_27_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ_1_27_0 , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} + +static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} +static int qcom_pcie_link_up (struct dw_pcie *pci) {u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );
@@ -1297,6 +1311,15 @@ static const struct qcom_pcie_ops ops_2_9_0 = { .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, }; +/* Qcom IP rev.: 1.27.0 Synopsys IP rev.: 5.80a */ +static const struct qcom_pcie_ops ops_1_27_0 = { + .get_resources = qcom_pcie_get_resources_2_9_0, + .init = qcom_pcie_init_2_9_0, + .post_init = qcom_pcie_post_init_1_27_0, + .deinit = qcom_pcie_deinit_2_9_0, + .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, +}; +static const struct qcom_pcie_cfg cfg_1_0_0 = { .ops = &ops_1_0_0, };
@@ -1334,6 +1357,10 @@ static const struct qcom_pcie_cfg cfg_sc8280xp = { .no_l0s = true, }; +static const struct qcom_pcie_cfg cfg_1_27_0 = { + .ops = &ops_1_27_0, +}; +static const struct dw_pcie_ops dw_pcie_ops = { .link_up = qcom_pcie_link_up, .start_link = qcom_pcie_start_link,
@@ -1603,6 +1630,7 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, + { .compatible = "qcom,pcie-ipq9574", .data = &cfg_1_27_0 }, { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp },
Signature · 1 line
2.34.1
Manivannan Sadhasivam
maintainerRe: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574
Quoted 28 lines · devi priya
The IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70aThe Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and '
ops_1_27_0' which reuses all the members of 'ops_2_9_0' except for thepost_initas theSLV_ADDR_SPACE_SIZEconfiguration differs between 2_9_0 and 1_27_0.Reviewed-by Dmitry Baryshkov <[email protected]>Reviewed-by Manivannan Sadhasivam <[email protected]>Co-developed-by Anusha Rao <[email protected]>Signed-off-by Anusha Rao <[email protected]>Signed-off-by devi priya <[email protected]>---
Changes in V5:
- Rebased on top of the below series which adds support for fetching clocks from the device tree
https://lore.kernel.org/linux-pci/[email protected]/drivers/pci/controller/dwc/pcie-qcom.c | 36 +++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-)drivers/pci/controller/dwc/pcie-qcom.c +0
-0
drivers/pci/controller/dwc/pcie-qcom.c line 109
Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +1
-0@@ -106,6 +106,7 @@/* PARF_SLV_ADDR_SPACE_SIZE register value */ #define SLV_ADDR_SPACE_SZ 0x10000000 +#define SLV_ADDR_SPACE_SZ_1_27_0 0x08000000
Can you please explain what this value corresponds to? Even though there is an old value, I didn't get much info earlier on what it is.
- Mani
Quoted 82 lines
drivers/pci/controller/dwc/pcie-qcom.c +31
-4/* PARF_MHI_CLOCK_RESET_CTRL register fields */ #define AHB_CLK_EN BIT(0)@@ -1095,16 +1096,13 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie)return clk_bulk_prepare_enable (res->num_clks, res->clks); } -static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +static int qcom_pcie_post_init (struct qcom_pcie *pcie) {struct dw_pcie *pci = pcie->pci;u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );u32 val;int i; -writel (SLV_ADDR_SPACE_SZ , - pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); - val =readl (pcie->parf +PARF_PHY_CTRL ); val &= ~PHY_TEST_PWR_DOWN ;writel (val, pcie->parf +PARF_PHY_CTRL );@@ -1144,6 +1142,22 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie)return 0 ; } +static int qcom_pcie_post_init_1_27_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ_1_27_0 , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} + +static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} +static int qcom_pcie_link_up (struct dw_pcie *pci) {u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );@@ -1297,6 +1311,15 @@ static const struct qcom_pcie_ops ops_2_9_0 = { .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, }; +/* Qcom IP rev.: 1.27.0 Synopsys IP rev.: 5.80a */ +static const struct qcom_pcie_ops ops_1_27_0 = { + .get_resources = qcom_pcie_get_resources_2_9_0, + .init = qcom_pcie_init_2_9_0, + .post_init = qcom_pcie_post_init_1_27_0, + .deinit = qcom_pcie_deinit_2_9_0, + .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, +}; +static const struct qcom_pcie_cfg cfg_1_0_0 = { .ops = &ops_1_0_0, };@@ -1334,6 +1357,10 @@ static const struct qcom_pcie_cfg cfg_sc8280xp = { .no_l0s = true, }; +static const struct qcom_pcie_cfg cfg_1_27_0 = { + .ops = &ops_1_27_0, +}; +static const struct dw_pcie_ops dw_pcie_ops = { .link_up = qcom_pcie_link_up, .start_link = qcom_pcie_start_link,@@ -1603,6 +1630,7 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, + { .compatible = "qcom,pcie-ipq9574", .data = &cfg_1_27_0 }, { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp },Signature · 1 line
2.34.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Re: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574
Quoted 30 lines · Manivannan Sadhasivam
Quoted 29 lines · devi priya
The IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70aThe Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and '
ops_1_27_0' which reuses all the members of 'ops_2_9_0' except for thepost_initas theSLV_ADDR_SPACE_SIZEconfiguration differs between 2_9_0 and 1_27_0.Reviewed-by Dmitry Baryshkov <[email protected]>Reviewed-by Manivannan Sadhasivam <[email protected]>Co-developed-by Anusha Rao <[email protected]>Signed-off-by Anusha Rao <[email protected]>Signed-off-by devi priya <[email protected]>---
Changes in V5:
- Rebased on top of the below series which adds support for fetching clocks from the device tree
https://lore.kernel.org/linux-pci/[email protected]/drivers/pci/controller/dwc/pcie-qcom.c | 36 +++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-)drivers/pci/controller/dwc/pcie-qcom.c +0
-0@@ -106,6 +106,7 @@
Quoted 6 lines
drivers/pci/controller/dwc/pcie-qcom.c line 109
Quoted 3 lines
drivers/pci/controller/dwc/pcie-qcom.c +1
-0/* PARF_SLV_ADDR_SPACE_SIZE register value */ #define SLV_ADDR_SPACE_SZ 0x10000000 +#define SLV_ADDR_SPACE_SZ_1_27_0 0x08000000Can you please explain what this value corresponds to? Even though there is an old value, I didn't get much info earlier on what it is.
The PARF_SLV_ADDR_SPACE_SIZE register indicates the range of RC accesses
to the EP's memory space. Default PoR value is 16MB, which seems to be sufficient for IPQ9574 SoC.
As per the memory map, the memory space corresponding to each PCIe region is 128Mb. As the older value corresponds to 256Mb we see PCIe enumeration failures. This register should either be updated to 128Mb(0x8000000) or left at the PoR value 16Mb (0x1000000).
Thanks,
Devi Priya
Quoted 86 lines
- Mani
Quoted 82 lines
drivers/pci/controller/dwc/pcie-qcom.c +31
-4/* PARF_MHI_CLOCK_RESET_CTRL register fields */ #define AHB_CLK_EN BIT(0)@@ -1095,16 +1096,13 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie)return clk_bulk_prepare_enable (res->num_clks, res->clks); } -static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +static int qcom_pcie_post_init (struct qcom_pcie *pcie) {struct dw_pcie *pci = pcie->pci;u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );u32 val;int i; -writel (SLV_ADDR_SPACE_SZ , - pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); - val =readl (pcie->parf +PARF_PHY_CTRL ); val &= ~PHY_TEST_PWR_DOWN ;writel (val, pcie->parf +PARF_PHY_CTRL );@@ -1144,6 +1142,22 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie)return 0 ; } +static int qcom_pcie_post_init_1_27_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ_1_27_0 , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} + +static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE ); + +return qcom_pcie_post_init (pcie); +} +static int qcom_pcie_link_up (struct dw_pcie *pci) {u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );@@ -1297,6 +1311,15 @@ static const struct qcom_pcie_ops ops_2_9_0 = { .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, }; +/* Qcom IP rev.: 1.27.0 Synopsys IP rev.: 5.80a */ +static const struct qcom_pcie_ops ops_1_27_0 = { + .get_resources = qcom_pcie_get_resources_2_9_0, + .init = qcom_pcie_init_2_9_0, + .post_init = qcom_pcie_post_init_1_27_0, + .deinit = qcom_pcie_deinit_2_9_0, + .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, +}; +static const struct qcom_pcie_cfg cfg_1_0_0 = { .ops = &ops_1_0_0, };@@ -1334,6 +1357,10 @@ static const struct qcom_pcie_cfg cfg_sc8280xp = { .no_l0s = true, }; +static const struct qcom_pcie_cfg cfg_1_27_0 = { + .ops = &ops_1_27_0, +}; +static const struct dw_pcie_ops dw_pcie_ops = { .link_up = qcom_pcie_link_up, .start_link = qcom_pcie_start_link,@@ -1603,6 +1630,7 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, + { .compatible = "qcom,pcie-ipq9574", .data = &cfg_1_27_0 }, { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp },Signature · 1 line
2.34.1
Re: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574
Quoted 39 lines · Devi Priya
Quoted 24 lines · Manivannan Sadhasivam
Quoted 23 lines · devi priya
The IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70aThe Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and '
ops_1_27_0' which reuses all the members of 'ops_2_9_0' except for thepost_initas theSLV_ADDR_SPACE_SIZEconfiguration differs between 2_9_0 and 1_27_0.Reviewed-by Dmitry Baryshkov <[email protected]>Reviewed-by Manivannan Sadhasivam <[email protected]>Co-developed-by Anusha Rao <[email protected]>Signed-off-by Anusha Rao <[email protected]>Signed-off-by devi priya <[email protected]>---
Changes in V5:
- Rebased on top of the below series which adds support for fetching clocks from the device tree
https://lore.kernel.org/linux-pci/[email protected]/drivers/pci/controller/dwc/pcie-qcom.c | 36 +++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-)Quoted 11 lines
drivers/pci/controller/dwc/pcie-qcom.c line 108
Quoted 8 lines
drivers/pci/controller/dwc/pcie-qcom.c +1
-0@@ -106,6 +106,7 @@/* PARF_SLV_ADDR_SPACE_SIZE register value */ #define SLV_ADDR_SPACE_SZ 0x10000000 +#define SLV_ADDR_SPACE_SZ_1_27_0 0x08000000Can you please explain what this value corresponds to? Even though there is an old value, I didn't get much info earlier on what it is.
Quoted 6 lines
The
PARF_SLV_ADDR_SPACE_SIZEregister indicates the range of RC accesses to the EP's memory space. Default PoR value is 16MB, which seems to be sufficient for IPQ9574 SoC.
As per the memory map, the memory space corresponding to each PCIe region is 128Mb. As the older value corresponds to 256Mb we see PCIe enumeration failures.
What kind of failure? Is it because kernel is trying to allocate memory region > 128MB range?
Quoted 3 lines
This register should either be updated to 128Mb(0x8000000) or left at the PoR value 16Mb (
0x1000000).
Ok, so this is essentially the same as the PCI MEM region defined in DT? In that case, this value should be extracted from DT instead of being hardcoded.
But PCI MEM region range in DT is low on many platforms. Maybe that's due to all PCIe instances sharing the 256MB range?
- Mani
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Re: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574
In reply to devi priyaQuoted 2 lines · devi priya
The IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70a
s/4/four/ to match "two"
Quoted 2 lines
The Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and '
ops_1_27_0'
s/Added/Add/ (use imperative mood:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=v6.9#n94)
Quoted 3 lines
which reuses all the members of '
ops_2_9_0' except for thepost_initas theSLV_ADDR_SPACE_SIZEconfiguration differs between 2_9_0 and 1_27_0.
Add periods at end of sentences. Rewrap to fill 75 columns.
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) · line 1148
Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +4
-0+static int qcom_pcie_post_init_1_27_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ_1_27_0 , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE );
Fits on one line.
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) · line 1156
Quoted 7 lines
drivers/pci/controller/dwc/pcie-qcom.c +7
-0+return qcom_pcie_post_init (pcie); +} + +static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE );
Fits on one line.
Quoted 2 lines
(quoted diff) +2
-0+ return qcom_pcie_post_init(pcie); +}
Re: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574
Quoted 5 lines · Bjorn Helgaas
Quoted 2 lines · devi priya
The IPQ9574 platform has 4 Gen3 PCIe controllers:
two single-lane and two dual-lane based on SNPS core 5.70as/4/four/ to match "two"
okay
Quoted 4 lines
Quoted 3 lines
The Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a Added a new compatible 'qcom,pcie-ipq9574' and '
ops_1_27_0'
Quoted 8 lines
s/Added/Add/ (use imperative mood:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=v6.9#n94)Quoted 3 lines
which reuses all the members of '
ops_2_9_0' except for thepost_initas theSLV_ADDR_SPACE_SIZEconfiguration differs between 2_9_0 and 1_27_0.Add periods at end of sentences. Rewrap to fill 75 columns.
okay
Quoted 7 lines
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) · line 1148
Quoted 5 lines
drivers/pci/controller/dwc/pcie-qcom.c +4
-0+static int qcom_pcie_post_init_1_27_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ_1_27_0 , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE );Fits on one line.
sure
Quoted 10 lines
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) · line 1156
Quoted 8 lines
drivers/pci/controller/dwc/pcie-qcom.c +7
-0+return qcom_pcie_post_init (pcie); +} + +static int qcom_pcie_post_init_2_9_0 (struct qcom_pcie *pcie) +{ +writel (SLV_ADDR_SPACE_SZ , + pcie->parf +PARF_SLV_ADDR_SPACE_SIZE );Fits on one line.
okay
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ return qcom_pcie_post_init(pcie); +}
Thanks,
Devi priya