Commit 2da120b6847f85c406f9afa13853e2755684389e

Authored by Bob Moore
Committed by Len Brown
1 parent 9ce81784c9

ACPI 5.0: Support for GeneralPurposeIo and GenericSerialBus operation region

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Showing 6 changed files with 41 additions and 18 deletions Side-by-side Diff

drivers/acpi/acpica/acconfig.h
... ... @@ -202,9 +202,10 @@
202 202 #define ACPI_RSDP_CHECKSUM_LENGTH 20
203 203 #define ACPI_RSDP_XCHECKSUM_LENGTH 36
204 204  
205   -/* SMBus and IPMI bidirectional buffer size */
  205 +/* SMBus, GSBus and IPMI bidirectional buffer size */
206 206  
207 207 #define ACPI_SMBUS_BUFFER_SIZE 34
  208 +#define ACPI_GSBUS_BUFFER_SIZE 34
208 209 #define ACPI_IPMI_BUFFER_SIZE 66
209 210  
210 211 /* _sx_d and _sx_w control methods */
drivers/acpi/acpica/amlcode.h
... ... @@ -466,13 +466,16 @@
466 466 * access_as keyword
467 467 */
468 468 typedef enum {
469   - AML_FIELD_ATTRIB_SMB_QUICK = 0x02,
470   - AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04,
471   - AML_FIELD_ATTRIB_SMB_BYTE = 0x06,
472   - AML_FIELD_ATTRIB_SMB_WORD = 0x08,
473   - AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A,
474   - AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
475   - AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
  469 + AML_FIELD_ATTRIB_QUICK = 0x02,
  470 + AML_FIELD_ATTRIB_SEND_RCV = 0x04,
  471 + AML_FIELD_ATTRIB_BYTE = 0x06,
  472 + AML_FIELD_ATTRIB_WORD = 0x08,
  473 + AML_FIELD_ATTRIB_BLOCK = 0x0A,
  474 + AML_FIELD_ATTRIB_MULTIBYTE = 0x0B,
  475 + AML_FIELD_ATTRIB_WORD_CALL = 0x0C,
  476 + AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D,
  477 + AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
  478 + AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F
476 479 } AML_ACCESS_ATTRIBUTE;
477 480  
478 481 /* Bit fields in the AML method_flags byte */
drivers/acpi/acpica/exfield.c
... ... @@ -100,18 +100,25 @@
100 100 (obj_desc->field.region_obj->region.space_id ==
101 101 ACPI_ADR_SPACE_SMBUS
102 102 || obj_desc->field.region_obj->region.space_id ==
  103 + ACPI_ADR_SPACE_GSBUS
  104 + || obj_desc->field.region_obj->region.space_id ==
103 105 ACPI_ADR_SPACE_IPMI)) {
104 106 /*
105   - * This is an SMBus or IPMI read. We must create a buffer to hold
  107 + * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold
106 108 * the data and then directly access the region handler.
107 109 *
108   - * Note: Smbus protocol value is passed in upper 16-bits of Function
  110 + * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
109 111 */
110 112 if (obj_desc->field.region_obj->region.space_id ==
111 113 ACPI_ADR_SPACE_SMBUS) {
112 114 length = ACPI_SMBUS_BUFFER_SIZE;
113 115 function =
114 116 ACPI_READ | (obj_desc->field.attribute << 16);
  117 + } else if (obj_desc->field.region_obj->region.space_id ==
  118 + ACPI_ADR_SPACE_GSBUS) {
  119 + length = ACPI_GSBUS_BUFFER_SIZE;
  120 + function =
  121 + ACPI_READ | (obj_desc->field.attribute << 16);
115 122 } else { /* IPMI */
116 123  
117 124 length = ACPI_IPMI_BUFFER_SIZE;
118 125  
119 126  
120 127  
121 128  
... ... @@ -248,21 +255,23 @@
248 255 (obj_desc->field.region_obj->region.space_id ==
249 256 ACPI_ADR_SPACE_SMBUS
250 257 || obj_desc->field.region_obj->region.space_id ==
  258 + ACPI_ADR_SPACE_GSBUS
  259 + || obj_desc->field.region_obj->region.space_id ==
251 260 ACPI_ADR_SPACE_IPMI)) {
252 261 /*
253   - * This is an SMBus or IPMI write. We will bypass the entire field
  262 + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field
254 263 * mechanism and handoff the buffer directly to the handler. For
255 264 * these address spaces, the buffer is bi-directional; on a write,
256 265 * return data is returned in the same buffer.
257 266 *
258 267 * Source must be a buffer of sufficient size:
259   - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE.
  268 + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
260 269 *
261   - * Note: SMBus protocol type is passed in upper 16-bits of Function
  270 + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
262 271 */
263 272 if (source_desc->common.type != ACPI_TYPE_BUFFER) {
264 273 ACPI_ERROR((AE_INFO,
265   - "SMBus or IPMI write requires Buffer, found type %s",
  274 + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
266 275 acpi_ut_get_object_type_name(source_desc)));
267 276  
268 277 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
... ... @@ -273,6 +282,11 @@
273 282 length = ACPI_SMBUS_BUFFER_SIZE;
274 283 function =
275 284 ACPI_WRITE | (obj_desc->field.attribute << 16);
  285 + } else if (obj_desc->field.region_obj->region.space_id ==
  286 + ACPI_ADR_SPACE_GSBUS) {
  287 + length = ACPI_GSBUS_BUFFER_SIZE;
  288 + function =
  289 + ACPI_WRITE | (obj_desc->field.attribute << 16);
276 290 } else { /* IPMI */
277 291  
278 292 length = ACPI_IPMI_BUFFER_SIZE;
... ... @@ -281,7 +295,7 @@
281 295  
282 296 if (source_desc->buffer.length < length) {
283 297 ACPI_ERROR((AE_INFO,
284   - "SMBus or IPMI write requires Buffer of length %u, found length %u",
  298 + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
285 299 length, source_desc->buffer.length));
286 300  
287 301 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
drivers/acpi/acpica/exfldio.c
... ... @@ -131,10 +131,11 @@
131 131 }
132 132  
133 133 /*
134   - * Exit now for SMBus or IPMI address space, it has a non-linear
  134 + * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
135 135 * address space and the request cannot be directly validated
136 136 */
137 137 if (space_id == ACPI_ADR_SPACE_SMBUS ||
  138 + space_id == ACPI_ADR_SPACE_GSBUS ||
138 139 space_id == ACPI_ADR_SPACE_IPMI) {
139 140  
140 141 /* SMBus or IPMI has a non-linear address space */
drivers/acpi/acpica/utdecode.c
... ... @@ -171,7 +171,9 @@
171 171 "SMBus",
172 172 "SystemCMOS",
173 173 "PCIBARTarget",
174   - "IPMI"
  174 + "IPMI",
  175 + "GeneralPurposeIo",
  176 + "GenericSerialBus"
175 177 };
176 178  
177 179 char *acpi_ut_get_region_name(u8 space_id)
include/acpi/actypes.h
... ... @@ -712,8 +712,10 @@
712 712 #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5
713 713 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6
714 714 #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7
  715 +#define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8
  716 +#define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9
715 717  
716   -#define ACPI_NUM_PREDEFINED_REGIONS 8
  718 +#define ACPI_NUM_PREDEFINED_REGIONS 10
717 719  
718 720 /*
719 721 * Special Address Spaces