From owner-p4-projects@FreeBSD.ORG Sun Nov 12 07:15:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF99716A412; Sun, 12 Nov 2006 07:15:18 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C9BA16A407 for ; Sun, 12 Nov 2006 07:15:18 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72A7743D97 for ; Sun, 12 Nov 2006 07:15:18 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kAC7FIfC009908 for ; Sun, 12 Nov 2006 07:15:18 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAC7FIb3009905 for perforce@freebsd.org; Sun, 12 Nov 2006 07:15:18 GMT (envelope-from imp@freebsd.org) Date: Sun, 12 Nov 2006 07:15:18 GMT Message-Id: <200611120715.kAC7FIb3009905@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 109778 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2006 07:15:19 -0000 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); }