Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/atheros/apb.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
#endif /* APB_DEBUG */ | #endif /* APB_DEBUG */ | ||||
#define DEVTOAPB(dev) ((struct apb_ivar *) device_get_ivars(dev)) | #define DEVTOAPB(dev) ((struct apb_ivar *) device_get_ivars(dev)) | ||||
static int apb_activate_resource(device_t, device_t, int, int, | static int apb_activate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static device_t apb_add_child(device_t, u_int, const char *, int); | static device_t apb_add_child(device_t, u_int, const char *, int); | ||||
static struct resource * | static struct resource * | ||||
apb_alloc_resource(device_t, device_t, int, int *, u_long, | apb_alloc_resource(device_t, device_t, int, int *, rman_res_t, | ||||
u_long, u_long, u_int); | rman_res_t, rman_res_t, u_int); | ||||
static int apb_attach(device_t); | static int apb_attach(device_t); | ||||
static int apb_deactivate_resource(device_t, device_t, int, int, | static int apb_deactivate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static struct resource_list * | static struct resource_list * | ||||
apb_get_resource_list(device_t, device_t); | apb_get_resource_list(device_t, device_t); | ||||
static void apb_hinted_child(device_t, const char *, int); | static void apb_hinted_child(device_t, const char *, int); | ||||
static int apb_filter(void *); | static int apb_filter(void *); | ||||
static int apb_probe(device_t); | static int apb_probe(device_t); | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
apb_unmask_irq((void*)APB_INTR_PMC); | apb_unmask_irq((void*)APB_INTR_PMC); | ||||
sc->sc_intr_counter[APB_INTR_PMC] = mips_intrcnt_create("apb irq5: pmc"); | sc->sc_intr_counter[APB_INTR_PMC] = mips_intrcnt_create("apb irq5: pmc"); | ||||
return (0); | return (0); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
apb_alloc_resource(device_t bus, device_t child, int type, int *rid, | apb_alloc_resource(device_t bus, 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 apb_softc *sc = device_get_softc(bus); | struct apb_softc *sc = device_get_softc(bus); | ||||
struct apb_ivar *ivar = device_get_ivars(child); | struct apb_ivar *ivar = device_get_ivars(child); | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
struct rman *rm; | struct rman *rm; | ||||
int isdefault, needactivate, passthrough; | int isdefault, needactivate, passthrough; | ||||
isdefault = (start == 0UL && end == ~0UL); | isdefault = (start == 0 && end == ~0); | ||||
needactivate = flags & RF_ACTIVE; | needactivate = flags & RF_ACTIVE; | ||||
/* | /* | ||||
* Pass memory requests to nexus device | * Pass memory requests to nexus device | ||||
*/ | */ | ||||
passthrough = (device_get_parent(child) != bus); | passthrough = (device_get_parent(child) != bus); | ||||
rle = NULL; | rle = NULL; | ||||
dprintf("%s: entry (%p, %p, %d, %d, %p, %p, %ld, %d)\n", | dprintf("%s: entry (%p, %p, %d, %d, %p, %p, %jd, %d)\n", | ||||
__func__, bus, child, type, *rid, (void *)(intptr_t)start, | __func__, bus, child, type, *rid, (void *)(intptr_t)start, | ||||
(void *)(intptr_t)end, count, flags); | (void *)(intptr_t)end, count, flags); | ||||
if (passthrough) | if (passthrough) | ||||
return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, | return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, | ||||
rid, start, end, count, flags)); | rid, start, end, count, flags)); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |