PERFORCE change 94840 for review
Warner Losh
imp at FreeBSD.org
Sun Apr 9 07:32:21 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94840
Change 94840 by imp at 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);
}
More information about the p4-projects
mailing list