xref: /OK3568_Linux_fs/kernel/include/acpi/acconfig.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2*4882a593Smuzhiyun /******************************************************************************
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Name: acconfig.h - Global configuration constants
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2000 - 2020, Intel Corp.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *****************************************************************************/
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef _ACCONFIG_H
11*4882a593Smuzhiyun #define _ACCONFIG_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /******************************************************************************
14*4882a593Smuzhiyun  *
15*4882a593Smuzhiyun  * Configuration options
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  *****************************************************************************/
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun /*
20*4882a593Smuzhiyun  * ACPI_DEBUG_OUTPUT    - This switch enables all the debug facilities of the
21*4882a593Smuzhiyun  *                        ACPI subsystem.  This includes the DEBUG_PRINT output
22*4882a593Smuzhiyun  *                        statements.  When disabled, all DEBUG_PRINT
23*4882a593Smuzhiyun  *                        statements are compiled out.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  * ACPI_APPLICATION     - Use this switch if the subsystem is going to be run
26*4882a593Smuzhiyun  *                        at the application level.
27*4882a593Smuzhiyun  *
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun /*
31*4882a593Smuzhiyun  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
32*4882a593Smuzhiyun  * but there is a large base of ASL/AML code in existing machines that check
33*4882a593Smuzhiyun  * for the string below.  The use of this string usually guarantees that
34*4882a593Smuzhiyun  * the ASL will execute down the most tested code path.  Also, there is some
35*4882a593Smuzhiyun  * code that will not execute the _OSI method unless _OS matches the string
36*4882a593Smuzhiyun  * below.  Therefore, change this string at your own risk.
37*4882a593Smuzhiyun  */
38*4882a593Smuzhiyun #define ACPI_OS_NAME                    "Microsoft Windows NT"
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun /* Maximum objects in the various object caches */
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #define ACPI_MAX_STATE_CACHE_DEPTH      96	/* State objects */
43*4882a593Smuzhiyun #define ACPI_MAX_PARSE_CACHE_DEPTH      96	/* Parse tree objects */
44*4882a593Smuzhiyun #define ACPI_MAX_EXTPARSE_CACHE_DEPTH   96	/* Parse tree objects */
45*4882a593Smuzhiyun #define ACPI_MAX_OBJECT_CACHE_DEPTH     96	/* Interpreter operand objects */
46*4882a593Smuzhiyun #define ACPI_MAX_NAMESPACE_CACHE_DEPTH  96	/* Namespace objects */
47*4882a593Smuzhiyun #define ACPI_MAX_COMMENT_CACHE_DEPTH    96	/* Comments for the -ca option */
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun /*
50*4882a593Smuzhiyun  * Should the subsystem abort the loading of an ACPI table if the
51*4882a593Smuzhiyun  * table checksum is incorrect?
52*4882a593Smuzhiyun  */
53*4882a593Smuzhiyun #ifndef ACPI_CHECKSUM_ABORT
54*4882a593Smuzhiyun #define ACPI_CHECKSUM_ABORT             FALSE
55*4882a593Smuzhiyun #endif
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun /*
58*4882a593Smuzhiyun  * Generate a version of ACPICA that only supports "reduced hardware"
59*4882a593Smuzhiyun  * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
60*4882a593Smuzhiyun  * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
61*4882a593Smuzhiyun  * model. In other words, no ACPI hardware is supported.
62*4882a593Smuzhiyun  *
63*4882a593Smuzhiyun  * If TRUE, this means no support for the following:
64*4882a593Smuzhiyun  *      PM Event and Control registers
65*4882a593Smuzhiyun  *      SCI interrupt (and handler)
66*4882a593Smuzhiyun  *      Fixed Events
67*4882a593Smuzhiyun  *      General Purpose Events (GPEs)
68*4882a593Smuzhiyun  *      Global Lock
69*4882a593Smuzhiyun  *      ACPI PM timer
70*4882a593Smuzhiyun  *      FACS table (Waking vectors and Global Lock)
71*4882a593Smuzhiyun  */
72*4882a593Smuzhiyun #ifndef ACPI_REDUCED_HARDWARE
73*4882a593Smuzhiyun #define ACPI_REDUCED_HARDWARE           FALSE
74*4882a593Smuzhiyun #endif
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun /******************************************************************************
77*4882a593Smuzhiyun  *
78*4882a593Smuzhiyun  * Subsystem Constants
79*4882a593Smuzhiyun  *
80*4882a593Smuzhiyun  *****************************************************************************/
81*4882a593Smuzhiyun 
82*4882a593Smuzhiyun /* Version of ACPI supported */
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun #define ACPI_CA_SUPPORT_LEVEL           5
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun /* Maximum count for a semaphore object */
87*4882a593Smuzhiyun 
88*4882a593Smuzhiyun #define ACPI_MAX_SEMAPHORE_COUNT        256
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun /* Maximum object reference count (detects object deletion issues) */
91*4882a593Smuzhiyun 
92*4882a593Smuzhiyun #define ACPI_MAX_REFERENCE_COUNT        0x4000
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun /* Default page size for use in mapping memory for operation regions */
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun #define ACPI_DEFAULT_PAGE_SIZE          4096	/* Must be power of 2 */
97*4882a593Smuzhiyun 
98*4882a593Smuzhiyun /* owner_id tracking. 128 entries allows for 4095 owner_ids */
99*4882a593Smuzhiyun 
100*4882a593Smuzhiyun #define ACPI_NUM_OWNERID_MASKS          128
101*4882a593Smuzhiyun 
102*4882a593Smuzhiyun /* Size of the root table array is increased by this increment */
103*4882a593Smuzhiyun 
104*4882a593Smuzhiyun #define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
105*4882a593Smuzhiyun 
106*4882a593Smuzhiyun /* Maximum sleep allowed via Sleep() operator */
107*4882a593Smuzhiyun 
108*4882a593Smuzhiyun #define ACPI_MAX_SLEEP                  2000	/* 2000 millisec == two seconds */
109*4882a593Smuzhiyun 
110*4882a593Smuzhiyun /* Address Range lists are per-space_id (Memory and I/O only) */
111*4882a593Smuzhiyun 
112*4882a593Smuzhiyun #define ACPI_ADDRESS_RANGE_MAX          2
113*4882a593Smuzhiyun 
114*4882a593Smuzhiyun /* Maximum time (default 30s) of While() loops before abort */
115*4882a593Smuzhiyun 
116*4882a593Smuzhiyun #define ACPI_MAX_LOOP_TIMEOUT           30
117*4882a593Smuzhiyun 
118*4882a593Smuzhiyun /******************************************************************************
119*4882a593Smuzhiyun  *
120*4882a593Smuzhiyun  * ACPI Specification constants (Do not change unless the specification changes)
121*4882a593Smuzhiyun  *
122*4882a593Smuzhiyun  *****************************************************************************/
123*4882a593Smuzhiyun 
124*4882a593Smuzhiyun /* Method info (in WALK_STATE), containing local variables and arguments */
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun #define ACPI_METHOD_NUM_LOCALS          8
127*4882a593Smuzhiyun #define ACPI_METHOD_MAX_LOCAL           7
128*4882a593Smuzhiyun 
129*4882a593Smuzhiyun #define ACPI_METHOD_NUM_ARGS            7
130*4882a593Smuzhiyun #define ACPI_METHOD_MAX_ARG             6
131*4882a593Smuzhiyun 
132*4882a593Smuzhiyun /*
133*4882a593Smuzhiyun  * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
134*4882a593Smuzhiyun  */
135*4882a593Smuzhiyun #define ACPI_OBJ_NUM_OPERANDS           8
136*4882a593Smuzhiyun #define ACPI_OBJ_MAX_OPERAND            7
137*4882a593Smuzhiyun 
138*4882a593Smuzhiyun /* Number of elements in the Result Stack frame, can be an arbitrary value */
139*4882a593Smuzhiyun 
140*4882a593Smuzhiyun #define ACPI_RESULTS_FRAME_OBJ_NUM      8
141*4882a593Smuzhiyun 
142*4882a593Smuzhiyun /*
143*4882a593Smuzhiyun  * Maximal number of elements the Result Stack can contain,
144*4882a593Smuzhiyun  * it may be an arbitrary value not exceeding the types of
145*4882a593Smuzhiyun  * result_size and result_count (now u8).
146*4882a593Smuzhiyun  */
147*4882a593Smuzhiyun #define ACPI_RESULTS_OBJ_NUM_MAX        255
148*4882a593Smuzhiyun 
149*4882a593Smuzhiyun /* Constants used in searching for the RSDP in low memory */
150*4882a593Smuzhiyun 
151*4882a593Smuzhiyun #define ACPI_EBDA_PTR_LOCATION          0x0000040E	/* Physical Address */
152*4882a593Smuzhiyun #define ACPI_EBDA_PTR_LENGTH            2
153*4882a593Smuzhiyun #define ACPI_EBDA_WINDOW_SIZE           1024
154*4882a593Smuzhiyun #define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000	/* Physical Address */
155*4882a593Smuzhiyun #define ACPI_HI_RSDP_WINDOW_SIZE        0x00020000
156*4882a593Smuzhiyun #define ACPI_RSDP_SCAN_STEP             16
157*4882a593Smuzhiyun 
158*4882a593Smuzhiyun /* Operation regions */
159*4882a593Smuzhiyun 
160*4882a593Smuzhiyun #define ACPI_USER_REGION_BEGIN          0x80
161*4882a593Smuzhiyun 
162*4882a593Smuzhiyun /* Maximum space_ids for Operation Regions */
163*4882a593Smuzhiyun 
164*4882a593Smuzhiyun #define ACPI_MAX_ADDRESS_SPACE          255
165*4882a593Smuzhiyun #define ACPI_NUM_DEFAULT_SPACES         4
166*4882a593Smuzhiyun 
167*4882a593Smuzhiyun /* Array sizes.  Used for range checking also */
168*4882a593Smuzhiyun 
169*4882a593Smuzhiyun #define ACPI_MAX_MATCH_OPCODE           5
170*4882a593Smuzhiyun 
171*4882a593Smuzhiyun /* RSDP checksums */
172*4882a593Smuzhiyun 
173*4882a593Smuzhiyun #define ACPI_RSDP_CHECKSUM_LENGTH       20
174*4882a593Smuzhiyun #define ACPI_RSDP_XCHECKSUM_LENGTH      36
175*4882a593Smuzhiyun 
176*4882a593Smuzhiyun /*
177*4882a593Smuzhiyun  * SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header,
178*4882a593Smuzhiyun  * containing both Status and Length.
179*4882a593Smuzhiyun  */
180*4882a593Smuzhiyun #define ACPI_SERIAL_HEADER_SIZE         2	/* Common for below. Status and Length fields */
181*4882a593Smuzhiyun 
182*4882a593Smuzhiyun #define ACPI_SMBUS_DATA_SIZE            32
183*4882a593Smuzhiyun #define ACPI_SMBUS_BUFFER_SIZE          ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE
184*4882a593Smuzhiyun 
185*4882a593Smuzhiyun #define ACPI_IPMI_DATA_SIZE             64
186*4882a593Smuzhiyun #define ACPI_IPMI_BUFFER_SIZE           ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE
187*4882a593Smuzhiyun 
188*4882a593Smuzhiyun #define ACPI_MAX_GSBUS_DATA_SIZE        255
189*4882a593Smuzhiyun #define ACPI_MAX_GSBUS_BUFFER_SIZE      ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
190*4882a593Smuzhiyun 
191*4882a593Smuzhiyun /* _sx_d and _sx_w control methods */
192*4882a593Smuzhiyun 
193*4882a593Smuzhiyun #define ACPI_NUM_sx_d_METHODS           4
194*4882a593Smuzhiyun #define ACPI_NUM_sx_w_METHODS           5
195*4882a593Smuzhiyun 
196*4882a593Smuzhiyun /******************************************************************************
197*4882a593Smuzhiyun  *
198*4882a593Smuzhiyun  * Miscellaneous constants
199*4882a593Smuzhiyun  *
200*4882a593Smuzhiyun  *****************************************************************************/
201*4882a593Smuzhiyun 
202*4882a593Smuzhiyun /* UUID constants */
203*4882a593Smuzhiyun 
204*4882a593Smuzhiyun #define UUID_BUFFER_LENGTH          16	/* Length of UUID in memory */
205*4882a593Smuzhiyun #define UUID_STRING_LENGTH          36	/* Total length of a UUID string */
206*4882a593Smuzhiyun 
207*4882a593Smuzhiyun /* Positions for required hyphens (dashes) in UUID strings */
208*4882a593Smuzhiyun 
209*4882a593Smuzhiyun #define UUID_HYPHEN1_OFFSET         8
210*4882a593Smuzhiyun #define UUID_HYPHEN2_OFFSET         13
211*4882a593Smuzhiyun #define UUID_HYPHEN3_OFFSET         18
212*4882a593Smuzhiyun #define UUID_HYPHEN4_OFFSET         23
213*4882a593Smuzhiyun 
214*4882a593Smuzhiyun /******************************************************************************
215*4882a593Smuzhiyun  *
216*4882a593Smuzhiyun  * ACPI AML Debugger
217*4882a593Smuzhiyun  *
218*4882a593Smuzhiyun  *****************************************************************************/
219*4882a593Smuzhiyun 
220*4882a593Smuzhiyun #define ACPI_DEBUGGER_MAX_ARGS          ACPI_METHOD_NUM_ARGS + 4	/* Max command line arguments */
221*4882a593Smuzhiyun #define ACPI_DB_LINE_BUFFER_SIZE        512
222*4882a593Smuzhiyun 
223*4882a593Smuzhiyun #define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
224*4882a593Smuzhiyun #define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
225*4882a593Smuzhiyun 
226*4882a593Smuzhiyun #endif				/* _ACCONFIG_H */
227