xref: /openbmc/linux/arch/ia64/include/asm/acpi.h (revision c9e6c5e6)
11a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
27f30491cSTony Luck /*
37f30491cSTony Luck  *  Copyright (C) 1999 VA Linux Systems
47f30491cSTony Luck  *  Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
57f30491cSTony Luck  *  Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
67f30491cSTony Luck  *  Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
77f30491cSTony Luck  */
87f30491cSTony Luck 
97f30491cSTony Luck #ifndef _ASM_ACPI_H
107f30491cSTony Luck #define _ASM_ACPI_H
117f30491cSTony Luck 
127f30491cSTony Luck #ifdef __KERNEL__
137f30491cSTony Luck 
14*c9e6c5e6SMichal Wilczynski #include <acpi/proc_cap_intel.h>
157f30491cSTony Luck 
167f30491cSTony Luck #include <linux/init.h>
177f30491cSTony Luck #include <linux/numa.h>
187f30491cSTony Luck #include <asm/numa.h>
197f30491cSTony Luck 
202e0f2b16SChristoph Hellwig 
21247dba58SBaoquan He extern int acpi_lapic;
227f30491cSTony Luck #define acpi_disabled 0	/* ACPI always enabled on IA64 */
237f30491cSTony Luck #define acpi_noirq 0	/* ACPI always enabled on IA64 */
247f30491cSTony Luck #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
257f30491cSTony Luck #define acpi_strict 1	/* no ACPI spec workarounds on IA64 */
26b50154d5SGraeme Gregory 
acpi_has_cpu_in_madt(void)27b50154d5SGraeme Gregory static inline bool acpi_has_cpu_in_madt(void)
28b50154d5SGraeme Gregory {
29b50154d5SGraeme Gregory 	return !!acpi_lapic;
30b50154d5SGraeme Gregory }
312e0f2b16SChristoph Hellwig 
327f30491cSTony Luck #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
disable_acpi(void)337f30491cSTony Luck static inline void disable_acpi(void) { }
347f30491cSTony Luck 
357f30491cSTony Luck int acpi_request_vector (u32 int_type);
367f30491cSTony Luck int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
377f30491cSTony Luck 
38f1a2003eSRafael J. Wysocki /* Low-level suspend routine. */
39f1a2003eSRafael J. Wysocki extern int acpi_suspend_lowlevel(void);
40c41b93fbSRafael J. Wysocki 
acpi_get_wakeup_address(void)418c53b318SSean Christopherson static inline unsigned long acpi_get_wakeup_address(void)
428c53b318SSean Christopherson {
438c53b318SSean Christopherson 	return 0;
448c53b318SSean Christopherson }
457f30491cSTony Luck 
467f30491cSTony Luck /*
477f30491cSTony Luck  * Record the cpei override flag and current logical cpu. This is
487f30491cSTony Luck  * useful for CPU removal.
497f30491cSTony Luck  */
507f30491cSTony Luck extern unsigned int can_cpei_retarget(void);
517f30491cSTony Luck extern unsigned int is_cpu_cpei_target(unsigned int cpu);
527f30491cSTony Luck extern void set_cpei_target_cpu(unsigned int cpu);
537f30491cSTony Luck extern unsigned int get_cpei_target_cpu(void);
547f30491cSTony Luck extern void prefill_possible_map(void);
557f30491cSTony Luck #ifdef CONFIG_ACPI_HOTPLUG_CPU
567f30491cSTony Luck extern int additional_cpus;
577f30491cSTony Luck #else
587f30491cSTony Luck #define additional_cpus 0
597f30491cSTony Luck #endif
607f30491cSTony Luck 
617f30491cSTony Luck #ifdef CONFIG_ACPI_NUMA
627f30491cSTony Luck #if MAX_NUMNODES > 256
637f30491cSTony Luck #define MAX_PXM_DOMAINS MAX_NUMNODES
647f30491cSTony Luck #else
657f30491cSTony Luck #define MAX_PXM_DOMAINS (256)
667f30491cSTony Luck #endif
675b5e76e9SGreg Kroah-Hartman extern int pxm_to_nid_map[MAX_PXM_DOMAINS];
687f30491cSTony Luck extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
697f30491cSTony Luck #endif
707f30491cSTony Luck 
arch_has_acpi_pdc(void)711d9cb470SAlex Chiang static inline bool arch_has_acpi_pdc(void) { return true; }
arch_acpi_set_proc_cap_bits(u32 * cap)72c5e4d05dSMichal Wilczynski static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
736c5807d7SAlex Chiang {
74*c9e6c5e6SMichal Wilczynski 	*cap |= ACPI_PROC_CAP_EST_CAPABILITY_SMP;
756c5807d7SAlex Chiang }
761d9cb470SAlex Chiang 
777f30491cSTony Luck #ifdef CONFIG_ACPI_NUMA
787f30491cSTony Luck extern cpumask_t early_cpu_possible_map;
797f30491cSTony Luck #define for_each_possible_early_cpu(cpu)  \
805d2068daSRusty Russell 	for_each_cpu((cpu), &early_cpu_possible_map)
817f30491cSTony Luck 
per_cpu_scan_finalize(int min_cpus,int reserve_cpus)827f30491cSTony Luck static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
837f30491cSTony Luck {
847f30491cSTony Luck 	int low_cpu, high_cpu;
857f30491cSTony Luck 	int cpu;
867f30491cSTony Luck 	int next_nid = 0;
877f30491cSTony Luck 
885d2068daSRusty Russell 	low_cpu = cpumask_weight(&early_cpu_possible_map);
897f30491cSTony Luck 
907f30491cSTony Luck 	high_cpu = max(low_cpu, min_cpus);
917f30491cSTony Luck 	high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
927f30491cSTony Luck 
937f30491cSTony Luck 	for (cpu = low_cpu; cpu < high_cpu; cpu++) {
945d2068daSRusty Russell 		cpumask_set_cpu(cpu, &early_cpu_possible_map);
957f30491cSTony Luck 		if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
967f30491cSTony Luck 			node_cpuid[cpu].nid = next_nid;
977f30491cSTony Luck 			next_nid++;
987f30491cSTony Luck 			if (next_nid >= num_online_nodes())
997f30491cSTony Luck 				next_nid = 0;
1007f30491cSTony Luck 		}
1017f30491cSTony Luck 	}
1027f30491cSTony Luck }
103312521d0SRobert Richter 
104312521d0SRobert Richter extern void acpi_numa_fixup(void);
105312521d0SRobert Richter 
1067f30491cSTony Luck #endif /* CONFIG_ACPI_NUMA */
1077f30491cSTony Luck 
1087f30491cSTony Luck #endif /*__KERNEL__*/
1097f30491cSTony Luck 
1107f30491cSTony Luck #endif /*_ASM_ACPI_H*/
111