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 <asm/setup.h>
27 
28 #define COMPILER_DEPENDENT_INT64   long long
29 #define COMPILER_DEPENDENT_UINT64  unsigned long long
30 #define ACPI_MAP_MEM_ATTR          PAGE_HYPERVISOR
31 
32 /* Tables marked as reserved in efi table */
33 typedef enum {
34     TBL_FADT,
35     TBL_MADT,
36     TBL_STAO,
37     TBL_XSDT,
38     TBL_RSDP,
39     TBL_EFIT,
40     TBL_MMAP,
41     TBL_MMAX,
42 } EFI_MEM_RES;
43 
44 bool acpi_psci_present(void);
45 bool acpi_psci_hvc_present(void);
46 void acpi_smp_init_cpus(void);
47 
48 /*
49  * This function returns the offset of a given ACPI/EFI table in the allocated
50  * memory region. Currently, the tables should be created in the same order as
51  * their associated 'index' in the enum EFI_MEM_RES. This means the function
52  * won't return the correct offset until all the tables before a given 'index'
53  * are created.
54  */
55 paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
56 
57 #ifdef CONFIG_ACPI
58 extern bool acpi_disabled;
59 /* Basic configuration for ACPI */
disable_acpi(void)60 static inline void disable_acpi(void)
61 {
62     acpi_disabled = true;
63 }
64 
enable_acpi(void)65 static inline void enable_acpi(void)
66 {
67     acpi_disabled = false;
68 }
69 #else
70 #define acpi_disabled (true)
71 #define disable_acpi()
72 #define enable_acpi()
73 #endif
74 
75 #endif /*_ASM_ARM_ACPI_H*/
76