Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/quicc/quicc_core.c
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
quicc_bfe_attach(device_t dev) | quicc_bfe_attach(device_t dev) | ||||
{ | { | ||||
struct quicc_device *qd; | struct quicc_device *qd; | ||||
struct quicc_softc *sc; | struct quicc_softc *sc; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
const char *sep; | const char *sep; | ||||
u_long size, start; | rman_res_t size, start; | ||||
int error; | int error; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
/* | /* | ||||
* Re-allocate. We expect that the softc contains the information | * Re-allocate. We expect that the softc contains the information | ||||
* collected by quicc_bfe_probe() intact. | * collected by quicc_bfe_probe() intact. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | quicc_bfe_probe(device_t dev, u_int clock) | ||||
rev = quicc_read2(sc->sc_rres, QUICC_PRAM_REV_NUM); | rev = quicc_read2(sc->sc_rres, QUICC_PRAM_REV_NUM); | ||||
bus_release_resource(dev, sc->sc_rtype, sc->sc_rrid, sc->sc_rres); | bus_release_resource(dev, sc->sc_rtype, sc->sc_rrid, sc->sc_rres); | ||||
return ((rev == 0x00e8) ? BUS_PROBE_DEFAULT : ENXIO); | return ((rev == 0x00e8) ? BUS_PROBE_DEFAULT : ENXIO); | ||||
} | } | ||||
struct resource * | struct resource * | ||||
quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid, | quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct quicc_device *qd; | struct quicc_device *qd; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
if (device_get_parent(child) != dev) | if (device_get_parent(child) != dev) | ||||
return (NULL); | return (NULL); | ||||
/* We only support default allocations. */ | /* We only support default allocations. */ | ||||
Show All 13 Lines | if (rle->res != NULL) { | ||||
rman_set_bushandle(rle->res, rle->start); | rman_set_bushandle(rle->res, rle->start); | ||||
} | } | ||||
} | } | ||||
return (rle->res); | return (rle->res); | ||||
} | } | ||||
int | int | ||||
quicc_bus_get_resource(device_t dev, device_t child, int type, int rid, | quicc_bus_get_resource(device_t dev, device_t child, int type, int rid, | ||||
u_long *startp, u_long *countp) | rman_res_t *startp, rman_res_t *countp) | ||||
{ | { | ||||
struct quicc_device *qd; | struct quicc_device *qd; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
if (device_get_parent(child) != dev) | if (device_get_parent(child) != dev) | ||||
return (EINVAL); | return (EINVAL); | ||||
qd = device_get_ivars(child); | qd = device_get_ivars(child); | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |