2 * (C) Copyright 2007 OpenMoko, Inc.
3 * Written by Harald Welte <laforge@openmoko.org>
5 * SPDX-License-Identifier: GPL-2.0+
13 #include <stdio_dev.h>
16 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char * const argv[])
19 struct stdio_dev *dev = NULL;
24 /* Scan for selected output/input device */
25 dev = stdio_get_by_name(argv[1]);
30 printf("Entering terminal mode for port %s\n", dev->name);
31 puts("Use '~.' to leave the terminal and get back to u-boot\n");
36 /* read from console and display on serial port */
37 if (stdio_devices[0]->tstc()) {
38 c = stdio_devices[0]->getc();
39 if (last_tilde == 1) {
46 /* write the delayed tilde */
48 /* fall-through to print current
60 /* read from serial port and display on console */
70 /***************************************************/
73 terminal, 3, 1, do_terminal,
74 "start terminal emulator",