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>
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",
87 gd->baudrate = load_baudrate;
91 if (getchar() == '\r')
95 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
97 offset = simple_strtol(argv[1], NULL, 16);
99 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
101 printf("## Ready for S-Record download ...\n");
103 addr = load_serial(offset);
106 * Gather any trailing characters (for instance, the ^D which
107 * is sent by 'cu' after sending a file), and give the
108 * box some time (100 * 1 ms)
110 for (i=0; i<100; ++i) {
118 printf("## S-Record download aborted\n");
121 printf("## Start Addr = 0x%08lX\n", addr);
122 image_load_addr = addr;
125 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
126 if (load_baudrate != current_baudrate) {
127 printf("## Switch baudrate to %d bps and press ESC ...\n",
131 gd->baudrate = current_baudrate;
135 if (getchar() == 0x1B) /* ESC */
143 static ulong load_serial(long 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 */
153 ulong start_addr = ~0;
158 lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
160 while (read_record(record, SREC_MAXRECLEN + 1) >= 0) {
161 type = srec_decode(record, &binlen, &addr, binbuf);
164 return (~0); /* Invalid S-Record */
171 store_addr = addr + offset;
172 #ifdef CONFIG_MTD_NOR_FLASH
173 if (addr2info(store_addr)) {
176 rc = flash_write((char *)binbuf,store_addr,binlen);
184 ret = lmb_reserve(&lmb, store_addr, binlen);
186 printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
187 store_addr, store_addr + binlen);
190 memcpy((char *)(store_addr), binbuf, binlen);
191 lmb_free(&lmb, store_addr, binlen);
193 if ((store_addr) < start_addr)
194 start_addr = store_addr;
195 if ((store_addr + binlen - 1) > end_addr)
196 end_addr = store_addr + binlen - 1;
202 size = end_addr - start_addr + 1;
204 "## First Load Addr = 0x%08lX\n"
205 "## Last Load Addr = 0x%08lX\n"
206 "## Total Size = 0x%08lX = %ld Bytes\n",
207 start_addr, end_addr, size, size
209 flush_cache(start_addr, size);
210 env_set_hex("filesize", size);
217 if (!do_echo) { /* print a '.' every 100 lines */
218 if ((++line_count % 100) == 0)
223 return (~0); /* Download aborted */
226 static int read_record(char *buf, ulong len)
231 --len; /* always leave room for terminating '\0' byte */
233 for (p=buf; p < buf+len; ++p) {
234 c = getchar(); /* read character */
236 putc(c); /* ... and echo it */
244 case 0x03: /* ^C - Control C */
250 /* Check for the console hangup (if any different from serial) */
251 if (gd->jt->getc != getchar) {
257 /* line too long - truncate */
262 #if defined(CONFIG_CMD_SAVES)
264 int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc,
269 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
270 int save_baudrate, current_baudrate;
272 save_baudrate = current_baudrate = gd->baudrate;
276 offset = hextoul(argv[1], NULL);
278 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
280 size = hextoul(argv[2], NULL);
283 save_baudrate = (int)dectoul(argv[3], NULL);
285 /* default to current baudrate */
286 if (save_baudrate == 0)
287 save_baudrate = current_baudrate;
289 if (save_baudrate != current_baudrate) {
290 printf("## Switch baudrate to %d bps and press ENTER ...\n",
293 gd->baudrate = save_baudrate;
297 if (getchar() == '\r')
301 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
303 size = hextoul(argv[2], NULL);
305 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
307 printf("## Ready for S-Record upload, press ENTER to proceed ...\n");
309 if (getchar() == '\r')
312 if (save_serial(offset, size)) {
313 printf("## S-Record upload aborted\n");
315 printf("## S-Record upload complete\n");
317 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
318 if (save_baudrate != current_baudrate) {
319 printf("## Switch baudrate to %d bps and press ESC ...\n",
320 (int)current_baudrate);
323 gd->baudrate = current_baudrate;
327 if (getchar() == 0x1B) /* ESC */
335 #define SREC3_START "S0030000FC\n"
336 #define SREC3_FORMAT "S3%02X%08lX%s%02X\n"
337 #define SREC3_END "S70500000000FA\n"
338 #define SREC_BYTES_PER_RECORD 16
340 static int save_serial(ulong address, ulong count)
342 int i, c, reclen, checksum, length;
343 char *hex = "0123456789ABCDEF";
344 char record[2*SREC_BYTES_PER_RECORD+16]; /* buffer for one S-Record */
345 char data[2*SREC_BYTES_PER_RECORD+1]; /* buffer for hex data */
350 if(write_record(SREC3_START)) /* write the header */
353 if(count) { /* collect hex data in the buffer */
354 c = *(volatile uchar*)(address + reclen); /* get one byte */
355 checksum += c; /* accumulate checksum */
356 data[2*reclen] = hex[(c>>4)&0x0f];
357 data[2*reclen+1] = hex[c & 0x0f];
358 data[2*reclen+2] = '\0';
362 if(reclen == SREC_BYTES_PER_RECORD || count == 0) {
363 /* enough data collected for one record: dump it */
364 if(reclen) { /* build & write a data record: */
365 /* address + data + checksum */
366 length = 4 + reclen + 1;
368 /* accumulate length bytes into checksum */
369 for(i = 0; i < 2; i++)
370 checksum += (length >> (8*i)) & 0xff;
372 /* accumulate address bytes into checksum: */
373 for(i = 0; i < 4; i++)
374 checksum += (address >> (8*i)) & 0xff;
376 /* make proper checksum byte: */
377 checksum = ~checksum & 0xff;
379 /* output one record: */
380 sprintf(record, SREC3_FORMAT, length, address, data, checksum);
381 if(write_record(record))
384 address += reclen; /* increment address */
390 if(write_record(SREC3_END)) /* write the final record */
395 static int write_record(char *buf)
402 /* Check for the console hangup (if any different from serial) */
414 #if defined(CONFIG_CMD_LOADB)
416 * loadb command (load binary) included
420 #define START_CHAR 0x01
421 #define ETX_CHAR 0x03
422 #define END_CHAR 0x0D
424 #define K_ESCAPE 0x23
425 #define SEND_TYPE 'S'
426 #define DATA_TYPE 'D'
428 #define NACK_TYPE 'N'
429 #define BREAK_TYPE 'B'
430 #define tochar(x) ((char) (((x) + SPACE) & 0xff))
431 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
433 static void set_kerm_bin_mode(unsigned long *);
434 static int k_recv(void);
435 static ulong load_serial_bin(ulong offset);
438 static char his_eol; /* character he needs at end of packet */
439 static int his_pad_count; /* number of pad chars he needs */
440 static char his_pad_char; /* pad chars he needs */
441 static char his_quote; /* quote chars he'll use */
443 static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc,
448 int load_baudrate, current_baudrate;
452 /* pre-set offset from CONFIG_SYS_LOAD_ADDR */
453 offset = CONFIG_SYS_LOAD_ADDR;
455 /* pre-set offset from $loadaddr */
456 s = env_get("loadaddr");
458 offset = hextoul(s, NULL);
460 load_baudrate = current_baudrate = gd->baudrate;
463 offset = hextoul(argv[1], NULL);
466 load_baudrate = (int)dectoul(argv[2], NULL);
468 /* default to current baudrate */
469 if (load_baudrate == 0)
470 load_baudrate = current_baudrate;
473 if (load_baudrate != current_baudrate) {
474 printf("## Switch baudrate to %d bps and press ENTER ...\n",
478 gd->baudrate = load_baudrate;
482 if (getchar() == '\r')
487 if (strcmp(argv[0],"loady")==0) {
488 printf("## Ready for binary (ymodem) download "
489 "to 0x%08lX at %d bps...\n",
493 addr = load_serial_ymodem(offset, xyzModem_ymodem);
497 printf("## Binary (ymodem) download aborted\n");
500 printf("## Start Addr = 0x%08lX\n", addr);
501 image_load_addr = addr;
503 } else if (strcmp(argv[0],"loadx")==0) {
504 printf("## Ready for binary (xmodem) download "
505 "to 0x%08lX at %d bps...\n",
509 addr = load_serial_ymodem(offset, xyzModem_xmodem);
513 printf("## Binary (xmodem) download aborted\n");
516 printf("## Start Addr = 0x%08lX\n", addr);
517 image_load_addr = addr;
521 printf("## Ready for binary (kermit) download "
522 "to 0x%08lX at %d bps...\n",
525 addr = load_serial_bin(offset);
529 printf("## Binary (kermit) download aborted\n");
532 printf("## Start Addr = 0x%08lX\n", addr);
533 image_load_addr = addr;
536 if (load_baudrate != current_baudrate) {
537 printf("## Switch baudrate to %d bps and press ESC ...\n",
541 gd->baudrate = current_baudrate;
545 if (getchar() == 0x1B) /* ESC */
554 static ulong load_serial_bin(ulong offset)
558 set_kerm_bin_mode((ulong *) offset);
562 * Gather any trailing characters (for instance, the ^D which
563 * is sent by 'cu' after sending a file), and give the
564 * box some time (100 * 1 ms)
566 for (i=0; i<100; ++i) {
574 return ~0; /* Download aborted */
576 flush_cache(offset, size);
578 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
579 env_set_hex("filesize", size);
584 static void send_pad(void)
586 int count = his_pad_count;
592 /* converts escaped kermit char to binary char */
593 static char ktrans(char in)
595 if ((in & 0x60) == 0x40) {
596 return (char) (in & ~0x40);
597 } else if ((in & 0x7f) == 0x3f) {
598 return (char) (in | 0x40);
603 static int chk1(char *buffer)
610 return (int) ((total + ((total >> 6) & 0x03)) & 0x3f);
613 static void s1_sendpacket(char *packet)
622 static void send_ack(int n)
629 a_b[4] = tochar(chk1(&a_b[1]));
635 static void send_nack(int n)
642 a_b[4] = tochar(chk1(&a_b[1]));
649 static void (*os_data_init)(void);
650 static void (*os_data_char)(char new_char);
651 static int os_data_state, os_data_state_saved;
652 static char *os_data_addr, *os_data_addr_saved;
653 static char *bin_start_address;
655 static void bin_data_init(void)
658 os_data_addr = bin_start_address;
661 static void os_data_save(void)
663 os_data_state_saved = os_data_state;
664 os_data_addr_saved = os_data_addr;
667 static void os_data_restore(void)
669 os_data_state = os_data_state_saved;
670 os_data_addr = os_data_addr_saved;
673 static void bin_data_char(char new_char)
675 switch (os_data_state) {
677 *os_data_addr++ = new_char;
682 static void set_kerm_bin_mode(unsigned long *addr)
684 bin_start_address = (char *) addr;
685 os_data_init = bin_data_init;
686 os_data_char = bin_data_char;
690 /* k_data_* simply handles the kermit escape translations */
691 static int k_data_escape, k_data_escape_saved;
692 static void k_data_init(void)
698 static void k_data_save(void)
700 k_data_escape_saved = k_data_escape;
704 static void k_data_restore(void)
706 k_data_escape = k_data_escape_saved;
710 static void k_data_char(char new_char)
713 /* last char was escape - translate this character */
714 os_data_char(ktrans(new_char));
717 if (new_char == his_quote) {
718 /* this char is escape - remember */
721 /* otherwise send this char as-is */
722 os_data_char(new_char);
727 #define SEND_DATA_SIZE 20
728 static char send_parms[SEND_DATA_SIZE];
729 static char *send_ptr;
731 /* handle_send_packet interprits the protocol info and builds and
732 sends an appropriate ack for what we can do */
733 static void handle_send_packet(int n)
738 /* initialize some protocol parameters */
739 his_eol = END_CHAR; /* default end of line character */
742 his_quote = K_ESCAPE;
744 /* ignore last character if it filled the buffer */
745 if (send_ptr == &send_parms[SEND_DATA_SIZE - 1])
747 bytes = send_ptr - send_parms; /* how many bytes we'll process */
751 /* handle MAXL - max length */
752 /* ignore what he says - most I'll take (here) is 94 */
753 a_b[++length] = tochar(94);
756 /* handle TIME - time you should wait for my packets */
757 /* ignore what he says - don't wait for my ack longer than 1 second */
758 a_b[++length] = tochar(1);
761 /* handle NPAD - number of pad chars I need */
762 /* remember what he says - I need none */
763 his_pad_count = untochar(send_parms[2]);
764 a_b[++length] = tochar(0);
767 /* handle PADC - pad chars I need */
768 /* remember what he says - I need none */
769 his_pad_char = ktrans(send_parms[3]);
770 a_b[++length] = 0x40; /* He should ignore this */
773 /* handle EOL - end of line he needs */
774 /* remember what he says - I need CR */
775 his_eol = untochar(send_parms[4]);
776 a_b[++length] = tochar(END_CHAR);
779 /* handle QCTL - quote control char he'll use */
780 /* remember what he says - I'll use '#' */
781 his_quote = send_parms[5];
785 /* handle QBIN - 8-th bit prefixing */
786 /* ignore what he says - I refuse */
790 /* handle CHKT - the clock check type */
791 /* ignore what he says - I do type 1 (for now) */
795 /* handle REPT - the repeat prefix */
796 /* ignore what he says - I refuse (for now) */
800 /* handle CAPAS - the capabilities mask */
801 /* ignore what he says - I only do long packets - I don't do windows */
802 a_b[++length] = tochar(2); /* only long packets */
803 a_b[++length] = tochar(0); /* no windows */
804 a_b[++length] = tochar(94); /* large packet msb */
805 a_b[++length] = tochar(94); /* large packet lsb */
809 a_b[1] = tochar(length);
812 a_b[++length] = '\0';
813 a_b[length] = tochar(chk1(&a_b[1]));
814 a_b[++length] = his_eol;
815 a_b[++length] = '\0';
819 /* k_recv receives a OS Open image file over kermit line */
820 static int k_recv(void)
823 char k_state, k_state_saved;
830 /* initialize some protocol parameters */
831 his_eol = END_CHAR; /* default end of line character */
834 his_quote = K_ESCAPE;
836 /* initialize the k_recv and k_data state machine */
840 k_state_saved = k_state;
842 n = 0; /* just to get rid of a warning */
845 /* expect this "type" sequence (but don't check):
850 B: break transmission
853 /* enter main loop */
855 /* set the send packet pointer to begining of send packet parms */
856 send_ptr = send_parms;
858 /* With each packet, start summing the bytes starting with the length.
859 Save the current sequence number.
860 Note the type of the packet.
861 If a character less than SPACE (0x20) is received - error.
865 /* OLD CODE, Prior to checking sequence numbers */
866 /* first have all state machines save current states */
867 k_state_saved = k_state;
872 /* wait for the starting character or ^C */
875 case START_CHAR: /* start packet */
877 case ETX_CHAR: /* ^C waiting for packet */
884 /* get length of packet */
886 new_char = getchar();
887 if ((new_char & 0xE0) == 0)
889 sum += new_char & 0xff;
890 length = untochar(new_char);
891 /* get sequence number */
892 new_char = getchar();
893 if ((new_char & 0xE0) == 0)
895 sum += new_char & 0xff;
896 n = untochar(new_char);
899 /* NEW CODE - check sequence numbers for retried packets */
900 /* Note - this new code assumes that the sequence number is correctly
901 * received. Handling an invalid sequence number adds another layer
902 * of complexity that may not be needed - yet! At this time, I'm hoping
903 * that I don't need to buffer the incoming data packets and can write
904 * the data into memory in real time.
907 /* same sequence number, restore the previous state */
908 k_state = k_state_saved;
911 /* new sequence number, checkpoint the download */
913 k_state_saved = k_state;
918 /* get packet type */
919 new_char = getchar();
920 if ((new_char & 0xE0) == 0)
922 sum += new_char & 0xff;
925 /* check for extended length */
927 /* (length byte was 0, decremented twice) */
928 /* get the two length bytes */
929 new_char = getchar();
930 if ((new_char & 0xE0) == 0)
932 sum += new_char & 0xff;
933 len_hi = untochar(new_char);
934 new_char = getchar();
935 if ((new_char & 0xE0) == 0)
937 sum += new_char & 0xff;
938 len_lo = untochar(new_char);
939 length = len_hi * 95 + len_lo;
940 /* check header checksum */
941 new_char = getchar();
942 if ((new_char & 0xE0) == 0)
944 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
946 sum += new_char & 0xff;
947 /* --length; */ /* new length includes only data and block check to come */
949 /* bring in rest of packet */
951 new_char = getchar();
952 if ((new_char & 0xE0) == 0)
954 sum += new_char & 0xff;
956 if (k_state == DATA_TYPE) {
957 /* pass on the data if this is a data packet */
958 k_data_char (new_char);
959 } else if (k_state == SEND_TYPE) {
960 /* save send pack in buffer as is */
961 *send_ptr++ = new_char;
962 /* if too much data, back off the pointer */
963 if (send_ptr >= &send_parms[SEND_DATA_SIZE])
967 /* get and validate checksum character */
968 new_char = getchar();
969 if ((new_char & 0xE0) == 0)
971 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
974 new_char = getchar();
975 if (new_char != END_CHAR) {
977 /* restore state machines */
978 k_state = k_state_saved;
980 /* send a negative acknowledge packet in */
982 } else if (k_state == SEND_TYPE) {
983 /* crack the protocol parms, build an appropriate ack packet */
984 handle_send_packet(n);
986 /* send simple acknowledge packet in */
988 /* quit if end of transmission */
989 if (k_state == BREAK_TYPE)
993 return ((ulong) os_data_addr - (ulong) bin_start_address);
996 static int getcxmodem(void) {
1001 static ulong load_serial_ymodem(ulong offset, int mode)
1006 connection_info_t info;
1007 char ymodemBuf[1024];
1008 ulong store_addr = ~0;
1013 res = xyzModem_stream_open(&info, &err);
1018 xyzModem_stream_read(ymodemBuf, 1024, &err)) > 0) {
1019 store_addr = addr + offset;
1022 #ifdef CONFIG_MTD_NOR_FLASH
1023 if (addr2info(store_addr)) {
1026 rc = flash_write((char *) ymodemBuf,
1029 xyzModem_stream_terminate(true, &getcxmodem);
1030 xyzModem_stream_close(&err);
1038 memcpy((char *)(store_addr), ymodemBuf,
1044 xyzModem_stream_terminate((err == xyzModem_cancel) ? false : true, &getcxmodem);
1045 xyzModem_stream_close(&err);
1046 printf("\n%s\n", xyzModem_error(err));
1047 return (~0); /* Download aborted */
1050 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1051 efi_set_bootdev("Uart", "", "",
1052 map_sysmem(offset, 0), size);
1055 printf("\n%s\n", xyzModem_error(err));
1056 return (~0); /* Download aborted */
1059 xyzModem_stream_terminate(false, &getcxmodem);
1060 xyzModem_stream_close(&err);
1063 flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));
1065 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
1066 env_set_hex("filesize", size);
1073 #if defined(CONFIG_CMD_LOADM)
1074 static int do_load_memory_bin(struct cmd_tbl *cmdtp, int flag, int argc,
1077 ulong addr, dest, size;
1081 return CMD_RET_USAGE;
1083 addr = simple_strtoul(argv[1], NULL, 16);
1085 dest = simple_strtoul(argv[2], NULL, 16);
1087 size = simple_strtoul(argv[3], NULL, 16);
1090 printf("loadm: can not load zero bytes\n");
1094 src = map_sysmem(addr, size);
1095 dst = map_sysmem(dest, size);
1097 memcpy(dst, src, size);
1102 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1103 efi_set_bootdev("Mem", "", "", map_sysmem(dest, 0), size);
1105 printf("loaded bin to memory: size: %lu\n", size);
1111 /* -------------------------------------------------------------------- */
1113 #if defined(CONFIG_CMD_LOADS)
1115 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1117 loads, 3, 0, do_load_serial,
1118 "load S-Record file over serial line",
1119 "[ off ] [ baud ]\n"
1120 " - load S-Record file over serial line"
1121 " with offset 'off' and baudrate 'baud'"
1124 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1126 loads, 2, 0, do_load_serial,
1127 "load S-Record file over serial line",
1129 " - load S-Record file over serial line with offset 'off'"
1131 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1134 * SAVES always requires LOADS support, but not vice versa
1138 #if defined(CONFIG_CMD_SAVES)
1139 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1141 saves, 4, 0, do_save_serial,
1142 "save S-Record file over serial line",
1143 "[ off ] [size] [ baud ]\n"
1144 " - save S-Record file over serial line"
1145 " with offset 'off', size 'size' and baudrate 'baud'"
1147 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1149 saves, 3, 0, do_save_serial,
1150 "save S-Record file over serial line",
1152 " - save S-Record file over serial line with offset 'off' and size 'size'"
1154 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1155 #endif /* CONFIG_CMD_SAVES */
1156 #endif /* CONFIG_CMD_LOADS */
1159 #if defined(CONFIG_CMD_LOADB)
1161 loadb, 3, 0, do_load_serial_bin,
1162 "load binary file over serial line (kermit mode)",
1163 "[ addr [ baud ] ]\n"
1164 " - load binary file over serial line"
1165 " at address 'addr' with baudrate 'baud'"
1169 loadx, 3, 0, do_load_serial_bin,
1170 "load binary file over serial line (xmodem mode)",
1171 "[ addr [ baud ] ]\n"
1172 " - load binary file over serial line"
1173 " at address 'addr' with baudrate 'baud'"
1177 loady, 3, 0, do_load_serial_bin,
1178 "load binary file over serial line (ymodem mode)",
1179 "[ addr [ baud ] ]\n"
1180 " - load binary file over serial line"
1181 " at address 'addr' with baudrate 'baud'"
1184 #endif /* CONFIG_CMD_LOADB */
1186 #if defined(CONFIG_CMD_LOADM)
1188 loadm, 4, 0, do_load_memory_bin,
1189 "load binary blob from source address to destination address",
1190 "[src_addr] [dst_addr] [size]\n"
1191 " - load a binary blob from one memory location to other"
1192 " from src_addr to dst_addr by size bytes"
1194 #endif /* CONFIG_CMD_LOADM */