Lines Matching +full:long +full:- +full:press +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2004
8 * Serial up- and download support
21 static ulong load_serial_ymodem(ulong offset, int mode);
25 static ulong load_serial(long offset);
35 /* -------------------------------------------------------------------- */
41 long offset = 0; in do_load_serial()
49 load_baudrate = current_baudrate = gd->baudrate; in do_load_serial()
70 printf("## Switch baudrate to %d bps and press ENTER ...\n", in do_load_serial()
73 gd->baudrate = load_baudrate; in do_load_serial()
87 printf("## Ready for S-Record download ...\n"); in do_load_serial()
104 printf("## S-Record download aborted\n"); in do_load_serial()
113 printf("## Switch baudrate to %d bps and press ESC ...\n", in do_load_serial()
116 gd->baudrate = current_baudrate; in do_load_serial()
128 static ulong load_serial(long offset) in load_serial()
130 char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */ in load_serial()
132 int binlen; /* no. of data bytes in S-Rec. */ in load_serial()
134 ulong addr; /* load address from S-Record */ in load_serial()
145 return (~0); /* Invalid S-Record */ in load_serial()
169 if ((store_addr + binlen - 1) > end_addr) in load_serial()
170 end_addr = store_addr + binlen - 1; in load_serial()
176 size = end_addr - start_addr + 1; in load_serial()
205 --len; /* always leave room for terminating '\0' byte */ in read_record()
216 return (p - buf); in read_record()
218 case 0x03: /* ^C - Control C */ in read_record()
219 return (-1); in read_record()
225 if (gd->jt->getc != getc) { in read_record()
227 return (-1); in read_record()
232 /* line too long - truncate */ in read_record()
234 return (p - buf); in read_record()
246 save_baudrate = current_baudrate = gd->baudrate; in do_save_serial()
264 printf("## Switch baudrate to %d bps and press ENTER ...\n", in do_save_serial()
267 gd->baudrate = save_baudrate; in do_save_serial()
281 printf("## Ready for S-Record upload, press ENTER to proceed ...\n"); in do_save_serial()
287 printf("## S-Record upload aborted\n"); in do_save_serial()
289 printf("## S-Record upload complete\n"); in do_save_serial()
293 printf("## Switch baudrate to %d bps and press ESC ...\n", in do_save_serial()
296 gd->baudrate = current_baudrate; in do_save_serial()
317 char record[2*SREC_BYTES_PER_RECORD+16]; /* buffer for one S-Record */ in save_serial()
324 return (-1); in save_serial()
333 --count; in save_serial()
355 return (-1); in save_serial()
364 return (-1); in save_serial()
378 return (-1); in write_record()
404 #define untochar(x) ((int) (((x) - SPACE) & 0xff))
406 static void set_kerm_bin_mode(unsigned long *);
425 /* pre-set offset from CONFIG_SYS_LOAD_ADDR */ in do_load_serial_bin()
428 /* pre-set offset from $loadaddr */ in do_load_serial_bin()
433 load_baudrate = current_baudrate = gd->baudrate; in do_load_serial_bin()
447 printf("## Switch baudrate to %d bps and press ENTER ...\n", in do_load_serial_bin()
450 gd->baudrate = load_baudrate; in do_load_serial_bin()
493 printf("## Switch baudrate to %d bps and press ESC ...\n", in do_load_serial_bin()
496 gd->baudrate = current_baudrate; in do_load_serial_bin()
540 while (count-- > 0) in send_pad()
634 static void set_kerm_bin_mode(unsigned long *addr) in set_kerm_bin_mode()
665 /* last char was escape - translate this character */ in k_data_char()
670 /* this char is escape - remember */ in k_data_char()
673 /* otherwise send this char as-is */ in k_data_char()
697 if (send_ptr == &send_parms[SEND_DATA_SIZE - 1]) in handle_send_packet()
698 --send_ptr; in handle_send_packet()
699 bytes = send_ptr - send_parms; /* how many bytes we'll process */ in handle_send_packet()
701 if (bytes-- <= 0) in handle_send_packet()
703 /* handle MAXL - max length */ in handle_send_packet()
704 /* ignore what he says - most I'll take (here) is 94 */ in handle_send_packet()
706 if (bytes-- <= 0) in handle_send_packet()
708 /* handle TIME - time you should wait for my packets */ in handle_send_packet()
709 /* ignore what he says - don't wait for my ack longer than 1 second */ in handle_send_packet()
711 if (bytes-- <= 0) in handle_send_packet()
713 /* handle NPAD - number of pad chars I need */ in handle_send_packet()
714 /* remember what he says - I need none */ in handle_send_packet()
717 if (bytes-- <= 0) in handle_send_packet()
719 /* handle PADC - pad chars I need */ in handle_send_packet()
720 /* remember what he says - I need none */ in handle_send_packet()
723 if (bytes-- <= 0) in handle_send_packet()
725 /* handle EOL - end of line he needs */ in handle_send_packet()
726 /* remember what he says - I need CR */ in handle_send_packet()
729 if (bytes-- <= 0) in handle_send_packet()
731 /* handle QCTL - quote control char he'll use */ in handle_send_packet()
732 /* remember what he says - I'll use '#' */ in handle_send_packet()
735 if (bytes-- <= 0) in handle_send_packet()
737 /* handle QBIN - 8-th bit prefixing */ in handle_send_packet()
738 /* ignore what he says - I refuse */ in handle_send_packet()
740 if (bytes-- <= 0) in handle_send_packet()
742 /* handle CHKT - the clock check type */ in handle_send_packet()
743 /* ignore what he says - I do type 1 (for now) */ in handle_send_packet()
745 if (bytes-- <= 0) in handle_send_packet()
747 /* handle REPT - the repeat prefix */ in handle_send_packet()
748 /* ignore what he says - I refuse (for now) */ in handle_send_packet()
750 if (bytes-- <= 0) in handle_send_packet()
752 /* handle CAPAS - the capabilities mask */ in handle_send_packet()
753 /* ignore what he says - I only do long packets - I don't do windows */ in handle_send_packet()
754 a_b[++length] = tochar(2); /* only long packets */ in handle_send_packet()
795 last_n = -1; in k_recv()
813 If a character less than SPACE (0x20) is received - error. in k_recv()
849 --length; in k_recv()
851 /* NEW CODE - check sequence numbers for retried packets */ in k_recv()
852 /* Note - this new code assumes that the sequence number is correctly in k_recv()
854 * of complexity that may not be needed - yet! At this time, I'm hoping in k_recv()
876 --length; in k_recv()
878 if (length == -2) { in k_recv()
899 /* --length; */ /* new length includes only data and block check to come */ in k_recv()
907 --length; in k_recv()
916 --send_ptr; in k_recv()
945 return ((ulong) os_data_addr - (ulong) bin_start_address); in k_recv()
951 return -1; in getcxmodem()
953 static ulong load_serial_ymodem(ulong offset, int mode) in load_serial_ymodem() argument
964 info.mode = mode; in load_serial_ymodem()
1009 /* -------------------------------------------------------------------- */
1016 "load S-Record file over serial line",
1018 " - load S-Record file over serial line"
1025 "load S-Record file over serial line",
1027 " - load S-Record file over serial line with offset 'off'"
1040 "save S-Record file over serial line",
1042 " - save S-Record file over serial line"
1048 "save S-Record file over serial line",
1050 " - save S-Record file over serial line with offset 'off' and size 'size'"
1060 "load binary file over serial line (kermit mode)",
1062 " - load binary file over serial line"
1068 "load binary file over serial line (xmodem mode)",
1070 " - load binary file over serial line"
1076 "load binary file over serial line (ymodem mode)",
1078 " - load binary file over serial line"