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.
This commit is contained in:
Andrew Turner 2015-05-05 11:13:16 +00:00
parent 29709006f7
commit 2c0d026b52
2 changed files with 15 additions and 0 deletions

View File

@ -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
*/

View File

@ -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_release_resource;
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, ofwbus_driver, ofwbus_devclass, 0, 0,
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_t parent)
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);
}