]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/logicpd/zoom2/zoom2_serial.c
mx6slevk: Include "mx6_common.h"
[karo-tx-uboot.git] / board / logicpd / zoom2 / zoom2_serial.c
index a3d777dfaddc7b16f23ea8c25e15ce8f2bc62fc2..29592761161919b30919832f788607d41df5c68a 100644 (file)
@@ -2,23 +2,9 @@
  * Copyright (c) 2009 Wind River Systems, Inc.
  * Tom Rix <Tom.Rix@windriver.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * This file was adapted from cpu/mpc5xxx/serial.c
+ * SPDX-License-Identifier:    GPL-2.0+
  *
+ * This file was adapted from arch/powerpc/cpu/mpc5xxx/serial.c
  */
 
 #include <common.h>
@@ -86,6 +72,8 @@ void quad_putc_dev (unsigned long base, const char c)
                        quad_putc_dev (base, '\r');
 
                NS16550_putc ((NS16550_t) base, c);
+       } else {
+               usbtty_putc(c);
        }
 }
 
@@ -94,6 +82,8 @@ void quad_puts_dev (unsigned long base, const char *s)
        if (zoom2_debug_board_connected ()) {
                while ((s != NULL) && (*s != '\0'))
                        quad_putc_dev (base, *s++);
+       } else {
+               usbtty_puts(s);
        }
 }
 
@@ -101,16 +91,16 @@ int quad_getc_dev (unsigned long base)
 {
        if (zoom2_debug_board_connected ())
                return NS16550_getc ((NS16550_t) base);
-       else
-               return 0;
+
+       return usbtty_getc();
 }
 
 int quad_tstc_dev (unsigned long base)
 {
        if (zoom2_debug_board_connected ())
                return NS16550_tstc ((NS16550_t) base);
-       else
-               return 0;
+
+       return usbtty_tstc();
 }
 
 void quad_setbrg_dev (unsigned long base)
@@ -128,3 +118,13 @@ QUAD_INIT (0)
 QUAD_INIT (1)
 QUAD_INIT (2)
 QUAD_INIT (3)
+
+struct serial_device *default_serial_console(void)
+{
+       switch (ZOOM2_DEFAULT_SERIAL_DEVICE) {
+       case 0: return &zoom2_serial_device0;
+       case 1: return &zoom2_serial_device1;
+       case 2: return &zoom2_serial_device2;
+       case 3: return &zoom2_serial_device3;
+       }
+}