ACPI: RISC-V: Add RPMI System MSI to GSI mapping
The RPMI System MSI device will provide GSIs to downstream devices (such as GED) so add it to the RISC-V GSI to fwnode mapping. Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Link: https://lore.kernel.org/r/20250818040920.272664-20-apatel@ventanamicro.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
This commit is contained in:
parent
4d185fdeef
commit
bb96fb5a79
|
|
@ -32,6 +32,7 @@ enum riscv_irqchip_type {
|
|||
ACPI_RISCV_IRQCHIP_IMSIC = 0x01,
|
||||
ACPI_RISCV_IRQCHIP_PLIC = 0x02,
|
||||
ACPI_RISCV_IRQCHIP_APLIC = 0x03,
|
||||
ACPI_RISCV_IRQCHIP_SMSI = 0x04,
|
||||
};
|
||||
|
||||
int riscv_acpi_get_gsi_info(struct fwnode_handle *fwnode, u32 *gsi_base,
|
||||
|
|
|
|||
|
|
@ -168,6 +168,33 @@ static int __init riscv_acpi_register_ext_intc(u32 gsi_base, u32 nr_irqs, u32 nr
|
|||
return 0;
|
||||
}
|
||||
|
||||
static acpi_status __init riscv_acpi_create_gsi_map_smsi(acpi_handle handle, u32 level,
|
||||
void *context, void **return_value)
|
||||
{
|
||||
acpi_status status;
|
||||
u64 gbase;
|
||||
|
||||
if (!acpi_has_method(handle, "_GSB")) {
|
||||
acpi_handle_err(handle, "_GSB method not found\n");
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
status = acpi_evaluate_integer(handle, "_GSB", NULL, &gbase);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_handle_err(handle, "failed to evaluate _GSB method\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
riscv_acpi_register_ext_intc(gbase, 0, 0, 0, ACPI_RISCV_IRQCHIP_SMSI);
|
||||
status = riscv_acpi_update_gsi_handle((u32)gbase, handle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_handle_err(handle, "failed to find the GSI mapping entry\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static acpi_status __init riscv_acpi_create_gsi_map(acpi_handle handle, u32 level,
|
||||
void *context, void **return_value)
|
||||
{
|
||||
|
|
@ -222,6 +249,9 @@ void __init riscv_acpi_init_gsi_mapping(void)
|
|||
|
||||
if (acpi_table_parse_madt(ACPI_MADT_TYPE_APLIC, riscv_acpi_aplic_parse_madt, 0) > 0)
|
||||
acpi_get_devices("RSCV0002", riscv_acpi_create_gsi_map, NULL, NULL);
|
||||
|
||||
/* Unlike PLIC/APLIC, SYSMSI doesn't have MADT */
|
||||
acpi_get_devices("RSCV0006", riscv_acpi_create_gsi_map_smsi, NULL, NULL);
|
||||
}
|
||||
|
||||
static acpi_handle riscv_acpi_get_gsi_handle(u32 gsi)
|
||||
|
|
|
|||
Loading…
Reference in New Issue