ACPICA: add support for ClockInput resource (v6.5)

ACPICA commit 661feab5ee01a34af95a389a18c82e79f1aba05a

Link: https://github.com/acpica/acpica/commit/661feab5
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:
Niyas Sait 2023-04-05 15:39:23 +02:00 committed by Rafael J. Wysocki
parent 612c293284
commit 520d4a0ee5
11 changed files with 137 additions and 2 deletions

View File

@ -1122,7 +1122,8 @@ struct acpi_port_info {
#define ACPI_RESOURCE_NAME_PIN_GROUP 0x90
#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91
#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x92
#define ACPI_RESOURCE_NAME_CLOCK_INPUT 0x93
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x94
/*****************************************************************************
*

View File

@ -306,6 +306,7 @@ extern struct acpi_rsconvert_info acpi_rs_convert_pin_config[];
extern struct acpi_rsconvert_info acpi_rs_convert_pin_group[];
extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[];
extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[];
extern struct acpi_rsconvert_info acpi_rs_convert_clock_input[];
/* These resources require separate get/set tables */
@ -361,6 +362,7 @@ extern struct acpi_rsdump_info acpi_rs_dump_pin_config[];
extern struct acpi_rsdump_info acpi_rs_dump_pin_group[];
extern struct acpi_rsdump_info acpi_rs_dump_pin_group_function[];
extern struct acpi_rsdump_info acpi_rs_dump_pin_group_config[];
extern struct acpi_rsdump_info acpi_rs_dump_clock_input[];
#endif
#endif /* __ACRESRC_H__ */

View File

@ -53,6 +53,8 @@ extern const char *acpi_gbl_sb_decode[];
extern const char *acpi_gbl_fc_decode[];
extern const char *acpi_gbl_pt_decode[];
extern const char *acpi_gbl_ptyp_decode[];
extern const char *acpi_gbl_clock_input_mode[];
extern const char *acpi_gbl_clock_input_scale[];
#endif
/*

View File

@ -70,6 +70,8 @@
#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
#define ACPI_RESTAG_VENDORDATA "_VEN"
#define ACPI_RESTAG_FQN "_FQN"
#define ACPI_RESTAG_FQD "_FQD"
/* Default sizes for "small" resource descriptors */
@ -427,6 +429,20 @@ struct aml_resource_pin_config {
*/
};
#define AML_RESOURCE_CLOCK_INPUT_REVISION 1 /* ACPI 6.5 */
struct aml_resource_clock_input {
AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
u16 flags;
u16 frequency_divisor;
u32 frequency_numerator;
/*
* Optional fields follow immediately:
* 1) Resource Source index
* 2) Resource Source String
*/
};
#define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */
struct aml_resource_pin_group {
@ -533,6 +549,7 @@ union aml_resource {
struct aml_resource_pin_group pin_group;
struct aml_resource_pin_group_function pin_group_function;
struct aml_resource_pin_group_config pin_group_config;
struct aml_resource_clock_input clock_input;
/* Utility overlays */

View File

@ -320,6 +320,16 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
break;
case ACPI_RESOURCE_TYPE_CLOCK_INPUT:
total_size = (acpi_rs_length)(total_size +
resource->data.
clock_input.
resource_source.
string_length);
break;
case ACPI_RESOURCE_TYPE_SERIAL_BUS:
total_size =
@ -650,6 +660,13 @@ acpi_rs_get_list_length(u8 *aml_buffer,
break;
case ACPI_RESOURCE_NAME_CLOCK_INPUT:
extra_struct_bytes =
acpi_rs_stream_option_length(resource_length,
minimum_aml_resource_length);
break;
default:
break;

View File

@ -301,6 +301,23 @@ struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = {
"VendorData", NULL},
};
struct acpi_rsdump_info acpi_rs_dump_clock_input[7] = {
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_clock_input),
"ClockInput", NULL},
{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(clock_input.revision_id), "RevisionId",
NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(clock_input.frequency_numerator),
"FrequencyNumerator", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(clock_input.frequency_divisor),
"FrequencyDivisor", NULL},
{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(clock_input.scale), "Scale",
acpi_gbl_clock_input_scale},
{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(clock_input.mode), "Mode",
acpi_gbl_clock_input_mode},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(clock_input.resource_source),
"ResourceSource", NULL},
};
struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = {
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_config),
"PinConfig", NULL},

View File

