0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _ASM_ACPI_H
0010 #define _ASM_ACPI_H
0011
0012 #include <linux/efi.h>
0013 #include <linux/memblock.h>
0014 #include <linux/psci.h>
0015 #include <linux/stddef.h>
0016
0017 #include <asm/cputype.h>
0018 #include <asm/io.h>
0019 #include <asm/ptrace.h>
0020 #include <asm/smp_plat.h>
0021 #include <asm/tlbflush.h>
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #define ACPI_MADT_GICC_MIN_LENGTH offsetof( \
0036 struct acpi_madt_generic_interrupt, efficiency_class)
0037
0038 #define BAD_MADT_GICC_ENTRY(entry, end) \
0039 (!(entry) || (entry)->header.length < ACPI_MADT_GICC_MIN_LENGTH || \
0040 (unsigned long)(entry) + (entry)->header.length > (end))
0041
0042 #define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \
0043 spe_interrupt) + sizeof(u16))
0044
0045
0046 #ifdef CONFIG_ACPI
0047 pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
0048
0049
0050 void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
0051 #define acpi_os_ioremap acpi_os_ioremap
0052
0053 typedef u64 phys_cpuid_t;
0054 #define PHYS_CPUID_INVALID INVALID_HWID
0055
0056 #define acpi_strict 1
0057 extern int acpi_disabled;
0058 extern int acpi_noirq;
0059 extern int acpi_pci_disabled;
0060
0061 static inline void disable_acpi(void)
0062 {
0063 acpi_disabled = 1;
0064 acpi_pci_disabled = 1;
0065 acpi_noirq = 1;
0066 }
0067
0068 static inline void enable_acpi(void)
0069 {
0070 acpi_disabled = 0;
0071 acpi_pci_disabled = 0;
0072 acpi_noirq = 0;
0073 }
0074
0075
0076
0077
0078
0079
0080 #define cpu_physical_id(cpu) cpu_logical_map(cpu)
0081
0082
0083
0084
0085
0086
0087
0088
0089 static inline bool acpi_has_cpu_in_madt(void)
0090 {
0091 return true;
0092 }
0093
0094 struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu);
0095 static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
0096 {
0097 return acpi_cpu_get_madt_gicc(cpu)->uid;
0098 }
0099
0100 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
0101 void __init acpi_init_cpus(void);
0102 int apei_claim_sea(struct pt_regs *regs);
0103 #else
0104 static inline void acpi_init_cpus(void) { }
0105 static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
0106 #endif
0107
0108 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
0109 bool acpi_parking_protocol_valid(int cpu);
0110 void __init
0111 acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor);
0112 #else
0113 static inline bool acpi_parking_protocol_valid(int cpu) { return false; }
0114 static inline void
0115 acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor)
0116 {}
0117 #endif
0118
0119 static inline const char *acpi_get_enable_method(int cpu)
0120 {
0121 if (acpi_psci_present())
0122 return "psci";
0123
0124 if (acpi_parking_protocol_valid(cpu))
0125 return "parking-protocol";
0126
0127 return NULL;
0128 }
0129
0130 #ifdef CONFIG_ACPI_APEI
0131
0132
0133
0134
0135
0136
0137
0138 #define acpi_disable_cmcff 1
0139 static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
0140 {
0141 return __acpi_get_mem_attribute(addr);
0142 }
0143 #endif
0144
0145 #ifdef CONFIG_ACPI_NUMA
0146 int arm64_acpi_numa_init(void);
0147 int acpi_numa_get_nid(unsigned int cpu);
0148 void acpi_map_cpus_to_nodes(void);
0149 #else
0150 static inline int arm64_acpi_numa_init(void) { return -ENOSYS; }
0151 static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
0152 static inline void acpi_map_cpus_to_nodes(void) { }
0153 #endif
0154
0155 #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
0156
0157 #endif