From: Matt Waddel <matt.wad...@linaro.org>

The pl01x serial driver was lacking the code to switch baudrates from the
command line.  Fixed by simply saving the new baudrate and calling
serial_init() again.

Signed-off-by: Matt Waddel <matt.wad...@linaro.org>
---
 drivers/serial/serial_pl01x.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..5cd5b9c 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -41,13 +41,14 @@
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudRate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -183,6 +184,8 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
+       baudRate = gd->baudrate;
+       serial_init();
 }
 
 static void pl01x_putc (int portnum, char c)
-- 
1.7.0.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to