1 /*
2 * Copyright (C) 2015, Shannon Zhao <shannon.zhao@linaro.org>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 */
22
23 #ifndef _ASM_ARM_ACPI_H
24 #define _ASM_ARM_ACPI_H
25
26 #include <xen/init.h>
27 #include <asm/page.h>
28 #include <asm/setup.h>
29
30 #define COMPILER_DEPENDENT_INT64 long long
31 #define COMPILER_DEPENDENT_UINT64 unsigned long long
32 #define ACPI_MAP_MEM_ATTR PAGE_HYPERVISOR
33
34 /* Tables marked as reserved in efi table */
35 typedef enum {
36 TBL_FADT,
37 TBL_MADT,
38 TBL_STAO,
39 TBL_XSDT,
40 TBL_RSDP,
41 TBL_EFIT,
42 TBL_MMAP,
43 TBL_MMAX,
44 } EFI_MEM_RES;
45
46 bool __init acpi_psci_present(void);
47 bool __init acpi_psci_hvc_present(void);
48 void __init acpi_smp_init_cpus(void);
49
50 /*
51 * This function returns the offset of a given ACPI/EFI table in the allocated
52 * memory region. Currently, the tables should be created in the same order as
53 * their associated 'index' in the enum EFI_MEM_RES. This means the function
54 * won't return the correct offset until all the tables before a given 'index'
55 * are created.
56 */
57 paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
58
59 #ifdef CONFIG_ACPI
60 extern bool acpi_disabled;
61 /* Basic configuration for ACPI */
disable_acpi(void)62 static inline void disable_acpi(void)
63 {
64 acpi_disabled = true;
65 }
66
enable_acpi(void)67 static inline void enable_acpi(void)
68 {
69 acpi_disabled = false;
70 }
71 #else
72 #define acpi_disabled (true)
73 #define disable_acpi()
74 #define enable_acpi()
75 #endif
76
77 #endif /*_ASM_ARM_ACPI_H*/
78