This commit moves ISA-specific code to separate function and makes that
function depend on CONFIG_{E}ISA so that we do not have to maintain
acpi_isa_irq_to_gsi() function for architectures which do not support ISA.
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
---
drivers/acpi/pci_irq.c | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 361b40c..0a553a0 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -370,6 +370,30 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
return NULL;
}
+#if IS_ENABLED(CONFIG_ISA) || IS_ENABLED(CONFIG_EISA)
+static int acpi_isa_register_gsi(struct pci_dev *dev)
+{
+ u32 dev_gsi;
+
+ /* Interrupt Line values above 0xF are forbidden */
+ if (dev->irq > 0 && (dev->irq <= 0xF) &&
+ (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
+ dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
+ pin_name(dev->pin), dev->irq);
+ acpi_register_gsi(&dev->dev, dev_gsi,
+ ACPI_LEVEL_SENSITIVE,
+ ACPI_ACTIVE_LOW);
+ return 0;
+ }
+ return -EINVAL;
+}
+#else
+static inline int acpi_isa_register_gsi(struct pci_dev *dev)
+{
+ return -ENODEV;
+}
+#endif
+
int acpi_pci_irq_enable(struct pci_dev *dev)
{
struct acpi_prt_entry *entry;
@@ -416,16 +440,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
* driver reported one, then use it. Exit in any case.
*/
if (gsi < 0) {
- u32 dev_gsi;
- /* Interrupt Line values above 0xF are forbidden */
- if (dev->irq > 0 && (dev->irq <= 0xF) &&
- (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
- dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
- pin_name(pin), dev->irq);
- acpi_register_gsi(&dev->dev, dev_gsi,
- ACPI_LEVEL_SENSITIVE,
- ACPI_ACTIVE_LOW);
- } else {
+ if (acpi_isa_register_gsi(dev)) {
dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
pin_name(pin));
}
--
1.7.9.5
Some of the ACPI code is arch-dependent and make the code can't be
compiled on !x86 or !ia64, the first two patches just do some rework
on the idle_boot_override and _PDC related stuff to make the ACPI
code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core
followed the ACPI 5.0 spec. Last two patches are just some cleanups.
I have compiled the kernel successfully after appling this patch set
on x86 and ia64.
Changes for v4:
a) remove preprocessor directives in function bodies;
b) add another two patches for cleanups.
Changes for v3:
Fix the issues pointed out by Lan Tianyu and add the Reviewed-by for
first patch.
Changes for v2:
a) add #if defined(CONFIG_X86) || defined(CONFIG_IA64) for
idle_boot_override related code;
b) Rebased on 3.14-rc1.
Changes since the RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested
by Alan;
c) Make these 3 patches as a separate patch set since there are
not not related to the ARM/ARM64 platform.
Hanjun Guo (5):
ACPI / idle: Make idle_boot_override depend on x86 and ia64
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI / processor: Introduce map_gic_id() to get apic id from MADT or
_MAT method
ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
ACPI: Replace printk with pr_* in tables.c
arch/ia64/include/asm/acpi.h | 5 +--
arch/ia64/kernel/acpi.c | 18 ++++++--
arch/x86/include/asm/acpi.h | 19 +--------
arch/x86/kernel/acpi/boot.c | 4 --
arch/x86/kernel/acpi/cstate.c | 29 +++++++++++++
drivers/acpi/processor_core.c | 92 ++++++++++++++++++++++++-----------------
drivers/acpi/tables.c | 51 +++++++++--------------
include/linux/acpi.h | 4 ++
8 files changed, 124 insertions(+), 98 deletions(-)
--
1.7.9.5
Some of the ACPI code is arch-dependent and make the code can't be
compiled on !x86 or !ia64, the first two patches just do some rework
on the idle_boot_override and _PDC related stuff to make the ACPI
code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core
followed by the ACPI 5.0 spec.
I have compiled the kernel successfully after appling this patch set
on x86 and ia64.
Changes for v2:
a) add #if defined(CONFIG_X86) || defined(CONFIG_IA64) for
idle_boot_override related code;
b) Rebased on 3.14-rc1.
Changes since the RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested
by Alan;
c) Make these 3 patches as a separate patch set since there are
not not related to the ARM/ARM64 platform.
Hanjun Guo (3):
ACPI / idle: Make idle_boot_override depend on x86 and ia64
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI: Introduce map_gic_id() to get apic id from MADT or _MAT method
arch/ia64/include/asm/acpi.h | 5 +--
arch/ia64/kernel/acpi.c | 17 +++++++++
arch/x86/include/asm/acpi.h | 19 +--------
arch/x86/kernel/acpi/cstate.c | 31 +++++++++++++++
drivers/acpi/processor_core.c | 85 ++++++++++++++++++++++++-----------------
5 files changed, 99 insertions(+), 58 deletions(-)
--
1.7.9.5
The leg-kernel release has been made and tagged as leg-20140217.0
This is based on mainline kernel v3.14-rc3
Repository : http://git.linaro.org/arm/acpi/leg-kernel.git
Direct Link: https://git.linaro.org/arm/acpi/leg-kernel.git/commit/f7f2b0bff8dacdb0e5768…
Notes :-
1) starting from this release, a FDT is not used to describe the platform. The
kernel uses ACPI tables only. This release contains prototype code to boot
the CPUs from information held in the MADT. It is hard coded to PSCI control
method for the FVP base model.
The leg-kernel release has been made and tagged as leg-20140211.0
This is based on mainline kernel v3.14-rc2
Repository : http://git.linaro.org/arm/acpi/leg-kernel.git
Direct Link: http://git.linaro.org/arm/acpi/leg-kernel.git/commit/a48313884f9124e9703f8c…
Notes :-
1) starting from this release, a FDT is not used to describe the platform. The
kernel uses ACPI tables only. Given that current ACPI 5.0 tables have
limitations in the MADT fields with regards to CPU topology for ARM platforms,
currently this means that booting with ACPI will boot with only one processor
running. This will remain until ACPI booting from PSCI prototype is completed.
As hinted last month with the introduction of a dummy patch[1], the team is
focusing on this and plans to present a prototype solution at LCA-14.
Booting in FDT mode is unaffected.
[1] http://www.spinics.net/lists/linux-acpi/msg48537.html
Some of the ACPI code is arch-dependent and make the code can't be
compiled on !x86 or !ia64, the first two patches just do some rework
on the idle_boot_override and _PDC related stuff to make the ACPI
code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core
followed the ACPI 5.0 spec.
I have compiled the kernel successfully after appling this patch set
on x86 and ia64.
Changes for v3:
Fix the issues pointed out by Lan Tianyu and and the Reviewed-by for
first patch.
Changes for v2:
a) add #if defined(CONFIG_X86) || defined(CONFIG_IA64) for
idle_boot_override related code;
b) Rebased on 3.14-rc1.
Changes since the RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested
by Alan;
c) Make these 3 patches as a separate patch set since there are
not not related to the ARM/ARM64 platform.
Hanjun Guo (3):
ACPI / idle: Make idle_boot_override depend on x86 and ia64
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI: Introduce map_gic_id() to get apic id from MADT or _MAT method
arch/ia64/include/asm/acpi.h | 5 +--
arch/ia64/kernel/acpi.c | 17 +++++++++
arch/x86/include/asm/acpi.h | 19 +--------
arch/x86/kernel/acpi/cstate.c | 31 +++++++++++++++
drivers/acpi/processor_core.c | 85 ++++++++++++++++++++++++-----------------
5 files changed, 99 insertions(+), 58 deletions(-)
--
1.7.9.5