Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2006 07:15:18 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 109778 for review
Message-ID:  <200611120715.kAC7FIb3009905@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109778

Change 109778 by imp@imp_lighthouse on 2006/11/12 07:14:19

	On second thought, the eeprom size is really irrelevant, and we
	shouldn't dictate it.  Instead, use the return value from xmodem_rx
	to calculate the number of bytes to burn.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/boot0iic/main.c#11 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/boot0iic/main.c#11 (text) ====

@@ -28,21 +28,19 @@
 #include "lib.h"
 #include "at91rm9200_lowlevel.h"
 
-#define EEPROMSIZE	12*1024	/* Bytes to be written to EEPROM  */
-
 int
 main(void)
 {
 	char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */
+	int len;
 
-	printf("\r\nSend data to be written into EEPROM at addr 0 "
-	       "(0x%x bytes)\r\n", EEPROMSIZE);
-
-	while (xmodem_rx(addr) == -1)
+	printf("\nSend data to be written into EEPROM\n");
+	while ((len = xmodem_rx(addr)) == -1)
 		continue;
 	InitEEPROM();
-	printf("\r\nWriting EEPROM from 0x%x to addr 0, 0x%x bytes\r\n", addr, EEPROMSIZE);
-	WriteEEPROM(0, addr, EEPROMSIZE);
-	printf("\r\nWrite complete.  Press reset\r\n");
+	printf("\nWriting EEPROM from 0x%x to addr 0, 0x%x bytes\n", addr,
+	    len);
+	WriteEEPROM(0, addr, len);
+	printf("\nWrite complete.  Press reset\n");
 	return (1);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611120715.kAC7FIb3009905>