18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
28c2ecf20Sopenharmony_ci/******************************************************************************
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Name: acconfig.h - Global configuration constants
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2000 - 2020, Intel Corp.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *****************************************************************************/
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _ACCONFIG_H
118c2ecf20Sopenharmony_ci#define _ACCONFIG_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/******************************************************************************
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * Configuration options
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci *****************************************************************************/
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/*
208c2ecf20Sopenharmony_ci * ACPI_DEBUG_OUTPUT    - This switch enables all the debug facilities of the
218c2ecf20Sopenharmony_ci *                        ACPI subsystem.  This includes the DEBUG_PRINT output
228c2ecf20Sopenharmony_ci *                        statements.  When disabled, all DEBUG_PRINT
238c2ecf20Sopenharmony_ci *                        statements are compiled out.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * ACPI_APPLICATION     - Use this switch if the subsystem is going to be run
268c2ecf20Sopenharmony_ci *                        at the application level.
278c2ecf20Sopenharmony_ci *
288c2ecf20Sopenharmony_ci */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/*
318c2ecf20Sopenharmony_ci * OS name, used for the _OS object.  The _OS object is essentially obsolete,
328c2ecf20Sopenharmony_ci * but there is a large base of ASL/AML code in existing machines that check
338c2ecf20Sopenharmony_ci * for the string below.  The use of this string usually guarantees that
348c2ecf20Sopenharmony_ci * the ASL will execute down the most tested code path.  Also, there is some
358c2ecf20Sopenharmony_ci * code that will not execute the _OSI method unless _OS matches the string
368c2ecf20Sopenharmony_ci * below.  Therefore, change this string at your own risk.
378c2ecf20Sopenharmony_ci */
388c2ecf20Sopenharmony_ci#define ACPI_OS_NAME                    "Microsoft Windows NT"
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/* Maximum objects in the various object caches */
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define ACPI_MAX_STATE_CACHE_DEPTH      96	/* State objects */
438c2ecf20Sopenharmony_ci#define ACPI_MAX_PARSE_CACHE_DEPTH      96	/* Parse tree objects */
448c2ecf20Sopenharmony_ci#define ACPI_MAX_EXTPARSE_CACHE_DEPTH   96	/* Parse tree objects */
458c2ecf20Sopenharmony_ci#define ACPI_MAX_OBJECT_CACHE_DEPTH     96	/* Interpreter operand objects */
468c2ecf20Sopenharmony_ci#define ACPI_MAX_NAMESPACE_CACHE_DEPTH  96	/* Namespace objects */
478c2ecf20Sopenharmony_ci#define ACPI_MAX_COMMENT_CACHE_DEPTH    96	/* Comments for the -ca option */
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/*
508c2ecf20Sopenharmony_ci * Should the subsystem abort the loading of an ACPI table if the
518c2ecf20Sopenharmony_ci * table checksum is incorrect?
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_ci#ifndef ACPI_CHECKSUM_ABORT
548c2ecf20Sopenharmony_ci#define ACPI_CHECKSUM_ABORT             FALSE
558c2ecf20Sopenharmony_ci#endif
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci/*
588c2ecf20Sopenharmony_ci * Generate a version of ACPICA that only supports "reduced hardware"
598c2ecf20Sopenharmony_ci * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
608c2ecf20Sopenharmony_ci * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
618c2ecf20Sopenharmony_ci * model. In other words, no ACPI hardware is supported.
628c2ecf20Sopenharmony_ci *
638c2ecf20Sopenharmony_ci * If TRUE, this means no support for the following:
648c2ecf20Sopenharmony_ci *      PM Event and Control registers
658c2ecf20Sopenharmony_ci *      SCI interrupt (and handler)
668c2ecf20Sopenharmony_ci *      Fixed Events
678c2ecf20Sopenharmony_ci *      General Purpose Events (GPEs)
688c2ecf20Sopenharmony_ci *      Global Lock
698c2ecf20Sopenharmony_ci *      ACPI PM timer
708c2ecf20Sopenharmony_ci *      FACS table (Waking vectors and Global Lock)
718c2ecf20Sopenharmony_ci */
728c2ecf20Sopenharmony_ci#ifndef ACPI_REDUCED_HARDWARE
738c2ecf20Sopenharmony_ci#define ACPI_REDUCED_HARDWARE           FALSE
748c2ecf20Sopenharmony_ci#endif
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/******************************************************************************
778c2ecf20Sopenharmony_ci *
788c2ecf20Sopenharmony_ci * Subsystem Constants
798c2ecf20Sopenharmony_ci *
808c2ecf20Sopenharmony_ci *****************************************************************************/
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* Version of ACPI supported */
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define ACPI_CA_SUPPORT_LEVEL           5
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/* Maximum count for a semaphore object */
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define ACPI_MAX_SEMAPHORE_COUNT        256
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* Maximum object reference count (detects object deletion issues) */
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define ACPI_MAX_REFERENCE_COUNT        0x4000
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/* Default page size for use in mapping memory for operation regions */
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define ACPI_DEFAULT_PAGE_SIZE          4096	/* Must be power of 2 */
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* owner_id tracking. 128 entries allows for 4095 owner_ids */
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define ACPI_NUM_OWNERID_MASKS          128
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/* Size of the root table array is increased by this increment */
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci/* Maximum sleep allowed via Sleep() operator */
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define ACPI_MAX_SLEEP                  2000	/* 2000 millisec == two seconds */
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/* Address Range lists are per-space_id (Memory and I/O only) */
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define ACPI_ADDRESS_RANGE_MAX          2
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/* Maximum time (default 30s) of While() loops before abort */
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#define ACPI_MAX_LOOP_TIMEOUT           30
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/******************************************************************************
1198c2ecf20Sopenharmony_ci *
1208c2ecf20Sopenharmony_ci * ACPI Specification constants (Do not change unless the specification changes)
1218c2ecf20Sopenharmony_ci *
1228c2ecf20Sopenharmony_ci *****************************************************************************/
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* Method info (in WALK_STATE), containing local variables and arguments */
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define ACPI_METHOD_NUM_LOCALS          8
1278c2ecf20Sopenharmony_ci#define ACPI_METHOD_MAX_LOCAL           7
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define ACPI_METHOD_NUM_ARGS            7
1308c2ecf20Sopenharmony_ci#define ACPI_METHOD_MAX_ARG             6
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/*
1338c2ecf20Sopenharmony_ci * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
1348c2ecf20Sopenharmony_ci */
1358c2ecf20Sopenharmony_ci#define ACPI_OBJ_NUM_OPERANDS           8
1368c2ecf20Sopenharmony_ci#define ACPI_OBJ_MAX_OPERAND            7
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci/* Number of elements in the Result Stack frame, can be an arbitrary value */
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#define ACPI_RESULTS_FRAME_OBJ_NUM      8
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci/*
1438c2ecf20Sopenharmony_ci * Maximal number of elements the Result Stack can contain,
1448c2ecf20Sopenharmony_ci * it may be an arbitrary value not exceeding the types of
1458c2ecf20Sopenharmony_ci * result_size and result_count (now u8).
1468c2ecf20Sopenharmony_ci */
1478c2ecf20Sopenharmony_ci#define ACPI_RESULTS_OBJ_NUM_MAX        255
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci/* Constants used in searching for the RSDP in low memory */
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define ACPI_EBDA_PTR_LOCATION          0x0000040E	/* Physical Address */
1528c2ecf20Sopenharmony_ci#define ACPI_EBDA_PTR_LENGTH            2
1538c2ecf20Sopenharmony_ci#define ACPI_EBDA_WINDOW_SIZE           1024
1548c2ecf20Sopenharmony_ci#define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000	/* Physical Address */
1558c2ecf20Sopenharmony_ci#define ACPI_HI_RSDP_WINDOW_SIZE        0x00020000
1568c2ecf20Sopenharmony_ci#define ACPI_RSDP_SCAN_STEP             16
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci/* Operation regions */
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define ACPI_USER_REGION_BEGIN          0x80
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci/* Maximum space_ids for Operation Regions */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define ACPI_MAX_ADDRESS_SPACE          255
1658c2ecf20Sopenharmony_ci#define ACPI_NUM_DEFAULT_SPACES         4
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci/* Array sizes.  Used for range checking also */
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define ACPI_MAX_MATCH_OPCODE           5
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/* RSDP checksums */
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci#define ACPI_RSDP_CHECKSUM_LENGTH       20
1748c2ecf20Sopenharmony_ci#define ACPI_RSDP_XCHECKSUM_LENGTH      36
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci/*
1778c2ecf20Sopenharmony_ci * SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header,
1788c2ecf20Sopenharmony_ci * containing both Status and Length.
1798c2ecf20Sopenharmony_ci */
1808c2ecf20Sopenharmony_ci#define ACPI_SERIAL_HEADER_SIZE         2	/* Common for below. Status and Length fields */
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define ACPI_SMBUS_DATA_SIZE            32
1838c2ecf20Sopenharmony_ci#define ACPI_SMBUS_BUFFER_SIZE          ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define ACPI_IPMI_DATA_SIZE             64
1868c2ecf20Sopenharmony_ci#define ACPI_IPMI_BUFFER_SIZE           ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci#define ACPI_MAX_GSBUS_DATA_SIZE        255
1898c2ecf20Sopenharmony_ci#define ACPI_MAX_GSBUS_BUFFER_SIZE      ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci/* _sx_d and _sx_w control methods */
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define ACPI_NUM_sx_d_METHODS           4
1948c2ecf20Sopenharmony_ci#define ACPI_NUM_sx_w_METHODS           5
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci/******************************************************************************
1978c2ecf20Sopenharmony_ci *
1988c2ecf20Sopenharmony_ci * Miscellaneous constants
1998c2ecf20Sopenharmony_ci *
2008c2ecf20Sopenharmony_ci *****************************************************************************/
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/* UUID constants */
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#define UUID_BUFFER_LENGTH          16	/* Length of UUID in memory */
2058c2ecf20Sopenharmony_ci#define UUID_STRING_LENGTH          36	/* Total length of a UUID string */
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* Positions for required hyphens (dashes) in UUID strings */
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci#define UUID_HYPHEN1_OFFSET         8
2108c2ecf20Sopenharmony_ci#define UUID_HYPHEN2_OFFSET         13
2118c2ecf20Sopenharmony_ci#define UUID_HYPHEN3_OFFSET         18
2128c2ecf20Sopenharmony_ci#define UUID_HYPHEN4_OFFSET         23
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci/******************************************************************************
2158c2ecf20Sopenharmony_ci *
2168c2ecf20Sopenharmony_ci * ACPI AML Debugger
2178c2ecf20Sopenharmony_ci *
2188c2ecf20Sopenharmony_ci *****************************************************************************/
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci#define ACPI_DEBUGGER_MAX_ARGS          ACPI_METHOD_NUM_ARGS + 4	/* Max command line arguments */
2218c2ecf20Sopenharmony_ci#define ACPI_DB_LINE_BUFFER_SIZE        512
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci#define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
2248c2ecf20Sopenharmony_ci#define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci#endif				/* _ACCONFIG_H */
227