diff mbox series

[RFC,1/3] PCI: cadence: Add architecture information for PCIe controller

Message ID CH2PPF4D26F8E1C021640F924EF26D4CAD4A2F12@CH2PPF4D26F8E1C.namprd07.prod.outlook.com (mailing list archive)
State RFC
Delegated to: Krzysztof WilczyƄski
Headers show
Series PCI: cadence: Add support for next gen PCIe controller | expand

Commit Message

Manikandan Karunakaran Pillai Feb. 7, 2025, 9:40 a.m. UTC
Add is_hpa boolean to struct cdns_pcie, to support presence of next generation - HPA(High performance architecture) PCIe controllers.

Signed-off-by: Manikandan K Pillai <mpillai@cadence.com>
---
 drivers/pci/controller/cadence/pcie-cadence-plat.c | 5 +++++
 drivers/pci/controller/cadence/pcie-cadence.h      | 1 +
 2 files changed, 6 insertions(+)

--
2.27.0
diff mbox series

Patch

diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c
index 0456845dabb9..98ffd184be93 100644
--- a/drivers/pci/controller/cadence/pcie-cadence-plat.c
+++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c
@@ -42,11 +42,13 @@  static int cdns_plat_pcie_probe(struct platform_device *pdev)
 	const struct cdns_plat_pcie_of_data *data;
 	struct cdns_plat_pcie *cdns_plat_pcie;
 	struct device *dev = &pdev->dev;
+	struct device_node *np = dev->of_node;
 	struct pci_host_bridge *bridge;
 	struct cdns_pcie_ep *ep;
 	struct cdns_pcie_rc *rc;
 	int phy_count;
 	bool is_rc;
+	bool is_hpa;
 	int ret;
 
 	data = of_device_get_match_data(dev);
@@ -55,6 +57,8 @@  static int cdns_plat_pcie_probe(struct platform_device *pdev)
 
 	is_rc = data->is_rc;
 
+	is_hpa = of_property_read_bool(np, "hpa");
+
 	pr_debug(" Started %s with is_rc: %d\n", __func__, is_rc);
 	cdns_plat_pcie = devm_kzalloc(dev, sizeof(*cdns_plat_pcie), GFP_KERNEL);
 	if (!cdns_plat_pcie)
@@ -72,6 +76,7 @@  static int cdns_plat_pcie_probe(struct platform_device *pdev)
 		rc = pci_host_bridge_priv(bridge);
 		rc->pcie.dev = dev;
 		rc->pcie.ops = &cdns_plat_ops;
+		rc->pcie.is_hpa = is_hpa;
 		cdns_plat_pcie->pcie = &rc->pcie;
 
 		ret = cdns_pcie_init_phy(dev, cdns_plat_pcie->pcie); diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h
index f5eeff834ec1..fecb64ec9581 100644
--- a/drivers/pci/controller/cadence/pcie-cadence.h
+++ b/drivers/pci/controller/cadence/pcie-cadence.h
@@ -305,6 +305,7 @@  struct cdns_pcie {
 	struct resource		*mem_res;
 	struct device		*dev;
 	bool			is_rc;
+	bool			is_hpa;
 	int			phy_count;
 	struct phy		**phy;
 	struct device_link	**link;