diff options
author | Bob Moore <robert.moore@intel.com> | 2011-11-16 01:14:32 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-01-17 03:36:29 -0500 |
commit | 2da120b6847f85c406f9afa13853e2755684389e (patch) | |
tree | 08a3540fd90ce2159aa04bb08f55a060f10f3315 | |
parent | 9ce81784c9c0396a6a6be05248928a71134fe60b (diff) |
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>
-rw-r--r-- | drivers/acpi/acpica/acconfig.h | 3 | ||||
-rw-r--r-- | drivers/acpi/acpica/amlcode.h | 17 | ||||
-rw-r--r-- | drivers/acpi/acpica/exfield.c | 28 | ||||
-rw-r--r-- | drivers/acpi/acpica/exfldio.c | 3 | ||||
-rw-r--r-- | drivers/acpi/acpica/utdecode.c | 4 | ||||
-rw-r--r-- | include/acpi/actypes.h | 4 |
6 files changed, 41 insertions, 18 deletions
diff --git a/drivers/acpi/acpica/acconfig.h b/drivers/acpi/acpica/acconfig.h index f895a244ca7e..f467d49c1ace 100644 --- a/drivers/acpi/acpica/acconfig.h +++ b/drivers/acpi/acpica/acconfig.h | |||
@@ -202,9 +202,10 @@ | |||
202 | #define ACPI_RSDP_CHECKSUM_LENGTH 20 | 202 | #define ACPI_RSDP_CHECKSUM_LENGTH 20 |
203 | #define ACPI_RSDP_XCHECKSUM_LENGTH 36 | 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 | #define ACPI_SMBUS_BUFFER_SIZE 34 | 207 | #define ACPI_SMBUS_BUFFER_SIZE 34 |
208 | #define ACPI_GSBUS_BUFFER_SIZE 34 | ||
208 | #define ACPI_IPMI_BUFFER_SIZE 66 | 209 | #define ACPI_IPMI_BUFFER_SIZE 66 |
209 | 210 | ||
210 | /* _sx_d and _sx_w control methods */ | 211 | /* _sx_d and _sx_w control methods */ |
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h index adf7a71ea766..c7db80ee61ae 100644 --- a/drivers/acpi/acpica/amlcode.h +++ b/drivers/acpi/acpica/amlcode.h | |||
@@ -466,13 +466,16 @@ typedef enum { | |||
466 | * access_as keyword | 466 | * access_as keyword |
467 | */ | 467 | */ |
468 | typedef enum { | 468 | typedef enum { |
469 | AML_FIELD_ATTRIB_SMB_QUICK = 0x02, | 469 | AML_FIELD_ATTRIB_QUICK = 0x02, |
470 | AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, | 470 | AML_FIELD_ATTRIB_SEND_RCV = 0x04, |
471 | AML_FIELD_ATTRIB_SMB_BYTE = 0x06, | 471 | AML_FIELD_ATTRIB_BYTE = 0x06, |
472 | AML_FIELD_ATTRIB_SMB_WORD = 0x08, | 472 | AML_FIELD_ATTRIB_WORD = 0x08, |
473 | AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, | 473 | AML_FIELD_ATTRIB_BLOCK = 0x0A, |
474 | AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, | 474 | AML_FIELD_ATTRIB_MULTIBYTE = 0x0B, |
475 | AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D | 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 | } AML_ACCESS_ATTRIBUTE; | 479 | } AML_ACCESS_ATTRIBUTE; |
477 | 480 | ||
478 | /* Bit fields in the AML method_flags byte */ | 481 | /* Bit fields in the AML method_flags byte */ |
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index 0bde2230c028..3aeec028d71c 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c | |||
@@ -100,18 +100,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
100 | (obj_desc->field.region_obj->region.space_id == | 100 | (obj_desc->field.region_obj->region.space_id == |
101 | ACPI_ADR_SPACE_SMBUS | 101 | ACPI_ADR_SPACE_SMBUS |
102 | || obj_desc->field.region_obj->region.space_id == | 102 | || obj_desc->field.region_obj->region.space_id == |
103 | ACPI_ADR_SPACE_GSBUS | ||
104 | || obj_desc->field.region_obj->region.space_id == | ||
103 | ACPI_ADR_SPACE_IPMI)) { | 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 | * the data and then directly access the region handler. | 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 | if (obj_desc->field.region_obj->region.space_id == | 112 | if (obj_desc->field.region_obj->region.space_id == |
111 | ACPI_ADR_SPACE_SMBUS) { | 113 | ACPI_ADR_SPACE_SMBUS) { |
112 | length = ACPI_SMBUS_BUFFER_SIZE; | 114 | length = ACPI_SMBUS_BUFFER_SIZE; |
113 | function = | 115 | function = |
114 | ACPI_READ | (obj_desc->field.attribute << 16); | 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 | } else { /* IPMI */ | 122 | } else { /* IPMI */ |
116 | 123 | ||
117 | length = ACPI_IPMI_BUFFER_SIZE; | 124 | length = ACPI_IPMI_BUFFER_SIZE; |
@@ -248,21 +255,23 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
248 | (obj_desc->field.region_obj->region.space_id == | 255 | (obj_desc->field.region_obj->region.space_id == |
249 | ACPI_ADR_SPACE_SMBUS | 256 | ACPI_ADR_SPACE_SMBUS |
250 | || obj_desc->field.region_obj->region.space_id == | 257 | || obj_desc->field.region_obj->region.space_id == |
258 | ACPI_ADR_SPACE_GSBUS | ||
259 | || obj_desc->field.region_obj->region.space_id == | ||
251 | ACPI_ADR_SPACE_IPMI)) { | 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 | * mechanism and handoff the buffer directly to the handler. For | 263 | * mechanism and handoff the buffer directly to the handler. For |
255 | * these address spaces, the buffer is bi-directional; on a write, | 264 | * these address spaces, the buffer is bi-directional; on a write, |
256 | * return data is returned in the same buffer. | 265 | * return data is returned in the same buffer. |
257 | * | 266 | * |
258 | * Source must be a buffer of sufficient size: | 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 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { | 272 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { |
264 | ACPI_ERROR((AE_INFO, | 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 | acpi_ut_get_object_type_name(source_desc))); | 275 | acpi_ut_get_object_type_name(source_desc))); |
267 | 276 | ||
268 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 277 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -273,6 +282,11 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
273 | length = ACPI_SMBUS_BUFFER_SIZE; | 282 | length = ACPI_SMBUS_BUFFER_SIZE; |
274 | function = | 283 | function = |
275 | ACPI_WRITE | (obj_desc->field.attribute << 16); | 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 | } else { /* IPMI */ | 290 | } else { /* IPMI */ |
277 | 291 | ||
278 | length = ACPI_IPMI_BUFFER_SIZE; | 292 | length = ACPI_IPMI_BUFFER_SIZE; |
@@ -281,7 +295,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
281 | 295 | ||
282 | if (source_desc->buffer.length < length) { | 296 | if (source_desc->buffer.length < length) { |
283 | ACPI_ERROR((AE_INFO, | 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 | length, source_desc->buffer.length)); | 299 | length, source_desc->buffer.length)); |
286 | 300 | ||
287 | return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); | 301 | return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); |
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index cc9c5dfa4c45..5b76c11418fa 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -131,10 +131,11 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
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 | * address space and the request cannot be directly validated | 135 | * address space and the request cannot be directly validated |
136 | */ | 136 | */ |
137 | if (space_id == ACPI_ADR_SPACE_SMBUS || | 137 | if (space_id == ACPI_ADR_SPACE_SMBUS || |
138 | space_id == ACPI_ADR_SPACE_GSBUS || | ||
138 | space_id == ACPI_ADR_SPACE_IPMI) { | 139 | space_id == ACPI_ADR_SPACE_IPMI) { |
139 | 140 | ||
140 | /* SMBus or IPMI has a non-linear address space */ | 141 | /* SMBus or IPMI has a non-linear address space */ |
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index 8b087e2d64f4..6fd56d549296 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c | |||
@@ -171,7 +171,9 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | |||
171 | "SMBus", | 171 | "SMBus", |
172 | "SystemCMOS", | 172 | "SystemCMOS", |
173 | "PCIBARTarget", | 173 | "PCIBARTarget", |
174 | "IPMI" | 174 | "IPMI", |
175 | "GeneralPurposeIo", | ||
176 | "GenericSerialBus" | ||
175 | }; | 177 | }; |
176 | 178 | ||
177 | char *acpi_ut_get_region_name(u8 space_id) | 179 | char *acpi_ut_get_region_name(u8 space_id) |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index d088c902d6bd..d5dee7ce9474 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -712,8 +712,10 @@ typedef u8 acpi_adr_space_type; | |||
712 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 | 712 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 |
713 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 | 713 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 |
714 | #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 | 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 | * Special Address Spaces | 721 | * Special Address Spaces |