162306a36Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ 262306a36Sopenharmony_ci/****************************************************************************** 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Name: acconfig.h - Global configuration constants 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * Copyright (C) 2000 - 2023, Intel Corp. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci *****************************************************************************/ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _ACCONFIG_H 1162306a36Sopenharmony_ci#define _ACCONFIG_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci/****************************************************************************** 1462306a36Sopenharmony_ci * 1562306a36Sopenharmony_ci * Configuration options 1662306a36Sopenharmony_ci * 1762306a36Sopenharmony_ci *****************************************************************************/ 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci/* 2062306a36Sopenharmony_ci * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the 2162306a36Sopenharmony_ci * ACPI subsystem. This includes the DEBUG_PRINT output 2262306a36Sopenharmony_ci * statements. When disabled, all DEBUG_PRINT 2362306a36Sopenharmony_ci * statements are compiled out. 2462306a36Sopenharmony_ci * 2562306a36Sopenharmony_ci * ACPI_APPLICATION - Use this switch if the subsystem is going to be run 2662306a36Sopenharmony_ci * at the application level. 2762306a36Sopenharmony_ci * 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci/* 3162306a36Sopenharmony_ci * OS name, used for the _OS object. The _OS object is essentially obsolete, 3262306a36Sopenharmony_ci * but there is a large base of ASL/AML code in existing machines that check 3362306a36Sopenharmony_ci * for the string below. The use of this string usually guarantees that 3462306a36Sopenharmony_ci * the ASL will execute down the most tested code path. Also, there is some 3562306a36Sopenharmony_ci * code that will not execute the _OSI method unless _OS matches the string 3662306a36Sopenharmony_ci * below. Therefore, change this string at your own risk. 3762306a36Sopenharmony_ci */ 3862306a36Sopenharmony_ci#define ACPI_OS_NAME "Microsoft Windows NT" 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci/* Maximum objects in the various object caches */ 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ 4362306a36Sopenharmony_ci#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ 4462306a36Sopenharmony_ci#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ 4562306a36Sopenharmony_ci#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ 4662306a36Sopenharmony_ci#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ 4762306a36Sopenharmony_ci#define ACPI_MAX_COMMENT_CACHE_DEPTH 96 /* Comments for the -ca option */ 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci/* 5062306a36Sopenharmony_ci * Should the subsystem abort the loading of an ACPI table if the 5162306a36Sopenharmony_ci * table checksum is incorrect? 5262306a36Sopenharmony_ci */ 5362306a36Sopenharmony_ci#ifndef ACPI_CHECKSUM_ABORT 5462306a36Sopenharmony_ci#define ACPI_CHECKSUM_ABORT FALSE 5562306a36Sopenharmony_ci#endif 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci/* 5862306a36Sopenharmony_ci * Generate a version of ACPICA that only supports "reduced hardware" 5962306a36Sopenharmony_ci * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized 6062306a36Sopenharmony_ci * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" 6162306a36Sopenharmony_ci * model. In other words, no ACPI hardware is supported. 6262306a36Sopenharmony_ci * 6362306a36Sopenharmony_ci * If TRUE, this means no support for the following: 6462306a36Sopenharmony_ci * PM Event and Control registers 6562306a36Sopenharmony_ci * SCI interrupt (and handler) 6662306a36Sopenharmony_ci * Fixed Events 6762306a36Sopenharmony_ci * General Purpose Events (GPEs) 6862306a36Sopenharmony_ci * Global Lock 6962306a36Sopenharmony_ci * ACPI PM timer 7062306a36Sopenharmony_ci * FACS table (Waking vectors and Global Lock) 7162306a36Sopenharmony_ci */ 7262306a36Sopenharmony_ci#ifndef ACPI_REDUCED_HARDWARE 7362306a36Sopenharmony_ci#define ACPI_REDUCED_HARDWARE FALSE 7462306a36Sopenharmony_ci#endif 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci/****************************************************************************** 7762306a36Sopenharmony_ci * 7862306a36Sopenharmony_ci * Subsystem Constants 7962306a36Sopenharmony_ci * 8062306a36Sopenharmony_ci *****************************************************************************/ 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci/* Version of ACPI supported */ 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci#define ACPI_CA_SUPPORT_LEVEL 5 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci/* Maximum count for a semaphore object */ 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci#define ACPI_MAX_SEMAPHORE_COUNT 256 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci/* Maximum object reference count (detects object deletion issues) */ 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci#define ACPI_MAX_REFERENCE_COUNT 0x4000 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci/* Default page size for use in mapping memory for operation regions */ 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */ 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci/* owner_id tracking. 128 entries allows for 4095 owner_ids */ 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci#define ACPI_NUM_OWNERID_MASKS 128 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci/* Size of the root table array is increased by this increment */ 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci/* Maximum sleep allowed via Sleep() operator */ 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ 10962306a36Sopenharmony_ci 11062306a36Sopenharmony_ci/* Address Range lists are per-space_id (Memory and I/O only) */ 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci#define ACPI_ADDRESS_RANGE_MAX 2 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci/* Maximum time (default 30s) of While() loops before abort */ 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci#define ACPI_MAX_LOOP_TIMEOUT 30 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci/****************************************************************************** 11962306a36Sopenharmony_ci * 12062306a36Sopenharmony_ci * ACPI Specification constants (Do not change unless the specification changes) 12162306a36Sopenharmony_ci * 12262306a36Sopenharmony_ci *****************************************************************************/ 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ci/* Method info (in WALK_STATE), containing local variables and arguments */ 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci#define ACPI_METHOD_NUM_LOCALS 8 12762306a36Sopenharmony_ci#define ACPI_METHOD_MAX_LOCAL 7 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci#define ACPI_METHOD_NUM_ARGS 7 13062306a36Sopenharmony_ci#define ACPI_METHOD_MAX_ARG 6 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci/* 13362306a36Sopenharmony_ci * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG 13462306a36Sopenharmony_ci */ 13562306a36Sopenharmony_ci#define ACPI_OBJ_NUM_OPERANDS 8 13662306a36Sopenharmony_ci#define ACPI_OBJ_MAX_OPERAND 7 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci/* Number of elements in the Result Stack frame, can be an arbitrary value */ 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define ACPI_RESULTS_FRAME_OBJ_NUM 8 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ci/* 14362306a36Sopenharmony_ci * Maximal number of elements the Result Stack can contain, 14462306a36Sopenharmony_ci * it may be an arbitrary value not exceeding the types of 14562306a36Sopenharmony_ci * result_size and result_count (now u8). 14662306a36Sopenharmony_ci */ 14762306a36Sopenharmony_ci#define ACPI_RESULTS_OBJ_NUM_MAX 255 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci/* Constants used in searching for the RSDP in low memory */ 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ 15262306a36Sopenharmony_ci#define ACPI_EBDA_PTR_LENGTH 2 15362306a36Sopenharmony_ci#define ACPI_EBDA_WINDOW_SIZE 1024 15462306a36Sopenharmony_ci#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ 15562306a36Sopenharmony_ci#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 15662306a36Sopenharmony_ci#define ACPI_RSDP_SCAN_STEP 16 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci/* Operation regions */ 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci#define ACPI_USER_REGION_BEGIN 0x80 16162306a36Sopenharmony_ci 16262306a36Sopenharmony_ci/* Maximum space_ids for Operation Regions */ 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci#define ACPI_MAX_ADDRESS_SPACE 255 16562306a36Sopenharmony_ci#define ACPI_NUM_DEFAULT_SPACES 4 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ci/* Array sizes. Used for range checking also */ 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci#define ACPI_MAX_MATCH_OPCODE 5 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci/* RSDP checksums */ 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_ci#define ACPI_RSDP_CHECKSUM_LENGTH 20 17462306a36Sopenharmony_ci#define ACPI_RSDP_XCHECKSUM_LENGTH 36 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ci/* 17762306a36Sopenharmony_ci * SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header, 17862306a36Sopenharmony_ci * containing both Status and Length. 17962306a36Sopenharmony_ci */ 18062306a36Sopenharmony_ci#define ACPI_SERIAL_HEADER_SIZE 2 /* Common for below. Status and Length fields */ 18162306a36Sopenharmony_ci 18262306a36Sopenharmony_ci#define ACPI_SMBUS_DATA_SIZE 32 18362306a36Sopenharmony_ci#define ACPI_SMBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci#define ACPI_IPMI_DATA_SIZE 64 18662306a36Sopenharmony_ci#define ACPI_IPMI_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci#define ACPI_MAX_GSBUS_DATA_SIZE 255 18962306a36Sopenharmony_ci#define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#define ACPI_PRM_INPUT_BUFFER_SIZE 26 19262306a36Sopenharmony_ci 19362306a36Sopenharmony_ci#define ACPI_FFH_INPUT_BUFFER_SIZE 256 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci/* _sx_d and _sx_w control methods */ 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci#define ACPI_NUM_sx_d_METHODS 4 19862306a36Sopenharmony_ci#define ACPI_NUM_sx_w_METHODS 5 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_ci/****************************************************************************** 20162306a36Sopenharmony_ci * 20262306a36Sopenharmony_ci * Miscellaneous constants 20362306a36Sopenharmony_ci * 20462306a36Sopenharmony_ci *****************************************************************************/ 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_ci/* UUID constants */ 20762306a36Sopenharmony_ci 20862306a36Sopenharmony_ci#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */ 20962306a36Sopenharmony_ci#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */ 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_ci/* Positions for required hyphens (dashes) in UUID strings */ 21262306a36Sopenharmony_ci 21362306a36Sopenharmony_ci#define UUID_HYPHEN1_OFFSET 8 21462306a36Sopenharmony_ci#define UUID_HYPHEN2_OFFSET 13 21562306a36Sopenharmony_ci#define UUID_HYPHEN3_OFFSET 18 21662306a36Sopenharmony_ci#define UUID_HYPHEN4_OFFSET 23 21762306a36Sopenharmony_ci 21862306a36Sopenharmony_ci/****************************************************************************** 21962306a36Sopenharmony_ci * 22062306a36Sopenharmony_ci * ACPI AML Debugger 22162306a36Sopenharmony_ci * 22262306a36Sopenharmony_ci *****************************************************************************/ 22362306a36Sopenharmony_ci 22462306a36Sopenharmony_ci#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */ 22562306a36Sopenharmony_ci#define ACPI_DB_LINE_BUFFER_SIZE 512 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci#define ACPI_DEBUGGER_COMMAND_PROMPT '-' 22862306a36Sopenharmony_ci#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci#endif /* _ACCONFIG_H */ 231