summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-12-02 13:52:00 +0100
committerMichal Simek <michal.simek@xilinx.com>2015-01-26 08:55:58 +0100
commit12c9e7d622319bac804e68998019ba21118bc355 (patch)
treeddcd3c76ad45c0e567d3c8bee6cd0f30e4fa1694 /drivers
parentc4fa511425b4130b34d8ba407cca68e43addf694 (diff)
downloadu-boot-imx-12c9e7d622319bac804e68998019ba21118bc355.zip
u-boot-imx-12c9e7d622319bac804e68998019ba21118bc355.tar.gz
u-boot-imx-12c9e7d622319bac804e68998019ba21118bc355.tar.bz2
serial: zynq: Use global baudrate instead of hardcoded one
This change enables to change baudrate on command line. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_zynq.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
index 1ff27d5..74c4496 100644
--- a/drivers/serial/serial_zynq.c
+++ b/drivers/serial/serial_zynq.c
@@ -42,29 +42,13 @@ static struct uart_zynq *uart_zynq_ports[2] = {
[1] = (struct uart_zynq *)ZYNQ_SERIAL_BASEADDR1,
};
-#if !defined(CONFIG_ZYNQ_SERIAL_BAUDRATE0)
-# define CONFIG_ZYNQ_SERIAL_BAUDRATE0 CONFIG_BAUDRATE
-#endif
-#if !defined(CONFIG_ZYNQ_SERIAL_BAUDRATE1)
-# define CONFIG_ZYNQ_SERIAL_BAUDRATE1 CONFIG_BAUDRATE
-#endif
-
-struct uart_zynq_params {
- u32 baudrate;
-};
-
-static struct uart_zynq_params uart_zynq_ports_param[2] = {
- [0].baudrate = CONFIG_ZYNQ_SERIAL_BAUDRATE0,
- [1].baudrate = CONFIG_ZYNQ_SERIAL_BAUDRATE1,
-};
-
/* Set up the baud rate in gd struct */
static void uart_zynq_serial_setbrg(const int port)
{
/* Calculation results. */
unsigned int calc_bauderror, bdiv, bgen;
unsigned long calc_baud = 0;
- unsigned long baud = uart_zynq_ports_param[port].baudrate;
+ unsigned long baud = gd->baudrate;
unsigned long clock = get_uart_clk(port);
struct uart_zynq *regs = uart_zynq_ports[port];