2 * Copyright (C) 2013-2014, Linaro Ltd.
3 * Author: Al Stone <al.stone@linaro.org>
4 * Author: Graeme Gregory <graeme.gregory@linaro.org>
5 * Author: Hanjun Guo <hanjun.guo@linaro.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation;
16 #include <linux/irqchip/arm-gic-acpi.h>
18 #include <asm/cputype.h>
19 #include <asm/smp_plat.h>
21 /* Basic configuration for ACPI */
23 /* ACPI table mapping after acpi_gbl_permanent_mmap is set */
24 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
27 if (!page_is_ram(phys >> PAGE_SHIFT))
28 return ioremap(phys, size);
30 return ioremap_cache(phys, size);
32 #define acpi_os_ioremap acpi_os_ioremap
34 typedef u64 phys_cpuid_t;
35 #define PHYS_CPUID_INVALID INVALID_HWID
37 #define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */
38 extern int acpi_disabled;
39 extern int acpi_noirq;
40 extern int acpi_pci_disabled;
42 /* 1 to indicate PSCI 0.2+ is implemented */
43 static inline bool acpi_psci_present(void)
45 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
48 /* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */
49 static inline bool acpi_psci_use_hvc(void)
51 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
54 static inline void disable_acpi(void)
57 acpi_pci_disabled = 1;
61 static inline void enable_acpi(void)
64 acpi_pci_disabled = 0;
69 * The ACPI processor driver for ACPI core code needs this macro
70 * to find out this cpu was already mapped (mapping from CPU hardware
71 * ID to CPU logical ID) or not.
73 #define cpu_physical_id(cpu) cpu_logical_map(cpu)
76 * It's used from ACPI core in kdump to boot UP system with SMP kernel,
77 * with this check the ACPI core will not override the CPU index
78 * obtained from GICC with 0 and not print some error message as well.
79 * Since MADT must provide at least one GICC structure for GIC
80 * initialization, CPU will be always available in MADT on ARM64.
82 static inline bool acpi_has_cpu_in_madt(void)
87 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
88 void __init acpi_init_cpus(void);
91 static inline bool acpi_psci_present(void) { return false; }
92 static inline bool acpi_psci_use_hvc(void) { return false; }
93 static inline void acpi_init_cpus(void) { }
94 #endif /* CONFIG_ACPI */
96 #endif /*_ASM_ACPI_H*/