Commit | Line | Data |
---|---|---|
628c3bb4 HC |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
3 | * Author: Jianmin Lv <lvjianmin@loongson.cn> | |
4 | * Huacai Chen <chenhuacai@loongson.cn> | |
5 | * Copyright (C) 2020-2022 Loongson Technology Corporation Limited | |
6 | */ | |
7 | ||
8 | #ifndef _ASM_LOONGARCH_ACPI_H | |
9 | #define _ASM_LOONGARCH_ACPI_H | |
10 | ||
11 | #ifdef CONFIG_ACPI | |
12 | extern int acpi_strict; | |
13 | extern int acpi_disabled; | |
14 | extern int acpi_pci_disabled; | |
15 | extern int acpi_noirq; | |
f6f0c9a7 | 16 | extern int pptt_enabled; |
628c3bb4 HC |
17 | |
18 | #define acpi_os_ioremap acpi_os_ioremap | |
e0fba87c | 19 | void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); |
628c3bb4 HC |
20 | |
21 | static inline void disable_acpi(void) | |
22 | { | |
23 | acpi_disabled = 1; | |
24 | acpi_pci_disabled = 1; | |
25 | acpi_noirq = 1; | |
26 | } | |
27 | ||
28 | static inline bool acpi_has_cpu_in_madt(void) | |
29 | { | |
30 | return true; | |
31 | } | |
32 | ||
33 | extern struct list_head acpi_wakeup_device_list; | |
f6f0c9a7 HC |
34 | extern struct acpi_madt_core_pic acpi_core_pic[NR_CPUS]; |
35 | ||
36 | extern int __init parse_acpi_topology(void); | |
37 | ||
38 | static inline u32 get_acpi_id_for_cpu(unsigned int cpu) | |
39 | { | |
40 | return acpi_core_pic[cpu_logical_map(cpu)].processor_id; | |
41 | } | |
628c3bb4 HC |
42 | |
43 | #endif /* !CONFIG_ACPI */ | |
44 | ||
45 | #define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT | |
46 | ||
366bb35a HC |
47 | extern int loongarch_acpi_suspend(void); |
48 | extern int (*acpi_suspend_lowlevel)(void); | |
49 | extern void loongarch_suspend_enter(void); | |
50 | ||
51 | static inline unsigned long acpi_get_wakeup_address(void) | |
52 | { | |
1cf62488 | 53 | #ifdef CONFIG_SUSPEND |
366bb35a HC |
54 | extern void loongarch_wakeup_start(void); |
55 | return (unsigned long)loongarch_wakeup_start; | |
1cf62488 HC |
56 | #endif |
57 | return 0UL; | |
366bb35a HC |
58 | } |
59 | ||
628c3bb4 | 60 | #endif /* _ASM_LOONGARCH_ACPI_H */ |