svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw
Andrew Turner
andrew at FreeBSD.org
Tue May 5 11:13:17 UTC 2015
Author: andrew
Date: Tue May 5 11:13:16 2015
New Revision: 282480
URL: https://svnweb.freebsd.org/changeset/base/282480
Log:
Move the point we attach the ofw driver on arm64 to nexus.c. This will
allow us to have a single place to decide to use ofw or acpi.
Modified:
head/sys/arm64/arm64/nexus.c
head/sys/dev/ofw/ofwbus.c
Modified: head/sys/arm64/arm64/nexus.c
==============================================================================
--- head/sys/arm64/arm64/nexus.c Tue May 5 11:12:33 2015 (r282479)
+++ head/sys/arm64/arm64/nexus.c Tue May 5 11:13:16 2015 (r282480)
@@ -148,6 +148,10 @@ nexus_attach(device_t dev)
if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
+ /* Add the ofwbus device */
+ /* ARM64TODO: Alternatively add acpi */
+ nexus_add_child(dev, 10, "ofwbus", 0);
+
/*
* First, deal with the children we know about already
*/
Modified: head/sys/dev/ofw/ofwbus.c
==============================================================================
--- head/sys/dev/ofw/ofwbus.c Tue May 5 11:12:33 2015 (r282479)
+++ head/sys/dev/ofw/ofwbus.c Tue May 5 11:13:16 2015 (r282480)
@@ -69,7 +69,9 @@ struct ofwbus_softc {
struct rman sc_mem_rman;
};
+#ifndef __aarch64__
static device_identify_t ofwbus_identify;
+#endif
static device_probe_t ofwbus_probe;
static device_attach_t ofwbus_attach;
static bus_alloc_resource_t ofwbus_alloc_resource;
@@ -78,7 +80,9 @@ static bus_release_resource_t ofwbus_rel
static device_method_t ofwbus_methods[] = {
/* Device interface */
+#ifndef __aarch64__
DEVMETHOD(device_identify, ofwbus_identify),
+#endif
DEVMETHOD(device_probe, ofwbus_probe),
DEVMETHOD(device_attach, ofwbus_attach),
@@ -97,6 +101,7 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbu
BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
MODULE_VERSION(ofwbus, 1);
+#ifndef __aarch64__
static void
ofwbus_identify(driver_t *driver, device_t parent)
{
@@ -108,11 +113,17 @@ ofwbus_identify(driver_t *driver, device
if (device_find_child(parent, "ofwbus", -1) == NULL)
BUS_ADD_CHILD(parent, 0, "ofwbus", -1);
}
+#endif
static int
ofwbus_probe(device_t dev)
{
+#ifdef __aarch64__
+ if (OF_peer(0) == 0)
+ return (ENXIO);
+#endif
+
device_set_desc(dev, "Open Firmware Device Tree");
return (BUS_PROBE_NOWILDCARD);
}
More information about the svn-src-head
mailing list