From: Russ D. <ru...@us...> - 2001-08-31 14:38:11
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv7940/src Modified Files: Makefile.am flash.c linux.c main.c rest-ld-script Added Files: param_block.c Log Message: Paramater block support ***** Error reading new file: [Errno 2] No such file or directory: 'param_block.c' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile.am 2001/08/06 22:44:52 1.2 +++ Makefile.am 2001/08/31 06:26:59 1.3 @@ -57,6 +57,7 @@ linux.c \ main.c \ memory.c \ + param_block.c \ serial.c \ time.c \ util.c \ Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- flash.c 2001/08/06 22:44:52 1.2 +++ flash.c 2001/08/31 06:26:59 1.3 @@ -154,6 +154,13 @@ numBlocks = NUM_BLOB_BLOCKS; break; +#ifdef PARAM_START + case blParam: + thisBlock = (char *)PARAM_START; + numBlocks = NUM_PARAM_BLOCKS; + break; +#endif + case blKernel: thisBlock = (char *)KERNEL_START; numBlocks = NUM_KERNEL_BLOCKS; @@ -211,6 +218,13 @@ flashBase = (u32 *)BLOB_START; maxLength = BLOB_LEN; break; + +#ifdef PARAM_START + case blParam: + flashBase = (u32 *)PARAM_START; + maxLength = PARAM_LEN; + break; +#endif case blKernel: flashBase = (u32 *)KERNEL_START; Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/linux.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- linux.c 2001/08/30 08:39:49 1.3 +++ linux.c 2001/08/31 06:26:59 1.4 @@ -119,8 +119,11 @@ /* skip non-existent command lines so the kernel will still * use its default command line. */ - if(*p == '\0') - return; + if(*p == '\0') { + if(*blob_status.cmdline != '\0') + p = blob_status.cmdline; + else return; + } params->hdr.tag = ATAG_CMDLINE; params->hdr.size = (sizeof(struct tag_header) + strlen(p) + 1 + 4) >> 2; Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- main.c 2001/08/07 17:36:48 1.3 +++ main.c 2001/08/31 06:26:59 1.4 @@ -45,6 +45,7 @@ #include "linux.h" #include "main.h" #include "memory.h" +#include "param_block.h" #include "sa1100.h" #include "serial.h" #include "time.h" @@ -86,10 +87,29 @@ */ led_on(); + /* initialise status */ + blob_status.paramSize = 0; + blob_status.paramType = fromFlash; + blob_status.kernelSize = 0; + blob_status.kernelType = fromFlash; + blob_status.ramdiskSize = 0; + blob_status.ramdiskType = fromFlash; + blob_status.blockSize = blockSize; + blob_status.downloadSpeed = baud115k2; + blob_status.terminalSpeed = baud9k6; + blob_status.load_ramdisk = 1; + blob_status.cmdline[0] = '\0'; + blob_status.boot_delay = 10; + + /* Parse the paramater block */ +#ifdef PARAM_START + parse_ptags((void *) PARAM_START); +#endif + /* We really want to be able to communicate, so initialise the * serial port at 9k6 (which works good for terminals) */ - SerialInit(baud9k6); + SerialInit(blob_status.terminalSpeed); TimerInit(); /* Print the required GPL string */ @@ -110,19 +130,10 @@ /* get the amount of memory */ get_memory_map(); - /* initialise status */ - blob_status.kernelSize = 0; - blob_status.kernelType = fromFlash; - blob_status.ramdiskSize = 0; - blob_status.ramdiskType = fromFlash; - blob_status.blockSize = blockSize; - blob_status.downloadSpeed = baud115k2; - - /* Load kernel and ramdisk from flash to RAM */ Reload("blob"); Reload("kernel"); - Reload("ramdisk"); + if(blob_status.load_ramdisk) Reload("ramdisk"); #ifdef BLOB_DEBUG /* print some information */ @@ -138,7 +149,7 @@ #endif /* wait 10 seconds before starting autoboot */ SerialOutputString("Autoboot in progress, press any key to stop "); - for(i = 0; i < 10; i++) { + for(i = 0; i < blob_status.boot_delay; i++) { SerialOutputByte('.'); retval = SerialInputBlock(commandline, 1, 1); @@ -213,6 +224,14 @@ bufLen = blob_status.blockSize - BLOB_BLOCK_OFFSET; numRead = &blob_status.blobSize; blob_status.blobType = fromDownload; +#ifdef PARAM_START + } else if(MyStrNCmp(commandline, "param", 5) == 0) { + /* download kernel */ + startAddress = PARAM_RAM_BASE; + bufLen = PARAM_LEN; + numRead = &blob_status.paramSize; + blob_status.paramType = fromDownload; +#endif } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { /* download kernel */ startAddress = KERNEL_RAM_BASE; @@ -238,13 +257,17 @@ SerialOutputString(" baud\n"); SerialOutputString("You have 60 seconds to switch your terminal emulator to the same speed and\n"); - SerialOutputString("start downloading. After that " PACKAGE " will switch back to 9600 baud.\n"); + SerialOutputString("start downloading. After that " PACKAGE " will switch back to "); + PrintSerialSpeed(blob_status.terminalSpeed); + SerialOutputString(" baud.\n"); SerialInit(blob_status.downloadSpeed); *numRead = UUDecode((char *)startAddress, bufLen); - SerialOutputString("\n(Please switch your terminal emulator back to 9600 baud)\n"); + SerialOutputString("\n(Please switch your terminal emulator back to "); + PrintSerialSpeed(blob_status.terminalSpeed); + SerialOutputString(" baud)\n"); if(*numRead < 0) { /* something went wrong */ @@ -288,6 +311,20 @@ } SerialOutputString("Saving blob to flash "); +#ifdef PARAM_START + } else if(MyStrNCmp(commandline, "param", 5) == 0) { + startAddress = PARAM_RAM_BASE; + block = blParam; + numBytes = blob_status.paramSize; + maxSize = PARAM_LEN; + + if(blob_status.paramType == fromFlash) { + SerialOutputString("*** No paramater block downloaded\n"); + return; + } + + SerialOutputString("Saving paramater block to flash "); +#endif } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { startAddress = KERNEL_RAM_BASE; block = blKernel; @@ -343,19 +380,19 @@ { SerialOutputString("Help for " PACKAGE " " VERSION ", the LART bootloader\n"); SerialOutputString("The following commands are supported:\n"); - SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\n"); - SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\n"); - SerialOutputString(" Set the SA1100 core clock and DRAM timings\n"); - SerialOutputString(" (WARNING: dangerous command!)\n"); - SerialOutputString("* download {blob|kernel|ramdisk} Download blob/kernel/ramdisk image to RAM\n"); - SerialOutputString("* flash {blob|kernel|ramdisk} Copy blob/kernel/ramdisk from RAM to flash\n"); - SerialOutputString("* help Get this help\n"); - SerialOutputString("* reblob Restart blob from RAM\n"); - SerialOutputString("* reboot Reboot system\n"); - SerialOutputString("* reload {blob|kernel|ramdisk} Reload blob/kernel/ramdisk from flash to RAM\n"); - SerialOutputString("* reset Reset terminal\n"); - SerialOutputString("* speed Set download speed\n"); - SerialOutputString("* status Display current status\n"); + SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\n"); + SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\n"); + SerialOutputString(" Set the SA1100 core clock and DRAM timings\n"); + SerialOutputString(" (WARNING: dangerous command!)\n"); + SerialOutputString("* download {blob|param|kernel|ramdisk} Download <argument> image to RAM\n"); + SerialOutputString("* flash {blob|param|kernel|ramdisk} Copy <argument> from RAM to flash\n"); + SerialOutputString("* help Get this help\n"); + SerialOutputString("* reblob Restart blob from RAM\n"); + SerialOutputString("* reboot Reboot system\n"); + SerialOutputString("* reload {blob|param|kernel|ramdisk} Reload <argument> from flash to RAM\n"); + SerialOutputString("* reset Reset terminal\n"); + SerialOutputString("* speed Set download speed\n"); + SerialOutputString("* status Display current status\n"); } @@ -387,12 +424,16 @@ blob_status.downloadSpeed = baud115k2; } else if(MyStrNCmp(commandline, "115k2", 5) == 0) { blob_status.downloadSpeed = baud115k2; + } else if(MyStrNCmp(commandline, "230400", 6) == 0) { + blob_status.downloadSpeed = baud230k4; + } else if(MyStrNCmp(commandline, "230k4", 5) == 0) { + blob_status.downloadSpeed = baud230k4; } else { SerialOutputString("*** Invalid download speed value \""); SerialOutputString(commandline); SerialOutputString("\"\n*** Valid values are:\n"); - SerialOutputString("*** 1200, 9600, 19200, 38400, 57600, 115200,\n"); - SerialOutputString("*** 1k2, 9k6, 19k2, 38k4, 57k6, and 115k2\n"); + SerialOutputString("*** 1200, 9600, 19200, 38400, 57600, 115200, 230400\n"); + SerialOutputString("*** 1k2, 9k6, 19k2, 38k4, 57k6, 115k2, and 230k4\n"); } SerialOutputString("Download speed set to "); @@ -421,6 +462,10 @@ PrintSerialSpeed(blob_status.downloadSpeed); SerialOutputString(" baud\n"); + SerialOutputString("\nTerminal speed: "); + PrintSerialSpeed(blob_status.terminalSpeed); + SerialOutputString(" baud\n"); + SerialOutputString("Blob : "); if(blob_status.blobType == fromFlash) { SerialOutputString("from flash\n"); @@ -430,6 +475,19 @@ SerialOutputString(" bytes\n"); } +#ifdef PARAM_START + SerialOutputString("Param Block : "); + if(blob_status.paramType == fromFlash) { + SerialOutputString("from flash\n"); + } else { + SerialOutputString("downloaded, "); + SerialOutputDec(blob_status.blobSize); + SerialOutputString(" bytes\n"); + } +#else + SerialOutputString("Param Block : Not available\n"); +#endif + SerialOutputString("Kernel : "); if(blob_status.kernelType == fromFlash) { SerialOutputString("from flash\n"); @@ -456,7 +514,7 @@ { int i; - SerialInit(baud9k6); + SerialInit(blob_status.terminalSpeed); SerialOutputString(" c"); for(i = 0; i < 100; i++) SerialOutputByte('\n'); @@ -480,6 +538,15 @@ blob_status.blobSize = 0; blob_status.blobType = fromFlash; SerialOutputString("Loading blob from flash "); +#ifdef PARAM_START + } else if(MyStrNCmp(commandline, "param", 6) == 0) { + src = (u32 *)PARAM_RAM_BASE; + dst = (u32 *)PARAM_START; + numWords = PARAM_LEN / 4; + blob_status.paramSize = 0; + blob_status.paramType = fromFlash; + SerialOutputString("Loading paramater block from flash "); +#endif } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { src = (u32 *)KERNEL_RAM_BASE; dst = (u32 *)KERNEL_START; @@ -533,6 +600,10 @@ case baud115k2: SerialOutputDec(115200); + break; + + case baud230k4: + SerialOutputDec(230400); break; default: Index: rest-ld-script =================================================================== RCS file: /cvsroot/blob/blob/src/rest-ld-script,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- rest-ld-script 2001/08/06 22:44:52 1.2 +++ rest-ld-script 2001/08/31 06:26:59 1.3 @@ -31,5 +31,13 @@ . = ALIGN(4); .bss : { *(.bss) } + + . = ALIGN(4); + .ptaglist : { + __ptagtable_begin = .; + *(.ptaglist) + __ptagtable_end = .; + } + } |