Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica:
  ACPICA: Add PRMT module header to facilitate parsing
  ACPICA: Update version to 20210604
  ACPICA: Add support for PlatformRtMechanism OperationRegion handler
  ACPICA: iASL: add disassembler support for PRMT
  ACPICA: Add the CFMWS structure definition to the CEDT table
  ACPICA: Add defines for the CXL Host Bridge Structure (CHBS)
  ACPICA: iASL: Add support for the BDAT ACPI table
  ACPICA: Add _PLD panel positions
  ACPICA: Use ACPI_FALLTHROUGH
  ACPICA: iASL Table Compiler: Add full support for RGRT ACPI table
  ACPICA: iASL: Add support for the SVKL table
  ACPICA: iASL: Finish support for the IVRS ACPI table
  ACPICA: Fix memory leak caused by _CID repair function
  ACPICA: Add SVKL table headers
  ACPICA: ACPI 6.4: MADT: add Multiprocessor Wakeup Mailbox Structure
  • Loading branch information
Rafael J. Wysocki committed Jun 29, 2021
2 parents 49b9441 + 9f8c7ba commit f9ef9b8
Show file tree
Hide file tree
Showing 11 changed files with 259 additions and 5 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
8 changes: 6 additions & 2 deletions drivers/acpi/acpica/exfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */

Expand Down
12 changes: 12 additions & 0 deletions drivers/acpi/acpica/exserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
7 changes: 7 additions & 0 deletions drivers/acpi/acpica/nsrepair2.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ acpi_ns_repair_CID(struct acpi_evaluate_info *info,

(*element_ptr)->common.reference_count =
original_ref_count;

/*
* The original_element holds a reference from the package object
* that represents _HID. Since a new element was created by _HID,
* remove the reference from the _CID package.
*/
acpi_ut_remove_reference(original_element);
}

element_ptr++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/utprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int vsnprintf(char *string, acpi_size size, const char *format, va_list args)
case 'X':

type |= ACPI_FORMAT_UPPER;
/* FALLTHROUGH */
ACPI_FALLTHROUGH;

case 'x':

Expand Down
41 changes: 41 additions & 0 deletions drivers/acpi/acpica/utuuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions include/acpi/acbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,14 @@ struct acpi_pld_info {
#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */

/* Panel position defined in _PLD section of ACPI Specification 6.3 */

#define ACPI_PLD_PANEL_TOP 0
#define ACPI_PLD_PANEL_BOTTOM 1
#define ACPI_PLD_PANEL_LEFT 2
#define ACPI_PLD_PANEL_RIGHT 3
#define ACPI_PLD_PANEL_FRONT 4
#define ACPI_PLD_PANEL_BACK 5
#define ACPI_PLD_PANEL_UNKNOWN 6

#endif /* ACBUFFER_H */
2 changes: 2 additions & 0 deletions include/acpi/acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/* Current ACPICA subsystem version in YYYYMMDD format */

#define ACPI_CA_VERSION 0x20210331
#define ACPI_CA_VERSION 0x20210604

#include <acpi/acconfig.h>
#include <acpi/actypes.h>
Expand Down
41 changes: 40 additions & 1 deletion include/acpi/actbl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,20 @@ struct acpi_cedt_header {

enum acpi_cedt_type {
ACPI_CEDT_TYPE_CHBS = 0,
ACPI_CEDT_TYPE_RESERVED = 1
ACPI_CEDT_TYPE_CFMWS = 1,
ACPI_CEDT_TYPE_RESERVED = 2,
};

/* Values for version field above */

#define ACPI_CEDT_CHBS_VERSION_CXL11 (0)
#define ACPI_CEDT_CHBS_VERSION_CXL20 (1)

/* Values for length field above */

#define ACPI_CEDT_CHBS_LENGTH_CXL11 (0x2000)
#define ACPI_CEDT_CHBS_LENGTH_CXL20 (0x10000)

/*
* CEDT subtables
*/
Expand All @@ -345,6 +356,34 @@ struct acpi_cedt_chbs {
u64 length;
};

/* 1: CXL Fixed Memory Window Structure */

struct acpi_cedt_cfmws {
struct acpi_cedt_header header;
u32 reserved1;
u64 base_hpa;
u64 window_size;
u8 interleave_ways;
u8 interleave_arithmetic;
u16 reserved2;
u32 granularity;
u16 restrictions;
u16 qtg_id;
u32 interleave_targets[];
};

/* Values for Interleave Arithmetic field above */

#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)

/* Values for Restrictions field above */

#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1)
#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1)
#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2)
#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3)
#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4)

/*******************************************************************************
*
* CPEP - Corrected Platform Error Polling table (ACPI 4.0)
Expand Down
Loading

0 comments on commit f9ef9b8

Please sign in to comment.