| 136 | } |
| 137 | |
| 138 | int |
| 139 | uart_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 | } |
nothing calls this directly
no test coverage detected