From: Piotr Dymacz Date: Sun, 19 Oct 2014 20:19:44 +0000 (+0200) Subject: Switch to new UART driver and allow to use more baudrates on Dragino2 board for test... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a775f9600d62d56208bfdc4b0b7aae5297cfd124;p=oweals%2Fu-boot_mod.git Switch to new UART driver and allow to use more baudrates on Dragino2 board for test purposes. This changes break code on boards with compressed, 64 KB U-Boot image. --- diff --git a/u-boot/common/cmd_nvedit.c b/u-boot/common/cmd_nvedit.c index c70c608..74e2caa 100644 --- a/u-boot/common/cmd_nvedit.c +++ b/u-boot/common/cmd_nvedit.c @@ -240,6 +240,9 @@ int _do_setenv(int flag, int argc, char *argv[]){ udelay(50000); gd->baudrate = baudrate; + + serial_setbrg(); + udelay(50000); for(;;){ diff --git a/u-boot/cpu/mips/ar7240/Makefile b/u-boot/cpu/mips/ar7240/Makefile index ce36dfc..c231c74 100644 --- a/u-boot/cpu/mips/ar7240/Makefile +++ b/u-boot/cpu/mips/ar7240/Makefile @@ -8,7 +8,9 @@ START = OBJS = meminit.o ifeq ($(BOARD), ap121) -OBJS += hornet_serial.o +#OBJS += hornet_serial.o +OBJS += ar933x_serial.o +OBJS += ar933x_clocks.o SOBJS += hornet_ddr_init.o else OBJS += ar7240_serial.o diff --git a/u-boot/include/common.h b/u-boot/include/common.h index 89ce9dc..06eed3f 100644 --- a/u-boot/include/common.h +++ b/u-boot/include/common.h @@ -401,6 +401,7 @@ void serial_putc_raw(const char); void serial_puts (const char *); int serial_getc (void); int serial_tstc (void); +void serial_setbrg (void); void _serial_putc (const char, const int); void _serial_putc_raw(const char, const int); diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h index 6ec8cbe..06ff71b 100644 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -88,6 +88,10 @@ defined(CONFIG_FOR_MESH_POTATO_V2) #define CFG_LOAD_ADDR 0x9F040000 #define UPDATE_SCRIPT_FW_ADDR "0x9F040000" + + /* FOR NEW UART DRIVER TESTS ONLY! */ + #undef CFG_BAUDRATE_TABLE + #define CFG_BAUDRATE_TABLE { 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200, 128000, 230400, 256000, 460800, 921600 } #else #define CFG_LOAD_ADDR 0x9F020000 #define UPDATE_SCRIPT_FW_ADDR "0x9F020000" diff --git a/u-boot/lib_mips/board.c b/u-boot/lib_mips/board.c index 68a95eb..51dba36 100644 --- a/u-boot/lib_mips/board.c +++ b/u-boot/lib_mips/board.c @@ -100,7 +100,13 @@ static int display_banner(void){ } static int init_baudrate(void){ - gd->baudrate = CONFIG_BAUDRATE; + char *s; + + if((s = getenv("baudrate")) != NULL){ + gd->baudrate = simple_strtoul(s, NULL, 10); + } else { + gd->baudrate = CONFIG_BAUDRATE; + } return(0); }