[PATCH v2 1/4] ACPI: LoongArch: Add acpi_arch_[late]_init()
From: Bibo Mao
Date: Fri Jul 17 2026 - 02:46:23 EST
LoongArch IOMMU scanning flow is similar with virtio-iommu,
there is early init and late_init. In early init function, PCI
ACS is enabled if there is IOMMU table, and late_init is called
after PCI device scanning, where IOVT table scanning function is
executed.
Here add acpi_arch_init() and acpi_arch_late_init() API on LoongArch,
now they are both empty, In the future, IOVT table parsing will be
added.
Signed-off-by: Bibo Mao <maobibo@xxxxxxxxxxx>
---
drivers/acpi/Makefile | 2 +-
drivers/acpi/bus.c | 2 ++
drivers/acpi/loongarch/Makefile | 2 ++
drivers/acpi/loongarch/init.c | 11 +++++++++++
include/linux/acpi.h | 1 +
5 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 drivers/acpi/loongarch/Makefile
create mode 100644 drivers/acpi/loongarch/init.c
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index d1b0affb844f..91584a3c1e01 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -131,6 +131,6 @@ obj-y += dptf/
obj-$(CONFIG_ARM64) += arm64/
obj-$(CONFIG_ACPI_VIOT) += viot.o
-
+obj-$(CONFIG_LOONGARCH) += loongarch/
obj-$(CONFIG_RISCV) += riscv/
obj-$(CONFIG_X86) += x86/
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a30a904f6535..5f6924b9e29d 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1571,6 +1571,7 @@ struct kobject *acpi_kobj;
EXPORT_SYMBOL_GPL(acpi_kobj);
void __weak __init acpi_arch_init(void) { }
+void __weak __init acpi_arch_late_init(void) { }
static int __init acpi_init(void)
{
@@ -1609,6 +1610,7 @@ static int __init acpi_init(void)
acpi_wakeup_device_init();
acpi_debugger_init();
acpi_setup_sb_notify_handler();
+ acpi_arch_late_init();
acpi_viot_init();
return 0;
}
diff --git a/drivers/acpi/loongarch/Makefile b/drivers/acpi/loongarch/Makefile
new file mode 100644
index 000000000000..d3764139dfaf
--- /dev/null
+++ b/drivers/acpi/loongarch/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += init.o
diff --git a/drivers/acpi/loongarch/init.c b/drivers/acpi/loongarch/init.c
new file mode 100644
index 000000000000..b11aa5c7d928
--- /dev/null
+++ b/drivers/acpi/loongarch/init.c
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/acpi.h>
+
+void __init acpi_arch_init(void)
+{
+}
+
+void __init acpi_arch_late_init(void)
+{
+}
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 60ab50cb8930..c6a180341c2d 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1617,6 +1617,7 @@ static inline int acpi_pptt_get_cpumask_from_cache_id(u32 cache_id,
#endif
void acpi_arch_init(void);
+void acpi_arch_late_init(void);
#ifdef CONFIG_ACPI_PCC
void acpi_init_pcc(void);
--
2.39.3