* 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>
quad_putc_dev (base, '\r');
NS16550_putc ((NS16550_t) base, c);
+ } else {
+ usbtty_putc(c);
}
}
if (zoom2_debug_board_connected ()) {
while ((s != NULL) && (*s != '\0'))
quad_putc_dev (base, *s++);
+ } else {
+ usbtty_puts(s);
}
}
{
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)
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;
+ }
+}