PERFORCE change 109778 for review

Warner Losh imp at FreeBSD.org
Sun Nov 12 07:15:19 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=109778

Change 109778 by imp at 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);
 }


More information about the p4-projects mailing list