X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fserial%2Fserial.c;h=0d56e78c50b3ad63d8e6264f145d2c9644a53b55;hb=1fed668b3fb9c35932f58af00ff5539239fa4e1d;hp=8eda95cd3eddd1e2e3b183cefba3ebc9fe04d569;hpb=d03f4230a6cc08ac718c876309e4dc425e1a9854;p=oweals%2Fu-boot.git diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 8eda95cd3e..0d56e78c50 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -22,6 +22,7 @@ */ #include +#include #include #ifdef CONFIG_NS87308 @@ -29,6 +30,12 @@ #endif #ifdef CONFIG_KIRKWOOD #include +#elif defined(CONFIG_ORION5X) +#include +#elif defined(CONFIG_ARMADA100) +#include +#elif defined(CONFIG_PANTHEON) +#include #endif #if defined (CONFIG_SERIAL_MULTI) @@ -111,9 +118,8 @@ static NS16550_t serial_ports[4] = { serial_puts_dev(port, s);} /* Serial device descriptor */ -#define INIT_ESERIAL_STRUCTURE(port,name,bus) {\ +#define INIT_ESERIAL_STRUCTURE(port, name) {\ name,\ - bus,\ eserial##port##_init,\ NULL,\ eserial##port##_setbrg,\ @@ -319,14 +325,30 @@ serial_setbrg(void) DECLARE_ESERIAL_FUNCTIONS(1); struct serial_device eserial1_device = - INIT_ESERIAL_STRUCTURE(1,"eserial0","EUART1"); + INIT_ESERIAL_STRUCTURE(1, "eserial0"); DECLARE_ESERIAL_FUNCTIONS(2); struct serial_device eserial2_device = - INIT_ESERIAL_STRUCTURE(2,"eserial1","EUART2"); + INIT_ESERIAL_STRUCTURE(2, "eserial1"); DECLARE_ESERIAL_FUNCTIONS(3); struct serial_device eserial3_device = - INIT_ESERIAL_STRUCTURE(3,"eserial2","EUART3"); + INIT_ESERIAL_STRUCTURE(3, "eserial2"); DECLARE_ESERIAL_FUNCTIONS(4); struct serial_device eserial4_device = - INIT_ESERIAL_STRUCTURE(4,"eserial3","EUART4"); + INIT_ESERIAL_STRUCTURE(4, "eserial3"); + +__weak struct serial_device *default_serial_console(void) +{ +#if CONFIG_CONS_INDEX == 1 + return &eserial1_device; +#elif CONFIG_CONS_INDEX == 2 + return &eserial2_device; +#elif CONFIG_CONS_INDEX == 3 + return &eserial3_device; +#elif CONFIG_CONS_INDEX == 4 + return &eserial4_device; +#else +#error "Bad CONFIG_CONS_INDEX." +#endif +} + #endif /* CONFIG_SERIAL_MULTI */