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

Function uart_cpu_getdev

freebsd/mips/cavium/uart_cpu_octeonusart.c:138–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138int
139uart_cpu_getdev(int devtype, struct uart_devinfo *di)
140{
141 struct uart_class *class = &uart_oct16550_class;
142
143 /*
144 * These fields need to be setup corretly for uart_getenv to
145 * work in all cases.
146 */
147 uart_bus_space_io = NULL; /* No io map for this device */
148 uart_bus_space_mem = &octeon_uart_tag;
149 di->bas.bst = uart_bus_space_mem;
150
151 /*
152 * If env specification for UART exists it takes precedence:
153 * hw.uart.console="mm:0xf1012000" or similar
154 */
155 if (uart_getenv(devtype, di, class) == 0)
156 return (0);
157
158 /*
159 * Fallback to UART0 for console.
160 */
161 di->ops = uart_getops(class);
162 di->bas.chan = 0;
163 /* XXX */
164 if (bus_space_map(di->bas.bst, CVMX_MIO_UARTX_RBR(0),
165 uart_getrange(class), 0, &di->bas.bsh) != 0)
166 return (ENXIO);
167 di->bas.regshft = 3;
168 di->bas.rclk = 0;
169 di->baudrate = 115200;
170 di->databits = 8;
171 di->stopbits = 1;
172 di->parity = UART_PARITY_NONE;
173
174 return (0);
175}

Callers

nothing calls this directly

Calls 2

bus_space_mapFunction · 0.85
CVMX_MIO_UARTX_RBRFunction · 0.85

Tested by

no test coverage detected