Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/rmi/iodi.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
#include <mips/rmi/dev/xlr/atx_cpld.h> | #include <mips/rmi/dev/xlr/atx_cpld.h> | ||||
#include <mips/rmi/dev/xlr/xgmac_mdio.h> | #include <mips/rmi/dev/xlr/xgmac_mdio.h> | ||||
extern bus_space_tag_t uart_bus_space_mem; | extern bus_space_tag_t uart_bus_space_mem; | ||||
static struct resource * | static struct resource * | ||||
iodi_alloc_resource(device_t, device_t, int, int *, | iodi_alloc_resource(device_t, device_t, int, int *, | ||||
u_long, u_long, u_long, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int | static int | ||||
iodi_activate_resource(device_t, device_t, int, int, | iodi_activate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int | static int | ||||
iodi_setup_intr(device_t, device_t, struct resource *, int, | iodi_setup_intr(device_t, device_t, struct resource *, int, | ||||
driver_filter_t *, driver_intr_t *, void *, void **); | driver_filter_t *, driver_intr_t *, void *, void **); | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
cookiep, bridge_pcmcia_ack); | cookiep, bridge_pcmcia_ack); | ||||
pic_setup_intr(PIC_PCMCIA_IRQ - PIC_IRQ_BASE, PIC_PCMCIA_IRQ, 0x1, 1); | pic_setup_intr(PIC_PCMCIA_IRQ - PIC_IRQ_BASE, PIC_PCMCIA_IRQ, 0x1, 1); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
iodi_alloc_resource(device_t bus, device_t child, int type, int *rid, | iodi_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 resource *res = malloc(sizeof(*res), M_DEVBUF, M_WAITOK); | struct resource *res = malloc(sizeof(*res), M_DEVBUF, M_WAITOK); | ||||
const char *name = device_get_name(child); | const char *name = device_get_name(child); | ||||
int unit; | int unit; | ||||
#ifdef DEBUG | #ifdef DEBUG | ||||
switch (type) { | switch (type) { | ||||
case SYS_RES_IRQ: | case SYS_RES_IRQ: | ||||
device_printf(bus, "IRQ resource - for %s %lx-%lx\n", | device_printf(bus, "IRQ resource - for %s %jx-%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
break; | break; | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
device_printf(bus, "IOPORT resource - for %s %lx-%lx\n", | device_printf(bus, "IOPORT resource - for %s %jx-%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
break; | break; | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
device_printf(bus, "MEMORY resource - for %s %lx-%lx\n", | device_printf(bus, "MEMORY resource - for %s %jx-%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
break; | break; | ||||
} | } | ||||
#endif | #endif | ||||
if (strcmp(name, "uart") == 0) { | if (strcmp(name, "uart") == 0) { | ||||
if ((unit = device_get_unit(child)) == 0) { /* uart 0 */ | if ((unit = device_get_unit(child)) == 0) { /* uart 0 */ | ||||
res->r_bushandle = (xlr_io_base + XLR_IO_UART_0_OFFSET); | res->r_bushandle = (xlr_io_base + XLR_IO_UART_0_OFFSET); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |