mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
ACPI: RISC-V: Add support for RIMT
RISC-V IO Mapping Table (RIMT) is a static ACPI table to communicate IOMMU information to the OS. The spec is available at [1]. The changes at high level are, a) Initialize data structures required for IOMMU/device configuration using the data from RIMT. Provide APIs required for device configuration. b) Provide an API for IOMMU drivers to register the fwnode with RIMT data structures. This API will create a fwnode for PCIe IOMMU. [1] - https://github.com/riscv-non-isa/riscv-acpi-rimt Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20250818045807.763922-2-sunilvl@ventanamicro.com Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
@@ -347,6 +347,7 @@ L: linux-acpi@vger.kernel.org
|
||||
L: linux-riscv@lists.infradead.org
|
||||
S: Maintained
|
||||
F: drivers/acpi/riscv/
|
||||
F: include/linux/acpi_rimt.h
|
||||
|
||||
ACPI PCC(Platform Communication Channel) MAILBOX DRIVER
|
||||
M: Sudeep Holla <sudeep.holla@arm.com>
|
||||
|
||||
@@ -16,6 +16,7 @@ config RISCV
|
||||
select ACPI_MCFG if (ACPI && PCI)
|
||||
select ACPI_PPTT if ACPI
|
||||
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
|
||||
select ACPI_RIMT if ACPI
|
||||
select ACPI_SPCR_TABLE if ACPI
|
||||
select ARCH_DMA_DEFAULT_COHERENT
|
||||
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
|
||||
|
||||
@@ -547,6 +547,10 @@ if ARM64
|
||||
source "drivers/acpi/arm64/Kconfig"
|
||||
endif
|
||||
|
||||
if RISCV
|
||||
source "drivers/acpi/riscv/Kconfig"
|
||||
endif
|
||||
|
||||
config ACPI_PPTT
|
||||
bool
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# ACPI Configuration for RISC-V
|
||||
#
|
||||
|
||||
config ACPI_RIMT
|
||||
bool
|
||||
@@ -2,3 +2,4 @@
|
||||
obj-y += rhct.o init.o irq.o
|
||||
obj-$(CONFIG_ACPI_PROCESSOR_IDLE) += cpuidle.o
|
||||
obj-$(CONFIG_ACPI_CPPC_LIB) += cppc.o
|
||||
obj-$(CONFIG_ACPI_RIMT) += rimt.o
|
||||
|
||||
@@ -10,4 +10,6 @@
|
||||
void __init acpi_arch_init(void)
|
||||
{
|
||||
riscv_acpi_init_gsi_mapping();
|
||||
if (IS_ENABLED(CONFIG_ACPI_RIMT))
|
||||
riscv_acpi_rimt_init();
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
#include <linux/init.h>
|
||||
|
||||
void __init riscv_acpi_init_gsi_mapping(void);
|
||||
void __init riscv_acpi_rimt_init(void);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2024-2025, Ventana Micro Systems Inc.
|
||||
* Author: Sunil V L <sunilvl@ventanamicro.com>
|
||||
*/
|
||||
|
||||
#ifndef _ACPI_RIMT_H
|
||||
#define _ACPI_RIMT_H
|
||||
|
||||
#ifdef CONFIG_ACPI_RIMT
|
||||
int rimt_iommu_register(struct device *dev);
|
||||
#else
|
||||
static inline int rimt_iommu_register(struct device *dev)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_IOMMU_API) && defined(CONFIG_ACPI_RIMT)
|
||||
int rimt_iommu_configure_id(struct device *dev, const u32 *id_in);
|
||||
#else
|
||||
static inline int rimt_iommu_configure_id(struct device *dev, const u32 *id_in)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ACPI_RIMT_H */
|
||||
Reference in New Issue
Block a user