1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2004
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 * Serial up- and download support
14 #include <efi_loader.h>
25 #include <asm/cache.h>
26 #include <asm/global_data.h>
27 #include <linux/delay.h>
29 DECLARE_GLOBAL_DATA_PTR;
31 #if defined(CONFIG_CMD_LOADB)
32 static ulong load_serial_ymodem(ulong offset, int mode);
35 #if defined(CONFIG_CMD_LOADS)
36 static ulong load_serial(long offset);
37 static int read_record(char *buf, ulong len);
38 # if defined(CONFIG_CMD_SAVES)
39 static int save_serial(ulong offset, ulong size);
40 static int write_record(char *buf);
43 static int do_echo = 1;
46 /* -------------------------------------------------------------------- */
48 #if defined(CONFIG_CMD_LOADS)
49 static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc,
57 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
58 int load_baudrate, current_baudrate;
60 load_baudrate = current_baudrate = gd->baudrate;
63 env_echo = env_get("loads_echo");
64 if (env_echo && *env_echo == '1')
69 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
71 offset = simple_strtol(argv[1], NULL, 16);
74 load_baudrate = (int)dectoul(argv[2], NULL);
76 /* default to current baudrate */
77 if (load_baudrate == 0)
78 load_baudrate = current_baudrate;
80 if (load_baudrate != current_baudrate) {
81 printf("## Switch baudrate to %d bps and press ENTER ...\n",
84 gd->baudrate = load_baudrate;
88 if (getchar() == '\r')
92 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
94 offset = simple_strtol(argv[1], NULL, 16);
96 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
98 printf("## Ready for S-Record download ...\n");
100 addr = load_serial(offset);
103 * Gather any trailing characters (for instance, the ^D which
104 * is sent by 'cu' after sending a file), and give the
105 * box some time (100 * 1 ms)
107 for (i=0; i<100; ++i) {
115 printf("## S-Record download aborted\n");
118 printf("## Start Addr = 0x%08lX\n", addr);
119 image_load_addr = addr;
122 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
123 if (load_baudrate != current_baudrate) {
124 printf("## Switch baudrate to %d bps and press ESC ...\n",
127 gd->baudrate = current_baudrate;
131 if (getchar() == 0x1B) /* ESC */
139 static ulong load_serial(long offset)
142 char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */
143 char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */
144 int binlen; /* no. of data bytes in S-Rec. */
145 int type; /* return code for record type */
146 ulong addr; /* load address from S-Record */
147 ulong size; /* number of bytes transferred */
149 ulong start_addr = ~0;
154 lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
156 while (read_record(record, SREC_MAXRECLEN + 1) >= 0) {
157 type = srec_decode(record, &binlen, &addr, binbuf);
160 return (~0); /* Invalid S-Record */
167 store_addr = addr + offset;
168 #ifdef CONFIG_MTD_NOR_FLASH
169 if (addr2info(store_addr)) {
172 rc = flash_write((char *)binbuf,store_addr,binlen);
180 ret = lmb_reserve(&lmb, store_addr, binlen);
182 printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
183 store_addr, store_addr + binlen);
186 memcpy((char *)(store_addr), binbuf, binlen);
187 lmb_free(&lmb, store_addr, binlen);
189 if ((store_addr) < start_addr)
190 start_addr = store_addr;
191 if ((store_addr + binlen - 1) > end_addr)
192 end_addr = store_addr + binlen - 1;
198 size = end_addr - start_addr + 1;
200 "## First Load Addr = 0x%08lX\n"
201 "## Last Load Addr = 0x%08lX\n"
202 "## Total Size = 0x%08lX = %ld Bytes\n",
203 start_addr, end_addr, size, size
205 flush_cache(start_addr, size);
206 env_set_hex("filesize", size);
213 if (!do_echo) { /* print a '.' every 100 lines */
214 if ((++line_count % 100) == 0)
219 return (~0); /* Download aborted */
222 static int read_record(char *buf, ulong len)
227 --len; /* always leave room for terminating '\0' byte */
229 for (p=buf; p < buf+len; ++p) {
230 c = getchar(); /* read character */
232 putc(c); /* ... and echo it */
240 case 0x03: /* ^C - Control C */
246 /* Check for the console hangup (if any different from serial) */
247 if (gd->jt->getc != getchar) {
253 /* line too long - truncate */
258 #if defined(CONFIG_CMD_SAVES)
260 int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc,
265 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
266 int save_baudrate, current_baudrate;
268 save_baudrate = current_baudrate = gd->baudrate;
272 offset = hextoul(argv[1], NULL);
274 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
276 size = hextoul(argv[2], NULL);
279 save_baudrate = (int)dectoul(argv[3], NULL);
281 /* default to current baudrate */
282 if (save_baudrate == 0)
283 save_baudrate = current_baudrate;
285 if (save_baudrate != current_baudrate) {
286 printf("## Switch baudrate to %d bps and press ENTER ...\n",
289 gd->baudrate = save_baudrate;
293 if (getchar() == '\r')
297 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
299 size = hextoul(argv[2], NULL);
301 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
303 printf("## Ready for S-Record upload, press ENTER to proceed ...\n");
305 if (getchar() == '\r')
308 if (save_serial(offset, size)) {
309 printf("## S-Record upload aborted\n");
311 printf("## S-Record upload complete\n");
313 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
314 if (save_baudrate != current_baudrate) {
315 printf("## Switch baudrate to %d bps and press ESC ...\n",
316 (int)current_baudrate);
318 gd->baudrate = current_baudrate;
322 if (getchar() == 0x1B) /* ESC */
330 #define SREC3_START "S0030000FC\n"
331 #define SREC3_FORMAT "S3%02X%08lX%s%02X\n"
332 #define SREC3_END "S70500000000FA\n"
333 #define SREC_BYTES_PER_RECORD 16
335 static int save_serial(ulong address, ulong count)
337 int i, c, reclen, checksum, length;
338 char *hex = "0123456789ABCDEF";
339 char record[2*SREC_BYTES_PER_RECORD+16]; /* buffer for one S-Record */
340 char data[2*SREC_BYTES_PER_RECORD+1]; /* buffer for hex data */
345 if(write_record(SREC3_START)) /* write the header */
348 if(count) { /* collect hex data in the buffer */
349 c = *(volatile uchar*)(address + reclen); /* get one byte */
350 checksum += c; /* accumulate checksum */
351 data[2*reclen] = hex[(c>>4)&0x0f];
352 data[2*reclen+1] = hex[c & 0x0f];
353 data[2*reclen+2] = '\0';
357 if(reclen == SREC_BYTES_PER_RECORD || count == 0) {
358 /* enough data collected for one record: dump it */
359 if(reclen) { /* build & write a data record: */
360 /* address + data + checksum */
361 length = 4 + reclen + 1;
363 /* accumulate length bytes into checksum */
364 for(i = 0; i < 2; i++)
365 checksum += (length >> (8*i)) & 0xff;
367 /* accumulate address bytes into checksum: */
368 for(i = 0; i < 4; i++)
369 checksum += (address >> (8*i)) & 0xff;
371 /* make proper checksum byte: */
372 checksum = ~checksum & 0xff;
374 /* output one record: */
375 sprintf(record, SREC3_FORMAT, length, address, data, checksum);
376 if(write_record(record))
379 address += reclen; /* increment address */
385 if(write_record(SREC3_END)) /* write the final record */
390 static int write_record(char *buf)
397 /* Check for the console hangup (if any different from serial) */
409 #if defined(CONFIG_CMD_LOADB)
411 * loadb command (load binary) included
415 #define START_CHAR 0x01
416 #define ETX_CHAR 0x03
417 #define END_CHAR 0x0D
419 #define K_ESCAPE 0x23
420 #define SEND_TYPE 'S'
421 #define DATA_TYPE 'D'
423 #define NACK_TYPE 'N'
424 #define BREAK_TYPE 'B'
425 #define tochar(x) ((char) (((x) + SPACE) & 0xff))
426 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
428 static void set_kerm_bin_mode(unsigned long *);
429 static int k_recv(void);
430 static ulong load_serial_bin(ulong offset);
433 static char his_eol; /* character he needs at end of packet */
434 static int his_pad_count; /* number of pad chars he needs */
435 static char his_pad_char; /* pad chars he needs */
436 static char his_quote; /* quote chars he'll use */
438 static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc,
443 int load_baudrate, current_baudrate;
447 /* pre-set offset from CONFIG_SYS_LOAD_ADDR */
448 offset = CONFIG_SYS_LOAD_ADDR;
450 /* pre-set offset from $loadaddr */
451 s = env_get("loadaddr");
453 offset = hextoul(s, NULL);
455 load_baudrate = current_baudrate = gd->baudrate;
458 offset = hextoul(argv[1], NULL);
461 load_baudrate = (int)dectoul(argv[2], NULL);
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;
476 if (getchar() == '\r')
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, xyzModem_ymodem);
491 printf("## Binary (ymodem) download aborted\n");
494 printf("## Start Addr = 0x%08lX\n", addr);
495 image_load_addr = addr;
497 } else if (strcmp(argv[0],"loadx")==0) {
498 printf("## Ready for binary (xmodem) download "
499 "to 0x%08lX at %d bps...\n",
503 addr = load_serial_ymodem(offset, xyzModem_xmodem);
507 printf("## Binary (xmodem) download aborted\n");
510 printf("## Start Addr = 0x%08lX\n", addr);
511 image_load_addr = addr;
515 printf("## Ready for binary (kermit) download "
516 "to 0x%08lX at %d bps...\n",
519 addr = load_serial_bin(offset);
523 printf("## Binary (kermit) download aborted\n");
526 printf("## Start Addr = 0x%08lX\n", addr);
527 image_load_addr = addr;
530 if (load_baudrate != current_baudrate) {
531 printf("## Switch baudrate to %d bps and press ESC ...\n",
534 gd->baudrate = current_baudrate;
538 if (getchar() == 0x1B) /* ESC */
547 static ulong load_serial_bin(ulong offset)
551 set_kerm_bin_mode((ulong *) offset);
555 * Gather any trailing characters (for instance, the ^D which
556 * is sent by 'cu' after sending a file), and give the
557 * box some time (100 * 1 ms)
559 for (i=0; i<100; ++i) {
567 return ~0; /* Download aborted */
569 flush_cache(offset, size);
571 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
572 env_set_hex("filesize", size);
577 static void send_pad(void)
579 int count = his_pad_count;
585 /* converts escaped kermit char to binary char */
586 static char ktrans(char in)
588 if ((in & 0x60) == 0x40) {
589 return (char) (in & ~0x40);
590 } else if ((in & 0x7f) == 0x3f) {
591 return (char) (in | 0x40);
596 static int chk1(char *buffer)
603 return (int) ((total + ((total >> 6) & 0x03)) & 0x3f);
606 static void s1_sendpacket(char *packet)
615 static void send_ack(int n)
622 a_b[4] = tochar(chk1(&a_b[1]));
628 static void send_nack(int n)
635 a_b[4] = tochar(chk1(&a_b[1]));
642 static void (*os_data_init)(void);
643 static void (*os_data_char)(char new_char);
644 static int os_data_state, os_data_state_saved;
645 static char *os_data_addr, *os_data_addr_saved;
646 static char *bin_start_address;
648 static void bin_data_init(void)
651 os_data_addr = bin_start_address;
654 static void os_data_save(void)
656 os_data_state_saved = os_data_state;
657 os_data_addr_saved = os_data_addr;
660 static void os_data_restore(void)
662 os_data_state = os_data_state_saved;
663 os_data_addr = os_data_addr_saved;
666 static void bin_data_char(char new_char)
668 switch (os_data_state) {
670 *os_data_addr++ = new_char;
675 static void set_kerm_bin_mode(unsigned long *addr)
677 bin_start_address = (char *) addr;
678 os_data_init = bin_data_init;
679 os_data_char = bin_data_char;
683 /* k_data_* simply handles the kermit escape translations */
684 static int k_data_escape, k_data_escape_saved;
685 static void k_data_init(void)
691 static void k_data_save(void)
693 k_data_escape_saved = k_data_escape;
697 static void k_data_restore(void)
699 k_data_escape = k_data_escape_saved;
703 static void k_data_char(char new_char)
706 /* last char was escape - translate this character */
707 os_data_char(ktrans(new_char));
710 if (new_char == his_quote) {
711 /* this char is escape - remember */
714 /* otherwise send this char as-is */
715 os_data_char(new_char);
720 #define SEND_DATA_SIZE 20
721 static char send_parms[SEND_DATA_SIZE];
722 static char *send_ptr;
724 /* handle_send_packet interprits the protocol info and builds and
725 sends an appropriate ack for what we can do */
726 static void handle_send_packet(int n)
731 /* initialize some protocol parameters */
732 his_eol = END_CHAR; /* default end of line character */
735 his_quote = K_ESCAPE;
737 /* ignore last character if it filled the buffer */
738 if (send_ptr == &send_parms[SEND_DATA_SIZE - 1])
740 bytes = send_ptr - send_parms; /* how many bytes we'll process */
744 /* handle MAXL - max length */
745 /* ignore what he says - most I'll take (here) is 94 */
746 a_b[++length] = tochar(94);
749 /* handle TIME - time you should wait for my packets */
750 /* ignore what he says - don't wait for my ack longer than 1 second */
751 a_b[++length] = tochar(1);
754 /* handle NPAD - number of pad chars I need */
755 /* remember what he says - I need none */
756 his_pad_count = untochar(send_parms[2]);
757 a_b[++length] = tochar(0);
760 /* handle PADC - pad chars I need */
761 /* remember what he says - I need none */
762 his_pad_char = ktrans(send_parms[3]);
763 a_b[++length] = 0x40; /* He should ignore this */
766 /* handle EOL - end of line he needs */
767 /* remember what he says - I need CR */
768 his_eol = untochar(send_parms[4]);
769 a_b[++length] = tochar(END_CHAR);
772 /* handle QCTL - quote control char he'll use */
773 /* remember what he says - I'll use '#' */
774 his_quote = send_parms[5];
778 /* handle QBIN - 8-th bit prefixing */
779 /* ignore what he says - I refuse */
783 /* handle CHKT - the clock check type */
784 /* ignore what he says - I do type 1 (for now) */
788 /* handle REPT - the repeat prefix */
789 /* ignore what he says - I refuse (for now) */
793 /* handle CAPAS - the capabilities mask */
794 /* ignore what he says - I only do long packets - I don't do windows */
795 a_b[++length] = tochar(2); /* only long packets */
796 a_b[++length] = tochar(0); /* no windows */
797 a_b[++length] = tochar(94); /* large packet msb */
798 a_b[++length] = tochar(94); /* large packet lsb */
802 a_b[1] = tochar(length);
805 a_b[++length] = '\0';
806 a_b[length] = tochar(chk1(&a_b[1]));
807 a_b[++length] = his_eol;
808 a_b[++length] = '\0';
812 /* k_recv receives a OS Open image file over kermit line */
813 static int k_recv(void)
816 char k_state, k_state_saved;
823 /* initialize some protocol parameters */
824 his_eol = END_CHAR; /* default end of line character */
827 his_quote = K_ESCAPE;
829 /* initialize the k_recv and k_data state machine */
833 k_state_saved = k_state;
835 n = 0; /* just to get rid of a warning */
838 /* expect this "type" sequence (but don't check):
843 B: break transmission
846 /* enter main loop */
848 /* set the send packet pointer to begining of send packet parms */
849 send_ptr = send_parms;
851 /* With each packet, start summing the bytes starting with the length.
852 Save the current sequence number.
853 Note the type of the packet.
854 If a character less than SPACE (0x20) is received - error.
858 /* OLD CODE, Prior to checking sequence numbers */
859 /* first have all state machines save current states */
860 k_state_saved = k_state;
865 /* wait for the starting character or ^C */
868 case START_CHAR: /* start packet */
870 case ETX_CHAR: /* ^C waiting for packet */
877 /* get length of packet */
879 new_char = getchar();
880 if ((new_char & 0xE0) == 0)
882 sum += new_char & 0xff;
883 length = untochar(new_char);
884 /* get sequence number */
885 new_char = getchar();
886 if ((new_char & 0xE0) == 0)
888 sum += new_char & 0xff;
889 n = untochar(new_char);
892 /* NEW CODE - check sequence numbers for retried packets */
893 /* Note - this new code assumes that the sequence number is correctly
894 * received. Handling an invalid sequence number adds another layer
895 * of complexity that may not be needed - yet! At this time, I'm hoping
896 * that I don't need to buffer the incoming data packets and can write
897 * the data into memory in real time.
900 /* same sequence number, restore the previous state */
901 k_state = k_state_saved;
904 /* new sequence number, checkpoint the download */
906 k_state_saved = k_state;
911 /* get packet type */
912 new_char = getchar();
913 if ((new_char & 0xE0) == 0)
915 sum += new_char & 0xff;
918 /* check for extended length */
920 /* (length byte was 0, decremented twice) */
921 /* get the two length bytes */
922 new_char = getchar();
923 if ((new_char & 0xE0) == 0)
925 sum += new_char & 0xff;
926 len_hi = untochar(new_char);
927 new_char = getchar();
928 if ((new_char & 0xE0) == 0)
930 sum += new_char & 0xff;
931 len_lo = untochar(new_char);
932 length = len_hi * 95 + len_lo;
933 /* check header checksum */
934 new_char = getchar();
935 if ((new_char & 0xE0) == 0)
937 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
939 sum += new_char & 0xff;
940 /* --length; */ /* new length includes only data and block check to come */
942 /* bring in rest of packet */
944 new_char = getchar();
945 if ((new_char & 0xE0) == 0)
947 sum += new_char & 0xff;
949 if (k_state == DATA_TYPE) {
950 /* pass on the data if this is a data packet */
951 k_data_char (new_char);
952 } else if (k_state == SEND_TYPE) {
953 /* save send pack in buffer as is */
954 *send_ptr++ = new_char;
955 /* if too much data, back off the pointer */
956 if (send_ptr >= &send_parms[SEND_DATA_SIZE])
960 /* get and validate checksum character */
961 new_char = getchar();
962 if ((new_char & 0xE0) == 0)
964 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
967 new_char = getchar();
968 if (new_char != END_CHAR) {
970 /* restore state machines */
971 k_state = k_state_saved;
973 /* send a negative acknowledge packet in */
975 } else if (k_state == SEND_TYPE) {
976 /* crack the protocol parms, build an appropriate ack packet */
977 handle_send_packet(n);
979 /* send simple acknowledge packet in */
981 /* quit if end of transmission */
982 if (k_state == BREAK_TYPE)
986 return ((ulong) os_data_addr - (ulong) bin_start_address);
989 static int getcxmodem(void) {
994 static ulong load_serial_ymodem(ulong offset, int mode)
999 connection_info_t info;
1000 char ymodemBuf[1024];
1001 ulong store_addr = ~0;
1006 res = xyzModem_stream_open(&info, &err);
1011 xyzModem_stream_read(ymodemBuf, 1024, &err)) > 0) {
1012 store_addr = addr + offset;
1015 #ifdef CONFIG_MTD_NOR_FLASH
1016 if (addr2info(store_addr)) {
1019 rc = flash_write((char *) ymodemBuf,
1022 xyzModem_stream_terminate(true, &getcxmodem);
1023 xyzModem_stream_close(&err);
1031 memcpy((char *)(store_addr), ymodemBuf,
1037 xyzModem_stream_terminate((err == xyzModem_cancel) ? false : true, &getcxmodem);
1038 xyzModem_stream_close(&err);
1039 printf("\n%s\n", xyzModem_error(err));
1040 return (~0); /* Download aborted */
1043 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1044 efi_set_bootdev("Uart", "", "",
1045 map_sysmem(offset, 0), size);
1048 printf("\n%s\n", xyzModem_error(err));
1049 return (~0); /* Download aborted */
1052 xyzModem_stream_terminate(false, &getcxmodem);
1053 xyzModem_stream_close(&err);
1056 flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));
1058 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
1059 env_set_hex("filesize", size);
1066 #if defined(CONFIG_CMD_LOADM)
1067 static int do_load_memory_bin(struct cmd_tbl *cmdtp, int flag, int argc,
1070 ulong addr, dest, size;
1074 return CMD_RET_USAGE;
1076 addr = simple_strtoul(argv[1], NULL, 16);
1078 dest = simple_strtoul(argv[2], NULL, 16);
1080 size = simple_strtoul(argv[3], NULL, 16);
1083 printf("loadm: can not load zero bytes\n");
1087 src = map_sysmem(addr, size);
1088 dst = map_sysmem(dest, size);
1090 memcpy(dst, src, size);
1095 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1096 efi_set_bootdev("Mem", "", "", map_sysmem(dest, 0), size);
1098 printf("loaded bin to memory: size: %lu\n", size);
1104 /* -------------------------------------------------------------------- */
1106 #if defined(CONFIG_CMD_LOADS)
1108 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1110 loads, 3, 0, do_load_serial,
1111 "load S-Record file over serial line",
1112 "[ off ] [ baud ]\n"
1113 " - load S-Record file over serial line"
1114 " with offset 'off' and baudrate 'baud'"
1117 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1119 loads, 2, 0, do_load_serial,
1120 "load S-Record file over serial line",
1122 " - load S-Record file over serial line with offset 'off'"
1124 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1127 * SAVES always requires LOADS support, but not vice versa
1131 #if defined(CONFIG_CMD_SAVES)
1132 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1134 saves, 4, 0, do_save_serial,
1135 "save S-Record file over serial line",
1136 "[ off ] [size] [ baud ]\n"
1137 " - save S-Record file over serial line"
1138 " with offset 'off', size 'size' and baudrate 'baud'"
1140 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1142 saves, 3, 0, do_save_serial,
1143 "save S-Record file over serial line",
1145 " - save S-Record file over serial line with offset 'off' and size 'size'"
1147 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1148 #endif /* CONFIG_CMD_SAVES */
1149 #endif /* CONFIG_CMD_LOADS */
1152 #if defined(CONFIG_CMD_LOADB)
1154 loadb, 3, 0, do_load_serial_bin,
1155 "load binary file over serial line (kermit mode)",
1156 "[ addr [ baud ] ]\n"
1157 " - load binary file over serial line"
1158 " at address 'addr' with baudrate 'baud'"
1162 loadx, 3, 0, do_load_serial_bin,
1163 "load binary file over serial line (xmodem mode)",
1164 "[ addr [ baud ] ]\n"
1165 " - load binary file over serial line"
1166 " at address 'addr' with baudrate 'baud'"
1170 loady, 3, 0, do_load_serial_bin,
1171 "load binary file over serial line (ymodem mode)",
1172 "[ addr [ baud ] ]\n"
1173 " - load binary file over serial line"
1174 " at address 'addr' with baudrate 'baud'"
1177 #endif /* CONFIG_CMD_LOADB */
1179 #if defined(CONFIG_CMD_LOADM)
1181 loadm, 4, 0, do_load_memory_bin,
1182 "load binary blob from source address to destination address",
1183 "[src_addr] [dst_addr] [size]\n"
1184 " - load a binary blob from one memory location to other"
1185 " from src_addr to dst_addr by size bytes"
1187 #endif /* CONFIG_CMD_LOADM */