Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2006 17:15:06 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 110194 for review
Message-ID:  <200611211715.kALHF69Y066796@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <stdarg.h>
 
-#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));
+}



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