From: Sushrut Shree Trivedi <sushrut.trivedi@oss.qualcomm.com>
To: "Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
cros-qcom-dts-watchers@chromium.org,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
Sushrut Shree Trivedi <sushrut.trivedi@oss.qualcomm.com>
Subject: [PATCH 1/2] PCI: dwc: Program device-id
Date: Thu, 27 Nov 2025 21:00:51 +0530 [thread overview]
Message-ID: <20251127-program-device-id-v1-1-31ad36beda2c@quicinc.com> (raw)
In-Reply-To: <20251127-program-device-id-v1-0-31ad36beda2c@quicinc.com>
For some controllers, HW doesn't program the correct device-id
leading to incorrect identification in lspci. For ex, QCOM
controller SC7280 uses same device id as SM8250. This would
cause issues while applying controller specific quirks.
So, program the correct device-id after reading it from the
devicetree.
Signed-off-by: Sushrut Shree Trivedi <sushrut.trivedi@oss.qualcomm.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 7 +++++++
drivers/pci/controller/dwc/pcie-designware.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index e92513c5bda5..e8b975044b22 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -619,6 +619,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
}
}
+ pp->device_id = 0xffff;
+ of_property_read_u32(np, "device-id", &pp->device_id);
+
dw_pcie_version_detect(pci);
dw_pcie_iatu_detect(pci);
@@ -1094,6 +1097,10 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp)
dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, 0);
+ /* Program correct device id */
+ if (pp->device_id != 0xffff)
+ dw_pcie_writew_dbi(pci, PCI_DEVICE_ID, pp->device_id);
+
/* Program correct class for RC */
dw_pcie_writew_dbi(pci, PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_PCI);
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index e995f692a1ec..eff6da9438c4 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -431,6 +431,8 @@ struct dw_pcie_rp {
struct pci_config_window *cfg;
bool ecam_enabled;
bool native_ecam;
+ u32 vendor_id;
+ u32 device_id;
};
struct dw_pcie_ep_ops {
--
2.25.1
next prev parent reply other threads:[~2025-11-27 15:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 15:30 [PATCH 0/2] PCI: dwc: Program device-id Sushrut Shree Trivedi
2025-11-27 15:30 ` Sushrut Shree Trivedi [this message]
2025-11-28 1:03 ` [PATCH 1/2] " Shawn Lin
2025-11-29 7:34 ` Manivannan Sadhasivam
2025-11-30 2:43 ` Shawn Lin
2025-11-30 15:05 ` Manivannan Sadhasivam
2025-11-29 7:28 ` Manivannan Sadhasivam
2025-11-27 15:30 ` [PATCH 2/2] arm64: dts: qcom: sc7280: Add PCIe device-id Sushrut Shree Trivedi
2025-11-28 11:05 ` [PATCH 0/2] PCI: dwc: Program device-id Konrad Dybcio
2025-12-01 12:26 ` Rob Herring
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=20251127-program-device-id-v1-1-31ad36beda2c@quicinc.com \
--to=sushrut.trivedi@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=cros-qcom-dts-watchers@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=jingoohan1@gmail.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--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