[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 3/3] pci/rcar: Add support for Gen5 PCI host


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Mon, 30 Nov 2026 11:50:15 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qq55rwZ/u8BQxIFPfyY8IPCgJmO/ewYXXkKULR3pI3o=; b=n7d1Salt60F0GOD7FlOKnKVUoUXlqtc/m/T4LBxzS7w46oOOO3Jtfk415CvUJBbp0cTfP0Gm3Ig9GJbScIIAJX7/7dZzRzFPXAf/FeMR3m3GGIIqJ8D95t0BHEezYRFkEMKOP0WylUHO3IiNlfVXCwo1khbIbxNbUBaNCFibhubbqJQN5j55TwgUg4mbe5mgbjP24b7lPLb+/kJfvt6qX0/DVHZUh3pTX2T/LgG9hTYtw3zwP6oWeaZ35ZRMoZK0AsfotUb0Xq2tlfoFBnMve6o3iin/OXEAmKSx8dtBJDO9gd9WQGv7l9Uv17akQhdUPZ2CSEudtYtWLWLc9K6NZw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eEnSWKkhJ8IVcwnV0H/cQW9vtzbgVsVdh5CRhgOs6hEzINb7BydQZAB3kzK7wWBiDm+tXLun0kouKqvdWKz7douYdpzpGL3D3djmlTLBTvAVeFW71yvZq0eAIjTENDEfGURhvFwJvFOXOOVvsfa6k5bS+xnIW3tADQDXlE4QhM7ry/hSfWS5XBt2E09oIJ55692LGQrrnEOyovFZtx3NhKThyNbTkurLXXM1uTnCyQUB05MmtJ18Q57NSgmJc79Goa/cTMcJ4WZI/rghJ2dMfmuTb6kEyrv4gyJtXzMsGFAbkvjj7OMSYnFygpRKSBCTd0C8L3a+SF2PI6h9cPgp8g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>
  • Client-request-id: 377f262e-17ff-49dc-86f6-cc494dde2ad3
  • Delivery-date: Mon, 30 Nov 2026 11:50:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Request-id: be7ef11d-e790-4ac7-2e65-08df4ed81af1
  • Thread-index: AQHdgMD2GPOwAmQT3Ui9jC2fFJfFwA==
  • Thread-topic: [PATCH v2 3/3] pci/rcar: Add support for Gen5 PCI host

Add support for Renesas R-Car Gen5 PCI host controller. This includes
updating the device tree match table to recognize the new compatible
string "renesas,rcar-gen5-pcie6" and skipping the "app" register range
setup when the hardware does not have it.

Gen5 hosts do not expose the "app" register range, so only look it up
on Gen4.

Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
---
v1->v2:
* clarify the commit message regarding app registers
* drop ASSERT() after dt_match_node()
* add CHANGELOG.md entry
---
 CHANGELOG.md                     |  2 ++
 xen/arch/arm/pci/pci-host-rcar.c | 16 +++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f967437eda..e09c4d0b34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,8 @@ The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/)
      afterwards.
 
 ### Added
+ - On Arm:
+   - R-Car Gen5 PCI host controller support.
 
 ### Removed
  - On Arm:
diff --git a/xen/arch/arm/pci/pci-host-rcar.c b/xen/arch/arm/pci/pci-host-rcar.c
index 883ccfaeca..b4f678d6f0 100644
--- a/xen/arch/arm/pci/pci-host-rcar.c
+++ b/xen/arch/arm/pci/pci-host-rcar.c
@@ -17,6 +17,9 @@
 
 #define RCAR_DWC_VERSION     0x520A
 
+#define RCAR_GEN4    4
+#define RCAR_GEN5    5
+
 /* PCIE BDF-OSID assignment */
 #define CNVID(n)             (0x700 + ((n) * 4))
 #define CNVID_CNV_EN         (1U << 31)
@@ -87,8 +90,9 @@ static const struct pci_ecam_ops rcar_pcie_child_ops = {
 };
 
 static const struct dt_device_match __initconstrel rcar_pcie_dt_match[] = {
-    { .compatible = "renesas,r8a779f0-pcie" },
-    { .compatible = "renesas,r8a779g0-pcie" },
+    { .compatible = "renesas,r8a779f0-pcie", .data = (void *)RCAR_GEN4 },
+    { .compatible = "renesas,r8a779g0-pcie", .data = (void *)RCAR_GEN4 },
+    { .compatible = "renesas,rcar-gen5-pcie6", .data = (void *)RCAR_GEN5 },
     {},
 };
 
@@ -182,6 +186,7 @@ void rcar4_pcie_bdf_msk_set(struct pci_host_bridge *bridge, 
unsigned int reg_id,
 static int __init pci_host_rcar_probe(struct dt_device_node *dev,
                                       const void *data)
 {
+    const struct dt_device_match *match;
     struct pci_host_bridge *bridge;
     paddr_t app_phys_addr;
     paddr_t app_size;
@@ -199,6 +204,10 @@ static int __init pci_host_rcar_probe(struct 
dt_device_node *dev,
         goto err;
     }
 
+    match = dt_match_node(rcar_pcie_dt_match, dev);
+    if ( match->data != (void *)RCAR_GEN4 )
+        goto skip_app;
+
     app_idx = dt_property_match_string(dev, "reg-names", "app");
     if ( app_idx < 0 )
     {
@@ -223,6 +232,7 @@ static int __init pci_host_rcar_probe(struct dt_device_node 
*dev,
     printk("APP at [mem 0x%" PRIpaddr "-0x%" PRIpaddr "]\n", app_phys_addr,
            app_phys_addr + app_size - 1);
 
+skip_app:
     dw_pcie_set_priv(bridge, priv);
     dw_pcie_set_version(bridge, RCAR_DWC_VERSION);
 
@@ -232,7 +242,7 @@ err:
     return ret;
 }
 
-DT_DEVICE_START(pci_gen, "PCI HOST R-CAR GEN4", DEVICE_PCI_HOSTBRIDGE)
+DT_DEVICE_START(pci_gen, "PCI HOST R-CAR GEN4/GEN5", DEVICE_PCI_HOSTBRIDGE)
 .dt_match = rcar_pcie_dt_match,
 .init = pci_host_rcar_probe,
 DT_DEVICE_END

-- 
2.56.1

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.