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: https://github.com/acpica/acpica/commit/cdf48b14
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Erik Kaneda 2021-06-04 14:26:07 -07:00 committed by Rafael J. Wysocki
parent d71df85aac
commit 04da290dd2
5 changed files with 63 additions and 2 deletions

View File

@ -737,6 +737,8 @@ const char *acpi_ah_match_uuid(u8 *data);
*/
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
acpi_status acpi_ut_convert_uuid_to_string(char *uuid_buffer, char *out_string);
#endif
#endif /* _ACUTILS_H */

View File

@ -139,7 +139,9 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_GSBUS
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_IPMI)) {
ACPI_ADR_SPACE_IPMI
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_PLATFORM_RT)) {
/* SMBus, GSBus, IPMI serial */
@ -301,7 +303,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_GSBUS
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_IPMI)) {
ACPI_ADR_SPACE_IPMI
|| obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_PLATFORM_RT)) {
/* SMBus, GSBus, IPMI serial */

View File

@ -195,6 +195,12 @@ acpi_ex_read_serial_bus(union acpi_operand_object *obj_desc,
function = ACPI_READ | (accessor_type << 16);
break;
case ACPI_ADR_SPACE_PLATFORM_RT:
buffer_length = ACPI_PRM_INPUT_BUFFER_SIZE;
function = ACPI_READ;
break;
default:
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
}
@ -311,6 +317,12 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
function = ACPI_WRITE | (accessor_type << 16);
break;
case ACPI_ADR_SPACE_PLATFORM_RT:
buffer_length = ACPI_PRM_INPUT_BUFFER_SIZE;
function = ACPI_WRITE;
break;
default:
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
}

View File

@ -61,4 +61,45 @@ void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer)
1]);
}
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_convert_uuid_to_string
*
* PARAMETERS: uuid_buffer - 16-byte UUID buffer
* out_string - 36-byte formatted UUID string
*
* RETURN: Status
*
* DESCRIPTION: Convert 16-byte UUID buffer to 36-byte formatted UUID string
* out_string must be 37 bytes to include null terminator.
*
******************************************************************************/
acpi_status acpi_ut_convert_uuid_to_string(char *uuid_buffer, char *out_string)
{
u32 i;
if (!uuid_buffer || !out_string) {
return (AE_BAD_PARAMETER);
}
for (i = 0; i < UUID_BUFFER_LENGTH; i++) {
out_string[acpi_gbl_map_to_uuid_offset[i]] =
acpi_ut_hex_to_ascii_char(uuid_buffer[i], 4);
out_string[acpi_gbl_map_to_uuid_offset[i] + 1] =
acpi_ut_hex_to_ascii_char(uuid_buffer[i], 0);
}
/* Insert required hyphens (dashes) */
out_string[UUID_HYPHEN1_OFFSET] =
out_string[UUID_HYPHEN2_OFFSET] =
out_string[UUID_HYPHEN3_OFFSET] =
out_string[UUID_HYPHEN4_OFFSET] = '-';
out_string[UUID_STRING_LENGTH] = 0; /* Null terminate */
return (AE_OK);
}
#endif

View File

@ -188,6 +188,8 @@
#define ACPI_MAX_GSBUS_DATA_SIZE 255
#define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
#define ACPI_PRM_INPUT_BUFFER_SIZE 26
/* _sx_d and _sx_w control methods */
#define ACPI_NUM_sx_d_METHODS 4