|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |