From: Erik M. <er...@us...> - 2001-07-08 22:34:16
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv22063/src Modified Files: Tag: blob_1_0_9_hack Makefile.am flash.c main.c start.S Added Files: Tag: blob_1_0_9_hack flashasm.S memsetup.S rest-ld-script start-ld-script testmem.S testmem2.S Removed Files: Tag: blob_1_0_9_hack ld-script Log Message: - added Russ, Tim, and Wookey to the AUTHORS file - updated ChangeLog - run-from-RAM patch ***** Error reading new file: [Errno 2] No such file or directory: 'flashasm.S' ***** Error reading new file: [Errno 2] No such file or directory: 'memsetup.S' ***** Error reading new file: [Errno 2] No such file or directory: 'rest-ld-script' ***** Error reading new file: [Errno 2] No such file or directory: 'start-ld-script' ***** Error reading new file: [Errno 2] No such file or directory: 'testmem.S' ***** Error reading new file: [Errno 2] No such file or directory: 'testmem2.S' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- Makefile.am 2001/06/27 19:47:42 1.1.1.1 +++ Makefile.am 2001/07/08 22:34:14 1.1.1.1.2.1 @@ -12,46 +12,90 @@ bin_PROGRAMS = \ - blob-elf32 \ + blob-start-elf32 \ + blob-start \ + blob-rest-elf32 \ + blob-rest \ blob +# First specify how to build the first stage loader + # WARNING: start.S *must* be the first file, otherwise the target will # be linked in the wrong order! -blob_elf32_SOURCES = \ +blob_start_elf32_SOURCES = \ start.S \ - clock.c \ - command.c \ + memsetup.S \ + testmem.S + + +blob_start_elf32_LDFLAGS += \ + -Wl,-T,${top_srcdir}/src/start-ld-script + +blob_start_elf32_LDADD += \ + -lgcc + + +blob_start_SOURCES = + + +blob-start: blob-start-elf32 + $(OBJCOPY) $(OCFLAGS) $< $@ + + +# Now specify how to build the second stage loader + +blob_rest_elf32_SOURCES = \ + trampoline.S \ + testmem2.S \ + flashasm.S \ main.c \ - flash.c \ serial.c \ - time.c \ + command.c \ + clock.c \ util.c \ - uucodec.c + time.c \ + uucodec.c \ + flash.c -blob_SOURCES = +blob_rest_elf32_LDFLAGS += \ + -Wl,-T,${top_srcdir}/src/rest-ld-script -EXTRA_DIST = \ - ld-script +blob_rest_elf32_LDADD += \ + -lgcc -blob_elf32_LDFLAGS += \ - -Wl,-T,${top_srcdir}/src/ld-script +blob_rest_SOURCES = -blob_elf32_LDADD += \ - -lgcc +blob-rest: blob-rest-elf32 + $(OBJCOPY) $(OCFLAGS) $< $@ + + +# Finally specify how to build the full binary + +blob_SOURCES = +blob: blob-start blob-rest + rm -f $@ + dd if=blob-start of=$@ bs=1k conv=sync + dd if=blob-rest of=$@ bs=1k seek=1 + chmod +x blob + + +# automake administrativia + +EXTRA_DIST = \ + start-ld-script \ + rest-ld-script + + INCLUDES += \ -I${top_builddir}/include \ -I${top_srcdir}/include - - -blob: blob-elf32 - $(OBJCOPY) $(OCFLAGS) $< $@ CLEANFILES = *~ Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- flash.c 2001/06/27 19:47:42 1.1.1.1 +++ flash.c 2001/07/08 22:34:14 1.1.1.1.2.1 @@ -132,11 +132,6 @@ char *thisBlock; int numBlocks, i; - if(RunningFromInternal()) { - SerialOutputString("*** Can't erase -- running from internal flash.\r"); - return; - } - if(which == blKernel) { thisBlock = (char *)KERNEL_START; numBlocks = NUM_KERNEL_BLOCKS; Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.4 retrieving revision 1.1.1.1.2.5 diff -u -r1.1.1.1.2.4 -r1.1.1.1.2.5 --- main.c 2001/07/08 13:52:16 1.1.1.1.2.4 +++ main.c 2001/07/08 22:34:14 1.1.1.1.2.5 @@ -85,8 +85,9 @@ -void c_main(char *blockBase, u32 blockSize) +int main(void) { + u32 blockSize = 0x00800000; int numRead = 0; char commandline[128]; blobStatus status; @@ -98,21 +99,10 @@ */ SerialInit(baud9k6); TimerInit(); - - /* initialise status */ - status.kernelSize = 0; - status.kernelType = fromFlash; - status.ramdiskSize = 0; - status.ramdiskType = fromFlash; - status.blockSize = blockSize; - status.downloadSpeed = baud115k2; - - /* Load kernel and ramdisk from flash to RAM */ - Reload("kernel", &status); - Reload("ramdisk", &status); /* Print the required GPL string */ - SerialOutputString("\r" PACKAGE " version " VERSION "\r" + SerialOutputString("\rConsider yourself LARTed!\r\r"); + SerialOutputString(PACKAGE " version " VERSION "\r" "Copyright (C) 1999 2000 " "Jan-Derk Bakker and Erik Mouw\r" "Copyright (C) 2000 " @@ -123,17 +113,29 @@ "to redistribute it\r"); SerialOutputString("under certain conditions; " "read the GNU GPL for details.\r\r"); + + + /* initialise status */ + status.kernelSize = 0; + status.kernelType = fromFlash; + status.ramdiskSize = 0; + status.ramdiskType = fromFlash; + status.blockSize = blockSize; + status.downloadSpeed = baud115k2; + - /* and some information */ + /* Load kernel and ramdisk from flash to RAM */ + Reload("kernel", &status); + Reload("ramdisk", &status); + #ifdef BLOB_DEBUG + /* print some information */ SerialOutputString("Running from "); if(RunningFromInternal()) SerialOutputString("internal flash\r"); else SerialOutputString("external flash\r"); - SerialOutputString("blockBase = 0x"); - SerialOutputHex((int) blockBase); SerialOutputString(", blockSize = 0x"); SerialOutputHex(blockSize); SerialOutputByte('\r'); @@ -192,6 +194,8 @@ } } } + + return 0; } /* c_main */ @@ -314,11 +318,6 @@ u32 startAddress = 0; tBlockType block; int numBytes = 0;; - - if(RunningFromInternal()) { - SerialOutputString("*** Flash not possible when using internal flash\r"); - return; - } if(MyStrNCmp(commandline, "kernel", 6) == 0) { startAddress = KERNEL_RAM_BASE; Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.3 retrieving revision 1.1.1.1.2.4 diff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4 --- start.S 2001/07/07 19:24:40 1.1.1.1.2.3 +++ start.S 2001/07/08 22:34:14 1.1.1.1.2.4 @@ -1,17 +1,7 @@ -########################################################################### -## Filename: start.S -## Version: $Id$ -## Copyright: Copyright (C) 1999, Erik Mouw -## Author: Erik Mouw <J.A...@it...> -## Description: blob start code -## Created at: Sun Jul 18 20:29:08 1999 -## Modified by: Erik Mouw <J.A...@it...> -## Modified at: Fri Jul 14 17:55:36 2000 -########################################################################### /* [...1123 lines suppressed...] -abort_data: - b abort_data +data_abort: + b data_abort @@ -1090,8 +224,8 @@ b not_used + - irq: b irq --- ld-script DELETED --- |