From owner-p4-projects@FreeBSD.ORG Tue Nov 21 17:21:15 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 563F616CF33; Tue, 21 Nov 2006 17:20:37 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17DC716AF96 for ; Tue, 21 Nov 2006 17:20:33 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AE1843F96 for ; Tue, 21 Nov 2006 17:14:44 +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 kALHF65O066801 for ; Tue, 21 Nov 2006 17:15:06 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kALHF69Y066796 for perforce@freebsd.org; Tue, 21 Nov 2006 17:15:06 GMT (envelope-from imp@freebsd.org) Date: Tue, 21 Nov 2006 17:15:06 GMT Message-Id: <200611211715.kALHF69Y066796@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 110194 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: Tue, 21 Nov 2006 17:21:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=110194 Change 110194 by imp@imp_lighthouse on 2006/11/18 08:03:24 Move almost all of the atmel specific stuff to the *board.c files. This should allow us to be in a good position to also support booting off CF. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/board.h#3 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#28 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/kb920x_board.c#5 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/tsc_board.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/board.h#3 (text+ko) ==== @@ -26,3 +26,4 @@ void Update(void); void board_init(void); +int drvread(void *, unsigned, unsigned); ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#28 (text+ko) ==== @@ -26,9 +26,7 @@ #include -#include "emac.h" #include "lib.h" -#include "sd-card.h" #include "board.h" #define RBX_ASKNAME 0x0 /* -a */ @@ -96,7 +94,6 @@ static int parse(void); static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); -static int drvread(void *, unsigned, unsigned); #include "ufsread.c" @@ -148,9 +145,6 @@ ino_t ino; board_init(); - EMAC_Init(); - sdcard_init(); - EMAC_SetMACAddress(mac); dmadat = (void *)(0x20000000 + (16 << 20)); /* Process configuration file */ @@ -304,12 +298,3 @@ } return drvread(buf, dsk_start + lba, nblk); } - -static int -drvread(void *buf, unsigned lba, unsigned nblk) -{ - static unsigned c = 0x2d5c7c2f; - - printf("%c\b", c = c << 8 | c >> 24); - return (MCI_read((char *)buf, lba << 9, nblk << 9)); -} ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/kb920x_board.c#5 (text+ko) ==== @@ -31,6 +31,7 @@ #include "emac.h" #include "lib.h" #include "board.h" +#include "sd-card.h" extern unsigned char mac[]; @@ -57,4 +58,16 @@ { InitEEPROM(); MacFromEE(); + EMAC_Init(); + sdcard_init(); + EMAC_SetMACAddress(mac); +} + +int +drvread(void *buf, unsigned lba, unsigned nblk) +{ + static unsigned c = 0x2d5c7c2f; + + printf("%c\b", c = c << 8 | c >> 24); + return (MCI_read((char *)buf, lba << 9, nblk << 9)); } ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/tsc_board.c#6 (text+ko) ==== @@ -7,6 +7,7 @@ #include "lib.h" #include "ee.h" #include "board.h" +#include "sd-card.h" extern unsigned char mac[]; @@ -133,6 +134,19 @@ printf("mac\n"); MacFromEE(); printf("EEEEEE\n"); + EMAC_Init(); + sdcard_init(); + EMAC_SetMACAddress(mac); + } #include "../bootspi/ee.c" + +int +drvread(void *buf, unsigned lba, unsigned nblk) +{ + static unsigned c = 0x2d5c7c2f; + + printf("%c\b", c = c << 8 | c >> 24); + return (MCI_read((char *)buf, lba << 9, nblk << 9)); +}