Loading...
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
12extern int acpi_strict;
13extern int acpi_disabled;
14extern int acpi_pci_disabled;
15extern int acpi_noirq;
16
17#define acpi_os_ioremap acpi_os_ioremap
18void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
19
20static inline void disable_acpi(void)
21{
22 acpi_disabled = 1;
23 acpi_pci_disabled = 1;
24 acpi_noirq = 1;
25}
26
27static inline bool acpi_has_cpu_in_madt(void)
28{
29 return true;
30}
31
32extern struct list_head acpi_wakeup_device_list;
33
34#endif /* !CONFIG_ACPI */
35
36#define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT
37
38extern int loongarch_acpi_suspend(void);
39extern int (*acpi_suspend_lowlevel)(void);
40extern void loongarch_suspend_enter(void);
41
42static inline unsigned long acpi_get_wakeup_address(void)
43{
44 extern void loongarch_wakeup_start(void);
45 return (unsigned long)loongarch_wakeup_start;
46}
47
48#endif /* _ASM_LOONGARCH_ACPI_H */
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#include <asm/suspend.h>
12
13#ifdef CONFIG_ACPI
14extern int acpi_strict;
15extern int acpi_disabled;
16extern int acpi_pci_disabled;
17extern int acpi_noirq;
18extern int pptt_enabled;
19
20#define acpi_os_ioremap acpi_os_ioremap
21void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
22
23static inline void disable_acpi(void)
24{
25 acpi_disabled = 1;
26 acpi_pci_disabled = 1;
27 acpi_noirq = 1;
28}
29
30static inline bool acpi_has_cpu_in_madt(void)
31{
32 return true;
33}
34
35#define MAX_CORE_PIC 256
36
37extern struct list_head acpi_wakeup_device_list;
38extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
39
40extern int __init parse_acpi_topology(void);
41
42static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
43{
44 return acpi_core_pic[cpu_logical_map(cpu)].processor_id;
45}
46
47#endif /* !CONFIG_ACPI */
48
49#define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT
50
51extern int loongarch_acpi_suspend(void);
52extern int (*acpi_suspend_lowlevel)(void);
53
54static inline unsigned long acpi_get_wakeup_address(void)
55{
56#ifdef CONFIG_SUSPEND
57 return (unsigned long)loongarch_wakeup_start;
58#endif
59 return 0UL;
60}
61
62#endif /* _ASM_LOONGARCH_ACPI_H */