From 22607294d06ece380fdb85bb8249ac50c37eb8aa Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 26 Mar 2021 11:00:34 -0700 Subject: [PATCH 1/3] dt-bindings: arm: msm: add support for BDF filtering Add DT entry to filter out list of BDFs for enumeration. This list is required for PCIe switches unable to respond to configuration access request to certain supported BDFs. Without filtering, such BDFs are causing system bus hang or enumeration failure of downstream ports of switch. Change-Id: Ic89ad56f290f91f1e50255a4fdaa2f7d0d78b539 --- bindings/pci/pci-msm.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/pci/pci-msm.txt b/bindings/pci/pci-msm.txt index 22f05045e34c..e2f744b3e9cb 100644 --- a/bindings/pci/pci-msm.txt +++ b/bindings/pci/pci-msm.txt @@ -400,6 +400,11 @@ interconnects: Definition: PCIe PHY initialization sequence +- qcom,filtered-bdfs: + Usage: optional + Value type: + Definition: Skip enumeration for the list of 32-bit BDFs. + ============== Root port node ============== @@ -557,6 +562,7 @@ Example qcom,ep-latency = <20>; qcom,num-parf-testbus-sel = <0xb9>; qcom,switch-latency = <25>; + qcom,filtered-bdfs = <0x02080000>; qcom,eq-pset-req-vec = <0>; qcom,core-preset = <0x55555555> /* short channel */ From d761469ef7c85d320bbb8da1ea7d959a839f861e Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 26 Mar 2021 18:07:50 -0700 Subject: [PATCH 2/3] dt-bindings: arm: msm: Add child node entry for NTN3 i2c client In order to access NTN3 switch registers add i2c client properties. By accessing these registers root complex driver can toggle NTN3 GPIOs to tied to downstream endpoint reset. i2c interface is also used to dump NTN3 registers for debugging PCIe link related issues. Change-Id: I38279185c07a2ff7a9736a585f5e84053d459462 --- bindings/pci/pci-msm.txt | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/bindings/pci/pci-msm.txt b/bindings/pci/pci-msm.txt index e2f744b3e9cb..719ef66a1c15 100644 --- a/bindings/pci/pci-msm.txt +++ b/bindings/pci/pci-msm.txt @@ -585,3 +585,53 @@ Example qcom,iommu-cfg = <0x3> /* SMMU PRESENT. SET S1 BYPASS */ qcom,iommu-range = <0x0 0x10000000 0x0 0x40000000>; }; + +============== +i2c child node +============== + +- compatible: + Usage: required + Value type: + Definition: Compatible list, contains + - "qcom,pcie0-i2c-ntn3" for NTN3 switch attached to Root port 0 + +- reg: + Usage: required + Value type: + Definition: i2c slave id + +- gpio-config-reg: + Usage: optional + Value type: + Definition: Slave GPIO configuration register address + +- ep-reset-reg: + Usage: optional + Value type: + Definition: Slave endpoint reset register address + +- ep-reset-gpio-mask: + Usage: optional + Value type: + Definition: Slave GPIO number as 32-bit mask + +- dump-regs: + Usage: optional + Value Type: Array of + Definition: List of slave registers to dump by i2c read + +======= +Example +======= + +&i2c_3 { + pcie_i2c_ctrl: pcie_i2c_ctrl { + compatible = "qcom,pcie0-i2c-ntn3"; + reg = <0x77>; + gpio-config-reg = <0x801208>; + ep-reset-reg = <0x801210>; + ep-reset-gpio-mask = <0xf>; + dump-regs = <0x801330 0x801350 0x801370>; + }; +}; From 825929b12ec18cc5287b4c953a4603cb77e5a312 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 26 Mar 2021 18:28:23 -0700 Subject: [PATCH 3/3] ARM: dts: msm: Filter NTN3 downstream BDF for sdxlemur Add DT entry to filter BDF for enumeration. This is required for PCIe NTN3 switch unable to respond to configuration access request to certain supported BDF. Without filtering, such BDF is causing system bus hang. Change-Id: I97dc4411b5dfcce8f02881275fe36388268e3a13 --- qcom/sdxlemur-mtp-mbb-ntn3-pcie.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qcom/sdxlemur-mtp-mbb-ntn3-pcie.dtsi b/qcom/sdxlemur-mtp-mbb-ntn3-pcie.dtsi index 0ca02fe098bb..632a1adda7cd 100644 --- a/qcom/sdxlemur-mtp-mbb-ntn3-pcie.dtsi +++ b/qcom/sdxlemur-mtp-mbb-ntn3-pcie.dtsi @@ -25,6 +25,8 @@ }; &pcie0 { + qcom,filtered-bdfs = <0x02080000>; + iommu-map = <0x0 &apps_smmu 0x0200 0x1>, <0x100 &apps_smmu 0x0201 0x1>, <0x208 &apps_smmu 0x0202 0x1>,