1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2004
8 * Serial up- and download support
13 #include <efi_loader.h>
16 #ifdef CONFIG_MTD_NOR_FLASH
26 #include <asm/cache.h>
27 #include <asm/global_data.h>
28 #include <linux/delay.h>
30 DECLARE_GLOBAL_DATA_PTR;
32 #if defined(CONFIG_CMD_LOADB)
33 static ulong load_serial_ymodem(ulong offset, int mode);
36 #if defined(CONFIG_CMD_LOADS)
37 static ulong load_serial(long offset);
38 static int read_record(char *buf, ulong len);
39 # if defined(CONFIG_CMD_SAVES)
40 static int save_serial(ulong offset, ulong size);
41 static int write_record(char *buf);
44 static int do_echo = 1;
47 /* -------------------------------------------------------------------- */
49 #if defined(CONFIG_CMD_LOADS)
50 static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc,
58 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
59 int load_baudrate, current_baudrate;
61 load_baudrate = current_baudrate = gd->baudrate;
64 env_echo = env_get("loads_echo");
65 if (env_echo && *env_echo == '1')
70 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
72 offset = simple_strtol(argv[1], NULL, 16);
75 load_baudrate = (int)dectoul(argv[2], NULL);
77 /* default to current baudrate */
78 if (load_baudrate == 0)
79 load_baudrate = current_baudrate;
81 if (load_baudrate != current_baudrate) {
82 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",
130 gd->baudrate = current_baudrate;
134 if (getchar() == 0x1B) /* ESC */
142 static ulong load_serial(long offset)
145 char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */
146 char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */
147 int binlen; /* no. of data bytes in S-Rec. */
148 int type; /* return code for record type */
149 ulong addr; /* load address from S-Record */
150 ulong size; /* number of bytes transferred */
152 ulong start_addr = ~0;
157 lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
159 while (read_record(record, SREC_MAXRECLEN + 1) >= 0) {
160 type = srec_decode(record, &binlen, &addr, binbuf);
163 return (~0); /* Invalid S-Record */
170 store_addr = addr + offset;
171 #ifdef CONFIG_MTD_NOR_FLASH
172 if (addr2info(store_addr)) {
175 rc = flash_write((char *)binbuf,store_addr,binlen);
185 ret = lmb_reserve(&lmb, store_addr, binlen);
187 printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
188 store_addr, store_addr + binlen);
191 dst = map_sysmem(store_addr, binlen);
192 memcpy(dst, binbuf, binlen);
194 lmb_free(&lmb, store_addr, binlen);
196 if ((store_addr) < start_addr)
197 start_addr = store_addr;
198 if ((store_addr + binlen - 1) > end_addr)
199 end_addr = store_addr + binlen - 1;
205 size = end_addr - start_addr + 1;
207 "## First Load Addr = 0x%08lX\n"
208 "## Last Load Addr = 0x%08lX\n"
209 "## Total Size = 0x%08lX = %ld Bytes\n",
210 start_addr, end_addr, size, size
212 flush_cache(start_addr, size);
213 env_set_hex("filesize", size);
220 if (!do_echo) { /* print a '.' every 100 lines */
221 if ((++line_count % 100) == 0)
226 return (~0); /* Download aborted */
229 static int read_record(char *buf, ulong len)
234 --len; /* always leave room for terminating '\0' byte */
236 for (p=buf; p < buf+len; ++p) {
237 c = getchar(); /* read character */
239 putc(c); /* ... and echo it */
247 case 0x03: /* ^C - Control C */
253 /* Check for the console hangup (if any different from serial) */
254 if (gd->jt->getc != getchar) {
260 /* line too long - truncate */
265 #if defined(CONFIG_CMD_SAVES)
267 int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc,
272 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
273 int save_baudrate, current_baudrate;
275 save_baudrate = current_baudrate = gd->baudrate;
279 offset = hextoul(argv[1], NULL);
281 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
283 size = hextoul(argv[2], NULL);
286 save_baudrate = (int)dectoul(argv[3], NULL);
288 /* default to current baudrate */
289 if (save_baudrate == 0)
290 save_baudrate = current_baudrate;
292 if (save_baudrate != current_baudrate) {
293 printf("## Switch baudrate to %d bps and press ENTER ...\n",
296 gd->baudrate = save_baudrate;
300 if (getchar() == '\r')
304 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
306 size = hextoul(argv[2], NULL);
308 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
310 printf("## Ready for S-Record upload, press ENTER to proceed ...\n");
312 if (getchar() == '\r')
315 if (save_serial(offset, size)) {
316 printf("## S-Record upload aborted\n");
318 printf("## S-Record upload complete\n");
320 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
321 if (save_baudrate != current_baudrate) {
322 printf("## Switch baudrate to %d bps and press ESC ...\n",
323 (int)current_baudrate);
326 gd->baudrate = current_baudrate;
330 if (getchar() == 0x1B) /* ESC */
338 #define SREC3_START "S0030000FC\n"
339 #define SREC3_FORMAT "S3%02X%08lX%s%02X\n"
340 #define SREC3_END "S70500000000FA\n"
341 #define SREC_BYTES_PER_RECORD 16
343 static int save_serial(ulong address, ulong count)
345 int i, c, reclen, checksum, length;
346 char *hex = "0123456789ABCDEF";
347 char record[2*SREC_BYTES_PER_RECORD+16]; /* buffer for one S-Record */
348 char data[2*SREC_BYTES_PER_RECORD+1]; /* buffer for hex data */
353 if(write_record(SREC3_START)) /* write the header */
358 src = map_sysmem(address, count);
359 if (count) { /* collect hex data in the buffer */
360 c = src[reclen]; /* get one byte */
361 checksum += c; /* accumulate checksum */
362 data[2*reclen] = hex[(c>>4)&0x0f];
363 data[2*reclen+1] = hex[c & 0x0f];
364 data[2*reclen+2] = '\0';
368 unmap_sysmem((void *)src);
369 if(reclen == SREC_BYTES_PER_RECORD || count == 0) {
370 /* enough data collected for one record: dump it */
371 if(reclen) { /* build & write a data record: */
372 /* address + data + checksum */
373 length = 4 + reclen + 1;
375 /* accumulate length bytes into checksum */
376 for(i = 0; i < 2; i++)
377 checksum += (length >> (8*i)) & 0xff;
379 /* accumulate address bytes into checksum: */
380 for(i = 0; i < 4; i++)
381 checksum += (address >> (8*i)) & 0xff;
383 /* make proper checksum byte: */
384 checksum = ~checksum & 0xff;
386 /* output one record: */
387 sprintf(record, SREC3_FORMAT, length, address, data, checksum);
388 if(write_record(record))
391 address += reclen; /* increment address */
397 if(write_record(SREC3_END)) /* write the final record */
402 static int write_record(char *buf)
409 /* Check for the console hangup (if any different from serial) */
421 #if defined(CONFIG_CMD_LOADB)
423 * loadb command (load binary) included
427 #define START_CHAR 0x01
428 #define ETX_CHAR 0x03
429 #define END_CHAR 0x0D
431 #define K_ESCAPE 0x23
432 #define SEND_TYPE 'S'
433 #define DATA_TYPE 'D'
435 #define NACK_TYPE 'N'
436 #define BREAK_TYPE 'B'
437 #define tochar(x) ((char) (((x) + SPACE) & 0xff))
438 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
440 static void set_kerm_bin_mode(unsigned long *);
441 static int k_recv(void);
442 static ulong load_serial_bin(ulong offset);
445 static char his_eol; /* character he needs at end of packet */
446 static int his_pad_count; /* number of pad chars he needs */
447 static char his_pad_char; /* pad chars he needs */
448 static char his_quote; /* quote chars he'll use */
450 static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc,
455 int load_baudrate, current_baudrate;
459 /* pre-set offset from CONFIG_SYS_LOAD_ADDR */
460 offset = CONFIG_SYS_LOAD_ADDR;
462 /* pre-set offset from $loadaddr */
463 s = env_get("loadaddr");
465 offset = hextoul(s, NULL);
467 load_baudrate = current_baudrate = gd->baudrate;
470 offset = hextoul(argv[1], NULL);
473 load_baudrate = (int)dectoul(argv[2], NULL);
475 /* default to current baudrate */
476 if (load_baudrate == 0)
477 load_baudrate = current_baudrate;
480 if (load_baudrate != current_baudrate) {
481 printf("## Switch baudrate to %d bps and press ENTER ...\n",
485 gd->baudrate = load_baudrate;
489 if (getchar() == '\r')
494 if (strcmp(argv[0],"loady")==0) {
495 printf("## Ready for binary (ymodem) download "
496 "to 0x%08lX at %d bps...\n",
500 addr = load_serial_ymodem(offset, xyzModem_ymodem);
504 printf("## Binary (ymodem) download aborted\n");
507 printf("## Start Addr = 0x%08lX\n", addr);
508 image_load_addr = addr;
510 } else if (strcmp(argv[0],"loadx")==0) {
511 printf("## Ready for binary (xmodem) download "
512 "to 0x%08lX at %d bps...\n",
516 addr = load_serial_ymodem(offset, xyzModem_xmodem);
520 printf("## Binary (xmodem) download aborted\n");
523 printf("## Start Addr = 0x%08lX\n", addr);
524 image_load_addr = addr;
528 printf("## Ready for binary (kermit) download "
529 "to 0x%08lX at %d bps...\n",
532 addr = load_serial_bin(offset);
536 printf("## Binary (kermit) download aborted\n");
539 printf("## Start Addr = 0x%08lX\n", addr);
540 image_load_addr = addr;
543 if (load_baudrate != current_baudrate) {
544 printf("## Switch baudrate to %d bps and press ESC ...\n",
548 gd->baudrate = current_baudrate;
552 if (getchar() == 0x1B) /* ESC */
561 static ulong load_serial_bin(ulong offset)
565 set_kerm_bin_mode((ulong *) offset);
569 * Gather any trailing characters (for instance, the ^D which
570 * is sent by 'cu' after sending a file), and give the
571 * box some time (100 * 1 ms)
573 for (i=0; i<100; ++i) {
581 return ~0; /* Download aborted */
583 flush_cache(offset, size);
585 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
586 env_set_hex("filesize", size);
591 static void send_pad(void)
593 int count = his_pad_count;
599 /* converts escaped kermit char to binary char */
600 static char ktrans(char in)
602 if ((in & 0x60) == 0x40) {
603 return (char) (in & ~0x40);
604 } else if ((in & 0x7f) == 0x3f) {
605 return (char) (in | 0x40);
610 static int chk1(char *buffer)
617 return (int) ((total + ((total >> 6) & 0x03)) & 0x3f);
620 static void s1_sendpacket(char *packet)
629 static void send_ack(int n)
636 a_b[4] = tochar(chk1(&a_b[1]));
642 static void send_nack(int n)
649 a_b[4] = tochar(chk1(&a_b[1]));
656 static void (*os_data_init)(void);
657 static void (*os_data_char)(char new_char);
658 static int os_data_state, os_data_state_saved;
659 static char *os_data_addr, *os_data_addr_saved;
660 static char *bin_start_address;
662 static void bin_data_init(void)
665 os_data_addr = bin_start_address;
668 static void os_data_save(void)
670 os_data_state_saved = os_data_state;
671 os_data_addr_saved = os_data_addr;
674 static void os_data_restore(void)
676 os_data_state = os_data_state_saved;
677 os_data_addr = os_data_addr_saved;
680 static void bin_data_char(char new_char)
682 switch (os_data_state) {
684 *os_data_addr++ = new_char;
689 static void set_kerm_bin_mode(unsigned long *addr)
691 bin_start_address = (char *) addr;
692 os_data_init = bin_data_init;
693 os_data_char = bin_data_char;
697 /* k_data_* simply handles the kermit escape translations */
698 static int k_data_escape, k_data_escape_saved;
699 static void k_data_init(void)
705 static void k_data_save(void)
707 k_data_escape_saved = k_data_escape;
711 static void k_data_restore(void)
713 k_data_escape = k_data_escape_saved;
717 static void k_data_char(char new_char)
720 /* last char was escape - translate this character */
721 os_data_char(ktrans(new_char));
724 if (new_char == his_quote) {
725 /* this char is escape - remember */
728 /* otherwise send this char as-is */
729 os_data_char(new_char);
734 #define SEND_DATA_SIZE 20
735 static char send_parms[SEND_DATA_SIZE];
736 static char *send_ptr;
738 /* handle_send_packet interprits the protocol info and builds and
739 sends an appropriate ack for what we can do */
740 static void handle_send_packet(int n)
745 /* initialize some protocol parameters */
746 his_eol = END_CHAR; /* default end of line character */
749 his_quote = K_ESCAPE;
751 /* ignore last character if it filled the buffer */
752 if (send_ptr == &send_parms[SEND_DATA_SIZE - 1])
754 bytes = send_ptr - send_parms; /* how many bytes we'll process */
758 /* handle MAXL - max length */
759 /* ignore what he says - most I'll take (here) is 94 */
760 a_b[++length] = tochar(94);
763 /* handle TIME - time you should wait for my packets */
764 /* ignore what he says - don't wait for my ack longer than 1 second */
765 a_b[++length] = tochar(1);
768 /* handle NPAD - number of pad chars I need */
769 /* remember what he says - I need none */
770 his_pad_count = untochar(send_parms[2]);
771 a_b[++length] = tochar(0);
774 /* handle PADC - pad chars I need */
775 /* remember what he says - I need none */
776 his_pad_char = ktrans(send_parms[3]);
777 a_b[++length] = 0x40; /* He should ignore this */
780 /* handle EOL - end of line he needs */
781 /* remember what he says - I need CR */
782 his_eol = untochar(send_parms[4]);
783 a_b[++length] = tochar(END_CHAR);
786 /* handle QCTL - quote control char he'll use */
787 /* remember what he says - I'll use '#' */
788 his_quote = send_parms[5];
792 /* handle QBIN - 8-th bit prefixing */
793 /* ignore what he says - I refuse */
797 /* handle CHKT - the clock check type */
798 /* ignore what he says - I do type 1 (for now) */
802 /* handle REPT - the repeat prefix */
803 /* ignore what he says - I refuse (for now) */
807 /* handle CAPAS - the capabilities mask */
808 /* ignore what he says - I only do long packets - I don't do windows */
809 a_b[++length] = tochar(2); /* only long packets */
810 a_b[++length] = tochar(0); /* no windows */
811 a_b[++length] = tochar(94); /* large packet msb */
812 a_b[++length] = tochar(94); /* large packet lsb */
816 a_b[1] = tochar(length);
819 a_b[++length] = '\0';
820 a_b[length] = tochar(chk1(&a_b[1]));
821 a_b[++length] = his_eol;
822 a_b[++length] = '\0';
826 /* k_recv receives a OS Open image file over kermit line */
827 static int k_recv(void)
830 char k_state, k_state_saved;
837 /* initialize some protocol parameters */
838 his_eol = END_CHAR; /* default end of line character */
841 his_quote = K_ESCAPE;
843 /* initialize the k_recv and k_data state machine */
847 k_state_saved = k_state;
849 n = 0; /* just to get rid of a warning */
852 /* expect this "type" sequence (but don't check):
857 B: break transmission
860 /* enter main loop */
862 /* set the send packet pointer to begining of send packet parms */
863 send_ptr = send_parms;
865 /* With each packet, start summing the bytes starting with the length.
866 Save the current sequence number.
867 Note the type of the packet.
868 If a character less than SPACE (0x20) is received - error.
872 /* OLD CODE, Prior to checking sequence numbers */
873 /* first have all state machines save current states */
874 k_state_saved = k_state;
879 /* wait for the starting character or ^C */
882 case START_CHAR: /* start packet */
884 case ETX_CHAR: /* ^C waiting for packet */
891 /* get length of packet */
893 new_char = getchar();
894 if ((new_char & 0xE0) == 0)
896 sum += new_char & 0xff;
897 length = untochar(new_char);
898 /* get sequence number */
899 new_char = getchar();
900 if ((new_char & 0xE0) == 0)
902 sum += new_char & 0xff;
903 n = untochar(new_char);
906 /* NEW CODE - check sequence numbers for retried packets */
907 /* Note - this new code assumes that the sequence number is correctly
908 * received. Handling an invalid sequence number adds another layer
909 * of complexity that may not be needed - yet! At this time, I'm hoping
910 * that I don't need to buffer the incoming data packets and can write
911 * the data into memory in real time.
914 /* same sequence number, restore the previous state */
915 k_state = k_state_saved;
918 /* new sequence number, checkpoint the download */
920 k_state_saved = k_state;
925 /* get packet type */
926 new_char = getchar();
927 if ((new_char & 0xE0) == 0)
929 sum += new_char & 0xff;
932 /* check for extended length */
934 /* (length byte was 0, decremented twice) */
935 /* get the two length bytes */
936 new_char = getchar();
937 if ((new_char & 0xE0) == 0)
939 sum += new_char & 0xff;
940 len_hi = untochar(new_char);
941 new_char = getchar();
942 if ((new_char & 0xE0) == 0)
944 sum += new_char & 0xff;
945 len_lo = untochar(new_char);
946 length = len_hi * 95 + len_lo;
947 /* check header checksum */
948 new_char = getchar();
949 if ((new_char & 0xE0) == 0)
951 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
953 sum += new_char & 0xff;
954 /* --length; */ /* new length includes only data and block check to come */
956 /* bring in rest of packet */
958 new_char = getchar();
959 if ((new_char & 0xE0) == 0)
961 sum += new_char & 0xff;
963 if (k_state == DATA_TYPE) {
964 /* pass on the data if this is a data packet */
965 k_data_char (new_char);
966 } else if (k_state == SEND_TYPE) {
967 /* save send pack in buffer as is */
968 *send_ptr++ = new_char;
969 /* if too much data, back off the pointer */
970 if (send_ptr >= &send_parms[SEND_DATA_SIZE])
974 /* get and validate checksum character */
975 new_char = getchar();
976 if ((new_char & 0xE0) == 0)
978 if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f))
981 new_char = getchar();
982 if (new_char != END_CHAR) {
984 /* restore state machines */
985 k_state = k_state_saved;
987 /* send a negative acknowledge packet in */
989 } else if (k_state == SEND_TYPE) {
990 /* crack the protocol parms, build an appropriate ack packet */
991 handle_send_packet(n);
993 /* send simple acknowledge packet in */
995 /* quit if end of transmission */
996 if (k_state == BREAK_TYPE)
1000 return ((ulong) os_data_addr - (ulong) bin_start_address);
1003 static int getcxmodem(void) {
1008 static ulong load_serial_ymodem(ulong offset, int mode)
1013 connection_info_t info;
1014 char ymodemBuf[1024];
1015 ulong store_addr = ~0;
1020 res = xyzModem_stream_open(&info, &err);
1025 xyzModem_stream_read(ymodemBuf, 1024, &err)) > 0) {
1026 store_addr = addr + offset;
1029 #ifdef CONFIG_MTD_NOR_FLASH
1030 if (addr2info(store_addr)) {
1033 rc = flash_write((char *) ymodemBuf,
1036 xyzModem_stream_terminate(true, &getcxmodem);
1037 xyzModem_stream_close(&err);
1045 memcpy((char *)(store_addr), ymodemBuf,
1051 xyzModem_stream_terminate((err == xyzModem_cancel) ? false : true, &getcxmodem);
1052 xyzModem_stream_close(&err);
1053 printf("\n%s\n", xyzModem_error(err));
1054 return (~0); /* Download aborted */
1057 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1058 efi_set_bootdev("Uart", "", "",
1059 map_sysmem(offset, 0), size);
1062 printf("\n%s\n", xyzModem_error(err));
1063 return (~0); /* Download aborted */
1066 xyzModem_stream_terminate(false, &getcxmodem);
1067 xyzModem_stream_close(&err);
1070 flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));
1072 printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
1073 env_set_hex("filesize", size);
1080 #if defined(CONFIG_CMD_LOADM)
1081 static int do_load_memory_bin(struct cmd_tbl *cmdtp, int flag, int argc,
1084 ulong addr, dest, size;
1088 return CMD_RET_USAGE;
1090 addr = simple_strtoul(argv[1], NULL, 16);
1092 dest = simple_strtoul(argv[2], NULL, 16);
1094 size = simple_strtoul(argv[3], NULL, 16);
1097 printf("loadm: can not load zero bytes\n");
1101 src = map_sysmem(addr, size);
1102 dst = map_sysmem(dest, size);
1104 memcpy(dst, src, size);
1109 if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
1110 efi_set_bootdev("Mem", "", "", map_sysmem(dest, 0), size);
1112 printf("loaded bin to memory: size: %lu\n", size);
1118 /* -------------------------------------------------------------------- */
1120 #if defined(CONFIG_CMD_LOADS)
1122 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1124 loads, 3, 0, do_load_serial,
1125 "load S-Record file over serial line",
1126 "[ off ] [ baud ]\n"
1127 " - load S-Record file over serial line"
1128 " with offset 'off' and baudrate 'baud'"
1131 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1133 loads, 2, 0, do_load_serial,
1134 "load S-Record file over serial line",
1136 " - load S-Record file over serial line with offset 'off'"
1138 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1141 * SAVES always requires LOADS support, but not vice versa
1145 #if defined(CONFIG_CMD_SAVES)
1146 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
1148 saves, 4, 0, do_save_serial,
1149 "save S-Record file over serial line",
1150 "[ off ] [size] [ baud ]\n"
1151 " - save S-Record file over serial line"
1152 " with offset 'off', size 'size' and baudrate 'baud'"
1154 #else /* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
1156 saves, 3, 0, do_save_serial,
1157 "save S-Record file over serial line",
1159 " - save S-Record file over serial line with offset 'off' and size 'size'"
1161 #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */
1162 #endif /* CONFIG_CMD_SAVES */
1163 #endif /* CONFIG_CMD_LOADS */
1166 #if defined(CONFIG_CMD_LOADB)
1168 loadb, 3, 0, do_load_serial_bin,
1169 "load binary file over serial line (kermit mode)",
1170 "[ addr [ baud ] ]\n"
1171 " - load binary file over serial line"
1172 " at address 'addr' with baudrate 'baud'"
1176 loadx, 3, 0, do_load_serial_bin,
1177 "load binary file over serial line (xmodem mode)",
1178 "[ addr [ baud ] ]\n"
1179 " - load binary file over serial line"
1180 " at address 'addr' with baudrate 'baud'"
1184 loady, 3, 0, do_load_serial_bin,
1185 "load binary file over serial line (ymodem mode)",
1186 "[ addr [ baud ] ]\n"
1187 " - load binary file over serial line"
1188 " at address 'addr' with baudrate 'baud'"
1191 #endif /* CONFIG_CMD_LOADB */
1193 #if defined(CONFIG_CMD_LOADM)
1195 loadm, 4, 0, do_load_memory_bin,
1196 "load binary blob from source address to destination address",
1197 "[src_addr] [dst_addr] [size]\n"
1198 " - load a binary blob from one memory location to other"
1199 " from src_addr to dst_addr by size bytes"
1201 #endif /* CONFIG_CMD_LOADM */