Skip to content

Commit 04da290

Browse files
Erik Kanedarafaeljw
authored andcommitted
ACPICA: Add support for PlatformRtMechanism OperationRegion handler
ACPICA commit cdf48b141d7da38e47fe4020310033ddd1971f9e Writing a buffer to a PlatformRtMechanism FieldUnit invokes a bidirectional transaction. The input buffer contains 26 bytes containing 9 bytes of status, a command byte and a 16-byte UUID. This change will will simply pass this incoming buffer to a handler registered by the OS. Link: acpica/acpica@cdf48b14 Signed-off-by: Erik Kaneda <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d71df85 commit 04da290

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

drivers/acpi/acpica/acutils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ const char *acpi_ah_match_uuid(u8 *data);
737737
*/
738738
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
739739
void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
740+
741+
acpi_status acpi_ut_convert_uuid_to_string(char *uuid_buffer, char *out_string);
740742
#endif
741743

742744
#endif /* _ACUTILS_H */

drivers/acpi/acpica/exfield.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
139139
|| obj_desc->field.region_obj->region.space_id ==
140140
ACPI_ADR_SPACE_GSBUS
141141
|| obj_desc->field.region_obj->region.space_id ==
142-
ACPI_ADR_SPACE_IPMI)) {
142+
ACPI_ADR_SPACE_IPMI
143+
|| obj_desc->field.region_obj->region.space_id ==
144+
ACPI_ADR_SPACE_PLATFORM_RT)) {
143145

144146
/* SMBus, GSBus, IPMI serial */
145147

@@ -301,7 +303,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
301303
|| obj_desc->field.region_obj->region.space_id ==
302304
ACPI_ADR_SPACE_GSBUS
303305
|| obj_desc->field.region_obj->region.space_id ==
304-
ACPI_ADR_SPACE_IPMI)) {
306+
ACPI_ADR_SPACE_IPMI
307+
|| obj_desc->field.region_obj->region.space_id ==
308+
ACPI_ADR_SPACE_PLATFORM_RT)) {
305309

306310
/* SMBus, GSBus, IPMI serial */
307311

drivers/acpi/acpica/exserial.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ acpi_ex_read_serial_bus(union acpi_operand_object *obj_desc,
195195
function = ACPI_READ | (accessor_type << 16);
196196
break;
197197

198+
case ACPI_ADR_SPACE_PLATFORM_RT:
199+
200+
buffer_length = ACPI_PRM_INPUT_BUFFER_SIZE;
201+
function = ACPI_READ;
202+
break;
203+
198204
default:
199205
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
200206
}
@@ -311,6 +317,12 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
311317
function = ACPI_WRITE | (accessor_type << 16);
312318
break;
313319

320+
case ACPI_ADR_SPACE_PLATFORM_RT:
321+
322+
buffer_length = ACPI_PRM_INPUT_BUFFER_SIZE;
323+
function = ACPI_WRITE;
324+
break;
325+
314326
default:
315327
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
316328
}

drivers/acpi/acpica/utuuid.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,45 @@ void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer)
6161
1]);
6262
}
6363
}
64+
65+
/*******************************************************************************
66+
*
67+
* FUNCTION: acpi_ut_convert_uuid_to_string
68+
*
69+
* PARAMETERS: uuid_buffer - 16-byte UUID buffer
70+
* out_string - 36-byte formatted UUID string
71+
*
72+
* RETURN: Status
73+
*
74+
* DESCRIPTION: Convert 16-byte UUID buffer to 36-byte formatted UUID string
75+
* out_string must be 37 bytes to include null terminator.
76+
*
77+
******************************************************************************/
78+
79+
acpi_status acpi_ut_convert_uuid_to_string(char *uuid_buffer, char *out_string)
80+
{
81+
u32 i;
82+
83+
if (!uuid_buffer || !out_string) {
84+
return (AE_BAD_PARAMETER);
85+
}
86+
87+
for (i = 0; i < UUID_BUFFER_LENGTH; i++) {
88+
out_string[acpi_gbl_map_to_uuid_offset[i]] =
89+
acpi_ut_hex_to_ascii_char(uuid_buffer[i], 4);
90+
91+
out_string[acpi_gbl_map_to_uuid_offset[i] + 1] =
92+
acpi_ut_hex_to_ascii_char(uuid_buffer[i], 0);
93+
}
94+
95+
/* Insert required hyphens (dashes) */
96+
97+
out_string[UUID_HYPHEN1_OFFSET] =
98+
out_string[UUID_HYPHEN2_OFFSET] =
99+
out_string[UUID_HYPHEN3_OFFSET] =
100+
out_string[UUID_HYPHEN4_OFFSET] = '-';
101+
102+
out_string[UUID_STRING_LENGTH] = 0; /* Null terminate */
103+
return (AE_OK);
104+
}
64105
#endif

include/acpi/acconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
#define ACPI_MAX_GSBUS_DATA_SIZE 255
189189
#define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
190190

191+
#define ACPI_PRM_INPUT_BUFFER_SIZE 26
192+
191193
/* _sx_d and _sx_w control methods */
192194

193195
#define ACPI_NUM_sx_d_METHODS 4

0 commit comments

Comments
 (0)