summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-02-04 11:48:48 -0500
committerTom Rini <trini@ti.com>2014-02-04 11:51:21 -0500
commit0d74665059943dc207df995e21a4767ca3e51a05 (patch)
tree16500fcd91c82db6f378af7d370dc74a94c13b0d /drivers
parentf763be224fa78893384416734419d8e052c1c5ef (diff)
parent8c3bd6b596300d0ade265329f44832e89ef54a22 (diff)
downloadu-boot-imx-0d74665059943dc207df995e21a4767ca3e51a05.zip
u-boot-imx-0d74665059943dc207df995e21a4767ca3e51a05.tar.gz
u-boot-imx-0d74665059943dc207df995e21a4767ca3e51a05.tar.bz2
Merge branch 'serial' of git://www.denx.de/git/u-boot-microblaze
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_xuartlite.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c
index e613994..988438e 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -18,10 +18,14 @@
#define SR_RX_FIFO_VALID_DATA 0x01 /* data in receive FIFO */
#define SR_RX_FIFO_FULL 0x02 /* receive FIFO full */
+#define ULITE_CONTROL_RST_TX 0x01
+#define ULITE_CONTROL_RST_RX 0x02
+
struct uartlite {
unsigned int rx_fifo;
unsigned int tx_fifo;
unsigned int status;
+ unsigned int control;
};
static struct uartlite *userial_ports[4] = {
@@ -75,8 +79,16 @@ static int uartlite_serial_tstc(const int port)
static int uartlite_serial_init(const int port)
{
- if (userial_ports[port])
+ struct uartlite *regs = userial_ports[port];
+
+ if (regs) {
+ out_be32(&regs->control, 0);
+ out_be32(&regs->control,
+ ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
+ in_be32(&regs->control);
return 0;
+ }
+
return -1;
}