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