Skip to content

Commit e1f9277

Browse files
committed
Merge branch 'acpica'
* acpica: (22 commits) ACPICA: Update version to 20210331 ACPICA: IORT: Updates for revision E.b ACPICA: acpisrc: Add missing conversion for VIOT support ACPICA: iASL: Decode subtable type field for VIOT ACPICA: iASL: Add support for CEDT table ACPICA: ACPI 6.4: add support for PHAT table ACPICA: ACPI 6.4: add CSI2Bus resource template ACPICA: ACPI 6.4: PMTT: add new fields/structures ACPICA: CXL 2.0: CEDT: Add new CEDT table ACPICA: iASL: Add definitions for the VIOT table ACPICA: ACPI 6.4: add SDEV secure access components ACPICA: ACPI 6.4: Add new flags in SRAT ACPICA: ACPI 6.4: HMAT: add new fields/flags ACPICA: ACPI 6.4: NFIT: add Location Cookie field ACPICA: Tree-wide: fix various typos and spelling mistakes ACPICA: ACPI 6.4: PPTT: add new version of subtable type 1 ACPICA: ACPI 6.4: PCCT: add support for subtable type 5 ACPICA: ACPI 6.4: MADT: add Multiprocessor Wakeup Structure ACPICA: ACPI 6.4: add CXL ACPI device ID and _CBR object ACPICA: ACPI 6.4: add USB4 capabilities UUID ...
2 parents c3f2311 + c3fbd67 commit e1f9277

23 files changed

Lines changed: 537 additions & 44 deletions

File tree

drivers/acpi/acpica/acpredef.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,17 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
328328
{{"_BMS", METHOD_1ARGS(ACPI_TYPE_INTEGER),
329329
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
330330

331+
{{"_BPC", METHOD_0ARGS,
332+
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
333+
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
334+
335+
{{"_BPS", METHOD_0ARGS,
336+
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (5 Int) */
337+
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0),
338+
339+
{{"_BPT", METHOD_1ARGS(ACPI_TYPE_PACKAGE),
340+
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
341+
331342
{{"_BQC", METHOD_0ARGS,
332343
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
333344

@@ -347,6 +358,10 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
347358
{{"_CBA", METHOD_0ARGS,
348359
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
349360

361+
{{"_CBR", METHOD_0ARGS,
362+
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int) */
363+
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0, 0, 0),
364+
350365
{{"_CCA", METHOD_0ARGS,
351366
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
352367

drivers/acpi/acpica/acresrc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ typedef enum {
4646
ACPI_RSC_1BITFLAG,
4747
ACPI_RSC_2BITFLAG,
4848
ACPI_RSC_3BITFLAG,
49+
ACPI_RSC_6BITFLAG,
4950
ACPI_RSC_ADDRESS,
5051
ACPI_RSC_BITMASK,
5152
ACPI_RSC_BITMASK16,
@@ -102,6 +103,7 @@ typedef enum {
102103
ACPI_RSD_1BITFLAG,
103104
ACPI_RSD_2BITFLAG,
104105
ACPI_RSD_3BITFLAG,
106+
ACPI_RSD_6BITFLAG,
105107
ACPI_RSD_ADDRESS,
106108
ACPI_RSD_DWORDLIST,
107109
ACPI_RSD_LITERAL,
@@ -295,6 +297,7 @@ extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
295297
extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
296298
extern struct acpi_rsconvert_info acpi_rs_convert_gpio[];
297299
extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[];
300+
extern struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[];
298301
extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[];
299302
extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[];
300303
extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[];
@@ -349,6 +352,7 @@ extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
349352
extern struct acpi_rsdump_info acpi_rs_dump_pin_function[];
350353
extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
351354
extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
355+
extern struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[];
352356
extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
353357
extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
354358
extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];

drivers/acpi/acpica/acutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ extern const char *acpi_gbl_max_decode[];
2828
extern const char *acpi_gbl_mem_decode[];
2929
extern const char *acpi_gbl_min_decode[];
3030
extern const char *acpi_gbl_mtp_decode[];
31+
extern const char *acpi_gbl_phy_decode[];
3132
extern const char *acpi_gbl_rng_decode[];
3233
extern const char *acpi_gbl_rw_decode[];
3334
extern const char *acpi_gbl_shr_decode[];

drivers/acpi/acpica/amlresrc.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define ACPI_RESTAG_IORESTRICTION "_IOR"
4141
#define ACPI_RESTAG_LENGTH "_LEN"
4242
#define ACPI_RESTAG_LINE "_LIN"
43+
#define ACPI_RESTAG_LOCALPORT "_PRT"
4344
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
4445
#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
4546
#define ACPI_RESTAG_MAXADDR "_MAX"
@@ -49,6 +50,7 @@
4950
#define ACPI_RESTAG_MODE "_MOD"
5051
#define ACPI_RESTAG_PARITY "_PAR"
5152
#define ACPI_RESTAG_PHASE "_PHA"
53+
#define ACPI_RESTAG_PHYTYPE "_PHY"
5254
#define ACPI_RESTAG_PIN "_PIN"
5355
#define ACPI_RESTAG_PINCONFIG "_PPI"
5456
#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP"
@@ -316,12 +318,26 @@ struct aml_resource_gpio {
316318
#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
317319
#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
318320
#define AML_RESOURCE_UART_SERIALBUSTYPE 3
319-
#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
321+
#define AML_RESOURCE_CSI2_SERIALBUSTYPE 4
322+
#define AML_RESOURCE_MAX_SERIALBUSTYPE 4
320323
#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
321324

322325
struct aml_resource_common_serialbus {
323326
AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON};
324327

328+
struct aml_resource_csi2_serialbus {
329+
AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON
330+
/*
331+
* Optional fields follow immediately:
332+
* 1) Vendor Data bytes
333+
* 2) Resource Source String
334+
*/
335+
};
336+
337+
#define AML_RESOURCE_CSI2_REVISION 1 /* ACPI 6.4 */
338+
#define AML_RESOURCE_CSI2_TYPE_REVISION 1 /* ACPI 6.4 */
339+
#define AML_RESOURCE_CSI2_MIN_DATA_LEN 0 /* ACPI 6.4 */
340+
325341
struct aml_resource_i2c_serialbus {
326342
AML_RESOURCE_LARGE_HEADER_COMMON
327343
AML_RESOURCE_SERIAL_COMMON u32 connection_speed;
@@ -510,6 +526,7 @@ union aml_resource {
510526
struct aml_resource_i2c_serialbus i2c_serial_bus;
511527
struct aml_resource_spi_serialbus spi_serial_bus;
512528
struct aml_resource_uart_serialbus uart_serial_bus;
529+
struct aml_resource_csi2_serialbus csi2_serial_bus;
513530
struct aml_resource_common_serialbus common_serial_bus;
514531
struct aml_resource_pin_function pin_function;
515532
struct aml_resource_pin_config pin_config;

drivers/acpi/acpica/rscalc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,10 @@ acpi_rs_get_list_length(u8 *aml_buffer,
677677
*size_needed += buffer_size;
678678

679679
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
680-
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
680+
"Type %.2X, AmlLength %.2X InternalLength %.2X%8X\n",
681681
acpi_ut_get_resource_type(aml_buffer),
682682
acpi_ut_get_descriptor_length(aml_buffer),
683-
buffer_size));
683+
ACPI_FORMAT_UINT64(*size_needed)));
684684

685685
/*
686686
* Point to the next resource within the AML stream using the length

drivers/acpi/acpica/rsdump.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
8787
("Invalid descriptor type (%X) in resource list\n",
8888
resource_list->type);
8989
return;
90+
} else if (!resource_list->type) {
91+
ACPI_ERROR((AE_INFO, "Invalid Zero Resource Type"));
92+
return;
9093
}
9194

9295
/* Sanity check the length. It must not be zero, or we loop forever */
@@ -258,6 +261,11 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
258261
table->pointer[*target & 0x07]);
259262
break;
260263

264+
case ACPI_RSD_6BITFLAG:
265+
266+
acpi_rs_out_integer8(name, (ACPI_GET8(target) & 0x3F));
267+
break;
268+
261269
case ACPI_RSD_SHORTLIST:
262270
/*
263271
* Short byte list (single line output) for DMA and IRQ resources

drivers/acpi/acpica/rsdumpinfo.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,32 @@ struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[11] = {
421421
ACPI_RS_DUMP_COMMON_SERIAL_BUS
422422
};
423423

424+
struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[11] = {
425+
{ ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_csi2_serial_bus),
426+
"Camera Serial Bus", NULL },
427+
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.revision_id),
428+
"RevisionId", NULL },
429+
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type), "Type",
430+
acpi_gbl_sbt_decode },
431+
{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.producer_consumer),
432+
"ProducerConsumer", acpi_gbl_consume_decode },
433+
{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.slave_mode),
434+
"SlaveMode", acpi_gbl_sm_decode },
435+
{ ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.phy_type),
436+
"PhyType", acpi_gbl_phy_decode },
437+
{ ACPI_RSD_6BITFLAG,
438+
ACPI_RSD_OFFSET(csi2_serial_bus.local_port_instance),
439+
"LocalPortInstance", NULL },
440+
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type_revision_id),
441+
"TypeRevisionId", NULL },
442+
{ ACPI_RSD_UINT16, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_length),
443+
"VendorLength", NULL },
444+
{ ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_data),
445+
"VendorData", NULL },
446+
{ ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(csi2_serial_bus.resource_source),
447+
"ResourceSource", NULL },
448+
};
449+
424450
struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[14] = {
425451
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus),
426452
"I2C Serial Bus", NULL},

drivers/acpi/acpica/rsinfo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
9696
acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
9797
};
9898

99-
/* Subtype table for serial_bus -- I2C, SPI, and UART */
99+
/* Subtype table for serial_bus -- I2C, SPI, UART, and CSI2 */
100100

101101
struct acpi_rsconvert_info *acpi_gbl_convert_resource_serial_bus_dispatch[] = {
102102
NULL,
103103
acpi_rs_convert_i2c_serial_bus,
104104
acpi_rs_convert_spi_serial_bus,
105105
acpi_rs_convert_uart_serial_bus,
106+
acpi_rs_convert_csi2_serial_bus
106107
};
107108

108109
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
@@ -142,6 +143,7 @@ struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = {
142143
acpi_rs_dump_i2c_serial_bus, /* AML_RESOURCE_I2C_BUS_TYPE */
143144
acpi_rs_dump_spi_serial_bus, /* AML_RESOURCE_SPI_BUS_TYPE */
144145
acpi_rs_dump_uart_serial_bus, /* AML_RESOURCE_UART_BUS_TYPE */
146+
acpi_rs_dump_csi2_serial_bus, /* AML_RESOURCE_CSI2_BUS_TYPE */
145147
};
146148
#endif
147149

@@ -226,11 +228,13 @@ const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {
226228
sizeof(struct aml_resource_i2c_serialbus),
227229
sizeof(struct aml_resource_spi_serialbus),
228230
sizeof(struct aml_resource_uart_serialbus),
231+
sizeof(struct aml_resource_csi2_serialbus),
229232
};
230233

231234
const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = {
232235
0,
233236
ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
234237
ACPI_RS_SIZE(struct acpi_resource_spi_serialbus),
235238
ACPI_RS_SIZE(struct acpi_resource_uart_serialbus),
239+
ACPI_RS_SIZE(struct acpi_resource_csi2_serialbus),
236240
};

drivers/acpi/acpica/rslist.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
5959
AML_RESOURCE_MAX_SERIALBUSTYPE) {
6060
conversion_table = NULL;
6161
} else {
62-
/* This is an I2C, SPI, or UART serial_bus descriptor */
62+
/* This is an I2C, SPI, UART, or CSI2 serial_bus descriptor */
6363

6464
conversion_table =
6565
acpi_gbl_convert_resource_serial_bus_dispatch
@@ -89,6 +89,11 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
8989
return_ACPI_STATUS(status);
9090
}
9191

92+
if (!resource->length) {
93+
ACPI_EXCEPTION((AE_INFO, status,
94+
"Zero-length resource returned from RsConvertAmlToResource"));
95+
}
96+
9297
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
9398
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
9499
acpi_ut_get_resource_type(aml), length,
@@ -158,7 +163,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
158163
AML_RESOURCE_MAX_SERIALBUSTYPE) {
159164
conversion_table = NULL;
160165
} else {
161-
/* This is an I2C, SPI, or UART serial_bus descriptor */
166+
/* This is an I2C, SPI, UART or CSI2 serial_bus descriptor */
162167

163168
conversion_table =
164169
acpi_gbl_convert_resource_serial_bus_dispatch

drivers/acpi/acpica/rsmisc.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
7070
*/
7171
count = INIT_TABLE_LENGTH(info);
7272
while (count) {
73+
target = NULL;
74+
7375
/*
7476
* Source is the external AML byte stream buffer,
7577
* destination is the internal resource descriptor
@@ -120,6 +122,14 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
120122
((ACPI_GET8(source) >> info->value) & 0x07));
121123
break;
122124

125+
case ACPI_RSC_6BITFLAG:
126+
/*
127+
* Mask and shift the flag bits
128+
*/
129+
ACPI_SET8(destination,
130+
((ACPI_GET8(source) >> info->value) & 0x3F));
131+
break;
132+
123133
case ACPI_RSC_COUNT:
124134

125135
item_count = ACPI_GET8(source);
@@ -509,6 +519,15 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
509519
value));
510520
break;
511521

522+
case ACPI_RSC_6BITFLAG:
523+
/*
524+
* Mask and shift the flag bits
525+
*/
526+
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
527+
((ACPI_GET8(source) & 0x3F) << info->
528+
value));
529+
break;
530+
512531
case ACPI_RSC_COUNT:
513532

514533
item_count = ACPI_GET8(source);

0 commit comments

Comments
 (0)