Skip to content

Commit bb96fb5

Browse files
vlsunilPaul Walmsley
authored andcommitted
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>
1 parent 4d185fd commit bb96fb5

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

  • arch/riscv/include/asm
  • drivers/acpi/riscv

arch/riscv/include/asm/irq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum riscv_irqchip_type {
3232
ACPI_RISCV_IRQCHIP_IMSIC = 0x01,
3333
ACPI_RISCV_IRQCHIP_PLIC = 0x02,
3434
ACPI_RISCV_IRQCHIP_APLIC = 0x03,
35+
ACPI_RISCV_IRQCHIP_SMSI = 0x04,
3536
};
3637

3738
int riscv_acpi_get_gsi_info(struct fwnode_handle *fwnode, u32 *gsi_base,

drivers/acpi/riscv/irq.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,33 @@ static int __init riscv_acpi_register_ext_intc(u32 gsi_base, u32 nr_irqs, u32 nr
168168
return 0;
169169
}
170170

171+
static acpi_status __init riscv_acpi_create_gsi_map_smsi(acpi_handle handle, u32 level,
172+
void *context, void **return_value)
173+
{
174+
acpi_status status;
175+
u64 gbase;
176+
177+
if (!acpi_has_method(handle, "_GSB")) {
178+
acpi_handle_err(handle, "_GSB method not found\n");
179+
return AE_ERROR;
180+
}
181+
182+
status = acpi_evaluate_integer(handle, "_GSB", NULL, &gbase);
183+
if (ACPI_FAILURE(status)) {
184+
acpi_handle_err(handle, "failed to evaluate _GSB method\n");
185+
return status;
186+
}
187+
188+
riscv_acpi_register_ext_intc(gbase, 0, 0, 0, ACPI_RISCV_IRQCHIP_SMSI);
189+
status = riscv_acpi_update_gsi_handle((u32)gbase, handle);
190+
if (ACPI_FAILURE(status)) {
191+
acpi_handle_err(handle, "failed to find the GSI mapping entry\n");
192+
return status;
193+
}
194+
195+
return AE_OK;
196+
}
197+
171198
static acpi_status __init riscv_acpi_create_gsi_map(acpi_handle handle, u32 level,
172199
void *context, void **return_value)
173200
{
@@ -222,6 +249,9 @@ void __init riscv_acpi_init_gsi_mapping(void)
222249

223250
if (acpi_table_parse_madt(ACPI_MADT_TYPE_APLIC, riscv_acpi_aplic_parse_madt, 0) > 0)
224251
acpi_get_devices("RSCV0002", riscv_acpi_create_gsi_map, NULL, NULL);
252+
253+
/* Unlike PLIC/APLIC, SYSMSI doesn't have MADT */
254+
acpi_get_devices("RSCV0006", riscv_acpi_create_gsi_map_smsi, NULL, NULL);
225255
}
226256

227257
static acpi_handle riscv_acpi_get_gsi_handle(u32 gsi)

0 commit comments

Comments
 (0)