@ -49,6 +49,7 @@ struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[] = {
acpi_rs_convert_pin_group, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */
acpi_rs_convert_pin_group_function, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
acpi_rs_convert_pin_group_config, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
acpi_rs_convert_clock_input, /* 0x19, ACPI_RESOURCE_TYPE_CLOCK_INPUT */
};
/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@ -94,6 +95,7 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
acpi_rs_convert_pin_group, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
acpi_rs_convert_pin_group_function, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
acpi_rs_convert_clock_input, /* 0x13, ACPI_RESOURCE_NAME_CLOCK_INPUT */
};
/* Subtype table for serial_bus -- I2C, SPI, UART, and CSI2 */
@ -136,6 +138,7 @@ struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[] = {
acpi_rs_dump_pin_group, /* ACPI_RESOURCE_TYPE_PIN_GROUP */
acpi_rs_dump_pin_group_function, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
acpi_rs_dump_pin_group_config, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
acpi_rs_dump_clock_input, /* ACPI_RESOURCE_TYPE_CLOCK_INPUT */
};
struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = {
@ -178,6 +181,7 @@ const u8 acpi_gbl_aml_resource_sizes[] = {
sizeof(struct aml_resource_pin_group), /* ACPI_RESOURCE_TYPE_PIN_GROUP */
sizeof(struct aml_resource_pin_group_function), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
sizeof(struct aml_resource_pin_group_config), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
sizeof(struct aml_resource_clock_input), /* ACPI_RESOURCE_TYPE_CLOCK_INPUT */
};
const u8 acpi_gbl_resource_struct_sizes[] = {
@ -221,6 +225,7 @@ const u8 acpi_gbl_resource_struct_sizes[] = {
ACPI_RS_SIZE(struct acpi_resource_pin_group),
ACPI_RS_SIZE(struct acpi_resource_pin_group_function),
ACPI_RS_SIZE(struct acpi_resource_pin_group_config),
ACPI_RS_SIZE(struct acpi_resource_clock_input),
};
const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {

View File

@ -109,6 +109,55 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
0},
};
/*******************************************************************************
*
* acpi_rs_convert_clock_input
*
******************************************************************************/
struct acpi_rsconvert_info acpi_rs_convert_clock_input[8] = {
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_CLOCK_INPUT,
ACPI_RS_SIZE(struct acpi_resource_clock_input),
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_clock_input)},
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_CLOCK_INPUT,
sizeof(struct aml_resource_clock_input),
0}
,
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.clock_input.revision_id),
AML_OFFSET(clock_input.revision_id),
1}
,
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.clock_input.mode),
AML_OFFSET(clock_input.flags),
0}
,
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.clock_input.scale),
AML_OFFSET(clock_input.flags),
1}
,
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.clock_input.frequency_divisor),
AML_OFFSET(clock_input.frequency_divisor),
2}
,
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.clock_input.frequency_numerator),
AML_OFFSET(clock_input.frequency_numerator),
4}
,
/* Resource Source */
{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.clock_input.resource_source),
0,
sizeof(struct aml_resource_clock_input)}
,
};
/*******************************************************************************
*
* acpi_rs_convert_pinfunction

View File

@ -284,4 +284,15 @@ const char *acpi_gbl_ptyp_decode[] = {
"Input Schmitt Trigger",
};
const char *acpi_gbl_clock_input_mode[] = {
"Fixed",
"Variable",
};
const char *acpi_gbl_clock_input_scale[] = {
"Hz",
"KHz",
"MHz",
};
#endif

View File

@ -57,6 +57,8 @@ const u8 acpi_gbl_resource_aml_sizes[] = {
ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group),
ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_function),
ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_config),
ACPI_AML_SIZE_LARGE(struct aml_resource_clock_input),
};
const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = {
@ -114,6 +116,7 @@ static const u8 acpi_gbl_resource_types[] = {
ACPI_VARIABLE_LENGTH, /* 10 pin_group */
ACPI_VARIABLE_LENGTH, /* 11 pin_group_function */
ACPI_VARIABLE_LENGTH, /* 12 pin_group_config */
ACPI_VARIABLE_LENGTH, /* 13 clock_input */
};
/*******************************************************************************

View File

@ -536,6 +536,15 @@ struct acpi_resource_pin_config {
u8 *vendor_data;
};
struct acpi_resource_clock_input {
u8 revision_id;
u8 mode;
u8 scale;
u16 frequency_divisor;
u32 frequency_numerator;
struct acpi_resource_source resource_source;
};
/* Values for pin_config_type field above */
#define ACPI_PIN_CONFIG_DEFAULT 0
@ -613,7 +622,8 @@ struct acpi_resource_pin_group_config {
#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_MAX 24
#define ACPI_RESOURCE_TYPE_CLOCK_INPUT 25 /* ACPI 6.5 */
#define ACPI_RESOURCE_TYPE_MAX 25
/* Master union for resource descriptors */
@ -647,6 +657,7 @@ union acpi_resource_data {
struct acpi_resource_pin_group pin_group;
struct acpi_resource_pin_group_function pin_group_function;
struct acpi_resource_pin_group_config pin_group_config;
struct acpi_resource_clock_input clock_input;
/* Common fields */