]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'serial' of git://www.denx.de/git/u-boot-microblaze
authorTom Rini <trini@ti.com>
Tue, 4 Feb 2014 16:48:48 +0000 (11:48 -0500)
committerTom Rini <trini@ti.com>
Tue, 4 Feb 2014 16:51:21 +0000 (11:51 -0500)
drivers/serial/serial_xuartlite.c

index e6139943ba2506586c768e923efb66497c9f7bc5..988438e75471a37f2643328c910ff13b0fe753e5 100644 (file)
 #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;
 }