]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/serial/serial_pl01x.c
keystone2: ddr3: eliminate using global ddr3_size variable
[karo-tx-uboot.git] / drivers / serial / serial_pl01x.c
index fb11210e4c8fe2d08b598edc18ea9eda624c3ea0..75eb6bd729e1614033f1bd110fb602358cfb5e46 100644 (file)
@@ -72,23 +72,21 @@ static int pl01x_tstc(struct pl01x_regs *regs)
 static int pl01x_generic_serial_init(struct pl01x_regs *regs,
                                     enum pl01x_type type)
 {
+       switch (type) {
+       case TYPE_PL010:
+               /* disable everything */
+               writel(0, &regs->pl010_cr);
+               break;
+       case TYPE_PL011:
 #ifdef CONFIG_PL011_SERIAL_FLUSH_ON_INIT
-       if (type == TYPE_PL011) {
                /* Empty RX fifo if necessary */
                if (readl(&regs->pl011_cr) & UART_PL011_CR_UARTEN) {
                        while (!(readl(&regs->fr) & UART_PL01x_FR_RXFE))
                                readl(&regs->dr);
                }
-       }
 #endif
-
-       /* First, disable everything */
-       writel(0, &regs->pl010_cr);
-
-       switch (type) {
-       case TYPE_PL010:
-               break;
-       case TYPE_PL011:
+               /* disable everything */
+               writel(0, &regs->pl011_cr);
                break;
        default:
                return -EINVAL;
@@ -350,6 +348,7 @@ U_BOOT_DRIVER(serial_pl01x) = {
        .probe = pl01x_serial_probe,
        .ops    = &pl01x_serial_ops,
        .flags = DM_FLAG_PRE_RELOC,
+       .priv_auto_alloc_size = sizeof(struct pl01x_priv),
 };
 
 #endif