Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2006 07:32:20 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 94840 for review
Message-ID:  <200604090732.k397WKaa087229@repoman.freebsd.org>

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

Change 94840 by imp@imp_hammer on 2006/04/09 07:31:58

	Automatically start xmodem download to base + 1MB and jump to it when
	downloaded.  Loaded programs are expected to copy themselves to the
	right location or run at 1MB.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/main.c#2 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/main.c#2 (text+ko) ====

@@ -24,6 +24,8 @@
 #include "at91rm9200_lowlevel.h"
 #include "AT91RM9200.h"
 
+typedef	void fn_t(void);
+
 /*
  * .KB_C_FN_DEFINITION_START
  * int main(void)
@@ -34,13 +36,15 @@
  * from this function.
  * .KB_C_FN_DEFINITION_END
  */
-int main(void) {
+int
+main(void)
+{
+	char *addr = (char *)0x20000000 + (1 << 20); /* Load to base + 1MB */
+	fn_t *fn = (fn_t *)addr;
 
-	char		l_char;
-
 	AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC10;
-	while (1)
-	    DebugPrint(".");
-
+	xmodem_rx(addr);
+	AT91C_BASE_PIOC->PIO_CODR = AT91C_PIO_PC10;	
+	fn();
 	return (1);
 }



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