]>
git.ipfire.org Git - people/ms/u-boot.git/blob - common/cmd_load.c
2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
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,
25 * Serial up- and download support
34 DECLARE_GLOBAL_DATA_PTR
;
36 #if defined(CONFIG_CMD_LOADB)
37 static ulong
load_serial_ymodem (ulong offset
);
40 #if defined(CONFIG_CMD_LOADS)
41 static ulong
load_serial (ulong offset
);
42 static int read_record (char *buf
, ulong len
);
43 # if defined(CONFIG_CMD_SAVES)
44 static int save_serial (ulong offset
, ulong size
);
45 static int write_record (char *buf
);
48 static int do_echo
= 1;
51 /* -------------------------------------------------------------------- */
53 #if defined(CONFIG_CMD_LOADS)
54 int do_load_serial (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
61 #ifdef CFG_LOADS_BAUD_CHANGE
62 int load_baudrate
, current_baudrate
;
64 load_baudrate
= current_baudrate
= gd
->baudrate
;
67 if (((env_echo
= getenv("loads_echo")) != NULL
) && (*env_echo
== '1')) {
73 #ifdef CFG_LOADS_BAUD_CHANGE
75 offset
= simple_strtoul(argv
[1], NULL
, 16);
78 load_baudrate
= (int)simple_strtoul(argv
[2], NULL
, 10);
80 /* default to current baudrate */
81 if (load_baudrate
== 0)
82 load_baudrate
= current_baudrate
;
84 if (load_baudrate
!= current_baudrate
) {
85 printf ("## Switch baudrate to %d bps and press ENTER ...\n",
88 gd
->baudrate
= load_baudrate
;
96 #else /* ! CFG_LOADS_BAUD_CHANGE */
98 offset
= simple_strtoul(argv
[1], NULL
, 16);
100 #endif /* CFG_LOADS_BAUD_CHANGE */
102 printf ("## Ready for S-Record download ...\n");
104 addr
= load_serial (offset
);
107 * Gather any trailing characters (for instance, the ^D which
108 * is sent by 'cu' after sending a file), and give the
109 * box some time (100 * 1 ms)
111 for (i
=0; i
<100; ++i
) {
119 printf ("## S-Record download aborted\n");
122 printf ("## Start Addr = 0x%08lX\n", addr
);
126 #ifdef CFG_LOADS_BAUD_CHANGE
127 if (load_baudrate
!= current_baudrate
) {
128 printf ("## Switch baudrate to %d bps and press ESC ...\n",
131 gd
->baudrate
= current_baudrate
;
135 if (getc() == 0x1B) /* ESC */
144 load_serial (ulong offset
)
146 char record
[SREC_MAXRECLEN
+ 1]; /* buffer for one S-Record */
147 char binbuf
[SREC_MAXBINLEN
]; /* buffer for binary data */
148 int binlen
; /* no. of data bytes in S-Rec. */
149 int type
; /* return code for record type */
150 ulong addr
; /* load address from S-Record */
151 ulong size
; /* number of bytes transferred */
154 ulong start_addr
= ~0;
158 while (read_record(record
, SREC_MAXRECLEN
+ 1) >= 0) {
159 type
= srec_decode (record
, &binlen
, &addr
, binbuf
);
162 return (~0); /* Invalid S-Record */
169 store_addr
= addr
+ offset
;
171 if (addr2info(store_addr
)) {
174 rc
= flash_write((char *)binbuf
,store_addr
,binlen
);
182 memcpy ((char *)(store_addr
), binbuf
, binlen
);
184 if ((store_addr
) < start_addr
)
185 start_addr
= store_addr
;
186 if ((store_addr
+ binlen
- 1) > end_addr
)
187 end_addr
= store_addr
+ binlen
- 1;
193 size
= end_addr
- start_addr
+ 1;
195 "## First Load Addr = 0x%08lX\n"
196 "## Last Load Addr = 0x%08lX\n"
197 "## Total Size = 0x%08lX = %ld Bytes\n",
198 start_addr
, end_addr
, size
, size
200 flush_cache (start_addr
, size
);
201 sprintf(buf
, "%lX", size
);
202 setenv("filesize", buf
);
209 if (!do_echo
) { /* print a '.' every 100 lines */
210 if ((++line_count
% 100) == 0)
215 return (~0); /* Download aborted */
219 read_record (char *buf
, ulong len
)
224 --len
; /* always leave room for terminating '\0' byte */
226 for (p
=buf
; p
< buf
+len
; ++p
) {
227 c
= getc(); /* read character */
229 putc (c
); /* ... and echo it */
237 case 0x03: /* ^C - Control C */
243 /* Check for the console hangup (if any different from serial) */
244 if (gd
->jt
[XF_getc
] != getc
) {
251 /* line too long - truncate */
256 #if defined(CONFIG_CMD_SAVES)
258 int do_save_serial (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
262 #ifdef CFG_LOADS_BAUD_CHANGE
263 int save_baudrate
, current_baudrate
;
265 save_baudrate
= current_baudrate
= gd
->baudrate
;
269 offset
= simple_strtoul(argv
[1], NULL
, 16);
271 #ifdef CFG_LOADS_BAUD_CHANGE
273 size
= simple_strtoul(argv
[2], NULL
, 16);
276 save_baudrate
= (int)simple_strtoul(argv
[3], NULL
, 10);
278 /* default to current baudrate */
279 if (save_baudrate
== 0)
280 save_baudrate
= current_baudrate
;
282 if (save_baudrate
!= current_baudrate
) {
283 printf ("## Switch baudrate to %d bps and press ENTER ...\n",
286 gd
->baudrate
= save_baudrate
;
294 #else /* ! CFG_LOADS_BAUD_CHANGE */
296 size
= simple_strtoul(argv
[2], NULL
, 16);
298 #endif /* CFG_LOADS_BAUD_CHANGE */
300 printf ("## Ready for S-Record upload, press ENTER to proceed ...\n");
305 if(save_serial (offset
, size
)) {
306 printf ("## S-Record upload aborted\n");
308 printf ("## S-Record upload complete\n");
310 #ifdef CFG_LOADS_BAUD_CHANGE
311 if (save_baudrate
!= current_baudrate
) {
312 printf ("## Switch baudrate to %d bps and press ESC ...\n",
313 (int)current_baudrate
);
315 gd
->baudrate
= current_baudrate
;
319 if (getc() == 0x1B) /* ESC */
327 #define SREC3_START "S0030000FC\n"
328 #define SREC3_FORMAT "S3%02X%08lX%s%02X\n"
329 #define SREC3_END "S70500000000FA\n"
330 #define SREC_BYTES_PER_RECORD 16
332 static int save_serial (ulong address
, ulong count
)
334 int i
, c
, reclen
, checksum
, length
;
335 char *hex
= "0123456789ABCDEF";
336 char record
[2*SREC_BYTES_PER_RECORD
+16]; /* buffer for one S-Record */
337 char data
[2*SREC_BYTES_PER_RECORD
+1]; /* buffer for hex data */
342 if(write_record(SREC3_START
)) /* write the header */
345 if(count
) { /* collect hex data in the buffer */
346 c
= *(volatile uchar
*)(address
+ reclen
); /* get one byte */
347 checksum
+= c
; /* accumulate checksum */
348 data
[2*reclen
] = hex
[(c
>>4)&0x0f];
349 data
[2*reclen
+1] = hex
[c
& 0x0f];
350 data
[2*reclen
+2] = '\0';
354 if(reclen
== SREC_BYTES_PER_RECORD
|| count
== 0) {
355 /* enough data collected for one record: dump it */
356 if(reclen
) { /* build & write a data record: */
357 /* address + data + checksum */
358 length
= 4 + reclen
+ 1;
360 /* accumulate length bytes into checksum */
361 for(i
= 0; i
< 2; i
++)
362 checksum
+= (length
>> (8*i
)) & 0xff;
364 /* accumulate address bytes into checksum: */
365 for(i
= 0; i
< 4; i
++)
366 checksum
+= (address
>> (8*i
)) & 0xff;
368 /* make proper checksum byte: */
369 checksum
= ~checksum
& 0xff;
371 /* output one record: */
372 sprintf(record
, SREC3_FORMAT
, length
, address
, data
, checksum
);
373 if(write_record(record
))
376 address
+= reclen
; /* increment address */
382 if(write_record(SREC3_END
)) /* write the final record */
388 write_record (char *buf
)
395 /* Check for the console hangup (if any different from serial) */
407 #if defined(CONFIG_CMD_LOADB)
409 * loadb command (load binary) included
413 #define START_CHAR 0x01
414 #define ETX_CHAR 0x03
415 #define END_CHAR 0x0D
417 #define K_ESCAPE 0x23
418 #define SEND_TYPE 'S'
419 #define DATA_TYPE 'D'
421 #define NACK_TYPE 'N'
422 #define BREAK_TYPE 'B'
423 #define tochar(x) ((char) (((x) + SPACE) & 0xff))
424 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
426 extern int os_data_count
;
427 extern int os_data_header
[8];
429 static void set_kerm_bin_mode(unsigned long *);
430 static int k_recv(void);
431 static ulong
load_serial_bin (ulong offset
);
434 char his_eol
; /* character he needs at end of packet */
435 int his_pad_count
; /* number of pad chars he needs */
436 char his_pad_char
; /* pad chars he needs */
437 char his_quote
; /* quote chars he'll use */
439 int do_load_serial_bin (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
443 int load_baudrate
, current_baudrate
;
447 /* pre-set offset from CFG_LOAD_ADDR */
448 offset
= CFG_LOAD_ADDR
;
450 /* pre-set offset from $loadaddr */
451 if ((s
= getenv("loadaddr")) != NULL
) {
452 offset
= simple_strtoul(s
, NULL
, 16);
455 load_baudrate
= current_baudrate
= gd
->baudrate
;
458 offset
= simple_strtoul(argv
[1], NULL
, 16);
461 load_baudrate
= (int)simple_strtoul(argv
[2], NULL
, 10);
463 /* default to current baudrate */
464 if (load_baudrate
== 0)
465 load_baudrate
= current_baudrate
;
468 if (load_baudrate
!= current_baudrate
) {
469 printf ("## Switch baudrate to %d bps and press ENTER ...\n",
472 gd
->baudrate
= load_baudrate
;
481 if (strcmp(argv
[0],"loady")==0) {
482 printf ("## Ready for binary (ymodem) download "
483 "to 0x%08lX at %d bps...\n",
487 addr
= load_serial_ymodem (offset
);
491 printf ("## Ready for binary (kermit) download "
492 "to 0x%08lX at %d bps...\n",
495 addr
= load_serial_bin (offset
);
499 printf ("## Binary (kermit) download aborted\n");
502 printf ("## Start Addr = 0x%08lX\n", addr
);
506 if (load_baudrate
!= current_baudrate
) {
507 printf ("## Switch baudrate to %d bps and press ESC ...\n",
510 gd
->baudrate
= current_baudrate
;
514 if (getc() == 0x1B) /* ESC */
519 #ifdef CONFIG_AUTOSCRIPT
523 if (((s
= getenv("autoscript")) != NULL
) && (strcmp(s
,"yes") == 0)) {
524 printf("Running autoscript at addr 0x%08lX ...\n", load_addr
);
525 rcode
= autoscript (load_addr
);
533 static ulong
load_serial_bin (ulong offset
)
538 set_kerm_bin_mode ((ulong
*) offset
);
542 * Gather any trailing characters (for instance, the ^D which
543 * is sent by 'cu' after sending a file), and give the
544 * box some time (100 * 1 ms)
546 for (i
=0; i
<100; ++i
) {
553 flush_cache (offset
, size
);
555 printf("## Total Size = 0x%08x = %d Bytes\n", size
, size
);
556 sprintf(buf
, "%X", size
);
557 setenv("filesize", buf
);
564 int count
= his_pad_count
;
570 /* converts escaped kermit char to binary char */
571 char ktrans (char in
)
573 if ((in
& 0x60) == 0x40) {
574 return (char) (in
& ~0x40);
575 } else if ((in
& 0x7f) == 0x3f) {
576 return (char) (in
| 0x40);
581 int chk1 (char *buffer
)
588 return (int) ((total
+ ((total
>> 6) & 0x03)) & 0x3f);
591 void s1_sendpacket (char *packet
)
600 void send_ack (int n
)
607 a_b
[4] = tochar (chk1 (&a_b
[1]));
613 void send_nack (int n
)
620 a_b
[4] = tochar (chk1 (&a_b
[1]));
627 /* os_data_* takes an OS Open image and puts it into memory, and
628 puts the boot header in an array named os_data_header
630 if image is binary, no header is stored in os_data_header.
632 void (*os_data_init
) (void);
633 void (*os_data_char
) (char new_char
);
634 static int os_data_state
, os_data_state_saved
;
636 static int os_data_count_saved
;
637 static char *os_data_addr
, *os_data_addr_saved
;
638 static char *bin_start_address
;
639 int os_data_header
[8];
640 static void bin_data_init (void)
644 os_data_addr
= bin_start_address
;
646 static void os_data_save (void)
648 os_data_state_saved
= os_data_state
;
649 os_data_count_saved
= os_data_count
;
650 os_data_addr_saved
= os_data_addr
;
652 static void os_data_restore (void)
654 os_data_state
= os_data_state_saved
;
655 os_data_count
= os_data_count_saved
;
656 os_data_addr
= os_data_addr_saved
;
658 static void bin_data_char (char new_char
)
660 switch (os_data_state
) {
662 *os_data_addr
++ = new_char
;
667 static void set_kerm_bin_mode (unsigned long *addr
)
669 bin_start_address
= (char *) addr
;
670 os_data_init
= bin_data_init
;
671 os_data_char
= bin_data_char
;
675 /* k_data_* simply handles the kermit escape translations */
676 static int k_data_escape
, k_data_escape_saved
;
677 void k_data_init (void)
682 void k_data_save (void)
684 k_data_escape_saved
= k_data_escape
;
687 void k_data_restore (void)
689 k_data_escape
= k_data_escape_saved
;
692 void k_data_char (char new_char
)
695 /* last char was escape - translate this character */
696 os_data_char (ktrans (new_char
));
699 if (new_char
== his_quote
) {
700 /* this char is escape - remember */
703 /* otherwise send this char as-is */
704 os_data_char (new_char
);
709 #define SEND_DATA_SIZE 20
710 char send_parms
[SEND_DATA_SIZE
];
713 /* handle_send_packet interprits the protocol info and builds and
714 sends an appropriate ack for what we can do */
715 void handle_send_packet (int n
)
720 /* initialize some protocol parameters */
721 his_eol
= END_CHAR
; /* default end of line character */
724 his_quote
= K_ESCAPE
;
726 /* ignore last character if it filled the buffer */
727 if (send_ptr
== &send_parms
[SEND_DATA_SIZE
- 1])
729 bytes
= send_ptr
- send_parms
; /* how many bytes we'll process */
733 /* handle MAXL - max length */
734 /* ignore what he says - most I'll take (here) is 94 */
735 a_b
[++length
] = tochar (94);
738 /* handle TIME - time you should wait for my packets */
739 /* ignore what he says - don't wait for my ack longer than 1 second */
740 a_b
[++length
] = tochar (1);
743 /* handle NPAD - number of pad chars I need */
744 /* remember what he says - I need none */
745 his_pad_count
= untochar (send_parms
[2]);
746 a_b
[++length
] = tochar (0);
749 /* handle PADC - pad chars I need */
750 /* remember what he says - I need none */
751 his_pad_char
= ktrans (send_parms
[3]);
752 a_b
[++length
] = 0x40; /* He should ignore this */
755 /* handle EOL - end of line he needs */
756 /* remember what he says - I need CR */
757 his_eol
= untochar (send_parms
[4]);
758 a_b
[++length
] = tochar (END_CHAR
);
761 /* handle QCTL - quote control char he'll use */
762 /* remember what he says - I'll use '#' */
763 his_quote
= send_parms
[5];
767 /* handle QBIN - 8-th bit prefixing */
768 /* ignore what he says - I refuse */
772 /* handle CHKT - the clock check type */
773 /* ignore what he says - I do type 1 (for now) */
777 /* handle REPT - the repeat prefix */
778 /* ignore what he says - I refuse (for now) */
782 /* handle CAPAS - the capabilities mask */
783 /* ignore what he says - I only do long packets - I don't do windows */
784 a_b
[++length
] = tochar (2); /* only long packets */
785 a_b
[++length
] = tochar (0); /* no windows */
786 a_b
[++length
] = tochar (94); /* large packet msb */
787 a_b
[++length
] = tochar (94); /* large packet lsb */
791 a_b
[1] = tochar (length
);
794 a_b
[++length
] = '\0';
795 a_b
[length
] = tochar (chk1 (&a_b
[1]));
796 a_b
[++length
] = his_eol
;
797 a_b
[++length
] = '\0';
801 /* k_recv receives a OS Open image file over kermit line */
802 static int k_recv (void)
805 char k_state
, k_state_saved
;
813 /* initialize some protocol parameters */
814 his_eol
= END_CHAR
; /* default end of line character */
817 his_quote
= K_ESCAPE
;
819 /* initialize the k_recv and k_data state machine */
823 k_state_saved
= k_state
;
825 n
= 0; /* just to get rid of a warning */
828 /* expect this "type" sequence (but don't check):
833 B: break transmission
836 /* enter main loop */
838 /* set the send packet pointer to begining of send packet parms */
839 send_ptr
= send_parms
;
841 /* With each packet, start summing the bytes starting with the length.
842 Save the current sequence number.
843 Note the type of the packet.
844 If a character less than SPACE (0x20) is received - error.
848 /* OLD CODE, Prior to checking sequence numbers */
849 /* first have all state machines save current states */
850 k_state_saved
= k_state
;
855 /* wait for the starting character or ^C */
858 case START_CHAR
: /* start packet */
860 case ETX_CHAR
: /* ^C waiting for packet */
867 /* get length of packet */
870 if ((new_char
& 0xE0) == 0)
872 sum
+= new_char
& 0xff;
873 length
= untochar (new_char
);
874 /* get sequence number */
876 if ((new_char
& 0xE0) == 0)
878 sum
+= new_char
& 0xff;
879 n
= untochar (new_char
);
882 /* NEW CODE - check sequence numbers for retried packets */
883 /* Note - this new code assumes that the sequence number is correctly
884 * received. Handling an invalid sequence number adds another layer
885 * of complexity that may not be needed - yet! At this time, I'm hoping
886 * that I don't need to buffer the incoming data packets and can write
887 * the data into memory in real time.
890 /* same sequence number, restore the previous state */
891 k_state
= k_state_saved
;
894 /* new sequence number, checkpoint the download */
896 k_state_saved
= k_state
;
901 /* get packet type */
903 if ((new_char
& 0xE0) == 0)
905 sum
+= new_char
& 0xff;
908 /* check for extended length */
910 /* (length byte was 0, decremented twice) */
911 /* get the two length bytes */
913 if ((new_char
& 0xE0) == 0)
915 sum
+= new_char
& 0xff;
916 len_hi
= untochar (new_char
);
918 if ((new_char
& 0xE0) == 0)
920 sum
+= new_char
& 0xff;
921 len_lo
= untochar (new_char
);
922 length
= len_hi
* 95 + len_lo
;
923 /* check header checksum */
925 if ((new_char
& 0xE0) == 0)
927 if (new_char
!= tochar ((sum
+ ((sum
>> 6) & 0x03)) & 0x3f))
929 sum
+= new_char
& 0xff;
930 /* --length; */ /* new length includes only data and block check to come */
932 /* bring in rest of packet */
935 if ((new_char
& 0xE0) == 0)
937 sum
+= new_char
& 0xff;
939 if (k_state
== DATA_TYPE
) {
940 /* pass on the data if this is a data packet */
941 k_data_char (new_char
);
942 } else if (k_state
== SEND_TYPE
) {
943 /* save send pack in buffer as is */
944 *send_ptr
++ = new_char
;
945 /* if too much data, back off the pointer */
946 if (send_ptr
>= &send_parms
[SEND_DATA_SIZE
])
950 /* get and validate checksum character */
952 if ((new_char
& 0xE0) == 0)
954 if (new_char
!= tochar ((sum
+ ((sum
>> 6) & 0x03)) & 0x3f))
958 if (new_char
!= END_CHAR
) {
960 /* restore state machines */
961 k_state
= k_state_saved
;
963 /* send a negative acknowledge packet in */
965 } else if (k_state
== SEND_TYPE
) {
966 /* crack the protocol parms, build an appropriate ack packet */
967 handle_send_packet (n
);
969 /* send simple acknowledge packet in */
971 /* quit if end of transmission */
972 if (k_state
== BREAK_TYPE
)
977 return ((ulong
) os_data_addr
- (ulong
) bin_start_address
);
980 static int getcxmodem(void) {
985 static ulong
load_serial_ymodem (ulong offset
)
991 connection_info_t info
;
992 char ymodemBuf
[1024];
993 ulong store_addr
= ~0;
997 info
.mode
= xyzModem_ymodem
;
998 res
= xyzModem_stream_open (&info
, &err
);
1002 xyzModem_stream_read (ymodemBuf
, 1024, &err
)) > 0) {
1003 store_addr
= addr
+ offset
;
1006 #ifndef CFG_NO_FLASH
1007 if (addr2info (store_addr
)) {
1010 rc
= flash_write ((char *) ymodemBuf
,
1019 memcpy ((char *) (store_addr
), ymodemBuf
,
1025 printf ("%s\n", xyzModem_error (err
));
1028 xyzModem_stream_close (&err
);
1029 xyzModem_stream_terminate (false, &getcxmodem
);
1032 flush_cache (offset
, size
);
1034 printf ("## Total Size = 0x%08x = %d Bytes\n", size
, size
);
1035 sprintf (buf
, "%X", size
);
1036 setenv ("filesize", buf
);
1043 /* -------------------------------------------------------------------- */
1045 #if defined(CONFIG_CMD_LOADS)
1047 #ifdef CFG_LOADS_BAUD_CHANGE
1049 loads
, 3, 0, do_load_serial
,
1050 "loads - load S-Record file over serial line\n",
1051 "[ off ] [ baud ]\n"
1052 " - load S-Record file over serial line"
1053 " with offset 'off' and baudrate 'baud'\n"
1056 #else /* ! CFG_LOADS_BAUD_CHANGE */
1058 loads
, 2, 0, do_load_serial
,
1059 "loads - load S-Record file over serial line\n",
1061 " - load S-Record file over serial line with offset 'off'\n"
1063 #endif /* CFG_LOADS_BAUD_CHANGE */
1066 * SAVES always requires LOADS support, but not vice versa
1070 #if defined(CONFIG_CMD_SAVES)
1071 #ifdef CFG_LOADS_BAUD_CHANGE
1073 saves
, 4, 0, do_save_serial
,
1074 "saves - save S-Record file over serial line\n",
1075 "[ off ] [size] [ baud ]\n"
1076 " - save S-Record file over serial line"
1077 " with offset 'off', size 'size' and baudrate 'baud'\n"
1079 #else /* ! CFG_LOADS_BAUD_CHANGE */
1081 saves
, 3, 0, do_save_serial
,
1082 "saves - save S-Record file over serial line\n",
1084 " - save S-Record file over serial line with offset 'off' and size 'size'\n"
1086 #endif /* CFG_LOADS_BAUD_CHANGE */
1091 #if defined(CONFIG_CMD_LOADB)
1093 loadb
, 3, 0, do_load_serial_bin
,
1094 "loadb - load binary file over serial line (kermit mode)\n",
1095 "[ off ] [ baud ]\n"
1096 " - load binary file over serial line"
1097 " with offset 'off' and baudrate 'baud'\n"
1101 loady
, 3, 0, do_load_serial_bin
,
1102 "loady - load binary file over serial line (ymodem mode)\n",
1103 "[ off ] [ baud ]\n"
1104 " - load binary file over serial line"
1105 " with offset 'off' and baudrate 'baud'\n"
1110 /* -------------------------------------------------------------------- */
1112 #if defined(CONFIG_CMD_HWFLOW)
1113 int do_hwflow (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
1115 extern int hwflow_onoff(int);
1118 if (strcmp(argv
[1], "off") == 0)
1121 if (strcmp(argv
[1], "on") == 0)
1124 printf("Usage: %s\n", cmdtp
->usage
);
1126 printf("RTS/CTS hardware flow control: %s\n", hwflow_onoff(0) ? "on" : "off");
1130 /* -------------------------------------------------------------------- */
1133 hwflow
, 2, 0, do_hwflow
,
1134 "hwflow - turn the harwdare flow control on/off\n",
1135 "[on|off]\n - change RTS/CTS hardware flow control over serial line\n"