Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/broadcom/bcm2835/bcm2835_mbox.c
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
bcm_mbox_attach(device_t dev) | bcm_mbox_attach(device_t dev) | ||||
{ | { | ||||
struct bcm_mbox_softc *sc = device_get_softc(dev); | struct bcm_mbox_softc *sc = device_get_softc(dev); | ||||
int i; | int i; | ||||
int rid = 0; | int rid = 0; | ||||
sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); | sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, | ||||
RF_ACTIVE | RF_SHAREABLE); | |||||
if (sc->mem_res == NULL) { | if (sc->mem_res == NULL) { | ||||
device_printf(dev, "could not allocate memory resource\n"); | device_printf(dev, "could not allocate memory resource\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
sc->bst = rman_get_bustag(sc->mem_res); | sc->bst = rman_get_bustag(sc->mem_res); | ||||
sc->bsh = rman_get_bushandle(sc->mem_res); | sc->bsh = rman_get_bushandle(sc->mem_res); | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
static driver_t bcm_mbox_driver = { | static driver_t bcm_mbox_driver = { | ||||
"mbox", | "mbox", | ||||
bcm_mbox_methods, | bcm_mbox_methods, | ||||
sizeof(struct bcm_mbox_softc), | sizeof(struct bcm_mbox_softc), | ||||
}; | }; | ||||
static devclass_t bcm_mbox_devclass; | static devclass_t bcm_mbox_devclass; | ||||
DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0); | EARLY_DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0, | ||||
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); | |||||
static void | static void | ||||
bcm2835_mbox_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) | bcm2835_mbox_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) | ||||
{ | { | ||||
bus_addr_t *addr; | bus_addr_t *addr; | ||||
if (err) | if (err) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |