Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Moore and committed by
Len Brown
2da120b6 9ce81784

+41 -18
+2 -1
drivers/acpi/acpica/acconfig.h
··· 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 */
+10 -7
drivers/acpi/acpica/amlcode.h
··· 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 */
+21 -7
drivers/acpi/acpica/exfield.c
··· 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; 115 + function = 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; 113 120 function = 114 121 ACPI_READ | (obj_desc->field.attribute << 16); 115 122 } else { /* IPMI */ ··· 255 248 (obj_desc->field.region_obj->region.space_id == 256 249 ACPI_ADR_SPACE_SMBUS 257 250 || obj_desc->field.region_obj->region.space_id == 251 + ACPI_ADR_SPACE_GSBUS 252 + || obj_desc->field.region_obj->region.space_id == 258 253 ACPI_ADR_SPACE_IPMI)) { 259 254 /* 260 - * This is an SMBus or IPMI write. We will bypass the entire field 255 + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field 261 256 * mechanism and handoff the buffer directly to the handler. For 262 257 * these address spaces, the buffer is bi-directional; on a write, 263 258 * return data is returned in the same buffer. 264 259 * 265 260 * Source must be a buffer of sufficient size: 266 - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. 261 + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. 267 262 * 268 - * Note: SMBus protocol type is passed in upper 16-bits of Function 263 + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function 269 264 */ 270 265 if (source_desc->common.type != ACPI_TYPE_BUFFER) { 271 266 ACPI_ERROR((AE_INFO, 272 - "SMBus or IPMI write requires Buffer, found type %s", 267 + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", 273 268 acpi_ut_get_object_type_name(source_desc))); 274 269 275 270 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); ··· 282 273 length = ACPI_SMBUS_BUFFER_SIZE; 283 274 function = 284 275 ACPI_WRITE | (obj_desc->field.attribute << 16); 276 + } else if (obj_desc->field.region_obj->region.space_id == 277 + ACPI_ADR_SPACE_GSBUS) { 278 + length = ACPI_GSBUS_BUFFER_SIZE; 279 + function = 280 + ACPI_WRITE | (obj_desc->field.attribute << 16); 285 281 } else { /* IPMI */ 286 282 287 283 length = ACPI_IPMI_BUFFER_SIZE; ··· 295 281 296 282 if (source_desc->buffer.length < length) { 297 283 ACPI_ERROR((AE_INFO, 298 - "SMBus or IPMI write requires Buffer of length %u, found length %u", 284 + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", 299 285 length, source_desc->buffer.length)); 300 286 301 287 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
+2 -1
drivers/acpi/acpica/exfldio.c
··· 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 */
+3 -1
drivers/acpi/acpica/utdecode.c
··· 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)
+3 -1
include/acpi/actypes.h
··· 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