| 80 | } |
| 81 | |
| 82 | int |
| 83 | obio_attach(device_t dev) |
| 84 | { |
| 85 | struct obio_softc *sc = device_get_softc(dev); |
| 86 | |
| 87 | sc->oba_st = mips_bus_space_generic; |
| 88 | sc->oba_addr = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); |
| 89 | sc->oba_size = MALTA_PCIMEM3_SIZE; |
| 90 | sc->oba_rman.rm_type = RMAN_ARRAY; |
| 91 | sc->oba_rman.rm_descr = "OBIO I/O"; |
| 92 | if (rman_init(&sc->oba_rman) != 0 || |
| 93 | rman_manage_region(&sc->oba_rman, |
| 94 | sc->oba_addr, sc->oba_addr + sc->oba_size) != 0) |
| 95 | panic("obio_attach: failed to set up I/O rman"); |
| 96 | sc->oba_irq_rman.rm_type = RMAN_ARRAY; |
| 97 | sc->oba_irq_rman.rm_descr = "OBIO IRQ"; |
| 98 | |
| 99 | /* |
| 100 | * This module is intended for UART purposes only and |
| 101 | * it's IRQ is 4 |
| 102 | */ |
| 103 | if (rman_init(&sc->oba_irq_rman) != 0 || |
| 104 | rman_manage_region(&sc->oba_irq_rman, 4, 4) != 0) |
| 105 | panic("obio_attach: failed to set up IRQ rman"); |
| 106 | |
| 107 | device_add_child(dev, "uart", 0); |
| 108 | bus_generic_probe(dev); |
| 109 | bus_generic_attach(dev); |
| 110 | |
| 111 | return (0); |
| 112 | } |
| 113 | |
| 114 | static struct resource * |
| 115 | obio_alloc_resource(device_t bus, device_t child, int type, int *rid, |
nothing calls this directly
no test coverage detected