From: Vinod Koul <vkoul@kernel.org>
To: Qiang Yu <qiang.yu@oss.qualcomm.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Manivannan Sadhasivam <mani@kernel.org>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v8 2/6] phy: qcom: qmp-pcie: Add QMP PCIe Multi-PHY driver
Date: Thu, 6 Aug 2026 21:02:09 +0530 [thread overview]
Message-ID: <anSo-TRpqVm_T_Y1@vaman> (raw)
In-Reply-To: <20260730-glymur_linkmode_0731-v8-2-a455265ad8bf@oss.qualcomm.com>
On 30-07-26, 22:13, Qiang Yu wrote:
> Some QMP PCIe PHY hardware blocks support multiple link topologies (e.g.
> x8 or x4+x4) selected via a TCSR register. The existing single-instance
> QMP PCIe PHY driver has no way to model this: it assumes a single cfg per
> DT node and instantiates exactly one PHY.
>
> Add a dedicated driver for this class of PHY. Match data carries a
> per-mode cfg table; qmp_pcie_multiphy_probe() reads the current link
> mode from the TCSR register pointed to by "qcom,link-mode", looks up the
> corresponding cfg array, and instantiates one qmp_pcie per sub-PHY
> required by that link mode, registering the clock and #phy-cells = <1> phy
> providers so consumers can address individual sub-PHYs by index.
>
> The driver inherits the phy setting and link-mode programmed by firmware,
> so only the no_csr reset is used and no phy setting tables are provided.
>
> Add the first match data and compatible, qcom,glymur-qmp-gen5x8-pcie-phy,
> for the Glymur Gen5 PCIe PHY that can bifurcate into two x4 links or
> operate as a single x8 link.
>
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/Kconfig | 11 +
> drivers/phy/qualcomm/Makefile | 1 +
> drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c | 744 ++++++++++++++++++++++
> 3 files changed, 756 insertions(+)
>
> diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig
> index 60a0ead127fa..8d45820bc84a 100644
> --- a/drivers/phy/qualcomm/Kconfig
> +++ b/drivers/phy/qualcomm/Kconfig
> @@ -77,6 +77,17 @@ config PHY_QCOM_QMP_PCIE
> Enable this to support the QMP PCIe PHY transceiver that is used
> with PCIe controllers on Qualcomm chips.
>
> +config PHY_QCOM_QMP_PCIE_MULTIPHY
> + tristate "Qualcomm QMP PCIe Multi PHY Driver"
> + depends on PCI || COMPILE_TEST
> + select GENERIC_PHY
> + default PHY_QCOM_QMP
Can you please drop this. Let the respective config select it
> +
> +static struct clk_hw *qmp_pcie_multiphy_clk_hw_get(struct of_phandle_args *clkspec,
> + void *data)
please align this to preceding open braces. I think this might look
neater:
static struct clk_hw *
qmp_pcie_multiphy_clk_hw_get(struct of_phandle_args *clkspec, void *data)
> +{
> + struct qmp_pcie_multiphy *qmp_data = data;
> + unsigned int idx = 0;
> +
> + if (clkspec->args_count)
> + idx = clkspec->args[0];
> +
> + if (idx < (unsigned int)qmp_data->num_pipe_outputs)
> + return &qmp_data->pipe_out_clks[idx].hw;
> +
> + return ERR_PTR(-EINVAL);
> +}
> +
> +static int qmp_pcie_multiphy_register_clocks(struct device *dev,
> + struct device_node *np,
> + struct qmp_pcie_multiphy *qmp_data)
please align these two to preceding open braces
> +static int qmp_pcie_probe_phy(struct qmp_pcie *qmp, struct device_node *np,
> + struct phy **out_phy)
> +{
> + int ret;
> +
> + ret = qmp_pcie_get_mmio(qmp);
> + if (ret)
> + return ret;
> +
> + ret = qmp_pcie_clk_init(qmp);
> + if (ret)
> + return ret;
> +
> + ret = qmp_pcie_reset_init(qmp);
> + if (ret)
> + return ret;
> +
> + ret = qmp_pcie_vreg_init(qmp);
> + if (ret)
> + return ret;
> +
> + ret = qmp_pcie_pd_init(qmp);
> + if (ret)
> + return ret;
> +
> + *out_phy = devm_phy_create(qmp->dev, np, &qmp_pcie_phy_ops);
> + if (IS_ERR(*out_phy))
> + return PTR_ERR(*out_phy);
> +
> + phy_set_drvdata(*out_phy, qmp);
> +
> + return 0;
> +}
> +
> +
Two empty lines, please drop one
--
~Vinod
next prev parent reply other threads:[~2026-08-06 15:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 5:13 [PATCH v8 0/6] Add QMP PCIe Multi-PHY support Qiang Yu
2026-07-31 5:13 ` [PATCH v8 1/6] dt-bindings: phy: qcom: Add Glymur QMP PCIe multiple link-mode PHY Qiang Yu
2026-07-31 5:13 ` [PATCH v8 2/6] phy: qcom: qmp-pcie: Add QMP PCIe Multi-PHY driver Qiang Yu
2026-08-06 15:32 ` Vinod Koul [this message]
2026-07-31 5:13 ` [PATCH v8 3/6] arm64: dts: qcom: glymur: Add PCIe3 PHY and PCIe3a controller nodes Qiang Yu
2026-07-31 5:27 ` Manivannan Sadhasivam
2026-07-31 5:13 ` [PATCH v8 4/6] arm64: dts: qcom: glymur-crd: Add PHY supplies for pcie3_phy Qiang Yu
2026-07-31 5:27 ` Manivannan Sadhasivam
2026-07-31 5:13 ` [PATCH v8 5/6] arm64: dts: qcom: mahua: Replace pcie3a/pcie3_phy with dedicated pcie3b_phy Qiang Yu
2026-07-31 5:28 ` Manivannan Sadhasivam
2026-07-31 5:13 ` [PATCH v8 6/6] arm64: dts: qcom: mahua-crd: Add PHY supplies for pcie3b_phy Qiang Yu
2026-07-31 5:29 ` Manivannan Sadhasivam
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=anSo-TRpqVm_T_Y1@vaman \
--to=vkoul@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=qiang.yu@oss.qualcomm.com \
--cc=robh@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