acpi.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef _ASM_LOONGARCH_ACPI_H
  8. #define _ASM_LOONGARCH_ACPI_H
  9. #include <asm/smp.h>
  10. #include <asm/suspend.h>
  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;
  16. extern int pptt_enabled;
  17. #define acpi_os_ioremap acpi_os_ioremap
  18. void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
  19. static inline void disable_acpi(void)
  20. {
  21. acpi_disabled = 1;
  22. acpi_pci_disabled = 1;
  23. acpi_noirq = 1;
  24. }
  25. static inline bool acpi_has_cpu_in_madt(void)
  26. {
  27. return true;
  28. }
  29. #define MAX_CORE_PIC 2048
  30. extern struct list_head acpi_wakeup_device_list;
  31. extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
  32. extern int __init parse_acpi_topology(void);
  33. static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
  34. {
  35. return acpi_core_pic[cpu_logical_map(cpu)].processor_id;
  36. }
  37. #endif /* !CONFIG_ACPI */
  38. #define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT
  39. extern int loongarch_acpi_suspend(void);
  40. extern int (*acpi_suspend_lowlevel)(void);
  41. static inline unsigned long acpi_get_wakeup_address(void)
  42. {
  43. #ifdef CONFIG_SUSPEND
  44. return (unsigned long)loongarch_wakeup_start;
  45. #endif
  46. return 0UL;
  47. }
  48. #endif /* _ASM_LOONGARCH_ACPI_H */