1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2004
8 * Serial up- and download support
14 #include <efi_loader.h>
17 #ifdef CONFIG_MTD_NOR_FLASH
27 #include <asm/cache.h>
28 #include <asm/global_data.h>
29 #include <linux/delay.h>
31 DECLARE_GLOBAL_DATA_PTR;
33 #if defined(CONFIG_CMD_LOADB)
34 static ulong load_serial_ymodem(ulong offset, int mode);
37 #if defined(CONFIG_CMD_LOADS)
38 static ulong load_serial(long offset);
39 static int read_record(char *buf, ulong len);
40 # if defined(CONFIG_CMD_SAVES)
41 static int save_serial(ulong offset, ulong size);
42 static int write_record(char *buf);
45 static int do_echo = 1;
48 /* -------------------------------------------------------------------- */
50 #if defined(CONFIG_CMD_LOADS)
51 static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc,
59 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
60 int load_baudrate, current_baudrate;
62 load_baudrate = current_baudrate = gd->baudrate;
65 env_echo = env_get("loads_echo");
66 if (env_echo && *env_echo == '1')
71 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
73 offset = simple_strtol(argv[1], NULL, 16);
76 load_baudrate = (int)dectoul(argv[2], NULL);
78 /* default to current baudrate */
79 if (load_baudrate == 0)
80 load_baudrate = current_baudrate;
82 if (load_baudrate != current_baudrate) {
83 printf("## Switch baudrate to %d bps and press ENTER ...\n",
86 gd->baudrate = load_baudrate;
90 if (getchar() == '\r')
94 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
96 offset = simple_strtol(argv[1], NULL, 16);
98 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
100 printf("## Ready for S-Record download ...\n");
102 addr = load_serial(offset);
105 * Gather any trailing characters (for instance, the ^D which
106 * is sent by 'cu' after sending a file), and give the
107 * box some time (100 * 1 ms)
109 for (i=0; i<100; ++i) {
117 printf("## S-Record download aborted\n");
120 printf("## Start Addr = 0x%08lX\n", addr);
121 image_load_addr = addr;
124 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
125 if (load_baudrate != current_baudrate) {
126 printf("## Switch baudrate to %d bps and press ESC ...\n",
129 gd->baudrate = current_baudrate;
133 if (getchar() == 0x1B) /* ESC */
141 static ulong load_serial(long offset)
144 char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */
145 char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */
146 int binlen; /* no. of data bytes in S-Rec. */
147 int type; /* return code for record type */
148 ulong addr; /* load address from S-Record */
149 ulong size; /* number of bytes transferred */
151 ulong start_addr = ~0;
156 lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
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;
170 #ifdef CONFIG_MTD_NOR_FLASH
171 if (addr2info(store_addr)) {
174 rc = flash_write((char *)binbuf,store_addr,binlen);
182 ret = lmb_reserve(&lmb, store_addr, binlen);
184 printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
185 store_addr, store_addr + binlen);
188 memcpy((char *)(store_addr), binbuf, binlen);
189 lmb_free(&lmb, store_addr, binlen);
191 if ((store_addr) < start_addr)
192 start_addr = store_addr;
193 if ((store_addr + binlen - 1) > end_addr)
194 end_addr = store_addr + binlen - 1;
200 size = end_addr - start_addr + 1;
202 "## First Load Addr = 0x%08lX\n"
203 "## Last Load Addr = 0x%08lX\n"
204 "## Total Size = 0x%08lX = %ld Bytes\n",
205 start_addr, end_addr, size, size
207 flush_cache(start_addr, size);
208 env_set_hex("filesize", size);
215 if (!do_echo) { /* print a '.' every 100 lines */
216 if ((++line_count % 100) == 0)
221 return (~0); /* Download aborted */
224 static int read_record(char *buf, ulong len)
229 --len; /* always leave room for terminating '\0' byte */
231 for (p=buf; p < buf+len; ++p) {
232 c = getchar(); /* read character */
234 putc(c); /* ... and echo it */
242 case 0x03: /* ^C - Control C */
248 /* Check for the console hangup (if any different from serial) */
249 if (gd->jt->getc != getchar) {
255 /* line too long - truncate */
260 #if defined(CONFIG_CMD_SAVES)
262 int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc,
267 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
268 int save_baudrate, current_baudrate;
270 save_baudrate = current_baudrate = gd->baudrate;
274 offset = hextoul(argv[1], NULL);
276 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
278 size = hextoul(argv[2], NULL);
281 save_baudrate = (int)dectoul(argv[3], NULL);
283 /* default to current baudrate */
284 if (save_baudrate == 0)
285 save_baudrate = current_baudrate;
287 if (save_baudrate != current_baudrate) {
288 printf("## Switch baudrate to %d bps and press ENTER ...\n",
291 gd->baudrate = save_baudrate;
295 if (getchar() == '\r')
299 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
301 size = hextoul(argv[2], NULL);
303 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
305 printf("## Ready for S-Record upload, press ENTER to proceed ...\n");
307 if (getchar() == '\r')
310 if (save_serial(offset, size)) {
311 printf("## S-Record upload aborted\n");
313 printf("## S-Record upload complete\n");
315 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
316 if (save_baudrate != current_baudrate) {
317 printf("## Switch baudrate to %d bps and press ESC ...\n",
318 (int)current_baudrate);
320 gd->baudrate = current_baudrate;
324 if (getchar() == 0x1B) /* ESC */
332 #define SREC3_START "S0030000FC\n"
333 #define SREC3_FORMAT "S3%02X%08lX%s%02X\n"
334 #define SREC3_END "S70500000000FA\n"
335 #define SREC_BYTES_PER_RECORD 16
337 static int save_serial(ulong address, ulong count)
339 int i, c, reclen, checksum, length;
340 char *hex = "0123456789ABCDEF";
341 char record[2*SREC_BYTES_PER_RECORD+16]; /* buffer for one S-Record */
342 char data[2*SREC_BYTES_PER_RECORD+1]; /* buffer for hex data */
347 if(write_record(SREC3_START)) /* write the header */
350 if(count) { /* collect hex data in the buffer */
351 c = *(volatile uchar*)(address + reclen); /* get one byte */
352 checksum += c; /* accumulate checksum */
353 data[2*reclen] = hex[(c>>4)&0x0f];
354 data[2*reclen+1] = hex[c & 0x0f];
355 data[2*reclen+2] = '\0';
359 if(reclen == SREC_BYTES_PER_RECORD || count == 0) {
360 /* enough data collected for one record: dump it */
361 if(reclen) { /* build & write a data record: */
362 /* address + data + checksum */
363 length = 4 + reclen + 1;
365 /* accumulate length bytes into checksum */
366 for(i = 0; i < 2; i++)
367 checksum += (length >> (8*i)) & 0xff;
369 /* accumulate address bytes into checksum: */
370 for(i = 0; i < 4; i++)
371 checksum += (address >> (8*i)) & 0xff;
373 /* make proper checksum byte: */
374 checksum = ~checksum & 0xff;
376 /* output one record: */
377 sprintf(record, SREC3_FORMAT, length, address, data, checksum);
378 if(write_record(record))
381 address += reclen; /* increment address */
387 if(write_record(SREC3_END)) /* write the final record */
392 static int write_record(char *buf)
399 /* Check for the console hangup (if any different from serial) */
411 #if defined(CONFIG_CMD_LOADB)
413 * loadb command (load binary) included
417 #define START_CHAR 0x01
418 #define ETX_CHAR 0x03
419 #define END_CHAR 0x0D
421 #define K_ESCAPE 0x23
422 #define SEND_TYPE 'S'
423 #define DATA_TYPE 'D'
425 #define NACK_TYPE 'N'
426 #define BREAK_TYPE 'B'
427 #define tochar(x) ((char) (((x) + SPACE) & 0xff))
428 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
430 static void set_kerm_bin_mode(unsigned long *);
431 static int k_recv(void);
432 static ulong load_serial_bin(ulong offset);
435 static char his_eol; /* character he needs at end of packet */
436 static int his_pad_count; /* number of pad chars he needs */
437 static char his_pad_char; /* pad chars he needs */
438 static char his_quote; /* quote chars he'll use */
440 static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc,
445 int load_baudrate, current_baudrate;
449 /* pre-set offset from CONFIG_SYS_LOAD_ADDR */
450 offset = CONFIG_SYS_LOAD_ADDR;
452 /* pre-set offset from $loadaddr */
453 s = env_get("loadaddr");
455 offset = hextoul(s, NULL);
457 load_baudrate = current_baudrate = gd->baudrate;
460 offset = hextoul(argv[1], NULL);
463 load_baudrate = (int)dectoul(argv[2], NULL);
465 /* default to current baudrate */
466 if (load_baudrate == 0)
467 load_baudrate = current_baudrate;
470 if (load_baudrate != current_baudrate) {
471 printf("## Switch baudrate to %d bps and press ENTER ...\n",
474 gd->baudrate = load_baudrate;
478 if (getchar() == '\r')
483 if (strcmp(argv[0],"loady")==0) {
484 printf("## Ready for binary (ymodem) download "
485 "to 0x%08lX at %d bps...\n",
489 addr = load_serial_ymodem(offset, xyzModem_ymodem);
493 printf("## Binary (ymodem) download aborted\n");
496 printf("## Start Addr = 0x%08lX\n", addr);
497 image_load_addr = addr;
499 } else if (strcmp(argv[0],"loadx")==0) {
500 printf("## Ready for binary (xmodem) download "
501 "to 0x%08lX at %d bps...\n",
505 addr = load_serial_ymodem(offset, xyzModem_xmodem);
509 printf("## Binary (xmodem) download aborted\n");
512 printf("## Start Addr = 0x%08lX\n", addr);
513 image_load_addr = addr;
517 printf("## Ready for binary (kermit) download "
518 "to 0x%08lX at %d bps...\n",
521 addr = load_serial_bin(offset);
525 printf("## Binary (kermit) download aborted\n");
528 printf("## Start Addr = 0x%08lX\n", addr);
529 image_load_addr = addr;
532 if (load_baudrate != current_baudrate) {
533 printf("## Switch baudrate to %d bps and press ESC ...\n",
536 gd->baudrate = current_baudrate;
540 if (getchar() == 0x1B) /* ESC */
549 static ulong load_serial_bin(ulong offset)
553 set_kerm_bin_mode((ulong *) offset);
557 * Gather any trailing characters (for instance, the ^D which
558 * is sent by 'cu' after sending a file), and give the
559 * box some time (100 * 1 ms)
561 for (i=0; i<100; ++i) {
569 return ~0; /* Download aborted */
571 flush_cache(offset, size);
573 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
574 env_set_hex("filesize", size);
579 static void send_pad(void)
581 int count = his_pad_count;
587 /* converts escaped kermit char to binary char */
588 static char ktrans(char in)
590 if ((in & 0x60) == 0x40) {
591 return (char) (in & ~0x40);
592 } else if ((in & 0x7f) == 0x3f) {
593 return (char) (in | 0x40);
598 static int chk1(char *buffer)
605 return (int) ((total + ((total >> 6) & 0x03)) & 0x3f);
608 static void s1_sendpacket(char *packet)
617 static void send_ack(int n)
624 a_b[4] = tochar(chk1(&a_b[1]));
630 static void send_nack(int n)
637 a_b[4] = tochar(chk1(&a_b[1]));
644 static void (*os_data_init)(void);
645 static void (*os_data_char)(char new_char);
646 static int os_data_state, os_data_state_saved;
647 static char *os_data_addr, *os_data_addr_saved;
648 static char *bin_start_address;
650 static void bin_data_init(void)
653 os_data_addr = bin_start_address;
656 static void os_data_save(void)
658 os_data_state_saved = os_data_state;
659 os_data_addr_saved = os_data_addr;
662 static void os_data_restore(void)
664 os_data_state = os_data_state_saved;
665 os_data_addr = os_data_addr_saved;
668 static void bin_data_char(char new_char)
670 switch (os_data_state) {
672 *os_data_addr++ = new_char;
677 static void set_kerm_bin_mode(unsigned long *addr)
679 bin_start_address = (char *) addr;
680 os_data_init = bin_data_init;
681 os_data_char = bin_data_char;
685 /* k_data_* simply handles the kermit escape translations */
686 static int k_data_escape, k_data_escape_saved;
687 static void k_data_init(void)
693 static void k_data_save(void)
695 k_data_escape_saved = k_data_escape;
699 static void k_data_restore(void)
701 k_data_escape = k_data_escape_saved;
705 static void k_data_char(char new_char)
708 /* last char was escape - translate this character */
709 os_data_char(ktrans(new_char));
712 if (new_char == his_quote) {
713 /* this char is escape - remember */
716 /* otherwise send this char as-is */
717 os_data_char(new_char);
722 #define SEND_DATA_SIZE 20
723 static char send_parms[SEND_DATA_SIZE];
724 static char *send_ptr;
726 /* handle_send_packet interprits the protocol info and builds and
727 sends an appropriate ack for what we can do */
728 static void handle_send_packet(int n)
733 /* initialize some protocol parameters */
734 his_eol = END_CHAR; /* default end of line character */
737 his_quote = K_ESCAPE;
739 /* ignore last character if it filled the buffer */
740 if (send_ptr == &send_parms[SEND_DATA_SIZE - 1])
742 bytes = send_ptr - send_parms; /* how many bytes we'll process */
746 /* handle MAXL - max length */
747 /* ignore what he says - most I'll take (here) is 94 */
748 a_b[++length] = tochar(94);
751 /* handle TIME - time you should wait for my packets */
752 /* ignore what he says - don't wait for my ack longer than 1 second */
753 a_b[++length] = tochar(1);
756 /* handle NPAD - number of pad chars I need */
757 /* remember what he says - I need none */
758 his_pad_count = untochar(send_parms[2]);
759 a_b[++length] = tochar(0);
762 /* handle PADC - pad chars I need */
763 /* remember what he says - I need none */
764 his_pad_char = ktrans(send_parms[3]);
765 a_b[++length] = 0x40; /* He should ignore this */
768 /* handle EOL - end of line he needs */
769 /* remember what he says - I need CR */
770 his_eol = untochar(send_parms[4]);
771 a_b[++length] = tochar(END_CHAR);
774 /* handle QCTL - quote control char he'll use */
775 /* remember what he says - I'll use '#' */
776 his_quote = send_parms[5];
780 /* handle QBIN - 8-th bit prefixing */
781 /* ignore what he says - I refuse */
785 /* handle CHKT - the clock check type */
786 /* ignore what he says - I do type 1 (for now) */
790 /* handle REPT - the repeat prefix */
791 /* ignore what he says - I refuse (for now) */
795 /* handle CAPAS - the capabilities mask */
796 /* ignore what he says - I only do long packets - I don't do windows */
797 a_b[++length] = tochar(2); /* only long packets */
798 a_b[++length] = tochar(0); /* no windows */
799 a_b[++length] = tochar(94); /* large packet msb */
800 a_b[++length] = tochar(94); /* large packet lsb */
804 a_b[1] = tochar(length);
807 a_b[++length] = '\0';
808 a_b[length] = tochar(chk1(&a_b[1]));
809 a_b[++length] = his_eol;
810 a_b[++length] = '\0';
814 /* k_recv receives a OS Open image file over kermit line */
815 static int k_recv(void)
818 char k_state, k_state_saved;
825 /* initialize some protocol parameters */
826 his_eol = END_CHAR; /* default end of line character */
829 his_quote = K_ESCAPE;
831 /* initialize the k_recv and k_data state machine */
835 k_state_saved = k_state;
837 n = 0; /* just to get rid of a warning */
840 /* expect this "type" sequence (but don't check):
845 B: break transmission
848 /* enter main loop */
850 /* set the send packet pointer to begining of send packet parms */
851 send_ptr = send_parms;
853 /* With each packet, start summing the bytes starting with the length.
854 Save the current sequence number.
855 Note the type of the packet.
856 If a character less than SPACE (0x20) is received - error.
860 /* OLD CODE, Prior to checking sequence numbers */
861 /* first have all state machines save current states */
862 k_state_saved = k_state;
867 /* wait for the starting character or ^C */
870 case START_CHAR: /* start packet */
872 case ETX_CHAR: /* ^C waiting for packet */
879 /* get length of packet */
881 new_char = getchar();
882 if ((new_char & 0xE0) == 0)
884 sum += new_char & 0xff;
885 length = untochar(new_char);
886 /* get sequence number */
887 new_char = getchar();
888 if ((new_char & 0xE0) == 0)
890 sum += new_char & 0xff;
891 n = untochar(new_char);
894 /* NEW CODE - check sequence numbers for retried packets */
895 /* Note - this new code assumes that the sequence number is correctly
896 * received. Handling an invalid sequence number adds another layer
897 * of complexity that may not be needed - yet! At this time, I'm hoping
898 * that I don't need to buffer the incoming data packets and can write
899 * the data into memory in real time.
902 /* same sequence number, restore the previous state */
903 k_state = k_state_saved;
906 /* new sequence number, checkpoint the download */
908 k_state_saved = k_state;
913 /* get packet type */
914 new_char = getchar();
915 if ((new_char & 0xE0) == 0)
917 sum += new_char & 0xff;
920 /* check for extended length */
922 /* (length byte was 0, decremented twice) */
923 /* get the two length bytes */
924 new_char = getchar();
925 if ((new_char & 0xE0) == 0)
927 sum += new_char & 0xff;
928 len_hi = untochar(new_char);
929 new_char = getchar();
930 if ((new_char & 0xE0) == 0)
932 sum += new_char & 0xff;
933 len_lo = untochar(new_char);
934 length = len_hi * 95 + len_lo;
935 /* check header checksum */
936 new_char = getchar();
937 if ((new_char & 0xE0) == 0)
939 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
941 sum += new_char & 0xff;
942 /* --length; */ /* new length includes only data and block check to come */
944 /* bring in rest of packet */
946 new_char = getchar();
947 if ((new_char & 0xE0) == 0)
949 sum += new_char & 0xff;
951 if (k_state == DATA_TYPE) {
952 /* pass on the data if this is a data packet */
953 k_data_char (new_char);
954 } else if (k_state == SEND_TYPE) {
955 /* save send pack in buffer as is */
956 *send_ptr++ = new_char;
957 /* if too much data, back off the pointer */
958 if (send_ptr >= &send_parms[SEND_DATA_SIZE])
962 /* get and validate checksum character */
963 new_char = getchar();
964 if ((new_char & 0xE0) == 0)
966 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
969 new_char = getchar();
970 if (new_char != END_CHAR) {
972 /* restore state machines */
973 k_state = k_state_saved;
975 /* send a negative acknowledge packet in */
977 } else if (k_state == SEND_TYPE) {
978 /* crack the protocol parms, build an appropriate ack packet */
979 handle_send_packet(n);
981 /* send simple acknowledge packet in */
983 /* quit if end of transmission */
984 if (k_state == BREAK_TYPE)
988 return ((ulong) os_data_addr - (ulong) bin_start_address);
991 static int getcxmodem(void) {
996 static ulong load_serial_ymodem(ulong offset, int mode)
1001 connection_info_t info;
1002 char ymodemBuf[1024];
1003 ulong store_addr = ~0;
1008 res = xyzModem_stream_open(&info, &err);
1013 xyzModem_stream_read(ymodemBuf, 1024, &err)) > 0) {
1014 store_addr = addr + offset;
1017 #ifdef CONFIG_MTD_NOR_FLASH
1018 if (addr2info(store_addr)) {
1021 rc = flash_write((char *) ymodemBuf,
1024 xyzModem_stream_terminate(true, &getcxmodem);
1025 xyzModem_stream_close(&err);
1033 memcpy((char *)(store_addr), ymodemBuf,
1039 xyzModem_stream_terminate((err == xyzModem_cancel) ? false : true, &getcxmodem);
1040 xyzModem_stream_close(&err);
1041 printf("\n%s\n", xyzModem_error(err));
1042 return (~0); /* Download aborted */
1045 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1046 efi_set_bootdev("Uart", "", "",
1047 map_sysmem(offset, 0), size);
1050 printf("\n%s\n", xyzModem_error(err));
1051 return (~0); /* Download aborted */
1054 xyzModem_stream_terminate(false, &getcxmodem);
1055 xyzModem_stream_close(&err);
1058 flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));
1060 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
1061 env_set_hex("filesize", size);
1068 #if defined(CONFIG_CMD_LOADM)
1069 static int do_load_memory_bin(struct cmd_tbl *cmdtp, int flag, int argc,
1072 ulong addr, dest, size;
1076 return CMD_RET_USAGE;
1078 addr = simple_strtoul(argv[1], NULL, 16);
1080 dest = simple_strtoul(argv[2], NULL, 16);
1082 size = simple_strtoul(argv[3], NULL, 16);
1085 printf("loadm: can not load zero bytes\n");
1089 src = map_sysmem(addr, size);
1090 dst = map_sysmem(dest, size);
1092 memcpy(dst, src, size);
1097 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1098 efi_set_bootdev("Mem", "", "", map_sysmem(dest, 0), size);
1100 printf("loaded bin to memory: size: %lu\n", size);
1106 /* -------------------------------------------------------------------- */
1108 #if defined(CONFIG_CMD_LOADS)
1110 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1112 loads, 3, 0, do_load_serial,
1113 "load S-Record file over serial line",
1114 "[ off ] [ baud ]\n"
1115 " - load S-Record file over serial line"
1116 " with offset 'off' and baudrate 'baud'"
1119 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1121 loads, 2, 0, do_load_serial,
1122 "load S-Record file over serial line",
1124 " - load S-Record file over serial line with offset 'off'"
1126 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1129 * SAVES always requires LOADS support, but not vice versa
1133 #if defined(CONFIG_CMD_SAVES)
1134 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1136 saves, 4, 0, do_save_serial,
1137 "save S-Record file over serial line",
1138 "[ off ] [size] [ baud ]\n"
1139 " - save S-Record file over serial line"
1140 " with offset 'off', size 'size' and baudrate 'baud'"
1142 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1144 saves, 3, 0, do_save_serial,
1145 "save S-Record file over serial line",
1147 " - save S-Record file over serial line with offset 'off' and size 'size'"
1149 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1150 #endif /* CONFIG_CMD_SAVES */
1151 #endif /* CONFIG_CMD_LOADS */
1154 #if defined(CONFIG_CMD_LOADB)
1156 loadb, 3, 0, do_load_serial_bin,
1157 "load binary file over serial line (kermit mode)",
1158 "[ addr [ baud ] ]\n"
1159 " - load binary file over serial line"
1160 " at address 'addr' with baudrate 'baud'"
1164 loadx, 3, 0, do_load_serial_bin,
1165 "load binary file over serial line (xmodem mode)",
1166 "[ addr [ baud ] ]\n"
1167 " - load binary file over serial line"
1168 " at address 'addr' with baudrate 'baud'"
1172 loady, 3, 0, do_load_serial_bin,
1173 "load binary file over serial line (ymodem mode)",
1174 "[ addr [ baud ] ]\n"
1175 " - load binary file over serial line"
1176 " at address 'addr' with baudrate 'baud'"
1179 #endif /* CONFIG_CMD_LOADB */
1181 #if defined(CONFIG_CMD_LOADM)
1183 loadm, 4, 0, do_load_memory_bin,
1184 "load binary blob from source address to destination address",
1185 "[src_addr] [dst_addr] [size]\n"
1186 " - load a binary blob from one memory location to other"
1187 " from src_addr to dst_addr by size bytes"
1189 #endif /* CONFIG_CMD_LOADM */