Minor formatting changes. Also, elimiante a couple of unused variables.
This commit is contained in:
parent
c839424d34
commit
72bd8c62f6
@ -53,22 +53,28 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <dev/uart/uart_bus.h>
|
#include <dev/uart/uart_bus.h>
|
||||||
#include <dev/uart/uart_cpu.h>
|
#include <dev/uart/uart_cpu.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXXMIPS:
|
||||||
|
*/
|
||||||
#include <mips/octeon1/octeonreg.h>
|
#include <mips/octeon1/octeonreg.h>
|
||||||
|
|
||||||
#include "uart_if.h"
|
#include "uart_if.h"
|
||||||
|
|
||||||
|
extern struct uart_class uart_oct16550_class;
|
||||||
|
|
||||||
|
|
||||||
static int uart_octeon_probe(device_t dev);
|
static int uart_octeon_probe(device_t dev);
|
||||||
static void octeon_uart_identify(driver_t *drv, device_t parent);
|
static void octeon_uart_identify(driver_t * drv, device_t parent);
|
||||||
|
|
||||||
extern struct uart_class octeon_uart_class;
|
extern struct uart_class octeon_uart_class;
|
||||||
|
|
||||||
static device_method_t uart_octeon_methods[] = {
|
static device_method_t uart_octeon_methods[] = {
|
||||||
/* Device interface */
|
/* Device interface */
|
||||||
DEVMETHOD(device_probe, uart_octeon_probe),
|
DEVMETHOD(device_probe, uart_octeon_probe),
|
||||||
DEVMETHOD(device_attach, uart_bus_attach),
|
DEVMETHOD(device_attach, uart_bus_attach),
|
||||||
DEVMETHOD(device_detach, uart_bus_detach),
|
DEVMETHOD(device_detach, uart_bus_detach),
|
||||||
DEVMETHOD(device_identify, octeon_uart_identify),
|
DEVMETHOD(device_identify, octeon_uart_identify),
|
||||||
{ 0, 0 }
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static driver_t uart_octeon_driver = {
|
static driver_t uart_octeon_driver = {
|
||||||
@ -77,35 +83,36 @@ static driver_t uart_octeon_driver = {
|
|||||||
sizeof(struct uart_softc),
|
sizeof(struct uart_softc),
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
|
extern
|
||||||
static int
|
SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
|
||||||
uart_octeon_probe (device_t dev)
|
static int
|
||||||
|
uart_octeon_probe(device_t dev)
|
||||||
{
|
{
|
||||||
struct uart_softc *sc;
|
struct uart_softc *sc;
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note that both tty0 & tty1 are viable consoles. We add child devices
|
* Note that both tty0 & tty1 are viable consoles. We add child devices
|
||||||
* such that ttyu0 ends up front of queue.
|
* such that ttyu0 ends up front of queue.
|
||||||
*/
|
*/
|
||||||
unit = device_get_unit(dev);
|
unit = device_get_unit(dev);
|
||||||
sc = device_get_softc(dev);
|
sc = device_get_softc(dev);
|
||||||
sc->sc_sysdev = NULL;
|
sc->sc_sysdev = NULL;
|
||||||
sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
|
sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
|
||||||
bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
|
bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
|
||||||
if (!unit) {
|
if (!unit) {
|
||||||
sc->sc_sysdev->bas.bst = 0;
|
sc->sc_sysdev->bas.bst = 0;
|
||||||
sc->sc_sysdev->bas.bsh = OCTEON_UART0ADR;
|
sc->sc_sysdev->bas.bsh = OCTEON_UART0ADR;
|
||||||
}
|
}
|
||||||
sc->sc_class = &uart_oct16550_class;
|
sc->sc_class = &uart_oct16550_class;
|
||||||
sc->sc_bas.bst = 0;
|
sc->sc_bas.bst = 0;
|
||||||
sc->sc_bas.bsh = unit ? OCTEON_UART1ADR : OCTEON_UART0ADR;
|
sc->sc_bas.bsh = unit ? OCTEON_UART1ADR : OCTEON_UART0ADR;
|
||||||
sc->sc_bas.regshft = 0x3;
|
sc->sc_bas.regshft = 0x3;
|
||||||
return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, unit));
|
return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
octeon_uart_identify (driver_t *drv, device_t parent)
|
octeon_uart_identify(driver_t * drv, device_t parent)
|
||||||
{
|
{
|
||||||
BUS_ADD_CHILD(parent, 0, "uart", 0);
|
BUS_ADD_CHILD(parent, 0, "uart", 0);
|
||||||
}
|
}
|
||||||
@ -113,4 +120,3 @@ octeon_uart_identify (driver_t *drv, device_t parent)
|
|||||||
|
|
||||||
|
|
||||||
DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0);
|
DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0);
|
||||||
|
|
||||||
|
@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <mips/octeon1/octeonreg.h>
|
#include <mips/octeon1/octeonreg.h>
|
||||||
|
|
||||||
bus_space_tag_t uart_bus_space_io;
|
extern struct uart_class uart_oct16550_class;
|
||||||
bus_space_tag_t uart_bus_space_mem;
|
|
||||||
|
|
||||||
extern struct uart_ops octeon_usart_ops;
|
extern struct uart_ops octeon_usart_ops;
|
||||||
extern struct bus_space octeon_bs_tag;
|
extern struct bus_space octeon_bs_tag;
|
||||||
|
|
||||||
@ -66,18 +64,21 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
|
|||||||
int
|
int
|
||||||
uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||||
{
|
{
|
||||||
di->ops = uart_getops(&uart_oct16550_class);
|
struct uart_class *class;
|
||||||
di->bas.chan = 0;
|
|
||||||
|
class = &uart_oct16550_class;
|
||||||
|
di->ops = uart_getops(class);
|
||||||
di->bas.bst = 0;
|
di->bas.bst = 0;
|
||||||
di->bas.regshft = 3; /* Each UART reg is 8 byte addresss apart. 1 << 3 */
|
di->bas.chan = 0;
|
||||||
|
di->bas.regshft = 3; /* Each UART reg is 8 byte addresss apart. 1
|
||||||
|
* << 3 */
|
||||||
di->bas.rclk = 0;
|
di->bas.rclk = 0;
|
||||||
di->baudrate = 115200;
|
di->baudrate = 115200;
|
||||||
di->databits = 8;
|
di->databits = 8;
|
||||||
di->stopbits = 1;
|
di->stopbits = 1;
|
||||||
di->parity = UART_PARITY_NONE;
|
di->parity = UART_PARITY_NONE;
|
||||||
|
|
||||||
uart_bus_space_io = MIPS_PHYS_TO_KSEG1(OCTEON_UART0ADR);
|
di->bas.bsh = OCTEON_UART0ADR;
|
||||||
uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(OCTEON_UART0ADR);
|
uart_getenv(devtype, di, class);
|
||||||
di->bas.bsh = OCTEON_UART0ADR;
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user