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

Function uart_octeon_probe

freebsd/mips/cavium/uart_bus_octeonusart.c:85–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
84
85static int
86uart_octeon_probe(device_t dev)
87{
88 struct uart_softc *sc;
89 int unit;
90
91 unit = device_get_unit(dev);
92 sc = device_get_softc(dev);
93 sc->sc_class = &uart_oct16550_class;
94
95 /*
96 * We inherit the settings from the systme console. Note, the bst
97 * bad bus_space_map are bogus here, but obio doesn't yet support
98 * them, it seems.
99 */
100 sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
101 bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
102 sc->sc_bas.bst = uart_bus_space_mem;
103 /*
104 * XXX
105 * RBR isn't really a great base address.
106 */
107 if (bus_space_map(sc->sc_bas.bst, CVMX_MIO_UARTX_RBR(0),
108 uart_getrange(sc->sc_class), 0, &sc->sc_bas.bsh) != 0)
109 return (ENXIO);
110 return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, 0, unit, 0));
111}
112
113DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0);

Callers

nothing calls this directly

Calls 4

device_get_unitFunction · 0.85
device_get_softcFunction · 0.85
bus_space_mapFunction · 0.85
CVMX_MIO_UARTX_RBRFunction · 0.85

Tested by

no test coverage detected