Skip to content

Commit f3b19ad

Browse files
vlsunilrafaeljw
authored andcommitted
ACPICA: MADT: Add RISC-V external interrupt controllers
ACPICA commit 8c048cee4ea7b9ded8db3e1b3b9c14e21e084a2c This adds 3 different external interrupt controller definitions in MADT for RISC-V. 1) RISC-V PLIC is a platform interrupt controller for handling wired interrupt in a RISC-V systems. 2) RISC-V IMSIC is MSI interrupt controller to support MSI interrupts. 3) RISC-V APLIC has dual functionality. First it can act like PLIC and direct all wired interrupts to the CPU which doesn't have MSI controller. Second, when the CPU has MSI controller (IMSIC), it will act as a converter from wired interrupts to MSI. Update the existing RINTC structure also to support these external interrupt controllers. This codefirst ECR is approved by UEFI forum and will be part of next ACPI spec version. Link: acpica/acpica@8c048cee Signed-off-by: Haibo, Xu <haibo1.xu@intel.com> Co-developed-by: Haibo, Xu <haibo1.xu@intel.com> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3a21ffd commit f3b19ad

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

include/acpi/actbl2.h

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,10 @@ enum acpi_madt_type {
893893
ACPI_MADT_TYPE_BIO_PIC = 22,
894894
ACPI_MADT_TYPE_LPC_PIC = 23,
895895
ACPI_MADT_TYPE_RINTC = 24,
896-
ACPI_MADT_TYPE_RESERVED = 25, /* 25 to 0x7F are reserved */
896+
ACPI_MADT_TYPE_IMSIC = 25,
897+
ACPI_MADT_TYPE_APLIC = 26,
898+
ACPI_MADT_TYPE_PLIC = 27,
899+
ACPI_MADT_TYPE_RESERVED = 28, /* 28 to 0x7F are reserved */
897900
ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */
898901
};
899902

@@ -1261,6 +1264,9 @@ struct acpi_madt_rintc {
12611264
u32 flags;
12621265
u64 hart_id;
12631266
u32 uid; /* ACPI processor UID */
1267+
u32 ext_intc_id; /* External INTC Id */
1268+
u64 imsic_addr; /* IMSIC base address */
1269+
u32 imsic_size; /* IMSIC size */
12641270
};
12651271

12661272
/* Values for RISC-V INTC Version field above */
@@ -1271,6 +1277,48 @@ enum acpi_madt_rintc_version {
12711277
ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
12721278
};
12731279

1280+
/* 25: RISC-V IMSIC */
1281+
struct acpi_madt_imsic {
1282+
struct acpi_subtable_header header;
1283+
u8 version;
1284+
u8 reserved;
1285+
u32 flags;
1286+
u16 num_ids;
1287+
u16 num_guest_ids;
1288+
u8 guest_index_bits;
1289+
u8 hart_index_bits;
1290+
u8 group_index_bits;
1291+
u8 group_index_shift;
1292+
};
1293+
1294+
/* 26: RISC-V APLIC */
1295+
struct acpi_madt_aplic {
1296+
struct acpi_subtable_header header;
1297+
u8 version;
1298+
u8 id;
1299+
u32 flags;
1300+
u8 hw_id[8];
1301+
u16 num_idcs;
1302+
u16 num_sources;
1303+
u32 gsi_base;
1304+
u64 base_addr;
1305+
u32 size;
1306+
};
1307+
1308+
/* 27: RISC-V PLIC */
1309+
struct acpi_madt_plic {
1310+
struct acpi_subtable_header header;
1311+
u8 version;
1312+
u8 id;
1313+
u8 hw_id[8];
1314+
u16 num_irqs;
1315+
u16 max_prio;
1316+
u32 flags;
1317+
u32 size;
1318+
u64 base_addr;
1319+
u32 gsi_base;
1320+
};
1321+
12741322
/* 80: OEM data */
12751323

12761324
struct acpi_madt_oem_data {

0 commit comments

Comments
 (0)