Commit 01415e78 authored by Sunil V L's avatar Sunil V L Committed by Rafael J. Wysocki

ACPI: RISC-V: Implement PCI related functionality

Replace the dummy implementation for PCI related functions with actual
implementation. This needs ECAM and MCFG CONFIG options to be enabled
for RISC-V.
Signed-off-by: default avatarSunil V L <sunilvl@ventanamicro.com>
Tested-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
Link: https://patch.msgid.link/20240812005929.113499-10-sunilvl@ventanamicro.comSigned-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2cb9155d
...@@ -13,6 +13,7 @@ config 32BIT ...@@ -13,6 +13,7 @@ config 32BIT
config RISCV config RISCV
def_bool y def_bool y
select ACPI_GENERIC_GSI if ACPI select ACPI_GENERIC_GSI if ACPI
select ACPI_MCFG if (ACPI && PCI)
select ACPI_PPTT if ACPI select ACPI_PPTT if ACPI
select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_REDUCED_HARDWARE_ONLY if ACPI
select ACPI_SPCR_TABLE if ACPI select ACPI_SPCR_TABLE if ACPI
...@@ -188,6 +189,7 @@ config RISCV ...@@ -188,6 +189,7 @@ config RISCV
select OF_EARLY_FLATTREE select OF_EARLY_FLATTREE
select OF_IRQ select OF_IRQ
select PCI_DOMAINS_GENERIC if PCI select PCI_DOMAINS_GENERIC if PCI
select PCI_ECAM if (ACPI && PCI)
select PCI_MSI if PCI select PCI_MSI if PCI
select RISCV_ALTERNATIVE if !XIP_KERNEL select RISCV_ALTERNATIVE if !XIP_KERNEL
select RISCV_APLIC select RISCV_APLIC
......
...@@ -311,29 +311,26 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) ...@@ -311,29 +311,26 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
/* /*
* These interfaces are defined just to enable building ACPI core. * raw_pci_read/write - Platform-specific PCI config space access.
* TODO: Update it with actual implementation when external interrupt
* controller support is added in RISC-V ACPI.
*/ */
int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, int raw_pci_read(unsigned int domain, unsigned int bus,
int reg, int len, u32 *val) unsigned int devfn, int reg, int len, u32 *val)
{ {
return PCIBIOS_DEVICE_NOT_FOUND; struct pci_bus *b = pci_find_bus(domain, bus);
}
int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, if (!b)
int reg, int len, u32 val) return PCIBIOS_DEVICE_NOT_FOUND;
{ return b->ops->read(b, devfn, reg, len, val);
return PCIBIOS_DEVICE_NOT_FOUND;
} }
int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) int raw_pci_write(unsigned int domain, unsigned int bus,
unsigned int devfn, int reg, int len, u32 val)
{ {
return -1; struct pci_bus *b = pci_find_bus(domain, bus);
}
struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) if (!b)
{ return PCIBIOS_DEVICE_NOT_FOUND;
return NULL; return b->ops->write(b, devfn, reg, len, val);
} }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
...@@ -1543,7 +1543,7 @@ static int __init acpi_pci_init(void) ...@@ -1543,7 +1543,7 @@ static int __init acpi_pci_init(void)
} }
arch_initcall(acpi_pci_init); arch_initcall(acpi_pci_init);
#if defined(CONFIG_ARM64) #if defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
/* /*
* Try to assign the IRQ number when probing a new device * Try to assign the IRQ number when probing a new device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment