return 0;
}
-static void __init gic_dt_preinit(void)
-{
- int rc;
- struct dt_device_node *node;
- uint8_t num_gics = 0;
-
- dt_for_each_device_node( dt_host, node )
- {
- if ( !dt_get_property(node, "interrupt-controller", NULL) )
- continue;
-
- if ( !dt_get_parent(node) )
- continue;
-
- rc = device_init(node, DEVICE_INTERRUPT_CONTROLLER, NULL);
- if ( !rc )
- {
- /* NOTE: Only one GIC is supported */
- num_gics = 1;
- break;
- }
- }
- if ( !num_gics )
- panic("Unable to find compatible GIC in the device tree\n");
-
- /* Set the GIC as the primary interrupt controller */
- dt_interrupt_controller = node;
- dt_device_set_used_by(node, DOMID_XEN);
-}
-
#ifdef CONFIG_ACPI
static void __init gic_acpi_preinit(void)
{
void __init gic_preinit(void)
{
if ( acpi_disabled )
- gic_dt_preinit();
+ intc_dt_preinit();
else
gic_acpi_preinit();
}
obj-y += bootinfo.init.o
obj-y += device-tree.o
obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
+obj-y += intc.o
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+
+void __init intc_dt_preinit(void)
+{
+ struct dt_device_node *node;
+ uint8_t num_intc = 0;
+
+ dt_for_each_device_node( dt_host, node )
+ {
+ if ( !dt_get_property(node, "interrupt-controller", NULL) )
+ continue;
+
+ if ( !dt_get_parent(node) )
+ continue;
+
+ if ( !device_init(node, DEVICE_INTERRUPT_CONTROLLER, NULL) )
+ {
+ /* NOTE: Only one interrupt controller is supported */
+ num_intc = 1;
+ break;
+ }
+ }
+
+ if ( !num_intc )
+ panic("Unable to find compatible interrupt controller in the device tree\n");
+
+ /* Set the interrupt controller as the primary interrupt controller */
+ dt_interrupt_controller = node;
+ dt_device_set_used_by(node, DOMID_XEN);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
struct dt_device_node *
dt_find_interrupt_controller(const struct dt_device_match *matches);
+void intc_dt_preinit(void);
+
#define dt_prop_cmp(s1, s2) strcmp((s1), (s2))
#define dt_node_cmp(s1, s2) strcasecmp((s1), (s2))
#define dt_compat_cmp(s1, s2) strcasecmp((s1), (s2))