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

[PATCH v1 2/2] pci/rcar: Add support for Gen5 PCI host


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Mon, 16 Nov 2026 08:40:19 +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=XTxm5m4FP+hzQnpGiRPxKxWKCD2d2IuIBmvOjgaaa3Q=; b=Yt5fT6cxlEnS0ZbUVCjttq2icJ6/uOQQ0NpmTQQma6d86Fmknrv7LTIiVYJVg6xfMI8CoBjynRik14VWo+FWvBECbqVXKyPTpRdj4QzcUAFGjtx0jPA8Ge6ilJswhjQ1gSgyaOMMmORvMzhHOXudFn25+09G56/kFK9rB4zYR4XMMQF/tQpW/Yhb6UYuUp65Q76ycuDZ6zxA+UekeQqAYzD3ceZ4rGgQXUmmO6sJAQzUiORRKmvC52YwOvBLsGAOEC+Dalkw6OY59TS0kgSBVgcwbnM4Dgzhi72xUSCC81Z90Ru7K5uBwKJnWMUU0gUIBKA2fXvJlxl2Wdi26RpwBQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nQ+H+9L6xb0dJ+gqjMShP0nhR+rmvJZ1U6UDX0dJrbWEt/UZSnwWcFXpRzoUhPmJipS7AHiPru+k8fx2Fe+hOk/iR5gme6GdduqctLOjzHHQ3obckNLFmd2FWNB3FMCjcErf0Vr2H0LzU2vUIS2Jgy/sfi1PxsWGo3ietN6NJoxSd2eXozzMebLvQiROPdYWWJbOHnwhjl4g0gsHS4XvoKgvZIATVsZRz8jRcwnvhdJ42dbUotjZCNLaYn282vjjuDfvSHwNwc1EE1kkdySiekXjlphvivYTohBmVe1kLDwu1m3wSvQI2XBYDq6KxpinytmfZvm7d+fOz8tXJaN0uQ==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 16 Nov 2026 08:40:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHddaYcAIucuvPO/0quJ8il+q1yMg==
  • Thread-topic: [PATCH v1 2/2] 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 ensuring that the OSID registers
are only initialized when they are supported by the hardware.

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

Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
 xen/arch/arm/pci/pci-host-rcar.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-rcar.c b/xen/arch/arm/pci/pci-host-rcar.c
index 5f184d5ebc..87b3ccbc1c 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;
@@ -194,6 +199,11 @@ static int __init pci_host_rcar_probe(struct 
dt_device_node *dev,
     bridge = dw_pcie_host_probe(dev, data, &rcar_pcie_ops,
                                 &rcar_pcie_child_ops);
 
+    match = dt_match_node(rcar_pcie_dt_match, dev);
+    ASSERT(match);
+    if ( match->data != (void *)RCAR_GEN4 )
+        goto skip_app;
+
     app_idx = dt_property_match_string(dev, "reg-names", "app");
     if ( app_idx < 0 )
     {
@@ -218,6 +228,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);
 
@@ -227,7 +238,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®.