From: Frank Li <Frank.li@oss.nxp.com>
To: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Jeff Hugo" <jeff.hugo@oss.qualcomm.com>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Frank Li" <Frank.Li@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Niklas Cassel" <cassel@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Vinod Koul" <vkoul@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Abel Vesa" <abelvesa@kernel.org>,
mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-phy@lists.infradead.org
Subject: Re: [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support
Date: Mon, 23 Nov 2026 10:56:06 -0600 [thread overview]
Message-ID: <awRwJi0Wflbuox6i@SMW015318> (raw)
In-Reply-To: <20261122-nord_ep-v1-5-6d8839ffa9aa@oss.qualcomm.com>
On Sun, Nov 22, 2026 at 08:26:18AM +0530, Krishna Chaitanya Chundru wrote:
>
> The register initialization sequence differs slightly between root
> complex and endpoint mode. Add a .set_mode() op that records the
> requested PCIe submode, and an optional per-config tbls_ep delta that is
> applied as a second qmp_configure() pass over the pll_common/txrxz/pcs
> blocks when the PHY was put into endpoint mode before power-on.
>
> Configs that do not provide tbls_ep are unaffected and continue to
> program only the root-complex tables.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c | 26 +++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
> index ccdb7748a9e1..21cf6adf7d60 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
> @@ -13,6 +13,7 @@
> #include <linux/mfd/syscon.h>
> #include <linux/module.h>
> #include <linux/of.h>
> +#include <linux/phy/pcie.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> @@ -89,6 +90,7 @@ struct qmp_phy_cfg_tbls {
> struct qmp_phy_cfg {
> const struct qmp_pcie_offsets *offsets;
> const struct qmp_phy_cfg_tbls tbls;
> + const struct qmp_phy_cfg_tbls *tbls_ep;
> const struct qmp_phy_init_tbl * const *pll_tbls;
> const int *pll_nums;
> bool port_split;
> @@ -121,6 +123,7 @@ struct qmp_pcie {
> struct reset_control_bulk_data *nocsr_resets;
> struct regulator_bulk_data *vregs;
> struct device **pd_devs;
> + bool is_ep;
> };
>
> struct qmp_pcie_multiphy {
> @@ -930,6 +933,7 @@ static void qmp_pcie_init_port_registers(struct qmp_pcie *qmp)
> const struct qmp_phy_cfg *cfg = qmp->cfg;
> const struct qmp_pcie_offsets *offs = cfg->offsets;
> const struct qmp_phy_cfg_tbls *tbls = &cfg->tbls;
> + const struct qmp_phy_cfg_tbls *ep_tbls = qmp->is_ep ? cfg->tbls_ep : NULL;
> int i;
>
> for (i = 0; i < cfg->num_regs; i++) {
> @@ -957,6 +961,15 @@ static void qmp_pcie_init_port_registers(struct qmp_pcie *qmp)
> qmp_configure(qmp->dev, port + offs->pcs_lanez,
> tbls->pcs_lanez, tbls->pcs_lanez_num);
>
> + if (ep_tbls) {
> + qmp_configure(qmp->dev, port + offs->pll,
> + ep_tbls->pll_common, ep_tbls->pll_common_num);
> + qmp_configure(qmp->dev, port + offs->txrxz,
> + ep_tbls->txrxz, ep_tbls->txrxz_num);
> + qmp_configure(qmp->dev, port + offs->pcs,
> + ep_tbls->pcs, ep_tbls->pcs_num);
> + }
> +
> if (cfg->port_split)
> qmp_configure(qmp->dev, port + offs->txrxz,
> tbls->port_split_post_cfg, tbls->port_split_post_cfg_num);
> @@ -1179,9 +1192,22 @@ static int qmp_pcie_disable(struct phy *phy)
> return qmp_pcie_exit(phy);
> }
>
> +static int qmp_pcie_set_mode(struct phy *phy, enum phy_mode mode, int submode)
> +{
> + struct qmp_pcie *qmp = phy_get_drvdata(phy);
> +
> + if (mode != PHY_MODE_PCIE)
> + return -EINVAL;
> +
> + qmp->is_ep = (submode == PHY_MODE_PCIE_EP);
feel direct save cfg->tbls_ep to qmp is simpler
qmp->tbls_ep = submode == PHY_MODE_PCIE_EP ? cfg->tbls_ep : NULL;;
Frank
> +
> + return 0;
> +}
> +
> static const struct phy_ops qmp_pcie_phy_ops = {
> .power_on = qmp_pcie_enable,
> .power_off = qmp_pcie_disable,
> + .set_mode = qmp_pcie_set_mode,
> .owner = THIS_MODULE,
> };
>
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-11-23 16:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22 2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
2026-11-22 3:03 ` sashiko-bot
2026-11-23 10:03 ` Niklas Cassel
2026-11-22 2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
2026-11-22 3:08 ` sashiko-bot
2026-11-23 16:41 ` Frank Li
2026-11-22 2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
2026-11-22 3:15 ` sashiko-bot
2026-11-23 16:48 ` Frank Li
2026-11-22 2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
2026-11-23 16:49 ` Frank Li
2026-11-22 2:56 ` [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support Krishna Chaitanya Chundru
2026-11-23 16:56 ` Frank Li [this message]
2026-11-22 2:56 ` [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences Krishna Chaitanya Chundru
2026-11-23 16:57 ` Frank Li
2026-11-22 2:56 ` [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint Krishna Chaitanya Chundru
2026-11-22 2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22 3:08 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
2026-11-22 2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
2026-11-22 3:19 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
2026-11-22 3:17 ` sashiko-bot
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=awRwJi0Wflbuox6i@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=jingoohan1@gmail.com \
--cc=kishon@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=vkoul@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