aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-04 17:16:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-04 17:16:49 -0400
commiteceeae414edccb07fad683011c0c65abe8a3a554 (patch)
tree4d8d25e894382f9526a140f7c73ff9c9437c72a5
parent408c9861c6979db974455b9e7a9bcadd60e0934c (diff)
parent03471c06d02f80f9338a5df45f2a92ef38ca1233 (diff)
Merge tag 'acpi-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These mostly update the ACPICA code in the kernel to upstream revision 20170531 which covers all of the new material from ACPI 6.2, including new tables (WSMT, HMAT, PPTT), new subtables and definition changes for some existing tables (BGRT, HEST, SRAT, TPM2, PCCT), new resource descriptor macros for pin control, support for new predefined methods (_LSI, _LSR, _LSW, _HMA), fixes and cleanups. On top of that, an additional ACPICA change from Kees (which also is upstream already) switches all of the definitions of function pointer structures in ACPICA to use designated initializers so as to make the structure layout randomization GCC plugin work with it. The rest is a few fixes and cleanups in the EC driver, an xpower PMIC driver update, a new backlight blacklist entry, and update of the tables configfs interface and a messages formatting cleanup. Specifics: - Update the ACPICA code in the kernel to upstream revision revision 20170531 (which covers all of the new material from ACPI 6.2) including: * Support for the PinFunction(), PinConfig(), PinGroup(), PinGroupFunction(), and PinGroupConfig() resource descriptors (Mika Westerberg). * Support for new subtables in HEST and SRAT, new notify value for HEST, header support for TPM2 table changes, and BGRT Status field update (Bob Moore). * Support for new PCCT subtables (David Box). * Support for _LSI, _LSR, _LSW, and _HMA as predefined methods (Erik Schmauss). * Support for the new WSMT, HMAT, and PPTT tables (Lv Zheng). * New UUID values for Processor Properties (Bob Moore). * New notify values for memory attributes and graceful shutdown (Bob Moore). * Fix related to the PCAT_COMPAT MADT flag (Janosch Hildebrand). * Resource to AML conversion fix for resources containing GPIOs (Mika Westerberg). * Disassembler-related updates (Bob Moore, David Box, Erik Schmauss). * Assorted fixes and cleanups (Bob Moore, Erik Schmauss, Lv Zheng, Cao Jin). - Modify ACPICA to always use designated initializers for function pointer structures to make the structure layout randomization GCC plugin work with it (Kees Cook). - Update the tables configfs interface to unload SSDTs on configfs entry removal (Jan Kiszka). - Add support for the GPI1 regulator to the xpower PMIC Operation Region handler (Hans de Goede). - Fix ACPI EC issues related to conflicting EC definitions in the ECDT and in the ACPI namespace (Lv Zheng, Carlo Caione, Chris Chiu). - Fix an interrupt storm issue in the EC driver and make its debug output work with dynamic debug as expected (Lv Zheng). - Add ACPI backlight quirk for Dell Precision 7510 (Shih-Yuan Lee). - Fix whitespace in pr_fmt() to align log entries properly in some places in the ACPI subsystem (Vincent Legoll)" * tag 'acpi-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits) ACPI / EC: Add quirk for GL720VMK ACPI / EC: Fix media keys not working problem on some Asus laptops ACPI / EC: Add support to skip boot stage DSDT probe ACPI / EC: Enhance boot EC sanity check ACPI / video: Add quirks for the Dell Precision 7510 ACPI: EC: Fix EC command visibility for dynamic debug ACPI: EC: Fix an EC event IRQ storming issue ACPICA: Use designated initializers ACPICA: Update version to 20170531 ACPICA: Update a couple of debug output messages ACPICA: acpiexec: enhance local signal handler ACPICA: Simplify output for the ACPI Debug Object ACPICA: Unix application OSL: Correctly handle control-c (EINTR) ACPICA: Improvements for debug output only ACPICA: Disassembler: allow conflicting external declarations to be emitted. ACPICA: Disassembler: add external op to namespace on first pass ACPICA: Disassembler: prevent external op's from opening a new scope ACPICA: Changed Gbl_disasm_flag to acpi_gbl_disasm_flag ACPICA: Changing External to a named object ACPICA: Update two error messages to emit control method name ...
-rw-r--r--drivers/acpi/acpi_configfs.c20
-rw-r--r--drivers/acpi/acpi_dbg.c2
-rw-r--r--drivers/acpi/acpica/Makefile1
-rw-r--r--drivers/acpi/acpica/acapps.h4
-rw-r--r--drivers/acpi/acpica/acglobal.h3
-rw-r--r--drivers/acpi/acpica/aclocal.h15
-rw-r--r--drivers/acpi/acpica/acopcode.h2
-rw-r--r--drivers/acpi/acpica/acpredef.h16
-rw-r--r--drivers/acpi/acpica/acresrc.h15
-rw-r--r--drivers/acpi/acpica/acutils.h1
-rw-r--r--drivers/acpi/acpica/amlcode.h61
-rw-r--r--drivers/acpi/acpica/amlresrc.h104
-rw-r--r--drivers/acpi/acpica/dbexec.c12
-rw-r--r--drivers/acpi/acpica/dbobject.c6
-rw-r--r--drivers/acpi/acpica/dbxface.c2
-rw-r--r--drivers/acpi/acpica/dsargs.c5
-rw-r--r--drivers/acpi/acpica/dsdebug.c1
-rw-r--r--drivers/acpi/acpica/dsmethod.c12
-rw-r--r--drivers/acpi/acpica/dsopcode.c11
-rw-r--r--drivers/acpi/acpica/dsutils.c9
-rw-r--r--drivers/acpi/acpica/dswexec.c4
-rw-r--r--drivers/acpi/acpica/dswload.c42
-rw-r--r--drivers/acpi/acpica/dswload2.c16
-rw-r--r--drivers/acpi/acpica/evxfevnt.c18
-rw-r--r--drivers/acpi/acpica/exdebug.c4
-rw-r--r--drivers/acpi/acpica/exdump.c30
-rw-r--r--drivers/acpi/acpica/exoparg1.c25
-rw-r--r--drivers/acpi/acpica/exresolv.c23
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c14
-rw-r--r--drivers/acpi/acpica/nsaccess.c27
-rw-r--r--drivers/acpi/acpica/nsnames.c3
-rw-r--r--drivers/acpi/acpica/nsutils.c2
-rw-r--r--drivers/acpi/acpica/nsxfeval.c39
-rw-r--r--drivers/acpi/acpica/psobject.c14
-rw-r--r--drivers/acpi/acpica/psopcode.c8
-rw-r--r--drivers/acpi/acpica/psparse.c14
-rw-r--r--drivers/acpi/acpica/rscalc.c139
-rw-r--r--drivers/acpi/acpica/rsdump.c48
-rw-r--r--drivers/acpi/acpica/rsdumpinfo.c114
-rw-r--r--drivers/acpi/acpica/rsinfo.c28
-rw-r--r--drivers/acpi/acpica/rsmisc.c4
-rw-r--r--drivers/acpi/acpica/rsserial.c373
-rw-r--r--drivers/acpi/acpica/tbdata.c4
-rw-r--r--drivers/acpi/acpica/tbfadt.c4
-rw-r--r--drivers/acpi/acpica/tbutils.c6
-rw-r--r--drivers/acpi/acpica/utdecode.c8
-rw-r--r--drivers/acpi/acpica/utownerid.c12
-rw-r--r--drivers/acpi/acpica/utresdecode.c315
-rw-r--r--drivers/acpi/acpica/utresrc.c259
-rw-r--r--drivers/acpi/acpica/utxfmutex.c5
-rw-r--r--drivers/acpi/button.c2
-rw-r--r--drivers/acpi/ec.c84
-rw-r--r--drivers/acpi/ioapic.c2
-rw-r--r--drivers/acpi/pmic/intel_pmic_xpower.c21
-rw-r--r--drivers/acpi/video_detect.c8
-rw-r--r--drivers/char/tpm/tpm_crb.c4
-rw-r--r--drivers/mailbox/pcc.c10
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/acrestyp.h92
-rw-r--r--include/acpi/actbl1.h238
-rw-r--r--include/acpi/actbl2.h59
-rw-r--r--include/acpi/actbl3.h82
-rw-r--r--include/acpi/actypes.h67
-rw-r--r--include/acpi/acuuid.h5
-rw-r--r--include/acpi/platform/acenv.h4
-rw-r--r--include/acpi/platform/acgcc.h10
-rw-r--r--include/acpi/platform/acintel.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixxf.c10
69 files changed, 2156 insertions, 452 deletions
diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
index 146a77fb762d..853bc7fc673f 100644
--- a/drivers/acpi/acpi_configfs.c
+++ b/drivers/acpi/acpi_configfs.c
@@ -15,11 +15,15 @@
15#include <linux/configfs.h> 15#include <linux/configfs.h>
16#include <linux/acpi.h> 16#include <linux/acpi.h>
17 17
18#include "acpica/accommon.h"
19#include "acpica/actables.h"
20
18static struct config_group *acpi_table_group; 21static struct config_group *acpi_table_group;
19 22
20struct acpi_table { 23struct acpi_table {
21 struct config_item cfg; 24 struct config_item cfg;
22 struct acpi_table_header *header; 25 struct acpi_table_header *header;
26 u32 index;
23}; 27};
24 28
25static ssize_t acpi_table_aml_write(struct config_item *cfg, 29static ssize_t acpi_table_aml_write(struct config_item *cfg,
@@ -52,7 +56,11 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
52 if (!table->header) 56 if (!table->header)
53 return -ENOMEM; 57 return -ENOMEM;
54 58
55 ret = acpi_load_table(table->header); 59 ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
60 ret = acpi_tb_install_and_load_table(
61 ACPI_PTR_TO_PHYSADDR(table->header),
62 ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE,
63 &table->index);
56 if (ret) { 64 if (ret) {
57 kfree(table->header); 65 kfree(table->header);
58 table->header = NULL; 66 table->header = NULL;
@@ -215,8 +223,18 @@ static struct config_item *acpi_table_make_item(struct config_group *group,
215 return &table->cfg; 223 return &table->cfg;
216} 224}
217 225
226static void acpi_table_drop_item(struct config_group *group,
227 struct config_item *cfg)
228{
229 struct acpi_table *table = container_of(cfg, struct acpi_table, cfg);
230
231 ACPI_INFO(("Host-directed Dynamic ACPI Table Unload"));
232 acpi_tb_unload_table(table->index);
233}
234
218struct configfs_group_operations acpi_table_group_ops = { 235struct configfs_group_operations acpi_table_group_ops = {
219 .make_item = acpi_table_make_item, 236 .make_item = acpi_table_make_item,
237 .drop_item = acpi_table_drop_item,
220}; 238};
221 239
222static struct config_item_type acpi_tables_type = { 240static struct config_item_type acpi_tables_type = {
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c
index dee86925a9a1..3ec05aa1a903 100644
--- a/drivers/acpi/acpi_dbg.c
+++ b/drivers/acpi/acpi_dbg.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12/* #define DEBUG */ 12/* #define DEBUG */
13#define pr_fmt(fmt) "ACPI : AML: " fmt 13#define pr_fmt(fmt) "ACPI: AML: " fmt
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/module.h> 16#include <linux/module.h>
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index dea65306b687..b125bdd3d58b 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -172,6 +172,7 @@ acpi-y += \
172 utosi.o \ 172 utosi.o \
173 utownerid.o \ 173 utownerid.o \
174 utpredef.o \ 174 utpredef.o \
175 utresdecode.o \
175 utresrc.o \ 176 utresrc.o \
176 utstate.o \ 177 utstate.o \
177 utstring.o \ 178 utstring.o \
diff --git a/drivers/acpi/acpica/acapps.h b/drivers/acpi/acpica/acapps.h
index b65f2731e9e2..bb6a84b0b4b3 100644
--- a/drivers/acpi/acpica/acapps.h
+++ b/drivers/acpi/acpica/acapps.h
@@ -158,8 +158,8 @@ acpi_dm_finish_namespace_load(union acpi_parse_object *parse_tree_root,
158 acpi_owner_id owner_id); 158 acpi_owner_id owner_id);
159 159
160void 160void
161acpi_dm_convert_resource_indexes(union acpi_parse_object *parse_tree_root, 161acpi_dm_convert_parse_objects(union acpi_parse_object *parse_tree_root,
162 struct acpi_namespace_node *namespace_root); 162 struct acpi_namespace_node *namespace_root);
163 163
164/* 164/*
165 * adfile 165 * adfile
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index abe8c316908c..95eed442703f 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -315,6 +315,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
315ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE); 315ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE);
316ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE); 316ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE);
317ACPI_INIT_GLOBAL(u8, acpi_gbl_do_disassembler_optimizations, TRUE); 317ACPI_INIT_GLOBAL(u8, acpi_gbl_do_disassembler_optimizations, TRUE);
318ACPI_INIT_GLOBAL(ACPI_PARSE_OBJECT_LIST, *acpi_gbl_temp_list_head, NULL);
318 319
319ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm); 320ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm);
320ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing); 321ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing);
@@ -368,6 +369,8 @@ ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]);
368ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]); 369ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]);
369ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]); 370ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);
370 371
372ACPI_INIT_GLOBAL(u8, acpi_gbl_disasm_flag, FALSE);
373
371#endif 374#endif
372 375
373/* 376/*
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index f9b3f7fef462..8ddd3b20e0c6 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -859,7 +859,7 @@ ACPI_PARSE_COMMON};
859 * and bytelists. 859 * and bytelists.
860 */ 860 */
861struct acpi_parse_obj_named { 861struct acpi_parse_obj_named {
862 ACPI_PARSE_COMMON u8 *path; 862 ACPI_PARSE_COMMON char *path;
863 u8 *data; /* AML body or bytelist data */ 863 u8 *data; /* AML body or bytelist data */
864 u32 length; /* AML length */ 864 u32 length; /* AML length */
865 u32 name; /* 4-byte name or zero if no name */ 865 u32 name; /* 4-byte name or zero if no name */
@@ -1142,8 +1142,13 @@ struct acpi_port_info {
1142#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1142#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
1143#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 1143#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
1144#define ACPI_RESOURCE_NAME_GPIO 0x8C 1144#define ACPI_RESOURCE_NAME_GPIO 0x8C
1145#define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D
1145#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1146#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
1146#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 1147#define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F
1148#define ACPI_RESOURCE_NAME_PIN_GROUP 0x90
1149#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91
1150#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92
1151#define ACPI_RESOURCE_NAME_LARGE_MAX 0x92
1147 1152
1148/***************************************************************************** 1153/*****************************************************************************
1149 * 1154 *
@@ -1176,12 +1181,18 @@ struct acpi_external_list {
1176#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1181#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
1177#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ 1182#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
1178#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ 1183#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */
1184#define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */
1179 1185
1180struct acpi_external_file { 1186struct acpi_external_file {
1181 char *path; 1187 char *path;
1182 struct acpi_external_file *next; 1188 struct acpi_external_file *next;
1183}; 1189};
1184 1190
1191struct acpi_parse_object_list {
1192 union acpi_parse_object *op;
1193 struct acpi_parse_object_list *next;
1194};
1195
1185/***************************************************************************** 1196/*****************************************************************************
1186 * 1197 *
1187 * Debugger 1198 * Debugger
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index a5d9af758c52..cbd59a302679 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -112,7 +112,7 @@
112#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) 112#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
113#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) 113#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
114#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) 114#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
115#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA) 115#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAME, ARGP_BYTEDATA, ARGP_BYTEDATA)
116#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) 116#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
117#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) 117#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
118#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) 118#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index dcfc05d40e36..cdfcad8eb74c 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -581,6 +581,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
581 {{"_HID", METHOD_0ARGS, 581 {{"_HID", METHOD_0ARGS,
582 METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}}, 582 METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}},
583 583
584 {{"_HMA", METHOD_0ARGS,
585 METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
586
584 {{"_HOT", METHOD_0ARGS, 587 {{"_HOT", METHOD_0ARGS,
585 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 588 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
586 589
@@ -626,6 +629,19 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
626 ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 629 ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING,
627 10, 0), 630 10, 0),
628 631
632 {{"_LSI", METHOD_0ARGS,
633 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},
634 PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0, 0, 0),
635
636 {{"_LSR", METHOD_2ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
637 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},
638 PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1,
639 ACPI_RTYPE_BUFFER, 1, 0),
640
641 {{"_LSW",
642 METHOD_3ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER),
643 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
644
629 {{"_MAT", METHOD_0ARGS, 645 {{"_MAT", METHOD_0ARGS,
630 METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, 646 METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
631 647
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index b4d22f6e48e2..438f3098a093 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -148,7 +148,10 @@ typedef enum {
148 ACPI_RSD_UINT16, 148 ACPI_RSD_UINT16,
149 ACPI_RSD_UINT32, 149 ACPI_RSD_UINT32,
150 ACPI_RSD_UINT64, 150 ACPI_RSD_UINT64,
151 ACPI_RSD_WORDLIST 151 ACPI_RSD_WORDLIST,
152 ACPI_RSD_LABEL,
153 ACPI_RSD_SOURCE_LABEL,
154
152} ACPI_RSDUMP_OPCODES; 155} ACPI_RSDUMP_OPCODES;
153 156
154/* restore default alignment */ 157/* restore default alignment */
@@ -329,6 +332,11 @@ extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[];
329extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[]; 332extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[];
330extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[]; 333extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[];
331extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[]; 334extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[];
335extern struct acpi_rsconvert_info acpi_rs_convert_pin_function[];
336extern struct acpi_rsconvert_info acpi_rs_convert_pin_config[];
337extern struct acpi_rsconvert_info acpi_rs_convert_pin_group[];
338extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[];
339extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[];
332 340
333/* These resources require separate get/set tables */ 341/* These resources require separate get/set tables */
334 342
@@ -372,12 +380,17 @@ extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
372extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; 380extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
373extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; 381extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
374extern struct acpi_rsdump_info acpi_rs_dump_gpio[]; 382extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
383extern struct acpi_rsdump_info acpi_rs_dump_pin_function[];
375extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[]; 384extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
376extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[]; 385extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
377extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[]; 386extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
378extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[]; 387extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
379extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[]; 388extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
380extern struct acpi_rsdump_info acpi_rs_dump_general_flags[]; 389extern struct acpi_rsdump_info acpi_rs_dump_general_flags[];
390extern struct acpi_rsdump_info acpi_rs_dump_pin_config[];
391extern struct acpi_rsdump_info acpi_rs_dump_pin_group[];
392extern struct acpi_rsdump_info acpi_rs_dump_pin_group_function[];
393extern struct acpi_rsdump_info acpi_rs_dump_pin_group_config[];
381#endif 394#endif
382 395
383#endif /* __ACRESRC_H__ */ 396#endif /* __ACRESRC_H__ */
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 6f28cfae2212..2a3cc4296481 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -85,6 +85,7 @@ extern const char *acpi_gbl_bpb_decode[];
85extern const char *acpi_gbl_sb_decode[]; 85extern const char *acpi_gbl_sb_decode[];
86extern const char *acpi_gbl_fc_decode[]; 86extern const char *acpi_gbl_fc_decode[];
87extern const char *acpi_gbl_pt_decode[]; 87extern const char *acpi_gbl_pt_decode[];
88extern const char *acpi_gbl_ptyp_decode[];
88#endif 89#endif
89 90
90/* 91/*
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 176f7e9b4d0e..f54dc5a34bdc 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -313,6 +313,11 @@
313 * #A is the number of required arguments 313 * #A is the number of required arguments
314 * #T is the number of target operands 314 * #T is the number of target operands
315 * #R indicates whether there is a return value 315 * #R indicates whether there is a return value
316 *
317 * These types are used for the top-level dispatch of the AML
318 * opcode. They group similar operators that can share common
319 * front-end code before dispatch to the final code that implements
320 * the operator.
316 */ 321 */
317 322
318/* 323/*
@@ -353,42 +358,42 @@
353 * The opcode Type is used in a dispatch table, do not change 358 * The opcode Type is used in a dispatch table, do not change
354 * or add anything new without updating the table. 359 * or add anything new without updating the table.
355 */ 360 */
356#define AML_TYPE_EXEC_0A_0T_1R 0x00 361#define AML_TYPE_EXEC_0A_0T_1R 0x00 /* 0 Args, 0 Target, 1 ret_val */
357#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ 362#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* 1 Args, 0 Target, 0 ret_val */
358#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ 363#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* 1 Args, 0 Target, 1 ret_val */
359#define AML_TYPE_EXEC_1A_1T_0R 0x03 364#define AML_TYPE_EXEC_1A_1T_0R 0x03 /* 1 Args, 1 Target, 0 ret_val */
360#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ 365#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* 1 Args, 1 Target, 1 ret_val */
361#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ 366#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* 2 Args, 0 Target, 0 ret_val */
362#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ 367#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* 2 Args, 0 Target, 1 ret_val */
363#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ 368#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* 2 Args, 1 Target, 1 ret_val */
364#define AML_TYPE_EXEC_2A_2T_1R 0x08 369#define AML_TYPE_EXEC_2A_2T_1R 0x08 /* 2 Args, 2 Target, 1 ret_val */
365#define AML_TYPE_EXEC_3A_0T_0R 0x09 370#define AML_TYPE_EXEC_3A_0T_0R 0x09 /* 3 Args, 0 Target, 0 ret_val */
366#define AML_TYPE_EXEC_3A_1T_1R 0x0A 371#define AML_TYPE_EXEC_3A_1T_1R 0x0A /* 3 Args, 1 Target, 1 ret_val */
367#define AML_TYPE_EXEC_6A_0T_1R 0x0B 372#define AML_TYPE_EXEC_6A_0T_1R 0x0B /* 6 Args, 0 Target, 1 ret_val */
368/* End of types used in dispatch table */ 373/* End of types used in dispatch table */
369 374
370#define AML_TYPE_LITERAL 0x0B 375#define AML_TYPE_LITERAL 0x0C
371#define AML_TYPE_CONSTANT 0x0C 376#define AML_TYPE_CONSTANT 0x0D
372#define AML_TYPE_METHOD_ARGUMENT 0x0D 377#define AML_TYPE_METHOD_ARGUMENT 0x0E
373#define AML_TYPE_LOCAL_VARIABLE 0x0E 378#define AML_TYPE_LOCAL_VARIABLE 0x0F
374#define AML_TYPE_DATA_TERM 0x0F 379#define AML_TYPE_DATA_TERM 0x10
375 380
376/* Generic for an op that returns a value */ 381/* Generic for an op that returns a value */
377 382
378#define AML_TYPE_METHOD_CALL 0x10 383#define AML_TYPE_METHOD_CALL 0x11
379 384
380/* Miscellaneous types */ 385/* Miscellaneous types */
381 386
382#define AML_TYPE_CREATE_FIELD 0x11 387#define AML_TYPE_CREATE_FIELD 0x12
383#define AML_TYPE_CREATE_OBJECT 0x12 388#define AML_TYPE_CREATE_OBJECT 0x13
384#define AML_TYPE_CONTROL 0x13 389#define AML_TYPE_CONTROL 0x14
385#define AML_TYPE_NAMED_NO_OBJ 0x14 390#define AML_TYPE_NAMED_NO_OBJ 0x15
386#define AML_TYPE_NAMED_FIELD 0x15 391#define AML_TYPE_NAMED_FIELD 0x16
387#define AML_TYPE_NAMED_SIMPLE 0x16 392#define AML_TYPE_NAMED_SIMPLE 0x17
388#define AML_TYPE_NAMED_COMPLEX 0x17 393#define AML_TYPE_NAMED_COMPLEX 0x18
389#define AML_TYPE_RETURN 0x18 394#define AML_TYPE_RETURN 0x19
390#define AML_TYPE_UNDEFINED 0x19 395#define AML_TYPE_UNDEFINED 0x1A
391#define AML_TYPE_BOGUS 0x1A 396#define AML_TYPE_BOGUS 0x1B
392 397
393/* AML Package Length encodings */ 398/* AML Package Length encodings */
394 399
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index 653a3d1ef5d5..1236e9a414e4 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -65,6 +65,7 @@
65#define ACPI_RESTAG_DRIVESTRENGTH "_DRS" 65#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
66#define ACPI_RESTAG_ENDIANNESS "_END" 66#define ACPI_RESTAG_ENDIANNESS "_END"
67#define ACPI_RESTAG_FLOWCONTROL "_FLC" 67#define ACPI_RESTAG_FLOWCONTROL "_FLC"
68#define ACPI_RESTAG_FUNCTION "_FUN"
68#define ACPI_RESTAG_GRANULARITY "_GRA" 69#define ACPI_RESTAG_GRANULARITY "_GRA"
69#define ACPI_RESTAG_INTERRUPT "_INT" 70#define ACPI_RESTAG_INTERRUPT "_INT"
70#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 71#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
@@ -84,6 +85,8 @@
84#define ACPI_RESTAG_PHASE "_PHA" 85#define ACPI_RESTAG_PHASE "_PHA"
85#define ACPI_RESTAG_PIN "_PIN" 86#define ACPI_RESTAG_PIN "_PIN"
86#define ACPI_RESTAG_PINCONFIG "_PPI" 87#define ACPI_RESTAG_PINCONFIG "_PPI"
88#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP"
89#define ACPI_RESTAG_PINCONFIG_VALUE "_VAL"
87#define ACPI_RESTAG_POLARITY "_POL" 90#define ACPI_RESTAG_POLARITY "_POL"
88#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 91#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
89#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 92#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
@@ -404,6 +407,102 @@ struct aml_resource_uart_serialbus {
404#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ 407#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
405#define AML_RESOURCE_UART_MIN_DATA_LEN 10 408#define AML_RESOURCE_UART_MIN_DATA_LEN 10
406 409
410struct aml_resource_pin_function {
411 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
412 u16 flags;
413 u8 pin_config;
414 u16 function_number;
415 u16 pin_table_offset;
416 u8 res_source_index;
417 u16 res_source_offset;
418 u16 vendor_offset;
419 u16 vendor_length;
420 /*
421 * Optional fields follow immediately:
422 * 1) PIN list (Words)
423 * 2) Resource Source String
424 * 3) Vendor Data bytes
425 */
426};
427
428#define AML_RESOURCE_PIN_FUNCTION_REVISION 1 /* ACPI 6.2 */
429
430struct aml_resource_pin_config {
431 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
432 u16 flags;
433 u8 pin_config_type;
434 u32 pin_config_value;
435 u16 pin_table_offset;
436 u8 res_source_index;
437 u16 res_source_offset;
438 u16 vendor_offset;
439 u16 vendor_length;
440 /*
441 * Optional fields follow immediately:
442 * 1) PIN list (Words)
443 * 2) Resource Source String
444 * 3) Vendor Data bytes
445 */
446};
447
448#define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */
449
450struct aml_resource_pin_group {
451 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
452 u16 flags;
453 u16 pin_table_offset;
454 u16 label_offset;
455 u16 vendor_offset;
456 u16 vendor_length;
457 /*
458 * Optional fields follow immediately:
459 * 1) PIN list (Words)
460 * 2) Resource Label String
461 * 3) Vendor Data bytes
462 */
463};
464
465#define AML_RESOURCE_PIN_GROUP_REVISION 1 /* ACPI 6.2 */
466
467struct aml_resource_pin_group_function {
468 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
469 u16 flags;
470 u16 function_number;
471 u8 res_source_index;
472 u16 res_source_offset;
473 u16 res_source_label_offset;
474 u16 vendor_offset;
475 u16 vendor_length;
476 /*
477 * Optional fields follow immediately:
478 * 1) Resource Source String
479 * 2) Resource Source Label String
480 * 3) Vendor Data bytes
481 */
482};
483
484#define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION 1 /* ACPI 6.2 */
485
486struct aml_resource_pin_group_config {
487 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
488 u16 flags;
489 u8 pin_config_type;
490 u32 pin_config_value;
491 u8 res_source_index;
492 u16 res_source_offset;
493 u16 res_source_label_offset;
494 u16 vendor_offset;
495 u16 vendor_length;
496 /*
497 * Optional fields follow immediately:
498 * 1) Resource Source String
499 * 2) Resource Source Label String
500 * 3) Vendor Data bytes
501 */
502};
503
504#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */
505
407/* restore default alignment */ 506/* restore default alignment */
408 507
409#pragma pack() 508#pragma pack()
@@ -446,6 +545,11 @@ union aml_resource {
446 struct aml_resource_spi_serialbus spi_serial_bus; 545 struct aml_resource_spi_serialbus spi_serial_bus;
447 struct aml_resource_uart_serialbus uart_serial_bus; 546 struct aml_resource_uart_serialbus uart_serial_bus;
448 struct aml_resource_common_serialbus common_serial_bus; 547 struct aml_resource_common_serialbus common_serial_bus;
548 struct aml_resource_pin_function pin_function;
549 struct aml_resource_pin_config pin_config;
550 struct aml_resource_pin_group pin_group;
551 struct aml_resource_pin_group_function pin_group_function;
552 struct aml_resource_pin_group_config pin_group_config;
449 553
450 /* Utility overlays */ 554 /* Utility overlays */
451 555
diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c
index b611cd92b5f5..3b30319752f0 100644
--- a/drivers/acpi/acpica/dbexec.c
+++ b/drivers/acpi/acpica/dbexec.c
@@ -181,6 +181,18 @@ acpi_db_execute_method(struct acpi_db_method_info *info,
181 acpi_gbl_method_executing = FALSE; 181 acpi_gbl_method_executing = FALSE;
182 182
183 if (ACPI_FAILURE(status)) { 183 if (ACPI_FAILURE(status)) {
184 if ((status == AE_ABORT_METHOD) || acpi_gbl_abort_method) {
185
186 /* Clear the abort and fall back to the debugger prompt */
187
188 ACPI_EXCEPTION((AE_INFO, status,
189 "Aborting top-level method"));
190
191 acpi_gbl_abort_method = FALSE;
192 status = AE_OK;
193 goto cleanup;
194 }
195
184 ACPI_EXCEPTION((AE_INFO, status, 196 ACPI_EXCEPTION((AE_INFO, status,
185 "while executing %s from debugger", 197 "while executing %s from debugger",
186 info->pathname)); 198 info->pathname));
diff --git a/drivers/acpi/acpica/dbobject.c b/drivers/acpi/acpica/dbobject.c
index f2252b1ac0b3..e7b415c20aa8 100644
--- a/drivers/acpi/acpica/dbobject.c
+++ b/drivers/acpi/acpica/dbobject.c
@@ -448,7 +448,7 @@ void acpi_db_decode_locals(struct acpi_walk_state *walk_state)
448 448
449 if (display_locals) { 449 if (display_locals) {
450 acpi_os_printf 450 acpi_os_printf
451 ("\nInitialized Local Variables for method [%4.4s]:\n", 451 ("\nInitialized Local Variables for Method [%4.4s]:\n",
452 acpi_ut_get_node_name(node)); 452 acpi_ut_get_node_name(node));
453 453
454 for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) { 454 for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
@@ -461,7 +461,7 @@ void acpi_db_decode_locals(struct acpi_walk_state *walk_state)
461 } 461 }
462 } else { 462 } else {
463 acpi_os_printf 463 acpi_os_printf
464 ("No Local Variables are initialized for method [%4.4s]\n", 464 ("No Local Variables are initialized for Method [%4.4s]\n",
465 acpi_ut_get_node_name(node)); 465 acpi_ut_get_node_name(node));
466 } 466 }
467} 467}
@@ -515,7 +515,7 @@ void acpi_db_decode_arguments(struct acpi_walk_state *walk_state)
515 acpi_os_printf("Initialized Arguments for Method [%4.4s]: " 515 acpi_os_printf("Initialized Arguments for Method [%4.4s]: "
516 "(%X arguments defined for method invocation)\n", 516 "(%X arguments defined for method invocation)\n",
517 acpi_ut_get_node_name(node), 517 acpi_ut_get_node_name(node),
518 obj_desc->method.param_count); 518 node->object->method.param_count);
519 519
520 for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { 520 for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
521 obj_desc = walk_state->arguments[i].object; 521 obj_desc = walk_state->arguments[i].object;
diff --git a/drivers/acpi/acpica/dbxface.c b/drivers/acpi/acpica/dbxface.c
index 8f665d94b8b5..b6985323e7eb 100644
--- a/drivers/acpi/acpica/dbxface.c
+++ b/drivers/acpi/acpica/dbxface.c
@@ -244,7 +244,7 @@ acpi_db_single_step(struct acpi_walk_state *walk_state,
244 if ((acpi_gbl_db_output_to_file) || 244 if ((acpi_gbl_db_output_to_file) ||
245 (acpi_dbg_level & ACPI_LV_PARSE)) { 245 (acpi_dbg_level & ACPI_LV_PARSE)) {
246 acpi_os_printf 246 acpi_os_printf
247 ("\n[AmlDebug] Next AML Opcode to execute:\n"); 247 ("\nAML Debug: Next AML Opcode to execute:\n");
248 } 248 }
249 249
250 /* 250 /*
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 287b3fd73cfc..2873455c986d 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -82,7 +82,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
82 union acpi_parse_object *op; 82 union acpi_parse_object *op;
83 struct acpi_walk_state *walk_state; 83 struct acpi_walk_state *walk_state;
84 84
85 ACPI_FUNCTION_TRACE(ds_execute_arguments); 85 ACPI_FUNCTION_TRACE_PTR(ds_execute_arguments, aml_start);
86 86
87 /* Allocate a new parser op to be the root of the parsed tree */ 87 /* Allocate a new parser op to be the root of the parsed tree */
88 88
@@ -338,7 +338,8 @@ acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc)
338 return_ACPI_STATUS(AE_AML_INTERNAL); 338 return_ACPI_STATUS(AE_AML_INTERNAL);
339 } 339 }
340 340
341 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Package Arg Init\n")); 341 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n",
342 obj_desc->package.aml_start));
342 343
343 /* Execute the AML code for the term_arg arguments */ 344 /* Execute the AML code for the term_arg arguments */
344 345
diff --git a/drivers/acpi/acpica/dsdebug.c b/drivers/acpi/acpica/dsdebug.c
index 4d885eb8eda9..d1f457eda980 100644
--- a/drivers/acpi/acpica/dsdebug.c
+++ b/drivers/acpi/acpica/dsdebug.c
@@ -196,6 +196,7 @@ acpi_ds_dump_method_stack(acpi_status status,
196 op->common.next = NULL; 196 op->common.next = NULL;
197 197
198#ifdef ACPI_DISASSEMBLER 198#ifdef ACPI_DISASSEMBLER
199 acpi_os_printf("Failed at ");
199 acpi_dm_disassemble(next_walk_state, op, 200 acpi_dm_disassemble(next_walk_state, op,
200 ACPI_UINT32_MAX); 201 ACPI_UINT32_MAX);
201#endif 202#endif
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 31c9c7aec3d5..d7fc36917c67 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -212,6 +212,7 @@ acpi_status
212acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) 212acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
213{ 213{
214 u32 aml_offset; 214 u32 aml_offset;
215 acpi_name name = 0;
215 216
216 ACPI_FUNCTION_ENTRY(); 217 ACPI_FUNCTION_ENTRY();
217 218
@@ -237,10 +238,13 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
237 walk_state->parser_state. 238 walk_state->parser_state.
238 aml_start); 239 aml_start);
239 240
240 status = acpi_gbl_exception_handler(status, 241 if (walk_state->method_node) {
241 walk_state->method_node ? 242 name = walk_state->method_node->name.integer;
242 walk_state->method_node-> 243 } else if (walk_state->deferred_node) {
243 name.integer : 0, 244 name = walk_state->deferred_node->name.integer;
245 }
246
247 status = acpi_gbl_exception_handler(status, name,
244 walk_state->opcode, 248 walk_state->opcode,
245 aml_offset, NULL); 249 aml_offset, NULL);
246 acpi_ex_enter_interpreter(); 250 acpi_ex_enter_interpreter();
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 9a8f8a992b3e..dfc3c25a083d 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -227,13 +227,12 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
227 227
228 /* Entire field must fit within the current length of the buffer */ 228 /* Entire field must fit within the current length of the buffer */
229 229
230 if ((bit_offset + bit_count) > (8 * (u32) buffer_desc->buffer.length)) { 230 if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
231 ACPI_ERROR((AE_INFO, 231 ACPI_ERROR((AE_INFO,
232 "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)", 232 "Field [%4.4s] at bit offset/length %u/%u "
233 acpi_ut_get_node_name(result_desc), 233 "exceeds size of target Buffer (%u bits)",
234 bit_offset + bit_count, 234 acpi_ut_get_node_name(result_desc), bit_offset,
235 acpi_ut_get_node_name(buffer_desc->buffer.node), 235 bit_count, 8 * (u32)buffer_desc->buffer.length));
236 8 * (u32) buffer_desc->buffer.length));
237 status = AE_AML_BUFFER_LIMIT; 236 status = AE_AML_BUFFER_LIMIT;
238 goto cleanup; 237 goto cleanup;
239 } 238 }
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index 406edec20de7..0dabd9b95684 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -633,15 +633,6 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
633 633
634 if ((op_info->flags & AML_HAS_RETVAL) || 634 if ((op_info->flags & AML_HAS_RETVAL) ||
635 (arg->common.flags & ACPI_PARSEOP_IN_STACK)) { 635 (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
636 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
637 "Argument previously created, already stacked\n"));
638
639 acpi_db_display_argument_object(walk_state->
640 operands[walk_state->
641 num_operands -
642 1],
643 walk_state);
644
645 /* 636 /*
646 * Use value that was already previously returned 637 * Use value that was already previously returned
647 * by the evaluation of this argument 638 * by the evaluation of this argument
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index a2ff8ad70d58..20d7744b06ae 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -576,8 +576,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
576 case AML_TYPE_CREATE_OBJECT: 576 case AML_TYPE_CREATE_OBJECT:
577 577
578 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 578 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
579 "Executing CreateObject (Buffer/Package) Op=%p\n", 579 "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
580 op)); 580 op, op->named.data));
581 581
582 switch (op->common.parent->common.aml_opcode) { 582 switch (op->common.parent->common.aml_opcode) {
583 case AML_NAME_OP: 583 case AML_NAME_OP:
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index cafb3ab567ab..eaa859a89702 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -397,7 +397,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
397 /* Initialize the op */ 397 /* Initialize the op */
398 398
399#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)) 399#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
400 op->named.path = ACPI_CAST_PTR(u8, path); 400 op->named.path = path;
401#endif 401#endif
402 402
403 if (node) { 403 if (node) {
@@ -434,6 +434,10 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
434 acpi_object_type object_type; 434 acpi_object_type object_type;
435 acpi_status status = AE_OK; 435 acpi_status status = AE_OK;
436 436
437#ifdef ACPI_ASL_COMPILER
438 u8 param_count;
439#endif
440
437 ACPI_FUNCTION_TRACE(ds_load1_end_op); 441 ACPI_FUNCTION_TRACE(ds_load1_end_op);
438 442
439 op = walk_state->op; 443 op = walk_state->op;
@@ -514,6 +518,38 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
514 } 518 }
515 } 519 }
516 } 520 }
521#ifdef ACPI_ASL_COMPILER
522 /*
523 * For external opcode, get the object type from the argument and
524 * get the parameter count from the argument's next.
525 */
526 if (acpi_gbl_disasm_flag &&
527 op->common.node && op->common.aml_opcode == AML_EXTERNAL_OP) {
528 /*
529 * Note, if this external is not a method
530 * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0
531 * Therefore, param_count will be 0.
532 */
533 param_count =
534 (u8)op->common.value.arg->common.next->common.value.integer;
535 object_type = (u8)op->common.value.arg->common.value.integer;
536 op->common.node->flags |= ANOBJ_IS_EXTERNAL;
537 op->common.node->type = (u8)object_type;
538
539 acpi_dm_create_subobject_for_external((u8)object_type,
540 &op->common.node,
541 param_count);
542
543 /*
544 * Add the external to the external list because we may be
545 * emitting code based off of the items within the external list.
546 */
547 acpi_dm_add_op_to_external_list(op, op->named.path,
548 (u8)object_type, param_count,
549 ACPI_EXT_ORIGIN_FROM_OPCODE |
550 ACPI_EXT_RESOLVED_REFERENCE);
551 }
552#endif
517 553
518 /* 554 /*
519 * If we are executing a method, do not create any namespace objects 555 * If we are executing a method, do not create any namespace objects
@@ -563,7 +599,9 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
563 599
564 /* Pop the scope stack (only if loading a table) */ 600 /* Pop the scope stack (only if loading a table) */
565 601
566 if (!walk_state->method_node && acpi_ns_opens_scope(object_type)) { 602 if (!walk_state->method_node &&
603 op->common.aml_opcode != AML_EXTERNAL_OP &&
604 acpi_ns_opens_scope(object_type)) {
567 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 605 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
568 "(%s): Popping scope for Op %p\n", 606 "(%s): Popping scope for Op %p\n",
569 acpi_ut_get_type_name(object_type), op)); 607 acpi_ut_get_type_name(object_type), op));
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index 8d510c7e20c8..aad83ef5a4ec 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -310,6 +310,22 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
310 flags |= ACPI_NS_TEMPORARY; 310 flags |= ACPI_NS_TEMPORARY;
311 } 311 }
312 } 312 }
313#ifdef ACPI_ASL_COMPILER
314
315 /*
316 * Do not open a scope for AML_EXTERNAL_OP
317 * acpi_ns_lookup can open a new scope based on the object type
318 * of this op. AML_EXTERNAL_OP is a declaration rather than a
319 * definition. In the case that this external is a method object,
320 * acpi_ns_lookup will open a new scope. However, an AML_EXTERNAL_OP
321 * associated with the ACPI_TYPE_METHOD is a declaration, rather than
322 * a definition. Flags is set to avoid opening a scope for any
323 * AML_EXTERNAL_OP.
324 */
325 if (walk_state->opcode == AML_EXTERNAL_OP) {
326 flags |= ACPI_NS_DONT_OPEN_SCOPE;
327 }
328#endif
313 329
314 /* Add new entry or lookup existing entry */ 330 /* Add new entry or lookup existing entry */
315 331
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 82e8971f23a4..c773ac4892cb 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -180,6 +180,12 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
180 180
181 ACPI_FUNCTION_TRACE(acpi_enable_event); 181 ACPI_FUNCTION_TRACE(acpi_enable_event);
182 182
183 /* If Hardware Reduced flag is set, there are no fixed events */
184
185 if (acpi_gbl_reduced_hardware) {
186 return_ACPI_STATUS(AE_OK);
187 }
188
183 /* Decode the Fixed Event */ 189 /* Decode the Fixed Event */
184 190
185 if (event > ACPI_EVENT_MAX) { 191 if (event > ACPI_EVENT_MAX) {
@@ -237,6 +243,12 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
237 243
238 ACPI_FUNCTION_TRACE(acpi_disable_event); 244 ACPI_FUNCTION_TRACE(acpi_disable_event);
239 245
246 /* If Hardware Reduced flag is set, there are no fixed events */
247
248 if (acpi_gbl_reduced_hardware) {
249 return_ACPI_STATUS(AE_OK);
250 }
251
240 /* Decode the Fixed Event */ 252 /* Decode the Fixed Event */
241 253
242 if (event > ACPI_EVENT_MAX) { 254 if (event > ACPI_EVENT_MAX) {
@@ -290,6 +302,12 @@ acpi_status acpi_clear_event(u32 event)
290 302
291 ACPI_FUNCTION_TRACE(acpi_clear_event); 303 ACPI_FUNCTION_TRACE(acpi_clear_event);
292 304
305 /* If Hardware Reduced flag is set, there are no fixed events */
306
307 if (acpi_gbl_reduced_hardware) {
308 return_ACPI_STATUS(AE_OK);
309 }
310
293 /* Decode the Fixed Event */ 311 /* Decode the Fixed Event */
294 312
295 if (event > ACPI_EVENT_MAX) { 313 if (event > ACPI_EVENT_MAX) {
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index ec614f5a3bcb..a8191d2ca5e3 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -117,10 +117,10 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
117 timer = ((u32)acpi_os_get_timer() / 10); 117 timer = ((u32)acpi_os_get_timer() / 10);
118 timer &= 0x03FFFFFF; 118 timer &= 0x03FFFFFF;
119 119
120 acpi_os_printf("[ACPI Debug T=0x%8.8X] %*s", timer, 120 acpi_os_printf("ACPI Debug: T=0x%8.8X %*s", timer,
121 level, " "); 121 level, " ");
122 } else { 122 } else {
123 acpi_os_printf("[ACPI Debug] %*s", level, " "); 123 acpi_os_printf("ACPI Debug: %*s", level, " ");
124 } 124 }
125 } 125 }
126 126
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 970dc6c53994..44092f744477 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -645,10 +645,12 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
645 /* obj_desc is a valid object */ 645 /* obj_desc is a valid object */
646 646
647 if (depth > 0) { 647 if (depth > 0) {
648 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ", 648 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
649 depth, " ", depth, obj_desc)); 649 depth, " ", depth, obj_desc,
650 obj_desc->common.reference_count));
650 } else { 651 } else {
651 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc)); 652 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Refs=%u ",
653 obj_desc, obj_desc->common.reference_count));
652 } 654 }
653 655
654 /* Decode object type */ 656 /* Decode object type */
@@ -690,8 +692,11 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
690 692
691 case ACPI_REFCLASS_NAME: 693 case ACPI_REFCLASS_NAME:
692 694
693 acpi_os_printf("- [%4.4s]\n", 695 acpi_ut_repair_name(obj_desc->reference.node->name.
694 obj_desc->reference.node->name.ascii); 696 ascii);
697 acpi_os_printf("- [%4.4s] (Node %p)\n",
698 obj_desc->reference.node->name.ascii,
699 obj_desc->reference.node);
695 break; 700 break;
696 701
697 case ACPI_REFCLASS_ARG: 702 case ACPI_REFCLASS_ARG:
@@ -999,9 +1004,15 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
999 status = acpi_ns_handle_to_pathname(obj_desc->reference.node, 1004 status = acpi_ns_handle_to_pathname(obj_desc->reference.node,
1000 &ret_buf, TRUE); 1005 &ret_buf, TRUE);
1001 if (ACPI_FAILURE(status)) { 1006 if (ACPI_FAILURE(status)) {
1002 acpi_os_printf(" Could not convert name to pathname\n"); 1007 acpi_os_printf
1008 (" Could not convert name to pathname: %s\n",
1009 acpi_format_exception(status));
1003 } else { 1010 } else {
1004 acpi_os_printf("%s\n", (char *)ret_buf.pointer); 1011 acpi_os_printf("%s: %s\n",
1012 acpi_ut_get_type_name(obj_desc->
1013 reference.node->
1014 type),
1015 (char *)ret_buf.pointer);
1005 ACPI_FREE(ret_buf.pointer); 1016 ACPI_FREE(ret_buf.pointer);
1006 } 1017 }
1007 } else if (obj_desc->reference.object) { 1018 } else if (obj_desc->reference.object) {
@@ -1111,9 +1122,8 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
1111 1122
1112 case ACPI_TYPE_LOCAL_REFERENCE: 1123 case ACPI_TYPE_LOCAL_REFERENCE:
1113 1124
1114 acpi_os_printf("[Object Reference] Type [%s] %2.2X", 1125 acpi_os_printf("[Object Reference] Class [%s]",
1115 acpi_ut_get_reference_name(obj_desc), 1126 acpi_ut_get_reference_name(obj_desc));
1116 obj_desc->reference.class);
1117 acpi_ex_dump_reference_obj(obj_desc); 1127 acpi_ex_dump_reference_obj(obj_desc);
1118 break; 1128 break;
1119 1129
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index e327349675cd..f787651348c1 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -921,13 +921,26 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
921 * This is a deref_of (object_reference) 921 * This is a deref_of (object_reference)
922 * Get the actual object from the Node (This is the dereference). 922 * Get the actual object from the Node (This is the dereference).
923 * This case may only happen when a local_x or arg_x is 923 * This case may only happen when a local_x or arg_x is
924 * dereferenced above. 924 * dereferenced above, or for references to device and
925 * thermal objects.
925 */ 926 */
926 return_desc = acpi_ns_get_attached_object((struct 927 switch (((struct acpi_namespace_node *)operand[0])->
927 acpi_namespace_node 928 type) {
928 *) 929 case ACPI_TYPE_DEVICE:
929 operand[0]); 930 case ACPI_TYPE_THERMAL:
930 acpi_ut_add_reference(return_desc); 931
932 /* These types have no node subobject, return the NS node */
933
934 return_desc = operand[0];
935 break;
936
937 default:
938 /* For most types, get the object attached to the node */
939
940 return_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)operand[0]);
941 acpi_ut_add_reference(return_desc);
942 break;
943 }
931 } else { 944 } else {
932 /* 945 /*
933 * This must be a reference object produced by either the 946 * This must be a reference object produced by either the
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index aa8c6fd74cc3..5e1854ea85f6 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -368,11 +368,24 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
368 *)obj_desc); 368 *)obj_desc);
369 } 369 }
370 370
371 if (!obj_desc) { 371 switch (type) {
372 ACPI_ERROR((AE_INFO, 372 case ACPI_TYPE_DEVICE:
373 "[%4.4s] Node is unresolved or uninitialized", 373 case ACPI_TYPE_THERMAL:
374 acpi_ut_get_node_name(node))); 374
375 return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE); 375 /* These types have no attached subobject */
376 break;
377
378 default:
379
380 /* All other types require a subobject */
381
382 if (!obj_desc) {
383 ACPI_ERROR((AE_INFO,
384 "[%4.4s] Node is unresolved or uninitialized",
385 acpi_ut_get_node_name(node)));
386 return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE);
387 }
388 break;
376 } 389 }
377 break; 390 break;
378 391
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 5733b1167e46..7ef13934968f 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -70,11 +70,15 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
70/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ 70/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
71 71
72static struct acpi_sleep_functions acpi_sleep_dispatch[] = { 72static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
73 {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), 73 {ACPI_STRUCT_INIT(legacy_function,
74 acpi_hw_extended_sleep}, 74 ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)),
75 {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), 75 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_sleep) },
76 acpi_hw_extended_wake_prep}, 76 {ACPI_STRUCT_INIT(legacy_function,
77 {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake} 77 ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)),
78 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake_prep) },
79 {ACPI_STRUCT_INIT(legacy_function,
80 ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)),
81 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake) }
78}; 82};
79 83
80/* 84/*
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index fb265b5737de..e5f4fa496572 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -47,6 +47,10 @@
47#include "acnamesp.h" 47#include "acnamesp.h"
48#include "acdispat.h" 48#include "acdispat.h"
49 49
50#ifdef ACPI_ASL_COMPILER
51#include "acdisasm.h"
52#endif
53
50#define _COMPONENT ACPI_NAMESPACE 54#define _COMPONENT ACPI_NAMESPACE
51ACPI_MODULE_NAME("nsaccess") 55ACPI_MODULE_NAME("nsaccess")
52 56
@@ -580,6 +584,29 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
580 (char *)&current_node->name, 584 (char *)&current_node->name,
581 current_node)); 585 current_node));
582 } 586 }
587#ifdef ACPI_ASL_COMPILER
588 /*
589 * If this ACPI name already exists within the namespace as an
590 * external declaration, then mark the external as a conflicting
591 * declaration and proceed to process the current node as if it did
592 * not exist in the namespace. If this node is not processed as
593 * normal, then it could cause improper namespace resolution
594 * by failing to open a new scope.
595 */
596 if (acpi_gbl_disasm_flag &&
597 (status == AE_ALREADY_EXISTS) &&
598 ((this_node->flags & ANOBJ_IS_EXTERNAL) ||
599 (walk_state
600 && walk_state->opcode == AML_EXTERNAL_OP))) {
601 this_node->flags &= ~ANOBJ_IS_EXTERNAL;
602 this_node->type = (u8)this_search_type;
603 if (walk_state->opcode != AML_EXTERNAL_OP) {
604 acpi_dm_mark_external_conflict
605 (this_node);
606 }
607 break;
608 }
609#endif
583 610
584 *return_node = this_node; 611 *return_node = this_node;
585 return_ACPI_STATUS(status); 612 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index 3db9ca25a620..aa16aeaa8937 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -190,9 +190,6 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
190 190
191 (void)acpi_ns_build_normalized_path(node, buffer->pointer, 191 (void)acpi_ns_build_normalized_path(node, buffer->pointer,
192 required_size, no_trailing); 192 required_size, no_trailing);
193 if (ACPI_FAILURE(status)) {
194 return_ACPI_STATUS(status);
195 }
196 193
197 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n", 194 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
198 (char *)buffer->pointer, (u32) required_size)); 195 (char *)buffer->pointer, (u32) required_size));
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 2fe87d0dd9d5..b43fe5fce64b 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -89,7 +89,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node,
89 acpi_os_printf("%s ", message); 89 acpi_os_printf("%s ", message);
90 } 90 }
91 91
92 acpi_os_printf("[%s] (Node %p)", (char *)buffer.pointer, node); 92 acpi_os_printf("%s", (char *)buffer.pointer);
93 ACPI_FREE(buffer.pointer); 93 ACPI_FREE(buffer.pointer);
94 } 94 }
95} 95}
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index c944ff5c9c3d..538c61677c10 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -85,6 +85,8 @@ acpi_evaluate_object_typed(acpi_handle handle,
85{ 85{
86 acpi_status status; 86 acpi_status status;
87 u8 free_buffer_on_error = FALSE; 87 u8 free_buffer_on_error = FALSE;
88 acpi_handle target_handle;
89 char *full_pathname;
88 90
89 ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed); 91 ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed);
90 92
@@ -98,38 +100,51 @@ acpi_evaluate_object_typed(acpi_handle handle,
98 free_buffer_on_error = TRUE; 100 free_buffer_on_error = TRUE;
99 } 101 }
100 102
103 status = acpi_get_handle(handle, pathname, &target_handle);
104 if (ACPI_FAILURE(status)) {
105 return_ACPI_STATUS(status);
106 }
107
108 full_pathname = acpi_ns_get_external_pathname(target_handle);
109 if (!full_pathname) {
110 return_ACPI_STATUS(AE_NO_MEMORY);
111 }
112
101 /* Evaluate the object */ 113 /* Evaluate the object */
102 114
103 status = acpi_evaluate_object(handle, pathname, 115 status = acpi_evaluate_object(target_handle, NULL, external_params,
104 external_params, return_buffer); 116 return_buffer);
105 if (ACPI_FAILURE(status)) { 117 if (ACPI_FAILURE(status)) {
106 return_ACPI_STATUS(status); 118 goto exit;
107 } 119 }
108 120
109 /* Type ANY means "don't care" */ 121 /* Type ANY means "don't care about return value type" */
110 122
111 if (return_type == ACPI_TYPE_ANY) { 123 if (return_type == ACPI_TYPE_ANY) {
112 return_ACPI_STATUS(AE_OK); 124 goto exit;
113 } 125 }
114 126
115 if (return_buffer->length == 0) { 127 if (return_buffer->length == 0) {
116 128
117 /* Error because caller specifically asked for a return value */ 129 /* Error because caller specifically asked for a return value */
118 130
119 ACPI_ERROR((AE_INFO, "No return value")); 131 ACPI_ERROR((AE_INFO, "%s did not return any object",
120 return_ACPI_STATUS(AE_NULL_OBJECT); 132 full_pathname));
133 status = AE_NULL_OBJECT;
134 goto exit;
121 } 135 }
122 136
123 /* Examine the object type returned from evaluate_object */ 137 /* Examine the object type returned from evaluate_object */
124 138
125 if (((union acpi_object *)return_buffer->pointer)->type == return_type) { 139 if (((union acpi_object *)return_buffer->pointer)->type == return_type) {
126 return_ACPI_STATUS(AE_OK); 140 goto exit;
127 } 141 }
128 142
129 /* Return object type does not match requested type */ 143 /* Return object type does not match requested type */
130 144
131 ACPI_ERROR((AE_INFO, 145 ACPI_ERROR((AE_INFO,
132 "Incorrect return type [%s] requested [%s]", 146 "Incorrect return type from %s - received [%s], requested [%s]",
147 full_pathname,
133 acpi_ut_get_type_name(((union acpi_object *)return_buffer-> 148 acpi_ut_get_type_name(((union acpi_object *)return_buffer->
134 pointer)->type), 149 pointer)->type),
135 acpi_ut_get_type_name(return_type))); 150 acpi_ut_get_type_name(return_type)));
@@ -147,7 +162,11 @@ acpi_evaluate_object_typed(acpi_handle handle,
147 } 162 }
148 163
149 return_buffer->length = 0; 164 return_buffer->length = 0;
150 return_ACPI_STATUS(AE_TYPE); 165 status = AE_TYPE;
166
167exit:
168 ACPI_FREE(full_pathname);
169 return_ACPI_STATUS(status);
151} 170}
152 171
153ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed) 172ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed)
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index 5bcb61831706..ef6384e374fc 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -122,6 +122,9 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
122 (u32)(aml_offset + 122 (u32)(aml_offset +
123 sizeof(struct acpi_table_header))); 123 sizeof(struct acpi_table_header)));
124 124
125 ACPI_ERROR((AE_INFO,
126 "Aborting disassembly, AML byte code is corrupt"));
127
125 /* Dump the context surrounding the invalid opcode */ 128 /* Dump the context surrounding the invalid opcode */
126 129
127 acpi_ut_dump_buffer(((u8 *)walk_state->parser_state. 130 acpi_ut_dump_buffer(((u8 *)walk_state->parser_state.
@@ -130,6 +133,14 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
130 sizeof(struct acpi_table_header) - 133 sizeof(struct acpi_table_header) -
131 16)); 134 16));
132 acpi_os_printf(" */\n"); 135 acpi_os_printf(" */\n");
136
137 /*
138 * Just abort the disassembly, cannot continue because the
139 * parser is essentially lost. The disassembler can then
140 * randomly fail because an ill-constructed parse tree
141 * can result.
142 */
143 return_ACPI_STATUS(AE_AML_BAD_OPCODE);
133#endif 144#endif
134 } 145 }
135 146
@@ -331,6 +342,9 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
331 if (status == AE_CTRL_PARSE_CONTINUE) { 342 if (status == AE_CTRL_PARSE_CONTINUE) {
332 return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE); 343 return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
333 } 344 }
345 if (ACPI_FAILURE(status)) {
346 return_ACPI_STATUS(status);
347 }
334 348
335 /* Create Op structure and append to parent's argument list */ 349 /* Create Op structure and append to parent's argument list */
336 350
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index c343a0d5a3d2..a402ad772a1e 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -650,9 +650,11 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
650 650
651/* ACPI 6.0 opcodes */ 651/* ACPI 6.0 opcodes */
652 652
653 /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, 653/* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP,
654 ACPI_TYPE_ANY, AML_CLASS_EXECUTE, /* ? */ 654 ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT,
655 AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), 655 AML_TYPE_NAMED_SIMPLE,
656 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
657 AML_NSNODE | AML_NAMED),
656/* 82 */ ACPI_OP("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, 658/* 82 */ ACPI_OP("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP,
657 ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, 659 ACPI_TYPE_STRING, AML_CLASS_ARGUMENT,
658 AML_TYPE_LITERAL, AML_CONSTANT) 660 AML_TYPE_LITERAL, AML_CONSTANT)
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 8116a670de39..ac88319dc111 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -56,6 +56,7 @@
56#include "acdispat.h" 56#include "acdispat.h"
57#include "amlcode.h" 57#include "amlcode.h"
58#include "acinterp.h" 58#include "acinterp.h"
59#include "acnamesp.h"
59 60
60#define _COMPONENT ACPI_PARSER 61#define _COMPONENT ACPI_PARSER
61ACPI_MODULE_NAME("psparse") 62ACPI_MODULE_NAME("psparse")
@@ -538,9 +539,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
538 /* Either the method parse or actual execution failed */ 539 /* Either the method parse or actual execution failed */
539 540
540 acpi_ex_exit_interpreter(); 541 acpi_ex_exit_interpreter();
541 ACPI_ERROR_METHOD("Method parse/execution failed", 542 if (status == AE_ABORT_METHOD) {
542 walk_state->method_node, NULL, 543 acpi_ns_print_node_pathname(walk_state->
543 status); 544 method_node,
545 "Method aborted:");
546 acpi_os_printf("\n");
547 } else {
548 ACPI_ERROR_METHOD
549 ("Method parse/execution failed",
550 walk_state->method_node, NULL, status);
551 }
544 acpi_ex_enter_interpreter(); 552 acpi_ex_enter_interpreter();
545 553
546 /* Check for possible multi-thread reentrancy problem */ 554 /* Check for possible multi-thread reentrancy problem */
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 74e47f829ccb..659fb718504a 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -340,6 +340,22 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
340 340
341 break; 341 break;
342 342
343 case ACPI_RESOURCE_TYPE_PIN_FUNCTION:
344
345 total_size = (acpi_rs_length)(total_size +
346 (resource->data.
347 pin_function.
348 pin_table_length * 2) +
349 resource->data.
350 pin_function.
351 resource_source.
352 string_length +
353 resource->data.
354 pin_function.
355 vendor_length);
356
357 break;
358
343 case ACPI_RESOURCE_TYPE_SERIAL_BUS: 359 case ACPI_RESOURCE_TYPE_SERIAL_BUS:
344 360
345 total_size = 361 total_size =
@@ -359,6 +375,67 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
359 375
360 break; 376 break;
361 377
378 case ACPI_RESOURCE_TYPE_PIN_CONFIG:
379
380 total_size = (acpi_rs_length)(total_size +
381 (resource->data.
382 pin_config.
383 pin_table_length * 2) +
384 resource->data.pin_config.
385 resource_source.
386 string_length +
387 resource->data.pin_config.
388 vendor_length);
389
390 break;
391
392 case ACPI_RESOURCE_TYPE_PIN_GROUP:
393
394 total_size = (acpi_rs_length)(total_size +
395 (resource->data.pin_group.
396 pin_table_length * 2) +
397 resource->data.pin_group.
398 resource_label.
399 string_length +
400 resource->data.pin_group.
401 vendor_length);
402
403 break;
404
405 case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION:
406
407 total_size = (acpi_rs_length)(total_size +
408 resource->data.
409 pin_group_function.
410 resource_source.
411 string_length +
412 resource->data.
413 pin_group_function.
414 resource_source_label.
415 string_length +
416 resource->data.
417 pin_group_function.
418 vendor_length);
419
420 break;
421
422 case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG:
423
424 total_size = (acpi_rs_length)(total_size +
425 resource->data.
426 pin_group_config.
427 resource_source.
428 string_length +
429 resource->data.
430 pin_group_config.
431 resource_source_label.
432 string_length +
433 resource->data.
434 pin_group_config.
435 vendor_length);
436
437 break;
438
362 default: 439 default:
363 440
364 break; 441 break;
@@ -537,6 +614,24 @@ acpi_rs_get_list_length(u8 *aml_buffer,
537 } 614 }
538 break; 615 break;
539 616
617 case ACPI_RESOURCE_NAME_PIN_FUNCTION:
618
619 /* Vendor data is optional */
620
621 if (aml_resource->pin_function.vendor_length) {
622 extra_struct_bytes +=
623 aml_resource->pin_function.vendor_offset -
624 aml_resource->pin_function.
625 pin_table_offset +
626 aml_resource->pin_function.vendor_length;
627 } else {
628 extra_struct_bytes +=
629 aml_resource->large_header.resource_length +
630 sizeof(struct aml_resource_large_header) -
631 aml_resource->pin_function.pin_table_offset;
632 }
633 break;
634
540 case ACPI_RESOURCE_NAME_SERIAL_BUS: 635 case ACPI_RESOURCE_NAME_SERIAL_BUS:
541 636
542 minimum_aml_resource_length = 637 minimum_aml_resource_length =
@@ -547,6 +642,50 @@ acpi_rs_get_list_length(u8 *aml_buffer,
547 minimum_aml_resource_length; 642 minimum_aml_resource_length;
548 break; 643 break;
549 644
645 case ACPI_RESOURCE_NAME_PIN_CONFIG:
646
647 /* Vendor data is optional */
648
649 if (aml_resource->pin_config.vendor_length) {
650 extra_struct_bytes +=
651 aml_resource->pin_config.vendor_offset -
652 aml_resource->pin_config.pin_table_offset +
653 aml_resource->pin_config.vendor_length;
654 } else {
655 extra_struct_bytes +=
656 aml_resource->large_header.resource_length +
657 sizeof(struct aml_resource_large_header) -
658 aml_resource->pin_config.pin_table_offset;
659 }
660 break;
661
662 case ACPI_RESOURCE_NAME_PIN_GROUP:
663
664 extra_struct_bytes +=
665 aml_resource->pin_group.vendor_offset -
666 aml_resource->pin_group.pin_table_offset +
667 aml_resource->pin_group.vendor_length;
668
669 break;
670
671 case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION:
672
673 extra_struct_bytes +=
674 aml_resource->pin_group_function.vendor_offset -
675 aml_resource->pin_group_function.res_source_offset +
676 aml_resource->pin_group_function.vendor_length;
677
678 break;
679
680 case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG:
681
682 extra_struct_bytes +=
683 aml_resource->pin_group_config.vendor_offset -
684 aml_resource->pin_group_config.res_source_offset +
685 aml_resource->pin_group_config.vendor_length;
686
687 break;
688
550 default: 689 default:
551 690
552 break; 691 break;
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index f4cdf8d832dc..55fd1880efbe 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -75,6 +75,10 @@ static void acpi_rs_dump_short_byte_list(u8 length, u8 *data);
75static void 75static void
76acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); 76acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
77 77
78static void
79acpi_rs_dump_resource_label(char *title,
80 struct acpi_resource_label *resource_label);
81
78static void acpi_rs_dump_address_common(union acpi_resource_data *resource); 82static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
79 83
80static void 84static void
@@ -371,6 +375,26 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
371 target)); 375 target));
372 break; 376 break;
373 377
378 case ACPI_RSD_LABEL:
379 /*
380 * resource_label
381 */
382 acpi_rs_dump_resource_label("Resource Label",
383 ACPI_CAST_PTR(struct
384 acpi_resource_label,
385 target));
386 break;
387
388 case ACPI_RSD_SOURCE_LABEL:
389 /*
390 * resource_source_label
391 */
392 acpi_rs_dump_resource_label("Resource Source Label",
393 ACPI_CAST_PTR(struct
394 acpi_resource_label,
395 target));
396 break;
397
374 default: 398 default:
375 399
376 acpi_os_printf("**** Invalid table opcode [%X] ****\n", 400 acpi_os_printf("**** Invalid table opcode [%X] ****\n",
@@ -414,6 +438,30 @@ acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
414 438
415/******************************************************************************* 439/*******************************************************************************
416 * 440 *
441 * FUNCTION: acpi_rs_dump_resource_label
442 *
443 * PARAMETERS: title - Title of the dumped resource field
444 * resource_label - Pointer to a Resource Label struct
445 *
446 * RETURN: None
447 *
448 * DESCRIPTION: Common routine for dumping the resource_label
449 *
450 ******************************************************************************/
451
452static void
453acpi_rs_dump_resource_label(char *title,
454 struct acpi_resource_label *resource_label)
455{
456 ACPI_FUNCTION_ENTRY();
457
458 acpi_rs_out_string(title,
459 resource_label->string_ptr ?
460 resource_label->string_ptr : "[Not Specified]");
461}
462
463/*******************************************************************************
464 *
417 * FUNCTION: acpi_rs_dump_address_common 465 * FUNCTION: acpi_rs_dump_address_common
418 * 466 *
419 * PARAMETERS: resource - Pointer to an internal resource descriptor 467 * PARAMETERS: resource - Pointer to an internal resource descriptor
diff --git a/drivers/acpi/acpica/rsdumpinfo.c b/drivers/acpi/acpica/rsdumpinfo.c
index 8aacd28293fa..da150e17795b 100644
--- a/drivers/acpi/acpica/rsdumpinfo.c
+++ b/drivers/acpi/acpica/rsdumpinfo.c
@@ -314,6 +314,120 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
314 NULL}, 314 NULL},
315}; 315};
316 316
317struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = {
318 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_function),
319 "PinFunction", NULL},
320 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.revision_id),
321 "RevisionId", NULL},
322 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig",
323 acpi_gbl_ppc_decode},
324 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.sharable), "Sharing",
325 acpi_gbl_shr_decode},
326 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number),
327 "FunctionNumber", NULL},
328 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_function.resource_source),
329 "ResourceSource", NULL},
330 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.pin_table_length),
331 "PinTableLength", NULL},
332 {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_function.pin_table), "PinTable",
333 NULL},
334 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.vendor_length),
335 "VendorLength", NULL},
336 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_function.vendor_data),
337 "VendorData", NULL},
338};
339
340struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = {
341 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_config),
342 "PinConfig", NULL},
343 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.revision_id), "RevisionId",
344 NULL},
345 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer),
346 "ProducerConsumer", acpi_gbl_consume_decode},
347 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.sharable), "Sharing",
348 acpi_gbl_shr_decode},
349 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type),
350 "PinConfigType", NULL},
351 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_config.pin_config_value),
352 "PinConfigValue", NULL},
353 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_config.resource_source),
354 "ResourceSource", NULL},
355 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.pin_table_length),
356 "PinTableLength", NULL},
357 {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_config.pin_table), "PinTable",
358 NULL},
359 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.vendor_length),
360 "VendorLength", NULL},
361 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_config.vendor_data),
362 "VendorData", NULL},
363};
364
365struct acpi_rsdump_info acpi_rs_dump_pin_group[8] = {
366 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group),
367 "PinGroup", NULL},
368 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group.revision_id), "RevisionId",
369 NULL},
370 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group.producer_consumer),
371 "ProducerConsumer", acpi_gbl_consume_decode},
372 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.pin_table_length),
373 "PinTableLength", NULL},
374 {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_group.pin_table), "PinTable",
375 NULL},
376 {ACPI_RSD_LABEL, ACPI_RSD_OFFSET(pin_group.resource_label),
377 "ResourceLabel", NULL},
378 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.vendor_length),
379 "VendorLength", NULL},
380 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group.vendor_data),
381 "VendorData", NULL},
382};
383
384struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = {
385 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_function),
386 "PinGroupFunction", NULL},
387 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_function.revision_id),
388 "RevisionId", NULL},
389 {ACPI_RSD_1BITFLAG,
390 ACPI_RSD_OFFSET(pin_group_function.producer_consumer),
391 "ProducerConsumer", acpi_gbl_consume_decode},
392 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.sharable),
393 "Sharing", acpi_gbl_shr_decode},
394 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number),
395 "FunctionNumber", NULL},
396 {ACPI_RSD_SOURCE_LABEL,
397 ACPI_RSD_OFFSET(pin_group_function.resource_source_label),
398 "ResourceSourceLabel", NULL},
399 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_function.resource_source),
400 "ResourceSource", NULL},
401 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.vendor_length),
402 "VendorLength", NULL},
403 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_function.vendor_data),
404 "VendorData", NULL},
405};
406
407struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = {
408 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_config),
409 "PinGroupConfig", NULL},
410 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.revision_id),
411 "RevisionId", NULL},
412 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer),
413 "ProducerConsumer", acpi_gbl_consume_decode},
414 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.sharable),
415 "Sharing", acpi_gbl_shr_decode},
416 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type),
417 "PinConfigType", NULL},
418 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_group_config.pin_config_value),
419 "PinConfigValue", NULL},
420 {ACPI_RSD_SOURCE_LABEL,
421 ACPI_RSD_OFFSET(pin_group_config.resource_source_label),
422 "ResourceSourceLabel", NULL},
423 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_config.resource_source),
424 "ResourceSource", NULL},
425 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_config.vendor_length),
426 "VendorLength", NULL},
427 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_config.vendor_data),
428 "VendorData", NULL},
429};
430
317struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = { 431struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = {
318 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma), 432 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma),
319 "FixedDma", NULL}, 433 "FixedDma", NULL},
diff --git a/drivers/acpi/acpica/rsinfo.c b/drivers/acpi/acpica/rsinfo.c
index 475da9d6aed5..b0e50518d766 100644
--- a/drivers/acpi/acpica/rsinfo.c
+++ b/drivers/acpi/acpica/rsinfo.c
@@ -80,6 +80,11 @@ struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[] = {
80 acpi_rs_convert_gpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ 80 acpi_rs_convert_gpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
81 acpi_rs_convert_fixed_dma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ 81 acpi_rs_convert_fixed_dma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
82 NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ 82 NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
83 acpi_rs_convert_pin_function, /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */
84 acpi_rs_convert_pin_config, /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */
85 acpi_rs_convert_pin_group, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */
86 acpi_rs_convert_pin_group_function, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
87 acpi_rs_convert_pin_group_config, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
83}; 88};
84 89
85/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ 90/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@@ -119,8 +124,12 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
119 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ 124 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
120 acpi_rs_convert_ext_address64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 125 acpi_rs_convert_ext_address64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
121 acpi_rs_convert_gpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ 126 acpi_rs_convert_gpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
122 NULL, /* 0x0D, Reserved */ 127 acpi_rs_convert_pin_function, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
123 NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ 128 NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
129 acpi_rs_convert_pin_config, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
130 acpi_rs_convert_pin_group, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
131 acpi_rs_convert_pin_group_function, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
132 acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
124}; 133};
125 134
126/* Subtype table for serial_bus -- I2C, SPI, and UART */ 135/* Subtype table for serial_bus -- I2C, SPI, and UART */
@@ -157,6 +166,11 @@ struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[] = {
157 acpi_rs_dump_gpio, /* ACPI_RESOURCE_TYPE_GPIO */ 166 acpi_rs_dump_gpio, /* ACPI_RESOURCE_TYPE_GPIO */
158 acpi_rs_dump_fixed_dma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 167 acpi_rs_dump_fixed_dma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */
159 NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 168 NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
169 acpi_rs_dump_pin_function, /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
170 acpi_rs_dump_pin_config, /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
171 acpi_rs_dump_pin_group, /* ACPI_RESOURCE_TYPE_PIN_GROUP */
172 acpi_rs_dump_pin_group_function, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
173 acpi_rs_dump_pin_group_config, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
160}; 174};
161 175
162struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = { 176struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = {
@@ -193,6 +207,11 @@ const u8 acpi_gbl_aml_resource_sizes[] = {
193 sizeof(struct aml_resource_gpio), /* ACPI_RESOURCE_TYPE_GPIO */ 207 sizeof(struct aml_resource_gpio), /* ACPI_RESOURCE_TYPE_GPIO */
194 sizeof(struct aml_resource_fixed_dma), /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 208 sizeof(struct aml_resource_fixed_dma), /* ACPI_RESOURCE_TYPE_FIXED_DMA */
195 sizeof(struct aml_resource_common_serialbus), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 209 sizeof(struct aml_resource_common_serialbus), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
210 sizeof(struct aml_resource_pin_function), /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
211 sizeof(struct aml_resource_pin_config), /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
212 sizeof(struct aml_resource_pin_group), /* ACPI_RESOURCE_TYPE_PIN_GROUP */
213 sizeof(struct aml_resource_pin_group_function), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
214 sizeof(struct aml_resource_pin_group_config), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
196}; 215};
197 216
198const u8 acpi_gbl_resource_struct_sizes[] = { 217const u8 acpi_gbl_resource_struct_sizes[] = {
@@ -230,7 +249,12 @@ const u8 acpi_gbl_resource_struct_sizes[] = {
230 ACPI_RS_SIZE(struct acpi_resource_address64), 249 ACPI_RS_SIZE(struct acpi_resource_address64),
231 ACPI_RS_SIZE(struct acpi_resource_extended_address64), 250 ACPI_RS_SIZE(struct acpi_resource_extended_address64),
232 ACPI_RS_SIZE(struct acpi_resource_gpio), 251 ACPI_RS_SIZE(struct acpi_resource_gpio),
233 ACPI_RS_SIZE(struct acpi_resource_common_serialbus) 252 ACPI_RS_SIZE(struct acpi_resource_pin_function),
253 ACPI_RS_SIZE(struct acpi_resource_common_serialbus),
254 ACPI_RS_SIZE(struct acpi_resource_pin_config),
255 ACPI_RS_SIZE(struct acpi_resource_pin_group),
256 ACPI_RS_SIZE(struct acpi_resource_pin_group_function),
257 ACPI_RS_SIZE(struct acpi_resource_pin_group_config),
234}; 258};
235 259
236const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = { 260const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 2ae79613f6b7..cc4b5486c4bc 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -596,9 +596,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
596 596
597 /* Set vendor offset only if there is vendor data */ 597 /* Set vendor offset only if there is vendor data */
598 598
599 if (resource->data.gpio.vendor_length) { 599 ACPI_SET16(target, aml_length);
600 ACPI_SET16(target, aml_length);
601 }
602 600
603 acpi_rs_set_resource_length(aml_length, aml); 601 acpi_rs_set_resource_length(aml_length, aml);
604 break; 602 break;
diff --git a/drivers/acpi/acpica/rsserial.c b/drivers/acpi/acpica/rsserial.c
index c20e6d07928d..14d12d6eb716 100644
--- a/drivers/acpi/acpica/rsserial.c
+++ b/drivers/acpi/acpica/rsserial.c
@@ -147,6 +147,82 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
147 147
148/******************************************************************************* 148/*******************************************************************************
149 * 149 *
150 * acpi_rs_convert_pinfunction
151 *
152 ******************************************************************************/
153
154struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = {
155 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION,
156 ACPI_RS_SIZE(struct acpi_resource_pin_function),
157 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_function)},
158
159 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION,
160 sizeof(struct aml_resource_pin_function),
161 0},
162
163 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_function.revision_id),
164 AML_OFFSET(pin_function.revision_id),
165 1},
166
167 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.sharable),
168 AML_OFFSET(pin_function.flags),
169 0},
170
171 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_function.pin_config),
172 AML_OFFSET(pin_function.pin_config),
173 1},
174
175 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.pin_function.function_number),
176 AML_OFFSET(pin_function.function_number),
177 2},
178
179 /* Pin Table */
180
181 /*
182 * It is OK to use GPIO operations here because none of them refer GPIO
183 * structures directly but instead use offsets given here.
184 */
185
186 {ACPI_RSC_COUNT_GPIO_PIN,
187 ACPI_RS_OFFSET(data.pin_function.pin_table_length),
188 AML_OFFSET(pin_function.pin_table_offset),
189 AML_OFFSET(pin_function.res_source_offset)},
190
191 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_function.pin_table),
192 AML_OFFSET(pin_function.pin_table_offset),
193 0},
194
195 /* Resource Source */
196
197 {ACPI_RSC_MOVE8,
198 ACPI_RS_OFFSET(data.pin_function.resource_source.index),
199 AML_OFFSET(pin_function.res_source_index),
200 1},
201
202 {ACPI_RSC_COUNT_GPIO_RES,
203 ACPI_RS_OFFSET(data.pin_function.resource_source.string_length),
204 AML_OFFSET(pin_function.res_source_offset),
205 AML_OFFSET(pin_function.vendor_offset)},
206
207 {ACPI_RSC_MOVE_GPIO_RES,
208 ACPI_RS_OFFSET(data.pin_function.resource_source.string_ptr),
209 AML_OFFSET(pin_function.res_source_offset),
210 0},
211
212 /* Vendor Data */
213
214 {ACPI_RSC_COUNT_GPIO_VEN,
215 ACPI_RS_OFFSET(data.pin_function.vendor_length),
216 AML_OFFSET(pin_function.vendor_length),
217 1},
218
219 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_function.vendor_data),
220 AML_OFFSET(pin_function.vendor_offset),
221 0},
222};
223
224/*******************************************************************************
225 *
150 * acpi_rs_convert_i2c_serial_bus 226 * acpi_rs_convert_i2c_serial_bus
151 * 227 *
152 ******************************************************************************/ 228 ******************************************************************************/
@@ -458,3 +534,300 @@ struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[23] = {
458 AML_OFFSET(uart_serial_bus.default_baud_rate), 534 AML_OFFSET(uart_serial_bus.default_baud_rate),
459 1}, 535 1},
460}; 536};
537
538/*******************************************************************************
539 *
540 * acpi_rs_convert_pin_config
541 *
542 ******************************************************************************/
543
544struct acpi_rsconvert_info acpi_rs_convert_pin_config[14] = {
545 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG,
546 ACPI_RS_SIZE(struct acpi_resource_pin_config),
547 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_config)},
548
549 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG,
550 sizeof(struct aml_resource_pin_config),
551 0},
552
553 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.revision_id),
554 AML_OFFSET(pin_config.revision_id),
555 1},
556
557 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.sharable),
558 AML_OFFSET(pin_config.flags),
559 0},
560
561 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.producer_consumer),
562 AML_OFFSET(pin_config.flags),
563 1},
564
565 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.pin_config_type),
566 AML_OFFSET(pin_config.pin_config_type),
567 1},
568
569 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.pin_config.pin_config_value),
570 AML_OFFSET(pin_config.pin_config_value),
571 1},
572
573 /* Pin Table */
574
575 /*
576 * It is OK to use GPIO operations here because none of them refer GPIO
577 * structures directly but instead use offsets given here.
578 */
579
580 {ACPI_RSC_COUNT_GPIO_PIN,
581 ACPI_RS_OFFSET(data.pin_config.pin_table_length),
582 AML_OFFSET(pin_config.pin_table_offset),
583 AML_OFFSET(pin_config.res_source_offset)},
584
585 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_config.pin_table),
586 AML_OFFSET(pin_config.pin_table_offset),
587 0},
588
589 /* Resource Source */
590
591 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.resource_source.index),
592 AML_OFFSET(pin_config.res_source_index),
593 1},
594
595 {ACPI_RSC_COUNT_GPIO_RES,
596 ACPI_RS_OFFSET(data.pin_config.resource_source.string_length),
597 AML_OFFSET(pin_config.res_source_offset),
598 AML_OFFSET(pin_config.vendor_offset)},
599
600 {ACPI_RSC_MOVE_GPIO_RES,
601 ACPI_RS_OFFSET(data.pin_config.resource_source.string_ptr),
602 AML_OFFSET(pin_config.res_source_offset),
603 0},
604
605 /* Vendor Data */
606
607 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.pin_config.vendor_length),
608 AML_OFFSET(pin_config.vendor_length),
609 1},
610
611 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_config.vendor_data),
612 AML_OFFSET(pin_config.vendor_offset),
613 0},
614};
615
616/*******************************************************************************
617 *
618 * acpi_rs_convert_pin_group
619 *
620 ******************************************************************************/
621
622struct acpi_rsconvert_info acpi_rs_convert_pin_group[10] = {
623 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP,
624 ACPI_RS_SIZE(struct acpi_resource_pin_group),
625 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group)},
626
627 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP,
628 sizeof(struct aml_resource_pin_group),
629 0},
630
631 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group.revision_id),
632 AML_OFFSET(pin_group.revision_id),
633 1},
634
635 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group.producer_consumer),
636 AML_OFFSET(pin_group.flags),
637 0},
638
639 /* Pin Table */
640
641 /*
642 * It is OK to use GPIO operations here because none of them refer GPIO
643 * structures directly but instead use offsets given here.
644 */
645
646 {ACPI_RSC_COUNT_GPIO_PIN,
647 ACPI_RS_OFFSET(data.pin_group.pin_table_length),
648 AML_OFFSET(pin_group.pin_table_offset),
649 AML_OFFSET(pin_group.label_offset)},
650
651 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_group.pin_table),
652 AML_OFFSET(pin_group.pin_table_offset),
653 0},
654
655 /* Resource Label */
656
657 {ACPI_RSC_COUNT_GPIO_RES,
658 ACPI_RS_OFFSET(data.pin_group.resource_label.string_length),
659 AML_OFFSET(pin_group.label_offset),
660 AML_OFFSET(pin_group.vendor_offset)},
661
662 {ACPI_RSC_MOVE_GPIO_RES,
663 ACPI_RS_OFFSET(data.pin_group.resource_label.string_ptr),
664 AML_OFFSET(pin_group.label_offset),
665 0},
666
667 /* Vendor Data */
668
669 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.pin_group.vendor_length),
670 AML_OFFSET(pin_group.vendor_length),
671 1},
672
673 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_group.vendor_data),
674 AML_OFFSET(pin_group.vendor_offset),
675 0},
676};
677
678/*******************************************************************************
679 *
680 * acpi_rs_convert_pin_group_function
681 *
682 ******************************************************************************/
683
684struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[13] = {
685 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
686 ACPI_RS_SIZE(struct acpi_resource_pin_group_function),
687 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group_function)},
688
689 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
690 sizeof(struct aml_resource_pin_group_function),
691 0},
692
693 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_function.revision_id),
694 AML_OFFSET(pin_group_function.revision_id),
695 1},
696
697 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.sharable),
698 AML_OFFSET(pin_group_function.flags),
699 0},
700
701 {ACPI_RSC_1BITFLAG,
702 ACPI_RS_OFFSET(data.pin_group_function.producer_consumer),
703 AML_OFFSET(pin_group_function.flags),
704 1},
705
706 {ACPI_RSC_MOVE16,
707 ACPI_RS_OFFSET(data.pin_group_function.function_number),
708 AML_OFFSET(pin_group_function.function_number),
709 1},
710
711 /* Resource Source */
712
713 {ACPI_RSC_MOVE8,
714 ACPI_RS_OFFSET(data.pin_group_function.resource_source.index),
715 AML_OFFSET(pin_group_function.res_source_index),
716 1},
717
718 {ACPI_RSC_COUNT_GPIO_RES,
719 ACPI_RS_OFFSET(data.pin_group_function.resource_source.string_length),
720 AML_OFFSET(pin_group_function.res_source_offset),
721 AML_OFFSET(pin_group_function.res_source_label_offset)},
722
723 {ACPI_RSC_MOVE_GPIO_RES,
724 ACPI_RS_OFFSET(data.pin_group_function.resource_source.string_ptr),
725 AML_OFFSET(pin_group_function.res_source_offset),
726 0},
727
728 /* Resource Source Label */
729
730 {ACPI_RSC_COUNT_GPIO_RES,
731 ACPI_RS_OFFSET(data.pin_group_function.resource_source_label.
732 string_length),
733 AML_OFFSET(pin_group_function.res_source_label_offset),
734 AML_OFFSET(pin_group_function.vendor_offset)},
735
736 {ACPI_RSC_MOVE_GPIO_RES,
737 ACPI_RS_OFFSET(data.pin_group_function.resource_source_label.
738 string_ptr),
739 AML_OFFSET(pin_group_function.res_source_label_offset),
740 0},
741
742 /* Vendor Data */
743
744 {ACPI_RSC_COUNT_GPIO_VEN,
745 ACPI_RS_OFFSET(data.pin_group_function.vendor_length),
746 AML_OFFSET(pin_group_function.vendor_length),
747 1},
748
749 {ACPI_RSC_MOVE_GPIO_RES,
750 ACPI_RS_OFFSET(data.pin_group_function.vendor_data),
751 AML_OFFSET(pin_group_function.vendor_offset),
752 0},
753};
754
755/*******************************************************************************
756 *
757 * acpi_rs_convert_pin_group_config
758 *
759 ******************************************************************************/
760
761struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[14] = {
762 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
763 ACPI_RS_SIZE(struct acpi_resource_pin_group_config),
764 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group_config)},
765
766 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
767 sizeof(struct aml_resource_pin_group_config),
768 0},
769
770 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_config.revision_id),
771 AML_OFFSET(pin_group_config.revision_id),
772 1},
773
774 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.sharable),
775 AML_OFFSET(pin_group_config.flags),
776 0},
777
778 {ACPI_RSC_1BITFLAG,
779 ACPI_RS_OFFSET(data.pin_group_config.producer_consumer),
780 AML_OFFSET(pin_group_config.flags),
781 1},
782
783 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_config.pin_config_type),
784 AML_OFFSET(pin_group_config.pin_config_type),
785 1},
786
787 {ACPI_RSC_MOVE32,
788 ACPI_RS_OFFSET(data.pin_group_config.pin_config_value),
789 AML_OFFSET(pin_group_config.pin_config_value),
790 1},
791
792 /* Resource Source */
793
794 {ACPI_RSC_MOVE8,
795 ACPI_RS_OFFSET(data.pin_group_config.resource_source.index),
796 AML_OFFSET(pin_group_config.res_source_index),
797 1},
798
799 {ACPI_RSC_COUNT_GPIO_RES,
800 ACPI_RS_OFFSET(data.pin_group_config.resource_source.string_length),
801 AML_OFFSET(pin_group_config.res_source_offset),
802 AML_OFFSET(pin_group_config.res_source_label_offset)},
803
804 {ACPI_RSC_MOVE_GPIO_RES,
805 ACPI_RS_OFFSET(data.pin_group_config.resource_source.string_ptr),
806 AML_OFFSET(pin_group_config.res_source_offset),
807 0},
808
809 /* Resource Source Label */
810
811 {ACPI_RSC_COUNT_GPIO_RES,
812 ACPI_RS_OFFSET(data.pin_group_config.resource_source_label.
813 string_length),
814 AML_OFFSET(pin_group_config.res_source_label_offset),
815 AML_OFFSET(pin_group_config.vendor_offset)},
816
817 {ACPI_RSC_MOVE_GPIO_RES,
818 ACPI_RS_OFFSET(data.pin_group_config.resource_source_label.string_ptr),
819 AML_OFFSET(pin_group_config.res_source_label_offset),
820 0},
821
822 /* Vendor Data */
823
824 {ACPI_RSC_COUNT_GPIO_VEN,
825 ACPI_RS_OFFSET(data.pin_group_config.vendor_length),
826 AML_OFFSET(pin_group_config.vendor_length),
827 1},
828
829 {ACPI_RSC_MOVE_GPIO_RES,
830 ACPI_RS_OFFSET(data.pin_group_config.vendor_data),
831 AML_OFFSET(pin_group_config.vendor_offset),
832 0},
833};
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 27c5c27d4818..c9d6fa6d7cc6 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -867,6 +867,8 @@ exit:
867 return_ACPI_STATUS(status); 867 return_ACPI_STATUS(status);
868} 868}
869 869
870ACPI_EXPORT_SYMBOL(acpi_tb_install_and_load_table)
871
870/******************************************************************************* 872/*******************************************************************************
871 * 873 *
872 * FUNCTION: acpi_tb_unload_table 874 * FUNCTION: acpi_tb_unload_table
@@ -914,3 +916,5 @@ acpi_status acpi_tb_unload_table(u32 table_index)
914 acpi_tb_set_table_loaded_flag(table_index, FALSE); 916 acpi_tb_set_table_loaded_flag(table_index, FALSE);
915 return_ACPI_STATUS(status); 917 return_ACPI_STATUS(status);
916} 918}
919
920ACPI_EXPORT_SYMBOL(acpi_tb_unload_table)
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 51860bfc111e..5f051d82188d 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -449,8 +449,8 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
449 * The 64-bit X fields are optional extensions to the original 32-bit FADT 449 * The 64-bit X fields are optional extensions to the original 32-bit FADT
450 * V1.0 fields. Even if they are present in the FADT, they are optional and 450 * V1.0 fields. Even if they are present in the FADT, they are optional and
451 * are unused if the BIOS sets them to zero. Therefore, we must copy/expand 451 * are unused if the BIOS sets them to zero. Therefore, we must copy/expand
452 * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is 452 * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally
453 * originally zero. 453 * zero.
454 * 454 *
455 * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address 455 * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
456 * fields are expanded to the corresponding 64-bit X fields in the internal 456 * fields are expanded to the corresponding 64-bit X fields in the internal
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 0d2e98920069..0c6768d20395 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -141,9 +141,9 @@ void acpi_tb_check_dsdt_header(void)
141 * 141 *
142 * FUNCTION: acpi_tb_copy_dsdt 142 * FUNCTION: acpi_tb_copy_dsdt
143 * 143 *
144 * PARAMETERS: table_desc - Installed table to copy 144 * PARAMETERS: table_index - Index of installed table to copy
145 * 145 *
146 * RETURN: None 146 * RETURN: The copied DSDT
147 * 147 *
148 * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory. 148 * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory.
149 * Some very bad BIOSs are known to either corrupt the DSDT or 149 * Some very bad BIOSs are known to either corrupt the DSDT or
@@ -239,7 +239,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
239 * 239 *
240 * FUNCTION: acpi_tb_parse_root_table 240 * FUNCTION: acpi_tb_parse_root_table
241 * 241 *
242 * PARAMETERS: rsdp - Pointer to the RSDP 242 * PARAMETERS: rsdp_address - Pointer to the RSDP
243 * 243 *
244 * RETURN: Status 244 * RETURN: Status
245 * 245 *
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 60868309e326..02cd2c2d961a 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -460,9 +460,11 @@ static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
460 /* 09 */ "Device PLD Check", 460 /* 09 */ "Device PLD Check",
461 /* 0A */ "Reserved", 461 /* 0A */ "Reserved",
462 /* 0B */ "System Locality Update", 462 /* 0B */ "System Locality Update",
463 /* 0C */ "Shutdown Request", 463 /* 0C */ "Reserved (was previously Shutdown Request)",
464 /* Reserved in ACPI 6.0 */ 464 /* Reserved in ACPI 6.0 */
465 /* 0D */ "System Resource Affinity Update" 465 /* 0D */ "System Resource Affinity Update",
466 /* 0E */ "Heterogeneous Memory Attributes Update"
467 /* ACPI 6.2 */
466}; 468};
467 469
468static const char *acpi_gbl_device_notify[5] = { 470static const char *acpi_gbl_device_notify[5] = {
diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c
index c82399f9b456..1b3ee74a87eb 100644
--- a/drivers/acpi/acpica/utownerid.c
+++ b/drivers/acpi/acpica/utownerid.c
@@ -104,13 +104,19 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
104 break; 104 break;
105 } 105 }
106 106
107 if (!(acpi_gbl_owner_id_mask[j] & (1 << k))) { 107 /*
108 * Note: the u32 cast ensures that 1 is stored as a unsigned
109 * integer. Omitting the cast may result in 1 being stored as an
110 * int. Some compilers or runtime error detection may flag this as
111 * an error.
112 */
113 if (!(acpi_gbl_owner_id_mask[j] & ((u32)1 << k))) {
108 /* 114 /*
109 * Found a free ID. The actual ID is the bit index plus one, 115 * Found a free ID. The actual ID is the bit index plus one,
110 * making zero an invalid Owner ID. Save this as the last ID 116 * making zero an invalid Owner ID. Save this as the last ID
111 * allocated and update the global ID mask. 117 * allocated and update the global ID mask.
112 */ 118 */
113 acpi_gbl_owner_id_mask[j] |= (1 << k); 119 acpi_gbl_owner_id_mask[j] |= ((u32)1 << k);
114 120
115 acpi_gbl_last_owner_id_index = (u8)j; 121 acpi_gbl_last_owner_id_index = (u8)j;
116 acpi_gbl_next_owner_id_offset = (u8)(k + 1); 122 acpi_gbl_next_owner_id_offset = (u8)(k + 1);
@@ -201,7 +207,7 @@ void acpi_ut_release_owner_id(acpi_owner_id *owner_id_ptr)
201 /* Decode ID to index/offset pair */ 207 /* Decode ID to index/offset pair */
202 208
203 index = ACPI_DIV_32(owner_id); 209 index = ACPI_DIV_32(owner_id);
204 bit = 1 << ACPI_MOD_32(owner_id); 210 bit = (u32)1 << ACPI_MOD_32(owner_id);
205 211
206 /* Free the owner ID only if it is valid */ 212 /* Free the owner ID only if it is valid */
207 213
diff --git a/drivers/acpi/acpica/utresdecode.c b/drivers/acpi/acpica/utresdecode.c
new file mode 100644
index 000000000000..e15a2538558b
--- /dev/null
+++ b/drivers/acpi/acpica/utresdecode.c
@@ -0,0 +1,315 @@
1/*******************************************************************************
2 *
3 * Module Name: utresdecode - Resource descriptor keyword strings
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2017, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46#include "acresrc.h"
47
48#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utresdecode")
50
51#if defined (ACPI_DEBUG_OUTPUT) || \
52 defined (ACPI_DISASSEMBLER) || \
53 defined (ACPI_DEBUGGER)
54/*
55 * Strings used to decode resource descriptors.
56 * Used by both the disassembler and the debugger resource dump routines
57 */
58const char *acpi_gbl_bm_decode[] = {
59 "NotBusMaster",
60 "BusMaster"
61};
62
63const char *acpi_gbl_config_decode[] = {
64 "0 - Good Configuration",
65 "1 - Acceptable Configuration",
66 "2 - Suboptimal Configuration",
67 "3 - ***Invalid Configuration***",
68};
69
70const char *acpi_gbl_consume_decode[] = {
71 "ResourceProducer",
72 "ResourceConsumer"
73};
74
75const char *acpi_gbl_dec_decode[] = {
76 "PosDecode",
77 "SubDecode"
78};
79
80const char *acpi_gbl_he_decode[] = {
81 "Level",
82 "Edge"
83};
84
85const char *acpi_gbl_io_decode[] = {
86 "Decode10",
87 "Decode16"
88};
89
90const char *acpi_gbl_ll_decode[] = {
91 "ActiveHigh",
92 "ActiveLow",
93 "ActiveBoth",
94 "Reserved"
95};
96
97const char *acpi_gbl_max_decode[] = {
98 "MaxNotFixed",
99 "MaxFixed"
100};
101
102const char *acpi_gbl_mem_decode[] = {
103 "NonCacheable",
104 "Cacheable",
105 "WriteCombining",
106 "Prefetchable"
107};
108
109const char *acpi_gbl_min_decode[] = {
110 "MinNotFixed",
111 "MinFixed"
112};
113
114const char *acpi_gbl_mtp_decode[] = {
115 "AddressRangeMemory",
116 "AddressRangeReserved",
117 "AddressRangeACPI",
118 "AddressRangeNVS"
119};
120
121const char *acpi_gbl_rng_decode[] = {
122 "InvalidRanges",
123 "NonISAOnlyRanges",
124 "ISAOnlyRanges",
125 "EntireRange"
126};
127
128const char *acpi_gbl_rw_decode[] = {
129 "ReadOnly",
130 "ReadWrite"
131};
132
133const char *acpi_gbl_shr_decode[] = {
134 "Exclusive",
135 "Shared",
136 "ExclusiveAndWake", /* ACPI 5.0 */
137 "SharedAndWake" /* ACPI 5.0 */
138};
139
140const char *acpi_gbl_siz_decode[] = {
141 "Transfer8",
142 "Transfer8_16",
143 "Transfer16",
144 "InvalidSize"
145};
146
147const char *acpi_gbl_trs_decode[] = {
148 "DenseTranslation",
149 "SparseTranslation"
150};
151
152const char *acpi_gbl_ttp_decode[] = {
153 "TypeStatic",
154 "TypeTranslation"
155};
156
157const char *acpi_gbl_typ_decode[] = {
158 "Compatibility",
159 "TypeA",
160 "TypeB",
161 "TypeF"
162};
163
164const char *acpi_gbl_ppc_decode[] = {
165 "PullDefault",
166 "PullUp",
167 "PullDown",
168 "PullNone"
169};
170
171const char *acpi_gbl_ior_decode[] = {
172 "IoRestrictionNone",
173 "IoRestrictionInputOnly",
174 "IoRestrictionOutputOnly",
175 "IoRestrictionNoneAndPreserve"
176};
177
178const char *acpi_gbl_dts_decode[] = {
179 "Width8bit",
180 "Width16bit",
181 "Width32bit",
182 "Width64bit",
183 "Width128bit",
184 "Width256bit",
185};
186
187/* GPIO connection type */
188
189const char *acpi_gbl_ct_decode[] = {
190 "Interrupt",
191 "I/O"
192};
193
194/* Serial bus type */
195
196const char *acpi_gbl_sbt_decode[] = {
197 "/* UNKNOWN serial bus type */",
198 "I2C",
199 "SPI",
200 "UART"
201};
202
203/* I2C serial bus access mode */
204
205const char *acpi_gbl_am_decode[] = {
206 "AddressingMode7Bit",
207 "AddressingMode10Bit"
208};
209
210/* I2C serial bus slave mode */
211
212const char *acpi_gbl_sm_decode[] = {
213 "ControllerInitiated",
214 "DeviceInitiated"
215};
216
217/* SPI serial bus wire mode */
218
219const char *acpi_gbl_wm_decode[] = {
220 "FourWireMode",
221 "ThreeWireMode"
222};
223
224/* SPI serial clock phase */
225
226const char *acpi_gbl_cph_decode[] = {
227 "ClockPhaseFirst",
228 "ClockPhaseSecond"
229};
230
231/* SPI serial bus clock polarity */
232
233const char *acpi_gbl_cpo_decode[] = {
234 "ClockPolarityLow",
235 "ClockPolarityHigh"
236};
237
238/* SPI serial bus device polarity */
239
240const char *acpi_gbl_dp_decode[] = {
241 "PolarityLow",
242 "PolarityHigh"
243};
244
245/* UART serial bus endian */
246
247const char *acpi_gbl_ed_decode[] = {
248 "LittleEndian",
249 "BigEndian"
250};
251
252/* UART serial bus bits per byte */
253
254const char *acpi_gbl_bpb_decode[] = {
255 "DataBitsFive",
256 "DataBitsSix",
257 "DataBitsSeven",
258 "DataBitsEight",
259 "DataBitsNine",
260 "/* UNKNOWN Bits per byte */",
261 "/* UNKNOWN Bits per byte */",
262 "/* UNKNOWN Bits per byte */"
263};
264
265/* UART serial bus stop bits */
266
267const char *acpi_gbl_sb_decode[] = {
268 "StopBitsZero",
269 "StopBitsOne",
270 "StopBitsOnePlusHalf",
271 "StopBitsTwo"
272};
273
274/* UART serial bus flow control */
275
276const char *acpi_gbl_fc_decode[] = {
277 "FlowControlNone",
278 "FlowControlHardware",
279 "FlowControlXON",
280 "/* UNKNOWN flow control keyword */"
281};
282
283/* UART serial bus parity type */
284
285const char *acpi_gbl_pt_decode[] = {
286 "ParityTypeNone",
287 "ParityTypeEven",
288 "ParityTypeOdd",
289 "ParityTypeMark",
290 "ParityTypeSpace",
291 "/* UNKNOWN parity keyword */",
292 "/* UNKNOWN parity keyword */",
293 "/* UNKNOWN parity keyword */"
294};
295
296/* pin_config type */
297
298const char *acpi_gbl_ptyp_decode[] = {
299 "Default",
300 "Bias Pull-up",
301 "Bias Pull-down",
302 "Bias Default",
303 "Bias Disable",
304 "Bias High Impedance",
305 "Bias Bus Hold",
306 "Drive Open Drain",
307 "Drive Open Source",
308 "Drive Push Pull",
309 "Drive Strength",
310 "Slew Rate",
311 "Input Debounce",
312 "Input Schmitt Trigger",
313};
314
315#endif
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index ff096d9755b9..70f78a4bf13b 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -48,251 +48,6 @@
48#define _COMPONENT ACPI_UTILITIES 48#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utresrc") 49ACPI_MODULE_NAME("utresrc")
50 50
51#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
52/*
53 * Strings used to decode resource descriptors.
54 * Used by both the disassembler and the debugger resource dump routines
55 */
56const char *acpi_gbl_bm_decode[] = {
57 "NotBusMaster",
58 "BusMaster"
59};
60
61const char *acpi_gbl_config_decode[] = {
62 "0 - Good Configuration",
63 "1 - Acceptable Configuration",
64 "2 - Suboptimal Configuration",
65 "3 - ***Invalid Configuration***",
66};
67
68const char *acpi_gbl_consume_decode[] = {
69 "ResourceProducer",
70 "ResourceConsumer"
71};
72
73const char *acpi_gbl_dec_decode[] = {
74 "PosDecode",
75 "SubDecode"
76};
77
78const char *acpi_gbl_he_decode[] = {
79 "Level",
80 "Edge"
81};
82
83const char *acpi_gbl_io_decode[] = {
84 "Decode10",
85 "Decode16"
86};
87
88const char *acpi_gbl_ll_decode[] = {
89 "ActiveHigh",
90 "ActiveLow",
91 "ActiveBoth",
92 "Reserved"
93};
94
95const char *acpi_gbl_max_decode[] = {
96 "MaxNotFixed",
97 "MaxFixed"
98};
99
100const char *acpi_gbl_mem_decode[] = {
101 "NonCacheable",
102 "Cacheable",
103 "WriteCombining",
104 "Prefetchable"
105};
106
107const char *acpi_gbl_min_decode[] = {
108 "MinNotFixed",
109 "MinFixed"
110};
111
112const char *acpi_gbl_mtp_decode[] = {
113 "AddressRangeMemory",
114 "AddressRangeReserved",
115 "AddressRangeACPI",
116 "AddressRangeNVS"
117};
118
119const char *acpi_gbl_rng_decode[] = {
120 "InvalidRanges",
121 "NonISAOnlyRanges",
122 "ISAOnlyRanges",
123 "EntireRange"
124};
125
126const char *acpi_gbl_rw_decode[] = {
127 "ReadOnly",
128 "ReadWrite"
129};
130
131const char *acpi_gbl_shr_decode[] = {
132 "Exclusive",
133 "Shared",
134 "ExclusiveAndWake", /* ACPI 5.0 */
135 "SharedAndWake" /* ACPI 5.0 */
136};
137
138const char *acpi_gbl_siz_decode[] = {
139 "Transfer8",
140 "Transfer8_16",
141 "Transfer16",
142 "InvalidSize"
143};
144
145const char *acpi_gbl_trs_decode[] = {
146 "DenseTranslation",
147 "SparseTranslation"
148};
149
150const char *acpi_gbl_ttp_decode[] = {
151 "TypeStatic",
152 "TypeTranslation"
153};
154
155const char *acpi_gbl_typ_decode[] = {
156 "Compatibility",
157 "TypeA",
158 "TypeB",
159 "TypeF"
160};
161
162const char *acpi_gbl_ppc_decode[] = {
163 "PullDefault",
164 "PullUp",
165 "PullDown",
166 "PullNone"
167};
168
169const char *acpi_gbl_ior_decode[] = {
170 "IoRestrictionNone",
171 "IoRestrictionInputOnly",
172 "IoRestrictionOutputOnly",
173 "IoRestrictionNoneAndPreserve"
174};
175
176const char *acpi_gbl_dts_decode[] = {
177 "Width8bit",
178 "Width16bit",
179 "Width32bit",
180 "Width64bit",
181 "Width128bit",
182 "Width256bit",
183};
184
185/* GPIO connection type */
186
187const char *acpi_gbl_ct_decode[] = {
188 "Interrupt",
189 "I/O"
190};
191
192/* Serial bus type */
193
194const char *acpi_gbl_sbt_decode[] = {
195 "/* UNKNOWN serial bus type */",
196 "I2C",
197 "SPI",
198 "UART"
199};
200
201/* I2C serial bus access mode */
202
203const char *acpi_gbl_am_decode[] = {
204 "AddressingMode7Bit",
205 "AddressingMode10Bit"
206};
207
208/* I2C serial bus slave mode */
209
210const char *acpi_gbl_sm_decode[] = {
211 "ControllerInitiated",
212 "DeviceInitiated"
213};
214
215/* SPI serial bus wire mode */
216
217const char *acpi_gbl_wm_decode[] = {
218 "FourWireMode",
219 "ThreeWireMode"
220};
221
222/* SPI serial clock phase */
223
224const char *acpi_gbl_cph_decode[] = {
225 "ClockPhaseFirst",
226 "ClockPhaseSecond"
227};
228
229/* SPI serial bus clock polarity */
230
231const char *acpi_gbl_cpo_decode[] = {
232 "ClockPolarityLow",
233 "ClockPolarityHigh"
234};
235
236/* SPI serial bus device polarity */
237
238const char *acpi_gbl_dp_decode[] = {
239 "PolarityLow",
240 "PolarityHigh"
241};
242
243/* UART serial bus endian */
244
245const char *acpi_gbl_ed_decode[] = {
246 "LittleEndian",
247 "BigEndian"
248};
249
250/* UART serial bus bits per byte */
251
252const char *acpi_gbl_bpb_decode[] = {
253 "DataBitsFive",
254 "DataBitsSix",
255 "DataBitsSeven",
256 "DataBitsEight",
257 "DataBitsNine",
258 "/* UNKNOWN Bits per byte */",
259 "/* UNKNOWN Bits per byte */",
260 "/* UNKNOWN Bits per byte */"
261};
262
263/* UART serial bus stop bits */
264
265const char *acpi_gbl_sb_decode[] = {
266 "StopBitsZero",
267 "StopBitsOne",
268 "StopBitsOnePlusHalf",
269 "StopBitsTwo"
270};
271
272/* UART serial bus flow control */
273
274const char *acpi_gbl_fc_decode[] = {
275 "FlowControlNone",
276 "FlowControlHardware",
277 "FlowControlXON",
278 "/* UNKNOWN flow control keyword */"
279};
280
281/* UART serial bus parity type */
282
283const char *acpi_gbl_pt_decode[] = {
284 "ParityTypeNone",
285 "ParityTypeEven",
286 "ParityTypeOdd",
287 "ParityTypeMark",
288 "ParityTypeSpace",
289 "/* UNKNOWN parity keyword */",
290 "/* UNKNOWN parity keyword */",
291 "/* UNKNOWN parity keyword */"
292};
293
294#endif
295
296/* 51/*
297 * Base sizes of the raw AML resource descriptors, indexed by resource type. 52 * Base sizes of the raw AML resource descriptors, indexed by resource type.
298 * Zero indicates a reserved (and therefore invalid) resource type. 53 * Zero indicates a reserved (and therefore invalid) resource type.
@@ -332,8 +87,12 @@ const u8 acpi_gbl_resource_aml_sizes[] = {
332 ACPI_AML_SIZE_LARGE(struct aml_resource_address64), 87 ACPI_AML_SIZE_LARGE(struct aml_resource_address64),
333 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64), 88 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64),
334 ACPI_AML_SIZE_LARGE(struct aml_resource_gpio), 89 ACPI_AML_SIZE_LARGE(struct aml_resource_gpio),
335 0, 90 ACPI_AML_SIZE_LARGE(struct aml_resource_pin_function),
336 ACPI_AML_SIZE_LARGE(struct aml_resource_common_serialbus), 91 ACPI_AML_SIZE_LARGE(struct aml_resource_common_serialbus),
92 ACPI_AML_SIZE_LARGE(struct aml_resource_pin_config),
93 ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group),
94 ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_function),
95 ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_config),
337}; 96};
338 97
339const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = { 98const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = {
@@ -384,8 +143,12 @@ static const u8 acpi_gbl_resource_types[] = {
384 ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ 143 ACPI_VARIABLE_LENGTH, /* 0A Qword* address */
385 ACPI_FIXED_LENGTH, /* 0B Extended* address */ 144 ACPI_FIXED_LENGTH, /* 0B Extended* address */
386 ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ 145 ACPI_VARIABLE_LENGTH, /* 0C Gpio* */
387 0, 146 ACPI_VARIABLE_LENGTH, /* 0D pin_function */
388 ACPI_VARIABLE_LENGTH /* 0E *serial_bus */ 147 ACPI_VARIABLE_LENGTH, /* 0E *serial_bus */
148 ACPI_VARIABLE_LENGTH, /* 0F pin_config */
149 ACPI_VARIABLE_LENGTH, /* 10 pin_group */
150 ACPI_VARIABLE_LENGTH, /* 11 pin_group_function */
151 ACPI_VARIABLE_LENGTH, /* 12 pin_group_config */
389}; 152};
390 153
391/******************************************************************************* 154/*******************************************************************************
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c
index c016211c35ae..0b85f113f726 100644
--- a/drivers/acpi/acpica/utxfmutex.c
+++ b/drivers/acpi/acpica/utxfmutex.c
@@ -151,6 +151,8 @@ acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout)
151 return (status); 151 return (status);
152} 152}
153 153
154ACPI_EXPORT_SYMBOL(acpi_acquire_mutex)
155
154/******************************************************************************* 156/*******************************************************************************
155 * 157 *
156 * FUNCTION: acpi_release_mutex 158 * FUNCTION: acpi_release_mutex
@@ -167,7 +169,6 @@ acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout)
167 * not both. 169 * not both.
168 * 170 *
169 ******************************************************************************/ 171 ******************************************************************************/
170
171acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname) 172acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname)
172{ 173{
173 acpi_status status; 174 acpi_status status;
@@ -185,3 +186,5 @@ acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname)
185 acpi_os_release_mutex(mutex_obj->mutex.os_mutex); 186 acpi_os_release_mutex(mutex_obj->mutex.os_mutex);
186 return (AE_OK); 187 return (AE_OK);
187} 188}
189
190ACPI_EXPORT_SYMBOL(acpi_release_mutex)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 91cfdf377df7..ef1856b15488 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -19,7 +19,7 @@
19 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 */ 20 */
21 21
22#define pr_fmt(fmt) "ACPI : button: " fmt 22#define pr_fmt(fmt) "ACPI: button: " fmt
23 23
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/module.h> 25#include <linux/module.h>
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 156e15c35ffa..854d428e2a2d 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -27,7 +27,7 @@
27 27
28/* Uncomment next line to get verbose printout */ 28/* Uncomment next line to get verbose printout */
29/* #define DEBUG */ 29/* #define DEBUG */
30#define pr_fmt(fmt) "ACPI : EC: " fmt 30#define pr_fmt(fmt) "ACPI: EC: " fmt
31 31
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/module.h> 33#include <linux/module.h>
@@ -190,6 +190,7 @@ static struct workqueue_struct *ec_query_wq;
190 190
191static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ 191static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
192static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */ 192static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
193static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
193 194
194/* -------------------------------------------------------------------------- 195/* --------------------------------------------------------------------------
195 * Logging/Debugging 196 * Logging/Debugging
@@ -316,7 +317,7 @@ static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
316 ec->timestamp = jiffies; 317 ec->timestamp = jiffies;
317} 318}
318 319
319#ifdef DEBUG 320#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
320static const char *acpi_ec_cmd_string(u8 cmd) 321static const char *acpi_ec_cmd_string(u8 cmd)
321{ 322{
322 switch (cmd) { 323 switch (cmd) {
@@ -459,8 +460,10 @@ static bool acpi_ec_submit_flushable_request(struct acpi_ec *ec)
459 460
460static void acpi_ec_submit_query(struct acpi_ec *ec) 461static void acpi_ec_submit_query(struct acpi_ec *ec)
461{ 462{
462 if (acpi_ec_event_enabled(ec) && 463 acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM);
463 !test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 464 if (!acpi_ec_event_enabled(ec))
465 return;
466 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) {
464 ec_dbg_evt("Command(%s) submitted/blocked", 467 ec_dbg_evt("Command(%s) submitted/blocked",
465 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); 468 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
466 ec->nr_pending_queries++; 469 ec->nr_pending_queries++;
@@ -470,11 +473,10 @@ static void acpi_ec_submit_query(struct acpi_ec *ec)
470 473
471static void acpi_ec_complete_query(struct acpi_ec *ec) 474static void acpi_ec_complete_query(struct acpi_ec *ec)
472{ 475{
473 if (test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 476 if (test_and_clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
474 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
475 ec_dbg_evt("Command(%s) unblocked", 477 ec_dbg_evt("Command(%s) unblocked",
476 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); 478 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
477 } 479 acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM);
478} 480}
479 481
480static inline void __acpi_ec_enable_event(struct acpi_ec *ec) 482static inline void __acpi_ec_enable_event(struct acpi_ec *ec)
@@ -1362,13 +1364,23 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
1362 ec_parse_io_ports, ec); 1364 ec_parse_io_ports, ec);
1363 if (ACPI_FAILURE(status)) 1365 if (ACPI_FAILURE(status))
1364 return status; 1366 return status;
1367 if (ec->data_addr == 0 || ec->command_addr == 0)
1368 return AE_OK;
1365 1369
1366 /* Get GPE bit assignment (EC events). */ 1370 if (boot_ec && boot_ec_is_ecdt && EC_FLAGS_IGNORE_DSDT_GPE) {
1367 /* TODO: Add support for _GPE returning a package */ 1371 /*
1368 status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp); 1372 * Always inherit the GPE number setting from the ECDT
1369 if (ACPI_FAILURE(status)) 1373 * EC.
1370 return status; 1374 */
1371 ec->gpe = tmp; 1375 ec->gpe = boot_ec->gpe;
1376 } else {
1377 /* Get GPE bit assignment (EC events). */
1378 /* TODO: Add support for _GPE returning a package */
1379 status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
1380 if (ACPI_FAILURE(status))
1381 return status;
1382 ec->gpe = tmp;
1383 }
1372 /* Use the global lock for all EC transactions? */ 1384 /* Use the global lock for all EC transactions? */
1373 tmp = 0; 1385 tmp = 0;
1374 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); 1386 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
@@ -1665,12 +1677,26 @@ static const struct acpi_device_id ec_device_ids[] = {
1665 {"", 0}, 1677 {"", 0},
1666}; 1678};
1667 1679
1680/*
1681 * This function is not Windows-compatible as Windows never enumerates the
1682 * namespace EC before the main ACPI device enumeration process. It is
1683 * retained for historical reason and will be deprecated in the future.
1684 */
1668int __init acpi_ec_dsdt_probe(void) 1685int __init acpi_ec_dsdt_probe(void)
1669{ 1686{
1670 acpi_status status; 1687 acpi_status status;
1671 struct acpi_ec *ec; 1688 struct acpi_ec *ec;
1672 int ret; 1689 int ret;
1673 1690
1691 /*
1692 * If a platform has ECDT, there is no need to proceed as the
1693 * following probe is not a part of the ACPI device enumeration,
1694 * executing _STA is not safe, and thus this probe may risk of
1695 * picking up an invalid EC device.
1696 */
1697 if (boot_ec)
1698 return -ENODEV;
1699
1674 ec = acpi_ec_alloc(); 1700 ec = acpi_ec_alloc();
1675 if (!ec) 1701 if (!ec)
1676 return -ENOMEM; 1702 return -ENOMEM;
@@ -1753,11 +1779,43 @@ static int ec_correct_ecdt(const struct dmi_system_id *id)
1753 return 0; 1779 return 0;
1754} 1780}
1755 1781
1782/*
1783 * Some DSDTs contain wrong GPE setting.
1784 * Asus FX502VD/VE, GL702VMK, X550VXK, X580VD
1785 * https://bugzilla.kernel.org/show_bug.cgi?id=195651
1786 */
1787static int ec_honor_ecdt_gpe(const struct dmi_system_id *id)
1788{
1789 pr_debug("Detected system needing ignore DSDT GPE setting.\n");
1790 EC_FLAGS_IGNORE_DSDT_GPE = 1;
1791 return 0;
1792}
1793
1756static struct dmi_system_id ec_dmi_table[] __initdata = { 1794static struct dmi_system_id ec_dmi_table[] __initdata = {
1757 { 1795 {
1758 ec_correct_ecdt, "MSI MS-171F", { 1796 ec_correct_ecdt, "MSI MS-171F", {
1759 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"), 1797 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"),
1760 DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),}, NULL}, 1798 DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),}, NULL},
1799 {
1800 ec_honor_ecdt_gpe, "ASUS FX502VD", {
1801 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1802 DMI_MATCH(DMI_PRODUCT_NAME, "FX502VD"),}, NULL},
1803 {
1804 ec_honor_ecdt_gpe, "ASUS FX502VE", {
1805 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1806 DMI_MATCH(DMI_PRODUCT_NAME, "FX502VE"),}, NULL},
1807 {
1808 ec_honor_ecdt_gpe, "ASUS GL702VMK", {
1809 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1810 DMI_MATCH(DMI_PRODUCT_NAME, "GL702VMK"),}, NULL},
1811 {
1812 ec_honor_ecdt_gpe, "ASUS X550VXK", {
1813 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1814 DMI_MATCH(DMI_PRODUCT_NAME, "X550VXK"),}, NULL},
1815 {
1816 ec_honor_ecdt_gpe, "ASUS X580VD", {
1817 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1818 DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
1761 {}, 1819 {},
1762}; 1820};
1763 1821
diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c
index 7e4fbf9a53a3..3595aa9c7c18 100644
--- a/drivers/acpi/ioapic.c
+++ b/drivers/acpi/ioapic.c
@@ -21,7 +21,7 @@
21 * registered when we parsed the ACPI MADT. 21 * registered when we parsed the ACPI MADT.
22 */ 22 */
23 23
24#define pr_fmt(fmt) "ACPI : IOAPIC: " fmt 24#define pr_fmt(fmt) "ACPI: IOAPIC: " fmt
25 25
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/acpi.h> 27#include <linux/acpi.h>
diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c b/drivers/acpi/pmic/intel_pmic_xpower.c
index 1a76c784cd4c..3b7d5be5b7ed 100644
--- a/drivers/acpi/pmic/intel_pmic_xpower.c
+++ b/drivers/acpi/pmic/intel_pmic_xpower.c
@@ -21,6 +21,11 @@
21#include "intel_pmic.h" 21#include "intel_pmic.h"
22 22
23#define XPOWER_GPADC_LOW 0x5b 23#define XPOWER_GPADC_LOW 0x5b
24#define XPOWER_GPI1_CTRL 0x92
25
26#define GPI1_LDO_MASK GENMASK(2, 0)
27#define GPI1_LDO_ON (3 << 0)
28#define GPI1_LDO_OFF (4 << 0)
24 29
25static struct pmic_table power_table[] = { 30static struct pmic_table power_table[] = {
26 { 31 {
@@ -118,6 +123,10 @@ static struct pmic_table power_table[] = {
118 .reg = 0x10, 123 .reg = 0x10,
119 .bit = 0x00 124 .bit = 0x00
120 }, /* BUC6 */ 125 }, /* BUC6 */
126 {
127 .address = 0x4c,
128 .reg = 0x92,
129 }, /* GPI1 */
121}; 130};
122 131
123/* TMP0 - TMP5 are the same, all from GPADC */ 132/* TMP0 - TMP5 are the same, all from GPADC */
@@ -156,7 +165,12 @@ static int intel_xpower_pmic_get_power(struct regmap *regmap, int reg,
156 if (regmap_read(regmap, reg, &data)) 165 if (regmap_read(regmap, reg, &data))
157 return -EIO; 166 return -EIO;
158 167
159 *value = (data & BIT(bit)) ? 1 : 0; 168 /* GPIO1 LDO regulator needs special handling */
169 if (reg == XPOWER_GPI1_CTRL)
170 *value = ((data & GPI1_LDO_MASK) == GPI1_LDO_ON);
171 else
172 *value = (data & BIT(bit)) ? 1 : 0;
173
160 return 0; 174 return 0;
161} 175}
162 176
@@ -165,6 +179,11 @@ static int intel_xpower_pmic_update_power(struct regmap *regmap, int reg,
165{ 179{
166 int data; 180 int data;
167 181
182 /* GPIO1 LDO regulator needs special handling */
183 if (reg == XPOWER_GPI1_CTRL)
184 return regmap_update_bits(regmap, reg, GPI1_LDO_MASK,
185 on ? GPI1_LDO_ON : GPI1_LDO_OFF);
186
168 if (regmap_read(regmap, reg, &data)) 187 if (regmap_read(regmap, reg, &data))
169 return -EIO; 188 return -EIO;
170 189
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 7f48156cbc0c..d179e8d9177d 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -305,6 +305,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
305 DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), 305 DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"),
306 }, 306 },
307 }, 307 },
308 {
309 .callback = video_detect_force_native,
310 .ident = "Dell Precision 7510",
311 .matches = {
312 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
313 DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"),
314 },
315 },
308 { }, 316 { },
309}; 317};
310 318
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index c378c7b15d49..fe42c4a0d8d1 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -563,12 +563,12 @@ static int crb_acpi_add(struct acpi_device *device)
563 sm == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD) 563 sm == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD)
564 priv->flags |= CRB_FL_ACPI_START; 564 priv->flags |= CRB_FL_ACPI_START;
565 565
566 if (sm == ACPI_TPM2_COMMAND_BUFFER_WITH_SMC) { 566 if (sm == ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC) {
567 if (buf->header.length < (sizeof(*buf) + sizeof(*crb_smc))) { 567 if (buf->header.length < (sizeof(*buf) + sizeof(*crb_smc))) {
568 dev_err(dev, 568 dev_err(dev,
569 FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n", 569 FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n",
570 buf->header.length, 570 buf->header.length,
571 ACPI_TPM2_COMMAND_BUFFER_WITH_SMC); 571 ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC);
572 return -EINVAL; 572 return -EINVAL;
573 } 573 }
574 crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf)); 574 crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf));
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index dd9ecd354a3e..ac91fd0d62c6 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -203,7 +203,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
203 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv; 203 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv;
204 u32 id = chan - pcc_mbox_channels; 204 u32 id = chan - pcc_mbox_channels;
205 205
206 doorbell_ack = &pcct2_ss->doorbell_ack_register; 206 doorbell_ack = &pcct2_ss->platform_ack_register;
207 doorbell_ack_preserve = pcct2_ss->ack_preserve_mask; 207 doorbell_ack_preserve = pcct2_ss->ack_preserve_mask;
208 doorbell_ack_write = pcct2_ss->ack_write_mask; 208 doorbell_ack_write = pcct2_ss->ack_write_mask;
209 209
@@ -416,11 +416,11 @@ static int parse_pcc_subspace(struct acpi_subtable_header *header,
416static int pcc_parse_subspace_irq(int id, 416static int pcc_parse_subspace_irq(int id,
417 struct acpi_pcct_hw_reduced *pcct_ss) 417 struct acpi_pcct_hw_reduced *pcct_ss)
418{ 418{
419 pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->doorbell_interrupt, 419 pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->platform_interrupt,
420 (u32)pcct_ss->flags); 420 (u32)pcct_ss->flags);
421 if (pcc_doorbell_irq[id] <= 0) { 421 if (pcc_doorbell_irq[id] <= 0) {
422 pr_err("PCC GSI %d not registered\n", 422 pr_err("PCC GSI %d not registered\n",
423 pcct_ss->doorbell_interrupt); 423 pcct_ss->platform_interrupt);
424 return -EINVAL; 424 return -EINVAL;
425 } 425 }
426 426
@@ -429,8 +429,8 @@ static int pcc_parse_subspace_irq(int id,
429 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss; 429 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss;
430 430
431 pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap( 431 pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap(
432 pcct2_ss->doorbell_ack_register.address, 432 pcct2_ss->platform_ack_register.address,
433 pcct2_ss->doorbell_ack_register.bit_width / 8); 433 pcct2_ss->platform_ack_register.bit_width / 8);
434 if (!pcc_doorbell_ack_vaddr[id]) { 434 if (!pcc_doorbell_ack_vaddr[id]) {
435 pr_err("Failed to ioremap PCC ACK register\n"); 435 pr_err("Failed to ioremap PCC ACK register\n");
436 return -ENOMEM; 436 return -ENOMEM;
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 15c86ce4df53..a59c44c3edd8 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20170303 49#define ACPI_CA_VERSION 0x20170531
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index f0f7403d2000..343dbdcef20c 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -289,6 +289,11 @@ union acpi_resource_attribute {
289 u8 type_specific; 289 u8 type_specific;
290}; 290};
291 291
292struct acpi_resource_label {
293 u16 string_length;
294 char *string_ptr;
295};
296
292struct acpi_resource_source { 297struct acpi_resource_source {
293 u8 index; 298 u8 index;
294 u16 string_length; 299 u16 string_length;
@@ -534,6 +539,81 @@ struct acpi_resource_uart_serialbus {
534#define ACPI_UART_CLEAR_TO_SEND (1<<6) 539#define ACPI_UART_CLEAR_TO_SEND (1<<6)
535#define ACPI_UART_REQUEST_TO_SEND (1<<7) 540#define ACPI_UART_REQUEST_TO_SEND (1<<7)
536 541
542struct acpi_resource_pin_function {
543 u8 revision_id;
544 u8 pin_config;
545 u8 sharable; /* For values, see Interrupt Attributes above */
546 u16 function_number;
547 u16 pin_table_length;
548 u16 vendor_length;
549 struct acpi_resource_source resource_source;
550 u16 *pin_table;
551 u8 *vendor_data;
552};
553
554struct acpi_resource_pin_config {
555 u8 revision_id;
556 u8 producer_consumer; /* For values, see Producer/Consumer above */
557 u8 sharable; /* For values, see Interrupt Attributes above */
558 u8 pin_config_type;
559 u32 pin_config_value;
560 u16 pin_table_length;
561 u16 vendor_length;
562 struct acpi_resource_source resource_source;
563 u16 *pin_table;
564 u8 *vendor_data;
565};
566
567/* Values for pin_config_type field above */
568
569#define ACPI_PIN_CONFIG_DEFAULT 0
570#define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
571#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
572#define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
573#define ACPI_PIN_CONFIG_BIAS_DISABLE 4
574#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
575#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
576#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
577#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
578#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
579#define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
580#define ACPI_PIN_CONFIG_SLEW_RATE 11
581#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
582#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
583
584struct acpi_resource_pin_group {
585 u8 revision_id;
586 u8 producer_consumer; /* For values, see Producer/Consumer above */
587 u16 pin_table_length;
588 u16 vendor_length;
589 u16 *pin_table;
590 struct acpi_resource_label resource_label;
591 u8 *vendor_data;
592};
593
594struct acpi_resource_pin_group_function {
595 u8 revision_id;
596 u8 producer_consumer; /* For values, see Producer/Consumer above */
597 u8 sharable; /* For values, see Interrupt Attributes above */
598 u16 function_number;
599 u16 vendor_length;
600 struct acpi_resource_source resource_source;
601 struct acpi_resource_label resource_source_label;
602 u8 *vendor_data;
603};
604
605struct acpi_resource_pin_group_config {
606 u8 revision_id;
607 u8 producer_consumer; /* For values, see Producer/Consumer above */
608 u8 sharable; /* For values, see Interrupt Attributes above */
609 u8 pin_config_type; /* For values, see pin_config_type above */
610 u32 pin_config_value;
611 u16 vendor_length;
612 struct acpi_resource_source resource_source;
613 struct acpi_resource_label resource_source_label;
614 u8 *vendor_data;
615};
616
537/* ACPI_RESOURCE_TYPEs */ 617/* ACPI_RESOURCE_TYPEs */
538 618
539#define ACPI_RESOURCE_TYPE_IRQ 0 619#define ACPI_RESOURCE_TYPE_IRQ 0
@@ -556,7 +636,12 @@ struct acpi_resource_uart_serialbus {
556#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ 636#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
557#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ 637#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
558#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ 638#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
559#define ACPI_RESOURCE_TYPE_MAX 19 639#define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */
640#define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */
641#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
642#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
643#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
644#define ACPI_RESOURCE_TYPE_MAX 24
560 645
561/* Master union for resource descriptors */ 646/* Master union for resource descriptors */
562 647
@@ -584,6 +669,11 @@ union acpi_resource_data {
584 struct acpi_resource_spi_serialbus spi_serial_bus; 669 struct acpi_resource_spi_serialbus spi_serial_bus;
585 struct acpi_resource_uart_serialbus uart_serial_bus; 670 struct acpi_resource_uart_serialbus uart_serial_bus;
586 struct acpi_resource_common_serialbus common_serial_bus; 671 struct acpi_resource_common_serialbus common_serial_bus;
672 struct acpi_resource_pin_function pin_function;
673 struct acpi_resource_pin_config pin_config;
674 struct acpi_resource_pin_group pin_group;
675 struct acpi_resource_pin_group_function pin_group_function;
676 struct acpi_resource_pin_group_config pin_group_config;
587 677
588 /* Common fields */ 678 /* Common fields */
589 679
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index b4ce55c008b0..6b8714a428b6 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -65,9 +65,11 @@
65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
66#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ 66#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
67#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ 67#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
68#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
68#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ 69#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
69#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 70#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
70#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ 71#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
72#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
71#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 73#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
72#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 74#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
73#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ 75#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
@@ -430,7 +432,8 @@ enum acpi_hest_types {
430 ACPI_HEST_TYPE_AER_BRIDGE = 8, 432 ACPI_HEST_TYPE_AER_BRIDGE = 8,
431 ACPI_HEST_TYPE_GENERIC_ERROR = 9, 433 ACPI_HEST_TYPE_GENERIC_ERROR = 9,
432 ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10, 434 ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
433 ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 435 ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
436 ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
434}; 437};
435 438
436/* 439/*
@@ -476,6 +479,7 @@ struct acpi_hest_aer_common {
476 479
477#define ACPI_HEST_FIRMWARE_FIRST (1) 480#define ACPI_HEST_FIRMWARE_FIRST (1)
478#define ACPI_HEST_GLOBAL (1<<1) 481#define ACPI_HEST_GLOBAL (1<<1)
482#define ACPI_HEST_GHES_ASSIST (1<<2)
479 483
480/* 484/*
481 * Macros to access the bus/segment numbers in Bus field above: 485 * Macros to access the bus/segment numbers in Bus field above:
@@ -513,7 +517,8 @@ enum acpi_hest_notify_types {
513 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ 517 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
514 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ 518 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
515 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ 519 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
516 ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */ 520 ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
521 ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
517}; 522};
518 523
519/* Values for config_write_enable bitfield above */ 524/* Values for config_write_enable bitfield above */
@@ -534,7 +539,7 @@ enum acpi_hest_notify_types {
534struct acpi_hest_ia_machine_check { 539struct acpi_hest_ia_machine_check {
535 struct acpi_hest_header header; 540 struct acpi_hest_header header;
536 u16 reserved1; 541 u16 reserved1;
537 u8 flags; 542 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
538 u8 enabled; 543 u8 enabled;
539 u32 records_to_preallocate; 544 u32 records_to_preallocate;
540 u32 max_sections_per_record; 545 u32 max_sections_per_record;
@@ -549,7 +554,7 @@ struct acpi_hest_ia_machine_check {
549struct acpi_hest_ia_corrected { 554struct acpi_hest_ia_corrected {
550 struct acpi_hest_header header; 555 struct acpi_hest_header header;
551 u16 reserved1; 556 u16 reserved1;
552 u8 flags; 557 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
553 u8 enabled; 558 u8 enabled;
554 u32 records_to_preallocate; 559 u32 records_to_preallocate;
555 u32 max_sections_per_record; 560 u32 max_sections_per_record;
@@ -686,6 +691,136 @@ struct acpi_hest_generic_data_v300 {
686#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1) 691#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
687#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2) 692#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
688 693
694/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
695
696struct acpi_hest_ia_deferred_check {
697 struct acpi_hest_header header;
698 u16 reserved1;
699 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
700 u8 enabled;
701 u32 records_to_preallocate;
702 u32 max_sections_per_record;
703 struct acpi_hest_notify notify;
704 u8 num_hardware_banks;
705 u8 reserved2[3];
706};
707
708/*******************************************************************************
709 *
710 * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
711 * Version 1
712 *
713 ******************************************************************************/
714
715struct acpi_table_hmat {
716 struct acpi_table_header header; /* Common ACPI table header */
717 u32 reserved;
718};
719
720/* Values for HMAT structure types */
721
722enum acpi_hmat_type {
723 ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
724 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
725 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
726 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
727};
728
729struct acpi_hmat_structure {
730 u16 type;
731 u16 reserved;
732 u32 length;
733};
734
735/*
736 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
737 */
738
739/* 0: Memory subystem address range */
740
741struct acpi_hmat_address_range {
742 struct acpi_hmat_structure header;
743 u16 flags;
744 u16 reserved1;
745 u32 processor_PD; /* Processor proximity domain */
746 u32 memory_PD; /* Memory proximity domain */
747 u32 reserved2;
748 u64 physical_address_base; /* Physical address range base */
749 u64 physical_address_length; /* Physical address range length */
750};
751
752/* Masks for Flags field above */
753
754#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */
755#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */
756#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
757
758/* 1: System locality latency and bandwidth information */
759
760struct acpi_hmat_locality {
761 struct acpi_hmat_structure header;
762 u8 flags;
763 u8 data_type;
764 u16 reserved1;
765 u32 number_of_initiator_Pds;
766 u32 number_of_target_Pds;
767 u32 reserved2;
768 u64 entry_base_unit;
769};
770
771/* Masks for Flags field above */
772
773#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
774
775/* Values for Memory Hierarchy flag */
776
777#define ACPI_HMAT_MEMORY 0
778#define ACPI_HMAT_LAST_LEVEL_CACHE 1
779#define ACPI_HMAT_1ST_LEVEL_CACHE 2
780#define ACPI_HMAT_2ND_LEVEL_CACHE 3
781#define ACPI_HMAT_3RD_LEVEL_CACHE 4
782
783/* Values for data_type field above */
784
785#define ACPI_HMAT_ACCESS_LATENCY 0
786#define ACPI_HMAT_READ_LATENCY 1
787#define ACPI_HMAT_WRITE_LATENCY 2
788#define ACPI_HMAT_ACCESS_BANDWIDTH 3
789#define ACPI_HMAT_READ_BANDWIDTH 4
790#define ACPI_HMAT_WRITE_BANDWIDTH 5
791
792/* 2: Memory side cache information */
793
794struct acpi_hmat_cache {
795 struct acpi_hmat_structure header;
796 u32 memory_PD;
797 u32 reserved1;
798 u64 cache_size;
799 u32 cache_attributes;
800 u16 reserved2;
801 u16 number_of_SMBIOShandles;
802};
803
804/* Masks for cache_attributes field above */
805
806#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
807#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
808#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
809#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
810#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
811
812/* Values for cache associativity flag */
813
814#define ACPI_HMAT_CA_NONE (0)
815#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
816#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
817
818/* Values for write policy flag */
819
820#define ACPI_HMAT_CP_NONE (0)
821#define ACPI_HMAT_CP_WB (1)
822#define ACPI_HMAT_CP_WT (2)
823
689/******************************************************************************* 824/*******************************************************************************
690 * 825 *
691 * MADT - Multiple APIC Description Table 826 * MADT - Multiple APIC Description Table
@@ -705,8 +840,8 @@ struct acpi_table_madt {
705 840
706/* Values for PCATCompat flag */ 841/* Values for PCATCompat flag */
707 842
708#define ACPI_MADT_DUAL_PIC 0 843#define ACPI_MADT_DUAL_PIC 1
709#define ACPI_MADT_MULTIPLE_APIC 1 844#define ACPI_MADT_MULTIPLE_APIC 0
710 845
711/* Values for MADT subtable type in struct acpi_subtable_header */ 846/* Values for MADT subtable type in struct acpi_subtable_header */
712 847
@@ -1147,6 +1282,85 @@ struct acpi_nfit_flush_address {
1147 1282
1148/******************************************************************************* 1283/*******************************************************************************
1149 * 1284 *
1285 * PPTT - Processor Properties Topology Table (ACPI 6.2)
1286 * Version 1
1287 *
1288 ******************************************************************************/
1289
1290struct acpi_table_pptt {
1291 struct acpi_table_header header; /* Common ACPI table header */
1292};
1293
1294/* Values for Type field above */
1295
1296enum acpi_pptt_type {
1297 ACPI_PPTT_TYPE_PROCESSOR = 0,
1298 ACPI_PPTT_TYPE_CACHE = 1,
1299 ACPI_PPTT_TYPE_ID = 2,
1300 ACPI_PPTT_TYPE_RESERVED = 3
1301};
1302
1303/* 0: Processor Hierarchy Node Structure */
1304
1305struct acpi_pptt_processor {
1306 struct acpi_subtable_header header;
1307 u16 reserved;
1308 u32 flags;
1309 u32 parent;
1310 u32 acpi_processor_id;
1311 u32 number_of_priv_resources;
1312};
1313
1314/* Flags */
1315
1316#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
1317#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
1318
1319/* 1: Cache Type Structure */
1320
1321struct acpi_pptt_cache {
1322 struct acpi_subtable_header header;
1323 u16 reserved;
1324 u32 flags;
1325 u32 next_level_of_cache;
1326 u32 size;
1327 u32 number_of_sets;
1328 u8 associativity;
1329 u8 attributes;
1330 u16 line_size;
1331};
1332
1333/* Flags */
1334
1335#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
1336#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
1337#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
1338#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
1339#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
1340#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
1341#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
1342
1343/* Masks for Attributes */
1344
1345#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
1346#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
1347#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
1348
1349/* 2: ID Structure */
1350
1351struct acpi_pptt_id {
1352 struct acpi_subtable_header header;
1353 u16 reserved;
1354 u32 vendor_id;
1355 u64 level1_id;
1356 u64 level2_id;
1357 u16 major_rev;
1358 u16 minor_rev;
1359 u16 spin_rev;
1360};
1361
1362/*******************************************************************************
1363 *
1150 * SBST - Smart Battery Specification Table 1364 * SBST - Smart Battery Specification Table
1151 * Version 1 1365 * Version 1
1152 * 1366 *
@@ -1192,7 +1406,8 @@ enum acpi_srat_type {
1192 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, 1406 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
1193 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, 1407 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
1194 ACPI_SRAT_TYPE_GICC_AFFINITY = 3, 1408 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
1195 ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */ 1409 ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
1410 ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
1196}; 1411};
1197 1412
1198/* 1413/*
@@ -1264,6 +1479,15 @@ struct acpi_srat_gicc_affinity {
1264 1479
1265#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ 1480#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
1266 1481
1482/* 4: GCC ITS Affinity (ACPI 6.2) */
1483
1484struct acpi_srat_gic_its_affinity {
1485 struct acpi_subtable_header header;
1486 u32 proximity_domain;
1487 u16 reserved;
1488 u32 its_id;
1489};
1490
1267/* Reset to default packing */ 1491/* Reset to default packing */
1268 1492
1269#pragma pack() 1493#pragma pack()
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index faa9f2c0d5de..707dda74c272 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -87,6 +87,7 @@
87#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ 87#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
88#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ 88#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
89#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 89#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
90#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */
90#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */ 91#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */
91 92
92#ifdef ACPI_UNDEFINED_TABLES 93#ifdef ACPI_UNDEFINED_TABLES
@@ -1220,7 +1221,8 @@ enum acpi_spmi_interface_types {
1220 * Version 2 1221 * Version 2
1221 * 1222 *
1222 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1223 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1223 * December 19, 2014 1224 * Version 1.2, Revision 8
1225 * February 27, 2017
1224 * 1226 *
1225 * NOTE: There are two versions of the table with the same signature -- 1227 * NOTE: There are two versions of the table with the same signature --
1226 * the client version and the server version. The common platform_class 1228 * the client version and the server version. The common platform_class
@@ -1283,7 +1285,8 @@ struct acpi_table_tcpa_server {
1283 * Version 4 1285 * Version 4
1284 * 1286 *
1285 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1287 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1286 * December 19, 2014 1288 * Version 1.2, Revision 8
1289 * February 27, 2017
1287 * 1290 *
1288 ******************************************************************************/ 1291 ******************************************************************************/
1289 1292
@@ -1304,7 +1307,36 @@ struct acpi_table_tpm2 {
1304#define ACPI_TPM2_MEMORY_MAPPED 6 1307#define ACPI_TPM2_MEMORY_MAPPED 6
1305#define ACPI_TPM2_COMMAND_BUFFER 7 1308#define ACPI_TPM2_COMMAND_BUFFER 7
1306#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 1309#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8
1307#define ACPI_TPM2_COMMAND_BUFFER_WITH_SMC 11 1310#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */
1311
1312/* Trailer appears after any start_method subtables */
1313
1314struct acpi_tpm2_trailer {
1315 u32 minimum_log_length; /* Minimum length for the event log area */
1316 u64 log_address; /* Address of the event log area */
1317};
1318
1319/*
1320 * Subtables (start_method-specific)
1321 */
1322
1323/* 11: Start Method for ARM SMC (V1.2 Rev 8) */
1324
1325struct acpi_tpm2_arm_smc {
1326 u32 global_interrupt;
1327 u8 interrupt_flags;
1328 u8 operation_flags;
1329 u16 reserved;
1330 u32 function_id;
1331};
1332
1333/* Values for interrupt_flags above */
1334
1335#define ACPI_TPM2_INTERRUPT_SUPPORT (1)
1336
1337/* Values for operation_flags above */
1338
1339#define ACPI_TPM2_IDLE_SUPPORT (1)
1308 1340
1309/******************************************************************************* 1341/*******************************************************************************
1310 * 1342 *
@@ -1498,6 +1530,27 @@ struct acpi_table_wdrt {
1498 u8 units; 1530 u8 units;
1499}; 1531};
1500 1532
1533/*******************************************************************************
1534 *
1535 * WSMT - Windows SMM Security Migrations Table
1536 * Version 1
1537 *
1538 * Conforms to "Windows SMM Security Migrations Table",
1539 * Version 1.0, April 18, 2016
1540 *
1541 ******************************************************************************/
1542
1543struct acpi_table_wsmt {
1544 struct acpi_table_header header; /* Common ACPI table header */
1545 u32 protection_flags;
1546};
1547
1548/* Flags for protection_flags field above */
1549
1550#define ACPI_WSMT_FIXED_COMM_BUFFERS (1)
1551#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
1552#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION (4)
1553
1501/* Reset to default packing */ 1554/* Reset to default packing */
1502 1555
1503#pragma pack() 1556#pragma pack()
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index 94414b255a38..5bde2e700530 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -116,6 +116,11 @@ struct acpi_table_bgrt {
116 u32 image_offset_y; 116 u32 image_offset_y;
117}; 117};
118 118
119/* Flags for Status field above */
120
121#define ACPI_BGRT_DISPLAYED (1)
122#define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1)
123
119/******************************************************************************* 124/*******************************************************************************
120 * 125 *
121 * DRTM - Dynamic Root of Trust for Measurement table 126 * DRTM - Dynamic Root of Trust for Measurement table
@@ -462,7 +467,7 @@ struct acpi_mpst_shared {
462/******************************************************************************* 467/*******************************************************************************
463 * 468 *
464 * PCCT - Platform Communications Channel Table (ACPI 5.0) 469 * PCCT - Platform Communications Channel Table (ACPI 5.0)
465 * Version 1 470 * Version 2 (ACPI 6.2)
466 * 471 *
467 ******************************************************************************/ 472 ******************************************************************************/
468 473
@@ -482,7 +487,9 @@ enum acpi_pcct_type {
482 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 487 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
483 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, 488 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
484 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ 489 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
485 ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 490 ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
491 ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
492 ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
486}; 493};
487 494
488/* 495/*
@@ -508,7 +515,7 @@ struct acpi_pcct_subspace {
508 515
509struct acpi_pcct_hw_reduced { 516struct acpi_pcct_hw_reduced {
510 struct acpi_subtable_header header; 517 struct acpi_subtable_header header;
511 u32 doorbell_interrupt; 518 u32 platform_interrupt;
512 u8 flags; 519 u8 flags;
513 u8 reserved; 520 u8 reserved;
514 u64 base_address; 521 u64 base_address;
@@ -525,7 +532,7 @@ struct acpi_pcct_hw_reduced {
525 532
526struct acpi_pcct_hw_reduced_type2 { 533struct acpi_pcct_hw_reduced_type2 {
527 struct acpi_subtable_header header; 534 struct acpi_subtable_header header;
528 u32 doorbell_interrupt; 535 u32 platform_interrupt;
529 u8 flags; 536 u8 flags;
530 u8 reserved; 537 u8 reserved;
531 u64 base_address; 538 u64 base_address;
@@ -536,11 +543,67 @@ struct acpi_pcct_hw_reduced_type2 {
536 u32 latency; 543 u32 latency;
537 u32 max_access_rate; 544 u32 max_access_rate;
538 u16 min_turnaround_time; 545 u16 min_turnaround_time;
539 struct acpi_generic_address doorbell_ack_register; 546 struct acpi_generic_address platform_ack_register;
540 u64 ack_preserve_mask; 547 u64 ack_preserve_mask;
541 u64 ack_write_mask; 548 u64 ack_write_mask;
542}; 549};
543 550
551/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
552
553struct acpi_pcct_ext_pcc_master {
554 struct acpi_subtable_header header;
555 u32 platform_interrupt;
556 u8 flags;
557 u8 reserved1;
558 u64 base_address;
559 u32 length;
560 struct acpi_generic_address doorbell_register;
561 u64 preserve_mask;
562 u64 write_mask;
563 u32 latency;
564 u32 max_access_rate;
565 u32 min_turnaround_time;
566 struct acpi_generic_address platform_ack_register;
567 u64 ack_preserve_mask;
568 u64 ack_set_mask;
569 u64 reserved2;
570 struct acpi_generic_address cmd_complete_register;
571 u64 cmd_complete_mask;
572 struct acpi_generic_address cmd_update_register;
573 u64 cmd_update_preserve_mask;
574 u64 cmd_update_set_mask;
575 struct acpi_generic_address error_status_register;
576 u64 error_status_mask;
577};
578
579/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
580
581struct acpi_pcct_ext_pcc_slave {
582 struct acpi_subtable_header header;
583 u32 platform_interrupt;
584 u8 flags;
585 u8 reserved1;
586 u64 base_address;
587 u32 length;
588 struct acpi_generic_address doorbell_register;
589 u64 preserve_mask;
590 u64 write_mask;
591 u32 latency;
592 u32 max_access_rate;
593 u32 min_turnaround_time;
594 struct acpi_generic_address platform_ack_register;
595 u64 ack_preserve_mask;
596 u64 ack_set_mask;
597 u64 reserved2;
598 struct acpi_generic_address cmd_complete_register;
599 u64 cmd_complete_mask;
600 struct acpi_generic_address cmd_update_register;
601 u64 cmd_update_preserve_mask;
602 u64 cmd_update_set_mask;
603 struct acpi_generic_address error_status_register;
604 u64 error_status_mask;
605};
606
544/* Values for doorbell flags above */ 607/* Values for doorbell flags above */
545 608
546#define ACPI_PCCT_INTERRUPT_POLARITY (1) 609#define ACPI_PCCT_INTERRUPT_POLARITY (1)
@@ -558,6 +621,15 @@ struct acpi_pcct_shared_memory {
558 u16 status; 621 u16 status;
559}; 622};
560 623
624/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
625
626struct acpi_pcct_ext_pcc_shared_memory {
627 u32 signature;
628 u32 flags;
629 u32 length;
630 u32 command;
631};
632
561/******************************************************************************* 633/*******************************************************************************
562 * 634 *
563 * PMTT - Platform Memory Topology Table (ACPI 5.0) 635 * PMTT - Platform Memory Topology Table (ACPI 5.0)
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index d549e31c6d18..2fcbaec8b368 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -47,9 +47,9 @@
47/* acpisrc:struct_defs -- for acpisrc conversion */ 47/* acpisrc:struct_defs -- for acpisrc conversion */
48 48
49/* 49/*
50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent
51 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of 51 * header and must be either 32 or 64. 16-bit ACPICA is no longer
52 * 12/2006. 52 * supported, as of 12/2006.
53 */ 53 */
54#ifndef ACPI_MACHINE_WIDTH 54#ifndef ACPI_MACHINE_WIDTH
55#error ACPI_MACHINE_WIDTH not defined 55#error ACPI_MACHINE_WIDTH not defined
@@ -87,9 +87,9 @@
87 * s64 64-bit (8 byte) signed value 87 * s64 64-bit (8 byte) signed value
88 * 88 *
89 * COMPILER_DEPENDENT_UINT64/s64 - These types are defined in the 89 * COMPILER_DEPENDENT_UINT64/s64 - These types are defined in the
90 * compiler-dependent header(s) and were introduced because there is no common 90 * compiler-dependent header(s) and were introduced because there is no
91 * 64-bit integer type across the various compilation models, as shown in 91 * common 64-bit integer type across the various compilation models, as
92 * the table below. 92 * shown in the table below.
93 * 93 *
94 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit 94 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
95 * char 8 8 8 8 8 8 95 * char 8 8 8 8 8 8
@@ -106,10 +106,10 @@
106 * 2) These types represent the native word size of the target mode of the 106 * 2) These types represent the native word size of the target mode of the
107 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are 107 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
108 * usually used for memory allocation, efficient loop counters, and array 108 * usually used for memory allocation, efficient loop counters, and array
109 * indexes. The types are similar to the size_t type in the C library and are 109 * indexes. The types are similar to the size_t type in the C library and
110 * required because there is no C type that consistently represents the native 110 * are required because there is no C type that consistently represents the
111 * data width. acpi_size is needed because there is no guarantee that a 111 * native data width. acpi_size is needed because there is no guarantee
112 * kernel-level C library is present. 112 * that a kernel-level C library is present.
113 * 113 *
114 * acpi_size 16/32/64-bit unsigned value 114 * acpi_size 16/32/64-bit unsigned value
115 * acpi_native_int 16/32/64-bit signed value 115 * acpi_native_int 16/32/64-bit signed value
@@ -169,9 +169,10 @@ typedef u64 acpi_physical_address;
169 169
170/* 170/*
171 * In the case of the Itanium Processor Family (IPF), the hardware does not 171 * In the case of the Itanium Processor Family (IPF), the hardware does not
172 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 172 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
173 * to indicate that special precautions must be taken to avoid alignment faults. 173 * flag to indicate that special precautions must be taken to avoid alignment
174 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 174 * faults. (IA64 or ia64 is currently used by existing compilers to indicate
175 * IPF.)
175 * 176 *
176 * Note: EM64T and other X86-64 processors support misaligned transfers, 177 * Note: EM64T and other X86-64 processors support misaligned transfers,
177 * so there is no need to define this flag. 178 * so there is no need to define this flag.
@@ -309,8 +310,8 @@ typedef u64 acpi_physical_address;
309#endif 310#endif
310 311
311/* 312/*
312 * Some compilers complain about unused variables. Sometimes we don't want to 313 * Some compilers complain about unused variables. Sometimes we don't want
313 * use all the variables (for example, _acpi_module_name). This allows us 314 * to use all the variables (for example, _acpi_module_name). This allows us
314 * to tell the compiler in a per-variable manner that a variable 315 * to tell the compiler in a per-variable manner that a variable
315 * is unused 316 * is unused
316 */ 317 */
@@ -319,8 +320,9 @@ typedef u64 acpi_physical_address;
319#endif 320#endif
320 321
321/* 322/*
322 * All ACPICA external functions that are available to the rest of the kernel 323 * All ACPICA external functions that are available to the rest of the
323 * are tagged with thes macros which can be defined as appropriate for the host. 324 * kernel are tagged with these macros which can be defined as appropriate
325 * for the host.
324 * 326 *
325 * Notes: 327 * Notes:
326 * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination 328 * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
@@ -383,7 +385,8 @@ typedef u64 acpi_physical_address;
383 385
384/****************************************************************************** 386/******************************************************************************
385 * 387 *
386 * ACPI Specification constants (Do not change unless the specification changes) 388 * ACPI Specification constants (Do not change unless the specification
389 * changes)
387 * 390 *
388 *****************************************************************************/ 391 *****************************************************************************/
389 392
@@ -484,10 +487,10 @@ typedef u8 acpi_owner_id;
484#define ACPI_DO_NOT_WAIT 0 487#define ACPI_DO_NOT_WAIT 0
485 488
486/* 489/*
487 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. 490 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are
488 * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this 491 * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits.
489 * pertains to the ACPI integer type only, not to other integers used in the 492 * Note that this pertains to the ACPI integer type only, not to other
490 * implementation of the ACPICA subsystem. 493 * integers used in the implementation of the ACPICA subsystem.
491 * 494 *
492 * 01/2010: This type is obsolete and has been removed from the entire ACPICA 495 * 01/2010: This type is obsolete and has been removed from the entire ACPICA
493 * code base. It remains here for compatibility with device drivers that use 496 * code base. It remains here for compatibility with device drivers that use
@@ -629,8 +632,9 @@ typedef u64 acpi_integer;
629#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B 632#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B
630#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 633#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
631#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D 634#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
635#define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E
632 636
633#define ACPI_GENERIC_NOTIFY_MAX 0x0D 637#define ACPI_GENERIC_NOTIFY_MAX 0x0E
634#define ACPI_SPECIFIC_NOTIFY_MAX 0x84 638#define ACPI_SPECIFIC_NOTIFY_MAX 0x84
635 639
636/* 640/*
@@ -667,10 +671,11 @@ typedef u32 acpi_object_type;
667 671
668/* 672/*
669 * These are object types that do not map directly to the ACPI 673 * These are object types that do not map directly to the ACPI
670 * object_type() operator. They are used for various internal purposes only. 674 * object_type() operator. They are used for various internal purposes
671 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these 675 * only. If new predefined ACPI_TYPEs are added (via the ACPI
672 * internal types must move upwards. (There is code that depends on these 676 * specification), these internal types must move upwards. (There
673 * values being contiguous with the external types above.) 677 * is code that depends on these values being contiguous with the
678 * external types above.)
674 */ 679 */
675#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 680#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
676#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 681#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
@@ -770,7 +775,7 @@ typedef u32 acpi_event_status;
770 * | | | | +-- Type of dispatch:to method, handler, notify, or none 775 * | | | | +-- Type of dispatch:to method, handler, notify, or none
771 * | | | +----- Interrupt type: edge or level triggered 776 * | | | +----- Interrupt type: edge or level triggered
772 * | | +------- Is a Wake GPE 777 * | | +------- Is a Wake GPE
773 * | +--------- Is GPE masked by the software GPE masking machanism 778 * | +--------- Is GPE masked by the software GPE masking mechanism
774 * +------------ <Reserved> 779 * +------------ <Reserved>
775 */ 780 */
776#define ACPI_GPE_DISPATCH_NONE (u8) 0x00 781#define ACPI_GPE_DISPATCH_NONE (u8) 0x00
@@ -908,8 +913,8 @@ struct acpi_sleep_functions {
908 */ 913 */
909 914
910/* 915/*
911 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element 916 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package
912 * or an unresolved named reference. 917 * element or an unresolved named reference.
913 */ 918 */
914union acpi_object { 919union acpi_object {
915 acpi_object_type type; /* See definition of acpi_ns_type for values */ 920 acpi_object_type type; /* See definition of acpi_ns_type for values */
@@ -1166,7 +1171,7 @@ struct acpi_pnp_device_id_list {
1166 1171
1167/* 1172/*
1168 * Structure returned from acpi_get_object_info. 1173 * Structure returned from acpi_get_object_info.
1169 * Optimized for both 32- and 64-bit builds 1174 * Optimized for both 32-bit and 64-bit builds.
1170 */ 1175 */
1171struct acpi_device_info { 1176struct acpi_device_info {
1172 u32 info_size; /* Size of info, including ID strings */ 1177 u32 info_size; /* Size of info, including ID strings */
diff --git a/include/acpi/acuuid.h b/include/acpi/acuuid.h
index 699a1999afe8..b1a0a8a64c3d 100644
--- a/include/acpi/acuuid.h
+++ b/include/acpi/acuuid.h
@@ -78,6 +78,11 @@
78#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" 78#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9"
79#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" 79#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d"
80 80
81/* Processor Properties (ACPI 6.2) */
82
83#define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D"
84#define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7"
85
81/* Miscellaneous */ 86/* Miscellaneous */
82 87
83#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" 88#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 09994b063243..912563c66948 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -382,4 +382,8 @@
382#define ACPI_INIT_FUNCTION 382#define ACPI_INIT_FUNCTION
383#endif 383#endif
384 384
385#ifndef ACPI_STRUCT_INIT
386#define ACPI_STRUCT_INIT(field, value) value
387#endif
388
385#endif /* __ACENV_H__ */ 389#endif /* __ACENV_H__ */
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index e877a35ee977..97a7e21cfbe0 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -48,7 +48,17 @@
48 * Use compiler specific <stdarg.h> is a good practice for even when 48 * Use compiler specific <stdarg.h> is a good practice for even when
49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. 49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
50 */ 50 */
51#ifndef va_arg
52#ifdef ACPI_USE_BUILTIN_STDARG
53typedef __builtin_va_list va_list;
54#define va_start(v, l) __builtin_va_start(v, l)
55#define va_end(v) __builtin_va_end(v)
56#define va_arg(v, l) __builtin_va_arg(v, l)
57#define va_copy(d, s) __builtin_va_copy(d, s)
58#else
51#include <stdarg.h> 59#include <stdarg.h>
60#endif
61#endif
52 62
53#define ACPI_INLINE __inline__ 63#define ACPI_INLINE __inline__
54 64
diff --git a/include/acpi/platform/acintel.h b/include/acpi/platform/acintel.h
index 17bd3b7b4e5a..bdb6858e2458 100644
--- a/include/acpi/platform/acintel.h
+++ b/include/acpi/platform/acintel.h
@@ -48,7 +48,9 @@
48 * Use compiler specific <stdarg.h> is a good practice for even when 48 * Use compiler specific <stdarg.h> is a good practice for even when
49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. 49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
50 */ 50 */
51#ifndef va_arg
51#include <stdarg.h> 52#include <stdarg.h>
53#endif
52 54
53/* Configuration specific to Intel 64-bit C compiler */ 55/* Configuration specific to Intel 64-bit C compiler */
54 56
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index a39e3f67616f..047f13865608 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -178,6 +178,8 @@
178#define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): " 178#define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): "
179#define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): " 179#define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): "
180 180
181#define ACPI_STRUCT_INIT(field, value) .field = value
182
181#else /* !__KERNEL__ */ 183#else /* !__KERNEL__ */
182 184
183#define ACPI_USE_STANDARD_HEADERS 185#define ACPI_USE_STANDARD_HEADERS
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c
index c04e8fea2c60..025c1b07049d 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixxf.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c
@@ -750,9 +750,9 @@ acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 msec_timeout)
750{ 750{
751 acpi_status status = AE_OK; 751 acpi_status status = AE_OK;
752 sem_t *sem = (sem_t *) handle; 752 sem_t *sem = (sem_t *) handle;
753 int ret_val;
753#ifndef ACPI_USE_ALTERNATE_TIMEOUT 754#ifndef ACPI_USE_ALTERNATE_TIMEOUT
754 struct timespec time; 755 struct timespec time;
755 int ret_val;
756#endif 756#endif
757 757
758 if (!sem) { 758 if (!sem) {
@@ -778,7 +778,10 @@ acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 msec_timeout)
778 778
779 case ACPI_WAIT_FOREVER: 779 case ACPI_WAIT_FOREVER:
780 780
781 if (sem_wait(sem)) { 781 while (((ret_val = sem_wait(sem)) == -1) && (errno == EINTR)) {
782 continue; /* Restart if interrupted */
783 }
784 if (ret_val != 0) {
782 status = (AE_TIME); 785 status = (AE_TIME);
783 } 786 }
784 break; 787 break;
@@ -831,7 +834,8 @@ acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 msec_timeout)
831 834
832 while (((ret_val = sem_timedwait(sem, &time)) == -1) 835 while (((ret_val = sem_timedwait(sem, &time)) == -1)
833 && (errno == EINTR)) { 836 && (errno == EINTR)) {
834 continue; 837 continue; /* Restart if interrupted */
838
835 } 839 }
836 840
837 if (ret_val != 0) { 841 if (ret_val != 0) {