diff options
author | Tomasz Nowicki <tn@semihalf.com> | 2016-06-10 15:55:18 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-06-10 19:36:19 -0400 |
commit | f058f4fbd64028c9e9d433472cf6bcff8efdce7c (patch) | |
tree | b5e5fe0b58be15d592f533e8c3348edc67c52e00 | |
parent | d8ed75d593321c80ccd92f9dba218e90286bde16 (diff) |
ARM64: PCI: Implement AML accessors for PCI_Config region
On ACPI systems, the PCI_Config OperationRegion allows AML to access PCI
configuration space. The ACPI CA AML interpreter uses performs config
space accesses with acpi_os_read_pci_configuration() and
acpi_os_write_pci_configuration(), which are OS-dependent functions
supplied by acpi/osl.c.
Implement the arch-specific raw_pci_read() and raw_pci_write() interfaces
used by acpi/osl.c for PCI_Config accesses.
N.B. PCI_Config accesses are not supported before PCI bus enumeration.
[bhelgaas: changelog]
Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r-- | arch/arm64/kernel/pci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index b3b8a2c68510..328f85727d35 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c | |||
@@ -71,13 +71,21 @@ int pcibios_alloc_irq(struct pci_dev *dev) | |||
71 | int raw_pci_read(unsigned int domain, unsigned int bus, | 71 | int raw_pci_read(unsigned int domain, unsigned int bus, |
72 | unsigned int devfn, int reg, int len, u32 *val) | 72 | unsigned int devfn, int reg, int len, u32 *val) |
73 | { | 73 | { |
74 | return -ENXIO; | 74 | struct pci_bus *b = pci_find_bus(domain, bus); |
75 | |||
76 | if (!b) | ||
77 | return PCIBIOS_DEVICE_NOT_FOUND; | ||
78 | return b->ops->read(b, devfn, reg, len, val); | ||
75 | } | 79 | } |
76 | 80 | ||
77 | int raw_pci_write(unsigned int domain, unsigned int bus, | 81 | int raw_pci_write(unsigned int domain, unsigned int bus, |
78 | unsigned int devfn, int reg, int len, u32 val) | 82 | unsigned int devfn, int reg, int len, u32 val) |
79 | { | 83 | { |
80 | return -ENXIO; | 84 | struct pci_bus *b = pci_find_bus(domain, bus); |
85 | |||
86 | if (!b) | ||
87 | return PCIBIOS_DEVICE_NOT_FOUND; | ||
88 | return b->ops->write(b, devfn, reg, len, val); | ||
81 | } | 89 | } |
82 | 90 | ||
83 | #ifdef CONFIG_NUMA | 91 | #ifdef CONFIG_NUMA |