[U-Boot-Users] [PATCH] 1/5: cmd_boot

Wolfgang Denk wd at denx.de
Mon Mar 31 12:12:09 CEST 2003


In message <20030331092850.GL7702 at pengutronix.de> you wrote:
> 
> here are some last minute patches, I hope Wolfgang has time to check
> them in before the release. 
> 
> -----
> 
> cmd_boot: 
> 
> - fix whitespace for bdinfo command
> - fix garbage characters output
> - add ctrl-c support for kermit download

See below.

> --- u-boot/common/cmd_boot.c	2003-03-31 08:34:19.000000000 +0200
> +++ u-boot-ptx/common/cmd_boot.c	2003-03-31 08:39:33.000000000 +0200
> @@ -163,10 +163,10 @@
>  		printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
>  	}
>  	printf ("\n"
> -		"ip_addr       = ");
> +		"ip_addr     = ");
>  	print_IPaddr (bd->bi_ip_addr);
>  	printf ("\n"
> -		"baudrate      = %d bps\n", bd->bi_baudrate);
> +		"baudrate    = %d bps\n", bd->bi_baudrate);

Which "whitespace" problem are you trying to fix? To me  the  current
output looks good:

	=> bdi
	memstart    = 0x00000000
	memsize     = 0x01000000
	flashstart  = 0x40000000
	flashsize   = 0x00800000
	flashoffset = 0x00040000
	sramstart   = 0x00000000
	sramsize    = 0x00000000
	immr_base   = 0xFFF00000
	bootflags   = 0x00000001
	intfreq     =     50 MHz
	busfreq     =     50 MHz
	ethaddr     = 00:D0:93:00:7B:8B
	IP addr     = 10.0.0.99
	baudrate    = 115200 bps


> @@ -575,6 +575,7 @@
>  #define XON_CHAR        17
>  #define XOFF_CHAR       19
>  #define START_CHAR      0x01
> +#define ETX_CHAR	0x03
>  #define END_CHAR        0x0D
>  #define SPACE           0x20
>  #define K_ESCAPE        0x23
> @@ -687,11 +688,24 @@
>  
>  static ulong load_serial_bin (ulong offset)
>  {
> -	int size;
> +	int size, i;
>  	char buf[32];
>  
>  	set_kerm_bin_mode ((ulong *) offset);
>  	size = k_recv ();
> +
> +	/*
> +	 * Gather any trailing characters (for instance, the ^D which
> +	 * is sent by 'cu' after sending a file), and give the
> +	 * box some time (100 * 1 ms)
> +	 */
> +	for (i=0; i<100; ++i) {
> +		if (serial_tstc()) {
> +			(void) serial_getc();
> +		}
> +		udelay(1000);
> +	}

This makes no sense to  me.  load_serial_bin()  is  used  for  kermit
serial  protocol download, but "cu" is used for S-Record (ASCII file)
download. So how would "cu" disturb load_serial_bin() ?

Can you please explain which problem you are trying to fix?


>  		/* wait for the starting character */
> -		while (serial_getc () != START_CHAR);
> +		do {
> +			new_char = serial_getc();
> +			if (new_char == ETX_CHAR) return 0;
> +
> +		} while (new_char != START_CHAR);
> +

Will add this.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
If there are self-made purgatories, then we all have to live in them.
	-- Spock, "This Side of Paradise", stardate 3417.7




More information about the U-Boot mailing list