summaryrefslogtreecommitdiffstats
path: root/sys/arm64
diff options
context:
space:
mode:
authorzbb <zbb@FreeBSD.org>2016-02-18 13:00:04 +0000
committerzbb <zbb@FreeBSD.org>2016-02-18 13:00:04 +0000
commitd2a1177be6963874bcf8d15330e4ea74c36d6823 (patch)
tree2affdba8f0124a43a93eb47db8afb77ab54cfd50 /sys/arm64
parentd520d79a17fed19e354e59fe3a6046fa89bcf8e3 (diff)
downloadFreeBSD-src-d2a1177be6963874bcf8d15330e4ea74c36d6823.zip
FreeBSD-src-d2a1177be6963874bcf8d15330e4ea74c36d6823.tar.gz
Introduce bus_get_bus_tag() method
Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips nexus and its children in order to return a platform specific default tag. This is required to ensure generic correctness of the bus_space tag. It is especially needed for arches where child bus tag does not match the parent bus tag. This solves the problem with ppc architecture where the PCI bus tag differs from parent bus tag which is big-endian. This commit is a part of the following patch: https://reviews.freebsd.org/D4879 Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/nexus.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
index 611addd..c56c7aa 100644
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -113,6 +113,7 @@ static int nexus_deactivate_resource(device_t, device_t, int, int,
static int nexus_setup_intr(device_t dev, device_t child, struct resource *res,
int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep);
static int nexus_teardown_intr(device_t, device_t, struct resource *, void *);
+static bus_space_tag_t nexus_get_bus_tag(device_t, device_t);
#ifdef SMP
static int nexus_bind_intr(device_t, device_t, struct resource *, int);
#endif
@@ -134,6 +135,7 @@ static device_method_t nexus_methods[] = {
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
+ DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag),
#ifdef SMP
DEVMETHOD(bus_bind_intr, nexus_bind_intr),
#endif
@@ -307,6 +309,13 @@ nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu)
}
#endif
+static bus_space_tag_t
+nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
+{
+
+ return(&memmap_bus);
+}
+
static int
nexus_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
OpenPOWER on IntegriCloud