|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/riscv: introduce intc_preinit()
commit 0e9bda67af4f19fbbe6cc1296e63d4e2b6486846
Author: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
AuthorDate: Tue Apr 1 12:46:47 2025 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 1 12:46:47 2025 +0200
xen/riscv: introduce intc_preinit()
Currently, only the device tree method is available to locate and perform
pre-initialization steps for the interrupt controller (at the moment, only
one interrupt controller is going to be supported). When `acpi_disabled`
is true, the system will scan for a node with the "interrupt-controller"
property and then call `device_init()` to validate if it is an expected
interrupt controller and if yes then save this node for further usage.
If `acpi_disabled` is false, the system will panic, as ACPI support is not
yet implemented for RISC-V.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/riscv/Makefile | 1 +
xen/arch/riscv/include/asm/intc.h | 2 ++
xen/arch/riscv/intc.c | 14 ++++++++++++++
xen/arch/riscv/setup.c | 3 +++
4 files changed, 20 insertions(+)
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index dd5fd25c7d..0c6c4a38a3 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -2,6 +2,7 @@ obj-y += aplic.o
obj-y += cpufeature.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-y += entry.o
+obj-y += intc.o
obj-y += mm.o
obj-y += pt.o
obj-$(CONFIG_RISCV_64) += riscv64/
diff --git a/xen/arch/riscv/include/asm/intc.h
b/xen/arch/riscv/include/asm/intc.h
index ff9bb33896..52ba196d87 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -17,4 +17,6 @@ struct intc_info {
const struct dt_device_node *node;
};
+void intc_preinit(void);
+
#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
new file mode 100644
index 0000000000..4061a3c457
--- /dev/null
+++ b/xen/arch/riscv/intc.c
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/acpi.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+
+void __init intc_preinit(void)
+{
+ if ( acpi_disabled )
+ intc_dt_preinit();
+ else
+ panic("ACPI interrupt controller preinit() isn't implemented\n");
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 836ad16fed..4e416f6e44 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -16,6 +16,7 @@
#include <asm/cpufeature.h>
#include <asm/early_printk.h>
#include <asm/fixmap.h>
+#include <asm/intc.h>
#include <asm/sbi.h>
#include <asm/setup.h>
#include <asm/smp.h>
@@ -128,6 +129,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
preinit_xen_time();
+ intc_preinit();
+
printk("All set up\n");
machine_halt();
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |