Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/fdt Only attach v2m if PCI support is present
details: https://anonhg.NetBSD.org/src/rev/e624ce7f6476
branches: trunk
changeset: 445781:e624ce7f6476
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Nov 12 12:41:03 2018 +0000
description:
Only attach v2m if PCI support is present
diffstat:
sys/arch/arm/fdt/gic_fdt.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (68 lines):
diff -r b8cad0026009 -r e624ce7f6476 sys/arch/arm/fdt/gic_fdt.c
--- a/sys/arch/arm/fdt/gic_fdt.c Mon Nov 12 09:25:42 2018 +0000
+++ b/sys/arch/arm/fdt/gic_fdt.c Mon Nov 12 12:41:03 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.14 2018/11/11 21:24:28 jmcneill Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.15 2018/11/12 12:41:03 jmcneill Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -26,8 +26,10 @@
* SUCH DAMAGE.
*/
+#include "pci.h"
+
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.14 2018/11/11 21:24:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.15 2018/11/12 12:41:03 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -57,7 +59,9 @@
static int gic_fdt_match(device_t, cfdata_t, void *);
static void gic_fdt_attach(device_t, device_t, void *);
+#if NPCI > 0
static void gic_fdt_attach_v2m(struct gic_fdt_softc *, bus_space_tag_t, int);
+#endif
static int gic_fdt_intr(void *);
@@ -129,7 +133,7 @@
bus_addr_t addr_d, addr_c;
bus_size_t size_d, size_c;
bus_space_handle_t bsh;
- int error, child;
+ int error;
sc->sc_dev = self;
sc->sc_phandle = phandle;
@@ -175,15 +179,18 @@
arm_fdt_irq_set_handler(armgic_irq_handler);
- for (child = OF_child(phandle); child; child = OF_peer(child)) {
+#if NPCI > 0
+ for (int child = OF_child(phandle); child; child = OF_peer(child)) {
if (!fdtbus_status_okay(child))
continue;
const char * const v2m_compat[] = { "arm,gic-v2m-frame", NULL };
if (of_match_compatible(child, v2m_compat))
gic_fdt_attach_v2m(sc, faa->faa_bst, child);
}
+#endif
}
+#if NPCI > 0
static void
gic_fdt_attach_v2m(struct gic_fdt_softc *sc, bus_space_tag_t bst, int phandle)
{
@@ -224,6 +231,7 @@
frame->frame_base + frame->frame_count);
}
}
+#endif
static void *
gic_fdt_establish(device_t dev, u_int *specifier, int ipl, int flags,
Home |
Main Index |
Thread Index |
Old Index