From: Krishna Chaitanya Chundru <quic_krichai@quicinc.com>
To: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
"Veerabhadrarao Badiganti" <quic_vbadigan@quicinc.com>,
<quic_skananth@quicinc.com>, <bartosz.golaszewski@linaro.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"open list:PCIE ENDPOINT DRIVER FOR QUALCOMM"
<linux-arm-msm@vger.kernel.org>
Subject: Proposal for QCOM PCIe switch power and configuration driver
Date: Thu, 11 Jan 2024 23:08:52 +0530 [thread overview]
Message-ID: <413d612f-0e31-6281-64e3-6484b85afe06@quicinc.com> (raw)
Hi DT maintainers,
We are trying to upstream the QCOM PCIe switch which has I2C interface
to configure the switch.
In generic a PCIe switch is a device that allows expansion of PCI
Express hierarchy, which allows more devices(PCIe endpoints) to be
connected to a single PCIe port.
We need to configure the QCOM switch like L0s, L1ss entry times, Tx
amplitudes etc.. through I2C interface before PCIe link is established
as these settings can affect link stability if we don't configure them.
Once PCIe switch is configured, PCIe link between the PCIe switch and
PCIe port connected should be established by the QCOM PCIe controller
driver to enumerate the PCIe endpoints connected to the PCIe switch.
We had a QCOM switch driver which powers on the switch and do the I2C
configurations.
This is how the flow goes.
-->Power on the switch
-->Do Switch configuration (over i2c) with qcom switch driver
-->PCIe link training and enumeration.
From the the above requirements we want a I2C client driver which probes
first and power's on the switch and do switch configurations through
I2C, and then PCIe driver needs to probe and do the link training and
enumeration. And for suspend resume usecase also we need these probe
dependencies.
As we can't keep the probe dependencies between PCIe controller driver
and I2C client driver in the DT, we want to propose following solution.
Since the I2C driver need to configure the switch and power it on before
the PCIe driver attempts to probe the device, we thought of exposing a
reset controller from the I2C driver.
We came up with this reset controller idea because the I2C driver
essentially has to configure the switch and power on the device, then
only the PCIe driver has to probe the switch. This aligns with how reset
controller operates in general.
This is how sample DT looks like
diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
index 2ff549f4dc7a..222206902305 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
@@ -414,6 +414,18 @@ &lpass_va_macro {
vdd-micb-supply = <&vreg_bob>;
};
+&i2c0 {
+ clock-frequency = <100000>;
+ status = "okay";
+
+ pcie_switch: pcie-switch@77 {
+ compatible = "qcom,switch-i2c";
+ reg = <0x77>;
+ vdda-supply = <&pcie_switch_rest_vreg>;
+ status = "okay";
+ };
+};
+
&pcie1 {
status = "okay";
perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
@@ -422,6 +434,10 @@ &pcie1 {
pinctrl-names = "default";
pinctrl-0 = <&pcie1_reset_n>, <&pcie1_wake_n>;
+
+ resets = <&gcc GCC_PCIE_1_BCR>,
+ <&pcie_switch 0>;
+ reset-names = "pci","device";
};
Can you please tell us whether this approach is acceptable or not?
we are open for any other suggestions also.
Thanks & Regards,
Krishna Chaitanya.
next reply other threads:[~2024-01-11 17:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 17:38 Krishna Chaitanya Chundru [this message]
2024-01-11 17:50 ` Krzysztof Kozlowski
2024-01-12 4:16 ` Krishna Chaitanya Chundru
2024-01-12 8:29 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=413d612f-0e31-6281-64e3-6484b85afe06@quicinc.com \
--to=quic_krichai@quicinc.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_skananth@quicinc.com \
--cc=quic_vbadigan@quicinc.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®