]>
git.ipfire.org Git - people/ms/u-boot.git/blob - common/cmd_terminal.c
2 * (C) Copyright 2007 OpenMoko, Inc.
3 * Written by Harald Welte <laforge@openmoko.org>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 #if defined(CONFIG_CMD_TERMINAL)
33 int do_terminal(cmd_tbl_t
* cmd
, int flag
, int argc
, char *argv
[])
42 /* Scan for selected output/input device */
43 for (i
= 1; i
<= ListNumItems (devlist
); i
++) {
44 device_t
*tmp
= ListGetPtrToItem (devlist
, i
);
45 if (!strcmp(tmp
->name
, argv
[1])) {
54 printf("Entering terminal mode for port %s\n", dev
->name
);
55 puts("Use '~.' to leave the terminal and get back to u-boot\n");
60 /* read from console and display on serial port */
61 if (stdio_devices
[0]->tstc()) {
62 c
= stdio_devices
[0]->getc();
63 if (last_tilde
== 1) {
70 /* write the delayed tilde */
72 /* fall-through to print current
84 /* read from serial port and display on console */
94 /***************************************************/
97 terminal
, 3, 1, do_terminal
,
98 "terminal - start terminal emulator\n",
102 #endif /* CONFIG_CMD_TERMINAL */