MCPcopy Create free account
hub / github.com/F-Stack/f-stack / obio_attach

Function obio_attach

freebsd/mips/malta/obio.c:82–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int
83obio_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
114static struct resource *
115obio_alloc_resource(device_t bus, device_t child, int type, int *rid,

Callers

nothing calls this directly

Calls 7

device_get_softcFunction · 0.85
rman_initFunction · 0.85
rman_manage_regionFunction · 0.85
device_add_childFunction · 0.85
bus_generic_probeFunction · 0.85
bus_generic_attachFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected