Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/fdt/simplebus.c
Show All 40 Lines | |||||
#include <dev/ofw/ofw_bus_subr.h> | #include <dev/ofw/ofw_bus_subr.h> | ||||
#include <dev/fdt/simplebus.h> | #include <dev/fdt/simplebus.h> | ||||
/* | /* | ||||
* Bus interface. | * Bus interface. | ||||
*/ | */ | ||||
static int simplebus_probe(device_t dev); | static int simplebus_probe(device_t dev); | ||||
static int simplebus_attach(device_t dev); | |||||
static struct resource *simplebus_alloc_resource(device_t, device_t, int, | static struct resource *simplebus_alloc_resource(device_t, device_t, int, | ||||
int *, rman_res_t, rman_res_t, rman_res_t, u_int); | int *, rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static void simplebus_probe_nomatch(device_t bus, device_t child); | static void simplebus_probe_nomatch(device_t bus, device_t child); | ||||
static int simplebus_print_child(device_t bus, device_t child); | static int simplebus_print_child(device_t bus, device_t child); | ||||
static device_t simplebus_add_child(device_t dev, u_int order, | static device_t simplebus_add_child(device_t dev, u_int order, | ||||
const char *name, int unit); | const char *name, int unit); | ||||
static struct resource_list *simplebus_get_resource_list(device_t bus, | static struct resource_list *simplebus_get_resource_list(device_t bus, | ||||
device_t child); | device_t child); | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (!(ofw_bus_is_compatible(dev, "simple-bus") && | ||||
"soc") != 0)) | "soc") != 0)) | ||||
return (ENXIO); | return (ENXIO); | ||||
device_set_desc(dev, "Flattened device tree simple bus"); | device_set_desc(dev, "Flattened device tree simple bus"); | ||||
return (BUS_PROBE_GENERIC); | return (BUS_PROBE_GENERIC); | ||||
} | } | ||||
static int | int | ||||
simplebus_attach(device_t dev) | simplebus_attach(device_t dev) | ||||
{ | { | ||||
struct simplebus_softc *sc; | struct simplebus_softc *sc; | ||||
phandle_t node; | phandle_t node; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
simplebus_init(dev, 0); | simplebus_init(dev, 0); | ||||
if (simplebus_fill_ranges(sc->node, sc) < 0) { | if ((sc->flags & SB_FLAG_NO_RANGES) == 0 && | ||||
simplebus_fill_ranges(sc->node, sc) < 0) { | |||||
device_printf(dev, "could not get ranges\n"); | device_printf(dev, "could not get ranges\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
/* | /* | ||||
* In principle, simplebus could have an interrupt map, but ignore that | * In principle, simplebus could have an interrupt map, but ignore that | ||||
* for now | * for now | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 271 Lines • Show Last 20 Lines |