aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/Makefile8
-rw-r--r--drivers/acpi/acpica/aclocal.h18
-rw-r--r--drivers/acpi/acpica/acpredef.h16
-rw-r--r--drivers/acpi/acpica/acutils.h9
-rw-r--r--drivers/acpi/acpica/exdebug.c11
-rw-r--r--drivers/acpi/acpica/exdump.c6
-rw-r--r--drivers/acpi/acpica/exfield.c22
-rw-r--r--drivers/acpi/acpica/utdecode.c32
-rw-r--r--drivers/acpi/acpica/utfileio.c3
-rw-r--r--drivers/acpi/acpica/uthex.c100
-rw-r--r--drivers/acpi/acpica/utprint.c9
-rw-r--r--drivers/acpi/acpica/utuuid.c96
-rw-r--r--drivers/iommu/dmar.c28
-rw-r--r--include/acpi/acconfig.h18
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/actbl.h12
-rw-r--r--include/acpi/actbl1.h44
-rw-r--r--include/acpi/actbl2.h14
-rw-r--r--include/acpi/actbl3.h118
-rw-r--r--include/acpi/actypes.h5
21 files changed, 468 insertions, 104 deletions
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index 4be4cc94572d..c1a963581dc0 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -157,6 +157,7 @@ acpi-y += \
157 uterror.o \ 157 uterror.o \
158 uteval.o \ 158 uteval.o \
159 utglobal.o \ 159 utglobal.o \
160 uthex.o \
160 utids.o \ 161 utids.o \
161 utinit.o \ 162 utinit.o \
162 utlock.o \ 163 utlock.o \
@@ -175,5 +176,10 @@ acpi-y += \
175 utxferror.o \ 176 utxferror.o \
176 utxfmutex.o 177 utxfmutex.o
177 178
178acpi-$(ACPI_FUTURE_USAGE) += utfileio.o utprint.o uttrack.o utcache.o 179acpi-$(ACPI_FUTURE_USAGE) += \
180 utcache.o \
181 utfileio.o \
182 utprint.o \
183 uttrack.o \
184 utuuid.o
179 185
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 91f801a2e689..1f9aba5fb81f 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -730,12 +730,13 @@ union acpi_parse_value {
730#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ 730#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
731#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ 731#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
732#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ 732#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
733#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */ 733#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
734#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */ 734#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
735#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a Lnot_equal (etc.) pair of opcodes */ 735#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
736#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a Lnot_equal (etc.) pair of opcodes */ 736#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a Lnot_equal (etc.) pair of opcodes */
737#define ACPI_DASM_HID_STRING 0x09 /* String is a _HID or _CID */ 737#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a Lnot_equal (etc.) pair of opcodes */
738#define ACPI_DASM_IGNORE 0x0A /* Not used at this time */ 738#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
739#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
739 740
740/* 741/*
741 * Generic operation (for example: If, While, Store) 742 * Generic operation (for example: If, While, Store)
@@ -1154,4 +1155,9 @@ struct ah_device_id {
1154 char *description; 1155 char *description;
1155}; 1156};
1156 1157
1158struct ah_uuid {
1159 char *description;
1160 char *string;
1161};
1162
1157#endif /* __ACLOCAL_H__ */ 1163#endif /* __ACLOCAL_H__ */
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index bd08817cafd8..bd3908d26c4f 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -105,6 +105,11 @@
105 * count = 0 (optional) 105 * count = 0 (optional)
106 * (Used for _DLM) 106 * (Used for _DLM)
107 * 107 *
108 * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
109 * defines the format of the package. Zero-length parent package is
110 * allowed.
111 * (Used for _DSD)
112 *
108 *****************************************************************************/ 113 *****************************************************************************/
109 114
110enum acpi_return_package_types { 115enum acpi_return_package_types {
@@ -117,7 +122,8 @@ enum acpi_return_package_types {
117 ACPI_PTYPE2_FIXED = 7, 122 ACPI_PTYPE2_FIXED = 7,
118 ACPI_PTYPE2_MIN = 8, 123 ACPI_PTYPE2_MIN = 8,
119 ACPI_PTYPE2_REV_FIXED = 9, 124 ACPI_PTYPE2_REV_FIXED = 9,
120 ACPI_PTYPE2_FIX_VAR = 10 125 ACPI_PTYPE2_FIX_VAR = 10,
126 ACPI_PTYPE2_UUID_PAIR = 11
121}; 127};
122 128
123/* Support macros for users of the predefined info table */ 129/* Support macros for users of the predefined info table */
@@ -364,6 +370,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
364 {{"_CBA", METHOD_0ARGS, 370 {{"_CBA", METHOD_0ARGS,
365 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */ 371 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
366 372
373 {{"_CCA", METHOD_0ARGS,
374 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
375
367 {{"_CDM", METHOD_0ARGS, 376 {{"_CDM", METHOD_0ARGS,
368 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 377 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
369 378
@@ -436,6 +445,11 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
436 {{"_DOS", METHOD_1ARGS(ACPI_TYPE_INTEGER), 445 {{"_DOS", METHOD_1ARGS(ACPI_TYPE_INTEGER),
437 METHOD_NO_RETURN_VALUE}}, 446 METHOD_NO_RETURN_VALUE}},
438 447
448 {{"_DSD", METHOD_0ARGS,
449 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
450 PACKAGE_INFO(ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1,
451 ACPI_RTYPE_PACKAGE, 1, 0),
452
439 {{"_DSM", 453 {{"_DSM",
440 METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, 454 METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER,
441 ACPI_TYPE_PACKAGE), 455 ACPI_TYPE_PACKAGE),
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index ed614f4b2182..486d342e74b6 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -194,6 +194,8 @@ char *acpi_ut_get_event_name(u32 event_id);
194 194
195char acpi_ut_hex_to_ascii_char(u64 integer, u32 position); 195char acpi_ut_hex_to_ascii_char(u64 integer, u32 position);
196 196
197u8 acpi_ut_ascii_char_to_hex(int hex_char);
198
197u8 acpi_ut_valid_object_type(acpi_object_type type); 199u8 acpi_ut_valid_object_type(acpi_object_type type);
198 200
199/* 201/*
@@ -759,6 +761,8 @@ const struct ah_predefined_name *acpi_ah_match_predefined_name(char *nameseg);
759 761
760const struct ah_device_id *acpi_ah_match_hardware_id(char *hid); 762const struct ah_device_id *acpi_ah_match_hardware_id(char *hid);
761 763
764const char *acpi_ah_match_uuid(u8 *data);
765
762/* 766/*
763 * utprint - printf/vprintf output functions 767 * utprint - printf/vprintf output functions
764 */ 768 */
@@ -778,4 +782,9 @@ int acpi_ut_file_vprintf(ACPI_FILE file, const char *format, va_list args);
778int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...); 782int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...);
779#endif 783#endif
780 784
785/*
786 * utuuid -- UUID support functions
787 */
788void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
789
781#endif /* _ACUTILS_H */ 790#endif /* _ACUTILS_H */
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index 4cfc3d3b5c97..6fbfad47518c 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -75,6 +75,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
75 u32 level, u32 index) 75 u32 level, u32 index)
76{ 76{
77 u32 i; 77 u32 i;
78 u32 timer;
78 79
79 ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); 80 ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
80 81
@@ -86,11 +87,19 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
86 } 87 }
87 88
88 /* 89 /*
90 * We will emit the current timer value (in microseconds) with each
91 * debug output. Only need the lower 26 bits. This allows for 67
92 * million microseconds or 67 seconds before rollover.
93 */
94 timer = ((u32)acpi_os_get_timer() / 10); /* (100 nanoseconds to microseconds) */
95 timer &= 0x03FFFFFF;
96
97 /*
89 * Print line header as long as we are not in the middle of an 98 * Print line header as long as we are not in the middle of an
90 * object display 99 * object display
91 */ 100 */
92 if (!((level > 0) && index == 0)) { 101 if (!((level > 0) && index == 0)) {
93 acpi_os_printf("[ACPI Debug] %*s", level, " "); 102 acpi_os_printf("[ACPI Debug %.8u] %*s", timer, level, " ");
94 } 103 }
95 104
96 /* Display the index for package output only */ 105 /* Display the index for package output only */
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 925202acc3e4..0f23c3f2678e 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -494,7 +494,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
494 } 494 }
495 } 495 }
496 496
497 acpi_os_printf("\n", next); 497 acpi_os_printf("\n");
498 break; 498 break;
499 499
500 case ACPI_EXD_HDLR_LIST: 500 case ACPI_EXD_HDLR_LIST:
@@ -528,7 +528,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
528 } 528 }
529 } 529 }
530 530
531 acpi_os_printf("\n", next); 531 acpi_os_printf("\n");
532 break; 532 break;
533 533
534 case ACPI_EXD_RGN_LIST: 534 case ACPI_EXD_RGN_LIST:
@@ -562,7 +562,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
562 } 562 }
563 } 563 }
564 564
565 acpi_os_printf("\n", next); 565 acpi_os_printf("\n");
566 break; 566 break;
567 567
568 case ACPI_EXD_NODE: 568 case ACPI_EXD_NODE:
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index 1ff42c07b42b..6907ce0c704c 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -186,12 +186,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
186 access_length); 186 access_length);
187 187
188 /* 188 /*
189 * Add additional 2 bytes for modeled generic_serial_bus data buffer: 189 * Add additional 2 bytes for the generic_serial_bus data buffer:
190 * typedef struct { 190 *
191 * BYTEStatus; // Byte 0 of the data buffer 191 * Status; (Byte 0 of the data buffer)
192 * BYTELength; // Byte 1 of the data buffer 192 * Length; (Byte 1 of the data buffer)
193 * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 193 * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
194 * }
195 */ 194 */
196 length += 2; 195 length += 2;
197 function = ACPI_READ | (accessor_type << 16); 196 function = ACPI_READ | (accessor_type << 16);
@@ -368,12 +367,11 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
368 access_length); 367 access_length);
369 368
370 /* 369 /*
371 * Add additional 2 bytes for modeled generic_serial_bus data buffer: 370 * Add additional 2 bytes for the generic_serial_bus data buffer:
372 * typedef struct { 371 *
373 * BYTEStatus; // Byte 0 of the data buffer 372 * Status; (Byte 0 of the data buffer)
374 * BYTELength; // Byte 1 of the data buffer 373 * Length; (Byte 1 of the data buffer)
375 * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 374 * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
376 * }
377 */ 375 */
378 length += 2; 376 length += 2;
379 function = ACPI_WRITE | (accessor_type << 16); 377 function = ACPI_WRITE | (accessor_type << 16);
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 90ec37c473c6..40e923e675fc 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -88,33 +88,6 @@ const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES] = {
88 88
89/******************************************************************************* 89/*******************************************************************************
90 * 90 *
91 * FUNCTION: acpi_ut_hex_to_ascii_char
92 *
93 * PARAMETERS: integer - Contains the hex digit
94 * position - bit position of the digit within the
95 * integer (multiple of 4)
96 *
97 * RETURN: The converted Ascii character
98 *
99 * DESCRIPTION: Convert a hex digit to an Ascii character
100 *
101 ******************************************************************************/
102
103/* Hex to ASCII conversion table */
104
105static const char acpi_gbl_hex_to_ascii[] = {
106 '0', '1', '2', '3', '4', '5', '6', '7',
107 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
108};
109
110char acpi_ut_hex_to_ascii_char(u64 integer, u32 position)
111{
112
113 return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]);
114}
115
116/*******************************************************************************
117 *
118 * FUNCTION: acpi_ut_get_region_name 91 * FUNCTION: acpi_ut_get_region_name
119 * 92 *
120 * PARAMETERS: Space ID - ID for the region 93 * PARAMETERS: Space ID - ID for the region
@@ -475,7 +448,8 @@ static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
475 /* 09 */ "Device PLD Check", 448 /* 09 */ "Device PLD Check",
476 /* 0A */ "Reserved", 449 /* 0A */ "Reserved",
477 /* 0B */ "System Locality Update", 450 /* 0B */ "System Locality Update",
478 /* 0C */ "Shutdown Request" 451 /* 0C */ "Shutdown Request",
452 /* 0D */ "System Resource Affinity Update"
479}; 453};
480 454
481static const char *acpi_gbl_device_notify[4] = { 455static const char *acpi_gbl_device_notify[4] = {
@@ -502,7 +476,7 @@ static const char *acpi_gbl_thermal_notify[4] = {
502const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type) 476const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
503{ 477{
504 478
505 /* 00 - 0C are common to all object types */ 479 /* 00 - 0D are common to all object types */
506 480
507 if (notify_value <= ACPI_NOTIFY_MAX) { 481 if (notify_value <= ACPI_NOTIFY_MAX) {
508 return (acpi_gbl_generic_notify[notify_value]); 482 return (acpi_gbl_generic_notify[notify_value]);
diff --git a/drivers/acpi/acpica/utfileio.c b/drivers/acpi/acpica/utfileio.c
index bdf9914733cb..4e263a8cc6f0 100644
--- a/drivers/acpi/acpica/utfileio.c
+++ b/drivers/acpi/acpica/utfileio.c
@@ -201,8 +201,7 @@ acpi_ut_read_table(FILE * fp,
201 status = fl_check_for_ascii(fp, NULL, FALSE); 201 status = fl_check_for_ascii(fp, NULL, FALSE);
202 if (ACPI_SUCCESS(status)) { 202 if (ACPI_SUCCESS(status)) {
203 acpi_os_printf 203 acpi_os_printf
204 ("File appears to be ASCII only, must be binary\n", 204 ("File appears to be ASCII only, must be binary\n");
205 table_header.length, file_size);
206 } 205 }
207#endif 206#endif
208 return (AE_BAD_HEADER); 207 return (AE_BAD_HEADER);
diff --git a/drivers/acpi/acpica/uthex.c b/drivers/acpi/acpica/uthex.c
new file mode 100644
index 000000000000..9afa9441b183
--- /dev/null
+++ b/drivers/acpi/acpica/uthex.c
@@ -0,0 +1,100 @@
1/******************************************************************************
2 *
3 * Module Name: uthex -- Hex/ASCII support functions
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2014, 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
47#define _COMPONENT ACPI_COMPILER
48ACPI_MODULE_NAME("uthex")
49
50/* Hex to ASCII conversion table */
51static char acpi_gbl_hex_to_ascii[] = {
52 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
53 'E', 'F'
54};
55
56/*******************************************************************************
57 *
58 * FUNCTION: acpi_ut_hex_to_ascii_char
59 *
60 * PARAMETERS: integer - Contains the hex digit
61 * position - bit position of the digit within the
62 * integer (multiple of 4)
63 *
64 * RETURN: The converted Ascii character
65 *
66 * DESCRIPTION: Convert a hex digit to an Ascii character
67 *
68 ******************************************************************************/
69
70char acpi_ut_hex_to_ascii_char(u64 integer, u32 position)
71{
72
73 return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]);
74}
75
76/*******************************************************************************
77 *
78 * FUNCTION: acpi_ut_hex_char_to_value
79 *
80 * PARAMETERS: ascii_char - Hex character in Ascii
81 *
82 * RETURN: The binary value of the ascii/hex character
83 *
84 * DESCRIPTION: Perform ascii-to-hex translation
85 *
86 ******************************************************************************/
87
88u8 acpi_ut_ascii_char_to_hex(int hex_char)
89{
90
91 if (hex_char <= 0x39) {
92 return ((u8)(hex_char - 0x30));
93 }
94
95 if (hex_char <= 0x46) {
96 return ((u8)(hex_char - 0x37));
97 }
98
99 return ((u8)(hex_char - 0x57));
100}
diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c
index 10311648f701..0ce3f5a0dd67 100644
--- a/drivers/acpi/acpica/utprint.c
+++ b/drivers/acpi/acpica/utprint.c
@@ -242,6 +242,7 @@ static char *acpi_ut_format_number(char *string,
242 u64 number, 242 u64 number,
243 u8 base, s32 width, s32 precision, u8 type) 243 u8 base, s32 width, s32 precision, u8 type)
244{ 244{
245 char *pos;
245 char sign; 246 char sign;
246 char zero; 247 char zero;
247 u8 need_prefix; 248 u8 need_prefix;
@@ -289,9 +290,8 @@ static char *acpi_ut_format_number(char *string,
289 290
290 /* Generate full string in reverse order */ 291 /* Generate full string in reverse order */
291 292
292 i = ACPI_PTR_DIFF(acpi_ut_put_number 293 pos = acpi_ut_put_number(reversed_string, number, base, upper);
293 (reversed_string, number, base, upper), 294 i = ACPI_PTR_DIFF(pos, reversed_string);
294 reversed_string);
295 295
296 /* Printing 100 using %2d gives "100", not "00" */ 296 /* Printing 100 using %2d gives "100", not "00" */
297 297
@@ -401,6 +401,7 @@ acpi_ut_vsnprintf(char *string,
401 401
402 /* Process width */ 402 /* Process width */
403 403
404 width = -1;
404 if (ACPI_IS_DIGIT(*format)) { 405 if (ACPI_IS_DIGIT(*format)) {
405 format = acpi_ut_scan_number(format, &number); 406 format = acpi_ut_scan_number(format, &number);
406 width = (s32) number; 407 width = (s32) number;
@@ -415,6 +416,7 @@ acpi_ut_vsnprintf(char *string,
415 416
416 /* Process precision */ 417 /* Process precision */
417 418
419 precision = -1;
418 if (*format == '.') { 420 if (*format == '.') {
419 ++format; 421 ++format;
420 if (ACPI_IS_DIGIT(*format)) { 422 if (ACPI_IS_DIGIT(*format)) {
@@ -431,6 +433,7 @@ acpi_ut_vsnprintf(char *string,
431 433
432 /* Process qualifier */ 434 /* Process qualifier */
433 435
436 qualifier = -1;
434 if (*format == 'h' || *format == 'l' || *format == 'L') { 437 if (*format == 'h' || *format == 'l' || *format == 'L') {
435 qualifier = *format; 438 qualifier = *format;
436 ++format; 439 ++format;
diff --git a/drivers/acpi/acpica/utuuid.c b/drivers/acpi/acpica/utuuid.c
new file mode 100644
index 000000000000..4dc33130f134
--- /dev/null
+++ b/drivers/acpi/acpica/utuuid.c
@@ -0,0 +1,96 @@
1/******************************************************************************
2 *
3 * Module Name: utuuid -- UUID support functions
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2014, 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
47#define _COMPONENT ACPI_COMPILER
48ACPI_MODULE_NAME("utuuid")
49
50/*
51 * UUID support functions.
52 *
53 * This table is used to convert an input UUID ascii string to a 16 byte
54 * buffer and the reverse. The table maps a UUID buffer index 0-15 to
55 * the index within the 36-byte UUID string where the associated 2-byte
56 * hex value can be found.
57 *
58 * 36-byte UUID strings are of the form:
59 * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
60 * Where aa-pp are one byte hex numbers, made up of two hex digits
61 *
62 * Note: This table is basically the inverse of the string-to-offset table
63 * found in the ACPI spec in the description of the to_UUID macro.
64 */
65const u8 acpi_gbl_map_to_uuid_offset[UUID_BUFFER_LENGTH] = {
66 6, 4, 2, 0, 11, 9, 16, 14, 19, 21, 24, 26, 28, 30, 32, 34
67};
68
69/*******************************************************************************
70 *
71 * FUNCTION: acpi_ut_convert_string_to_uuid
72 *
73 * PARAMETERS: in_string - 36-byte formatted UUID string
74 * uuid_buffer - Where the 16-byte UUID buffer is returned
75 *
76 * RETURN: None. Output data is returned in the uuid_buffer
77 *
78 * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
79 *
80 ******************************************************************************/
81
82void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer)
83{
84 u32 i;
85
86 for (i = 0; i < UUID_BUFFER_LENGTH; i++) {
87 uuid_buffer[i] =
88 (acpi_ut_ascii_char_to_hex
89 (in_string[acpi_gbl_map_to_uuid_offset[i]]) << 4);
90
91 uuid_buffer[i] |=
92 acpi_ut_ascii_char_to_hex(in_string
93 [acpi_gbl_map_to_uuid_offset[i] +
94 1]);
95 }
96}
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 9a4f05e5b23f..bbe33a81015c 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -84,7 +84,7 @@ void *dmar_alloc_dev_scope(void *start, void *end, int *cnt)
84 *cnt = 0; 84 *cnt = 0;
85 while (start < end) { 85 while (start < end) {
86 scope = start; 86 scope = start;
87 if (scope->entry_type == ACPI_DMAR_SCOPE_TYPE_ACPI || 87 if (scope->entry_type == ACPI_DMAR_SCOPE_TYPE_NAMESPACE ||
88 scope->entry_type == ACPI_DMAR_SCOPE_TYPE_ENDPOINT || 88 scope->entry_type == ACPI_DMAR_SCOPE_TYPE_ENDPOINT ||
89 scope->entry_type == ACPI_DMAR_SCOPE_TYPE_BRIDGE) 89 scope->entry_type == ACPI_DMAR_SCOPE_TYPE_BRIDGE)
90 (*cnt)++; 90 (*cnt)++;
@@ -380,7 +380,7 @@ static int __init dmar_parse_one_andd(struct acpi_dmar_header *header)
380 struct acpi_dmar_andd *andd = (void *)header; 380 struct acpi_dmar_andd *andd = (void *)header;
381 381
382 /* Check for NUL termination within the designated length */ 382 /* Check for NUL termination within the designated length */
383 if (strnlen(andd->object_name, header->length - 8) == header->length - 8) { 383 if (strnlen(andd->device_name, header->length - 8) == header->length - 8) {
384 WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND, 384 WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND,
385 "Your BIOS is broken; ANDD object name is not NUL-terminated\n" 385 "Your BIOS is broken; ANDD object name is not NUL-terminated\n"
386 "BIOS vendor: %s; Ver: %s; Product Version: %s\n", 386 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
@@ -390,7 +390,7 @@ static int __init dmar_parse_one_andd(struct acpi_dmar_header *header)
390 return -EINVAL; 390 return -EINVAL;
391 } 391 }
392 pr_info("ANDD device: %x name: %s\n", andd->device_number, 392 pr_info("ANDD device: %x name: %s\n", andd->device_number,
393 andd->object_name); 393 andd->device_name);
394 394
395 return 0; 395 return 0;
396} 396}
@@ -448,17 +448,17 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
448 (unsigned long long)rmrr->base_address, 448 (unsigned long long)rmrr->base_address,
449 (unsigned long long)rmrr->end_address); 449 (unsigned long long)rmrr->end_address);
450 break; 450 break;
451 case ACPI_DMAR_TYPE_ATSR: 451 case ACPI_DMAR_TYPE_ROOT_ATS:
452 atsr = container_of(header, struct acpi_dmar_atsr, header); 452 atsr = container_of(header, struct acpi_dmar_atsr, header);
453 pr_info("ATSR flags: %#x\n", atsr->flags); 453 pr_info("ATSR flags: %#x\n", atsr->flags);
454 break; 454 break;
455 case ACPI_DMAR_HARDWARE_AFFINITY: 455 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
456 rhsa = container_of(header, struct acpi_dmar_rhsa, header); 456 rhsa = container_of(header, struct acpi_dmar_rhsa, header);
457 pr_info("RHSA base: %#016Lx proximity domain: %#x\n", 457 pr_info("RHSA base: %#016Lx proximity domain: %#x\n",
458 (unsigned long long)rhsa->base_address, 458 (unsigned long long)rhsa->base_address,
459 rhsa->proximity_domain); 459 rhsa->proximity_domain);
460 break; 460 break;
461 case ACPI_DMAR_TYPE_ANDD: 461 case ACPI_DMAR_TYPE_NAMESPACE:
462 /* We don't print this here because we need to sanity-check 462 /* We don't print this here because we need to sanity-check
463 it first. So print it in dmar_parse_one_andd() instead. */ 463 it first. So print it in dmar_parse_one_andd() instead. */
464 break; 464 break;
@@ -539,15 +539,15 @@ parse_dmar_table(void)
539 case ACPI_DMAR_TYPE_RESERVED_MEMORY: 539 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
540 ret = dmar_parse_one_rmrr(entry_header); 540 ret = dmar_parse_one_rmrr(entry_header);
541 break; 541 break;
542 case ACPI_DMAR_TYPE_ATSR: 542 case ACPI_DMAR_TYPE_ROOT_ATS:
543 ret = dmar_parse_one_atsr(entry_header); 543 ret = dmar_parse_one_atsr(entry_header);
544 break; 544 break;
545 case ACPI_DMAR_HARDWARE_AFFINITY: 545 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
546#ifdef CONFIG_ACPI_NUMA 546#ifdef CONFIG_ACPI_NUMA
547 ret = dmar_parse_one_rhsa(entry_header); 547 ret = dmar_parse_one_rhsa(entry_header);
548#endif 548#endif
549 break; 549 break;
550 case ACPI_DMAR_TYPE_ANDD: 550 case ACPI_DMAR_TYPE_NAMESPACE:
551 ret = dmar_parse_one_andd(entry_header); 551 ret = dmar_parse_one_andd(entry_header);
552 break; 552 break;
553 default: 553 default:
@@ -631,7 +631,7 @@ static void __init dmar_acpi_insert_dev_scope(u8 device_number,
631 for (scope = (void *)(drhd + 1); 631 for (scope = (void *)(drhd + 1);
632 (unsigned long)scope < ((unsigned long)drhd) + drhd->header.length; 632 (unsigned long)scope < ((unsigned long)drhd) + drhd->header.length;
633 scope = ((void *)scope) + scope->length) { 633 scope = ((void *)scope) + scope->length) {
634 if (scope->entry_type != ACPI_DMAR_SCOPE_TYPE_ACPI) 634 if (scope->entry_type != ACPI_DMAR_SCOPE_TYPE_NAMESPACE)
635 continue; 635 continue;
636 if (scope->enumeration_id != device_number) 636 if (scope->enumeration_id != device_number)
637 continue; 637 continue;
@@ -666,21 +666,21 @@ static int __init dmar_acpi_dev_scope_init(void)
666 for (andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar); 666 for (andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar);
667 ((unsigned long)andd) < ((unsigned long)dmar_tbl) + dmar_tbl->length; 667 ((unsigned long)andd) < ((unsigned long)dmar_tbl) + dmar_tbl->length;
668 andd = ((void *)andd) + andd->header.length) { 668 andd = ((void *)andd) + andd->header.length) {
669 if (andd->header.type == ACPI_DMAR_TYPE_ANDD) { 669 if (andd->header.type == ACPI_DMAR_TYPE_NAMESPACE) {
670 acpi_handle h; 670 acpi_handle h;
671 struct acpi_device *adev; 671 struct acpi_device *adev;
672 672
673 if (!ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, 673 if (!ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT,
674 andd->object_name, 674 andd->device_name,
675 &h))) { 675 &h))) {
676 pr_err("Failed to find handle for ACPI object %s\n", 676 pr_err("Failed to find handle for ACPI object %s\n",
677 andd->object_name); 677 andd->device_name);
678 continue; 678 continue;
679 } 679 }
680 acpi_bus_get_device(h, &adev); 680 acpi_bus_get_device(h, &adev);
681 if (!adev) { 681 if (!adev) {
682 pr_err("Failed to get device for ACPI object %s\n", 682 pr_err("Failed to get device for ACPI object %s\n",
683 andd->object_name); 683 andd->device_name);
684 continue; 684 continue;
685 } 685 }
686 dmar_acpi_insert_dev_scope(andd->device_number, adev); 686 dmar_acpi_insert_dev_scope(andd->device_number, adev);
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 932a60d6ed82..5a0a3e5daf85 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -219,6 +219,24 @@
219 219
220/****************************************************************************** 220/******************************************************************************
221 * 221 *
222 * Miscellaneous constants
223 *
224 *****************************************************************************/
225
226/* UUID constants */
227
228#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
229#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
230
231/* Positions for required hyphens (dashes) in UUID strings */
232
233#define UUID_HYPHEN1_OFFSET 8
234#define UUID_HYPHEN2_OFFSET 13
235#define UUID_HYPHEN3_OFFSET 18
236#define UUID_HYPHEN4_OFFSET 23
237
238/******************************************************************************
239 *
222 * ACPI AML Debugger 240 * ACPI AML Debugger
223 * 241 *
224 *****************************************************************************/ 242 *****************************************************************************/
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 3dd6e838dc30..c728113374f5 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -55,6 +55,7 @@
55#define METHOD_NAME__HID "_HID" 55#define METHOD_NAME__HID "_HID"
56#define METHOD_NAME__INI "_INI" 56#define METHOD_NAME__INI "_INI"
57#define METHOD_NAME__PLD "_PLD" 57#define METHOD_NAME__PLD "_PLD"
58#define METHOD_NAME__DSD "_DSD"
58#define METHOD_NAME__PRS "_PRS" 59#define METHOD_NAME__PRS "_PRS"
59#define METHOD_NAME__PRT "_PRT" 60#define METHOD_NAME__PRT "_PRT"
60#define METHOD_NAME__PRW "_PRW" 61#define METHOD_NAME__PRW "_PRW"
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index c3f38bc459e1..b7c89d47efbe 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 0x20140627 49#define ACPI_CA_VERSION 0x20140724
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/actbl.h b/include/acpi/actbl.h
index 1cc7ef13c01a..bee19d8170c5 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -270,7 +270,8 @@ struct acpi_table_fadt {
270 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ 270 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
271 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ 271 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
272 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 272 u8 reset_value; /* Value to write to the reset_register port to reset the system */
273 u8 reserved4[3]; /* Reserved, must be zero */ 273 u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
274 u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */
274 u64 Xfacs; /* 64-bit physical address of FACS */ 275 u64 Xfacs; /* 64-bit physical address of FACS */
275 u64 Xdsdt; /* 64-bit physical address of DSDT */ 276 u64 Xdsdt; /* 64-bit physical address of DSDT */
276 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 277 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -285,7 +286,7 @@ struct acpi_table_fadt {
285 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ 286 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */
286}; 287};
287 288
288/* Masks for FADT Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ 289/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
289 290
290#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ 291#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
291#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ 292#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -296,6 +297,11 @@ struct acpi_table_fadt {
296 297
297#define FADT2_REVISION_ID 3 298#define FADT2_REVISION_ID 3
298 299
300/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
301
302#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
303#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
304
299/* Masks for FADT flags */ 305/* Masks for FADT flags */
300 306
301#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ 307#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
@@ -399,7 +405,7 @@ struct acpi_table_desc {
399 * FADT V5 size: 0x10C 405 * FADT V5 size: 0x10C
400 */ 406 */
401#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 407#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
402#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) 408#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1)
403#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 409#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
404#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt)) 410#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))
405 411
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 9613e8e97960..7626bfeac2cb 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -671,7 +671,9 @@ enum acpi_madt_type {
671 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 671 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
672 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 672 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
673 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 673 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
674 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ 674 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
675 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
676 ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
675}; 677};
676 678
677/* 679/*
@@ -797,15 +799,26 @@ struct acpi_madt_local_x2apic_nmi {
797struct acpi_madt_generic_interrupt { 799struct acpi_madt_generic_interrupt {
798 struct acpi_subtable_header header; 800 struct acpi_subtable_header header;
799 u16 reserved; /* reserved - must be zero */ 801 u16 reserved; /* reserved - must be zero */
800 u32 gic_id; 802 u32 cpu_interface_number;
801 u32 uid; 803 u32 uid;
802 u32 flags; 804 u32 flags;
803 u32 parking_version; 805 u32 parking_version;
804 u32 performance_interrupt; 806 u32 performance_interrupt;
805 u64 parked_address; 807 u64 parked_address;
806 u64 base_address; 808 u64 base_address;
809 u64 gicv_base_address;
810 u64 gich_base_address;
811 u32 vgic_interrupt;
812 u64 gicr_base_address;
813 u64 arm_mpidr;
807}; 814};
808 815
816/* Masks for Flags field above */
817
818/* ACPI_MADT_ENABLED (1) Processor is usable if set */
819#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
820#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
821
809/* 12: Generic Distributor (ACPI 5.0) */ 822/* 12: Generic Distributor (ACPI 5.0) */
810 823
811struct acpi_madt_generic_distributor { 824struct acpi_madt_generic_distributor {
@@ -817,11 +830,36 @@ struct acpi_madt_generic_distributor {
817 u32 reserved2; /* reserved - must be zero */ 830 u32 reserved2; /* reserved - must be zero */
818}; 831};
819 832
833/* 13: Generic MSI Frame (ACPI 5.1) */
834
835struct acpi_madt_generic_msi_frame {
836 struct acpi_subtable_header header;
837 u16 reserved; /* reserved - must be zero */
838 u32 msi_frame_id;
839 u64 base_address;
840 u32 flags;
841 u16 spi_count;
842 u16 spi_base;
843};
844
845/* Masks for Flags field above */
846
847#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
848
849/* 14: Generic Redistributor (ACPI 5.1) */
850
851struct acpi_madt_generic_redistributor {
852 struct acpi_subtable_header header;
853 u16 reserved; /* reserved - must be zero */
854 u64 base_address;
855 u32 length;
856};
857
820/* 858/*
821 * Common flags fields for MADT subtables 859 * Common flags fields for MADT subtables
822 */ 860 */
823 861
824/* MADT Local APIC flags (lapic_flags) and GIC flags */ 862/* MADT Local APIC flags */
825 863
826#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 864#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
827 865
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 21314d37cb07..ecff62405f17 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -396,7 +396,7 @@ struct acpi_table_dbgp {
396 * Version 1 396 * Version 1
397 * 397 *
398 * Conforms to "Intel Virtualization Technology for Directed I/O", 398 * Conforms to "Intel Virtualization Technology for Directed I/O",
399 * Version 1.2, Sept. 2008 399 * Version 2.2, Sept. 2013
400 * 400 *
401 ******************************************************************************/ 401 ******************************************************************************/
402 402
@@ -423,9 +423,9 @@ struct acpi_dmar_header {
423enum acpi_dmar_type { 423enum acpi_dmar_type {
424 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, 424 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
425 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, 425 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
426 ACPI_DMAR_TYPE_ATSR = 2, 426 ACPI_DMAR_TYPE_ROOT_ATS = 2,
427 ACPI_DMAR_HARDWARE_AFFINITY = 3, 427 ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
428 ACPI_DMAR_TYPE_ANDD = 4, 428 ACPI_DMAR_TYPE_NAMESPACE = 4,
429 ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */ 429 ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
430}; 430};
431 431
@@ -439,7 +439,7 @@ struct acpi_dmar_device_scope {
439 u8 bus; 439 u8 bus;
440}; 440};
441 441
442/* Values for entry_type in struct acpi_dmar_device_scope */ 442/* Values for entry_type in struct acpi_dmar_device_scope - device types */
443 443
444enum acpi_dmar_scope_type { 444enum acpi_dmar_scope_type {
445 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, 445 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
@@ -447,7 +447,7 @@ enum acpi_dmar_scope_type {
447 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, 447 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
448 ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, 448 ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
449 ACPI_DMAR_SCOPE_TYPE_HPET = 4, 449 ACPI_DMAR_SCOPE_TYPE_HPET = 4,
450 ACPI_DMAR_SCOPE_TYPE_ACPI = 5, 450 ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
451 ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */ 451 ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
452}; 452};
453 453
@@ -516,7 +516,7 @@ struct acpi_dmar_andd {
516 struct acpi_dmar_header header; 516 struct acpi_dmar_header header;
517 u8 reserved[3]; 517 u8 reserved[3];
518 u8 device_number; 518 u8 device_number;
519 char object_name[1]; 519 char device_name[1];
520}; 520};
521 521
522/******************************************************************************* 522/*******************************************************************************
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index c2295cc4a5c0..787bcc814463 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -241,33 +241,96 @@ struct acpi_s3pt_suspend {
241 241
242/******************************************************************************* 242/*******************************************************************************
243 * 243 *
244 * GTDT - Generic Timer Description Table (ACPI 5.0) 244 * GTDT - Generic Timer Description Table (ACPI 5.1)
245 * Version 1 245 * Version 2
246 * 246 *
247 ******************************************************************************/ 247 ******************************************************************************/
248 248
249struct acpi_table_gtdt { 249struct acpi_table_gtdt {
250 struct acpi_table_header header; /* Common ACPI table header */ 250 struct acpi_table_header header; /* Common ACPI table header */
251 u64 address; 251 u64 counter_block_addresss;
252 u32 flags; 252 u32 reserved;
253 u32 secure_pl1_interrupt; 253 u32 secure_el1_interrupt;
254 u32 secure_pl1_flags; 254 u32 secure_el1_flags;
255 u32 non_secure_pl1_interrupt; 255 u32 non_secure_el1_interrupt;
256 u32 non_secure_pl1_flags; 256 u32 non_secure_el1_flags;
257 u32 virtual_timer_interrupt; 257 u32 virtual_timer_interrupt;
258 u32 virtual_timer_flags; 258 u32 virtual_timer_flags;
259 u32 non_secure_pl2_interrupt; 259 u32 non_secure_el2_interrupt;
260 u32 non_secure_pl2_flags; 260 u32 non_secure_el2_flags;
261 u64 counter_read_block_address;
262 u32 platform_timer_count;
263 u32 platform_timer_offset;
261}; 264};
262 265
263/* Values for Flags field above */ 266/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
267
268#define ACPI_GTDT_INTERRUPT_MODE (1)
269#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
270#define ACPI_GTDT_ALWAYS_ON (1<<2)
271
272/* Common GTDT subtable header */
273
274struct acpi_gtdt_header {
275 u8 type;
276 u16 length;
277};
264 278
265#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 279/* Values for GTDT subtable type above */
266 280
267/* Values for all "TimerFlags" fields above */ 281enum acpi_gtdt_type {
282 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
283 ACPI_GTDT_TYPE_WATCHDOG = 1,
284 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
285};
286
287/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
288
289/* 0: Generic Timer Block */
290
291struct acpi_gtdt_timer_block {
292 struct acpi_gtdt_header header;
293 u8 reserved;
294 u64 block_address;
295 u32 timer_count;
296 u32 timer_offset;
297};
298
299/* Timer Sub-Structure, one per timer */
300
301struct acpi_gtdt_timer_entry {
302 u8 frame_number;
303 u8 reserved[3];
304 u64 base_address;
305 u64 el0_base_address;
306 u32 timer_interrupt;
307 u32 timer_flags;
308 u32 virtual_timer_interrupt;
309 u32 virtual_timer_flags;
310 u32 common_flags;
311};
268 312
269#define ACPI_GTDT_INTERRUPT_MODE 1 313/* Flag Definitions: common_flags above */
270#define ACPI_GTDT_INTERRUPT_POLARITY 2 314
315#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
316#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
317
318/* 1: SBSA Generic Watchdog Structure */
319
320struct acpi_gtdt_watchdog {
321 struct acpi_gtdt_header header;
322 u8 reserved;
323 u64 refresh_frame_address;
324 u64 control_frame_address;
325 u32 timer_interrupt;
326 u32 timer_flags;
327};
328
329/* Flag Definitions: timer_flags above */
330
331#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
332#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
333#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
271 334
272/******************************************************************************* 335/*******************************************************************************
273 * 336 *
@@ -385,7 +448,8 @@ struct acpi_table_pcct {
385 448
386enum acpi_pcct_type { 449enum acpi_pcct_type {
387 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 450 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
388 ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ 451 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
452 ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
389}; 453};
390 454
391/* 455/*
@@ -407,6 +471,28 @@ struct acpi_pcct_subspace {
407 u16 min_turnaround_time; 471 u16 min_turnaround_time;
408}; 472};
409 473
474/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
475
476struct acpi_pcct_hw_reduced {
477 struct acpi_subtable_header header;
478 u32 doorbell_interrupt;
479 u8 flags;
480 u8 reserved;
481 u64 base_address;
482 u64 length;
483 struct acpi_generic_address doorbell_register;
484 u64 preserve_mask;
485 u64 write_mask;
486 u32 latency;
487 u32 max_access_rate;
488 u16 min_turnaround_time;
489};
490
491/* Values for doorbell flags above */
492
493#define ACPI_PCCT_INTERRUPT_POLARITY (1)
494#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
495
410/* 496/*
411 * PCC memory structures (not part of the ACPI table) 497 * PCC memory structures (not part of the ACPI table)
412 */ 498 */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 608a04019372..ac03ec81d342 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -517,7 +517,7 @@ typedef u64 acpi_integer;
517 517
518#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i) 518#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
519#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) 519#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
520#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) 520#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
521#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 521#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
522#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 522#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
523 523
@@ -612,8 +612,9 @@ typedef u64 acpi_integer;
612#define ACPI_NOTIFY_RESERVED (u8) 0x0A 612#define ACPI_NOTIFY_RESERVED (u8) 0x0A
613#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B 613#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B
614#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 614#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
615#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
615 616
616#define ACPI_NOTIFY_MAX 0x0C 617#define ACPI_NOTIFY_MAX 0x0D
617 618
618/* 619/*
619 * Types associated with ACPI names and objects. The first group of 620 * Types associated with ACPI names and objects. The first group of