|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH 1/2] pci: Allow platforms to modify BAR adresses
On 21.04.2026 09:57, Mykyta Poturai wrote:
> This patch is a preparatory work for adding Region ID support on Renesas
> R-Car series boards. Add new host bridge op "fixup_bar" that allows
> platforms to modify BAR addresses before they are mapped.
>
> Because x86 don't have support for PCI Host Bridge drivers, add another
> level of indirection in form of platform_pci_fixup_bar() function, that
> will call host bridge op on ARM and do nothing on x86.
>
> Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
> ---
> xen/arch/arm/include/asm/pci.h | 3 +++
> xen/arch/arm/include/asm/vpci.h | 9 +++++++++
> xen/arch/arm/vpci.c | 12 ++++++++++++
> xen/arch/x86/include/asm/vpci.h | 6 ++++++
> xen/drivers/vpci/header.c | 2 ++
> 5 files changed, 32 insertions(+)
>
> diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
> index 7c3211823f..398a4eb746 100644
> --- a/xen/arch/arm/include/asm/pci.h
> +++ b/xen/arch/arm/include/asm/pci.h
> @@ -80,6 +80,9 @@ struct pci_ops {
> void (*init_bus_range)(struct dt_device_node *dev,
> struct pci_host_bridge *bridge,
> struct pci_config_window *cfg);
> + void (*fixup_bar)(struct pci_host_bridge *bridge,
> + unsigned int bar_num,
> + paddr_t *addr);
I'm not an Arm maintainer, but if such a hook - used only when a certain
CONFIG_* is active, as per patch 2 - was introduced in common or x86 code,
I'd ask for the hook to also be conditional. Doing so avoids accidental use
without ...
> --- a/xen/arch/arm/vpci.c
> +++ b/xen/arch/arm/vpci.c
> @@ -189,6 +189,18 @@ unsigned int domain_vpci_get_num_mmio_handlers(struct
> domain *d)
> return 1;
> }
>
> +void platform_pci_fixup_bar(const struct pci_dev *pdev,
> + unsigned int bar_num,
> + paddr_t *addr)
> +{
> + struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->sbdf.seg,
> pdev->sbdf.bus);
> +
> + if ( bridge->ops->fixup_bar )
> + {
> + bridge->ops->fixup_bar(bridge, bar_num, addr);
> + }
... such a conditional around it.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |