You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(27) |
Sep
(64) |
Oct
(202) |
Nov
(31) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(173) |
Mar
(13) |
Apr
(140) |
May
(75) |
Jun
(1) |
Jul
(37) |
Aug
(14) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(2) |
2003 |
Jan
(51) |
Feb
(12) |
Mar
(18) |
Apr
(24) |
May
(1) |
Jun
|
Jul
|
Aug
(72) |
Sep
(12) |
Oct
(18) |
Nov
(60) |
Dec
(26) |
2004 |
Jan
(1) |
Feb
(40) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(5) |
2006 |
Jan
(13) |
Feb
(5) |
Mar
(8) |
Apr
(13) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(35) |
Nov
(20) |
Dec
(10) |
2007 |
Jan
(13) |
Feb
(9) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(54) |
Jun
(78) |
Jul
(35) |
Aug
(21) |
Sep
(21) |
Oct
(29) |
Nov
(10) |
Dec
(5) |
2010 |
Jan
|
Feb
|
Mar
(26) |
Apr
(55) |
May
(73) |
Jun
(63) |
Jul
(38) |
Aug
(39) |
Sep
(19) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Erik M. <er...@us...> - 2001-07-24 13:57:50
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv19819/include Added Files: Tag: blob_1_0_9_hack linux.h Log Message: I'll check in those empty files so the changes are visible later ***** Error reading new file: [Errno 2] No such file or directory: 'linux.h' |
From: Erik M. <er...@us...> - 2001-07-24 13:23:57
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv9911 Modified Files: Tag: blob_1_0_9_hack README Log Message: - "reblob" command that allows you to start a just downloaded blob from RAM - updated documentation - start.S updated for reblob, it now finds out where it is running from - made msleep() function for Reboot() and Reblob() Index: README =================================================================== RCS file: /cvsroot/blob/blob/README,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 --- README 2001/07/22 22:54:26 1.1.1.1.2.3 +++ README 2001/07/24 13:23:54 1.1.1.1.2.4 @@ -278,6 +278,7 @@ * download {kernel|ramdisk} Download kernel or ramdisk image to RAM * flash {kernel|ramdisk} Copy kernel or ramdisk from RAM to flash * help Get this help + * reblob Restart blob from RAM (useful for debugging) * reboot Reboot system * reload {kernel|ramdisk} Reload kernel or ramdisk from flash to RAM * reset Reset terminal @@ -370,6 +371,14 @@ Currently this command only works for LART, we are working on support for the other architectures. + + +*** "reblob" +------------ + +Restart blob from RAM. This is mainly useful if you are working on +blob itself because it allows you to download blob and immediately +start it without having to burn it to flash first. *** "reboot" |
From: Erik M. <er...@us...> - 2001-07-24 13:23:57
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv9911/src Modified Files: Tag: blob_1_0_9_hack main.c start.S time.c Log Message: - "reblob" command that allows you to start a just downloaded blob from RAM - updated documentation - start.S updated for reblob, it now finds out where it is running from - made msleep() function for Reboot() and Reblob() Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.10 retrieving revision 1.1.1.1.2.11 diff -u -r1.1.1.1.2.10 -r1.1.1.1.2.11 --- main.c 2001/07/23 05:44:26 1.1.1.1.2.10 +++ main.c 2001/07/24 13:23:54 1.1.1.1.2.11 @@ -88,16 +88,11 @@ void Reload(char *commandline, blobStatus *status); void PrintSerialSpeed(eBauds speed); void Reboot(void); +void Reblob(void); -/* Hmm, the compiler complains that the 'noreturn' function - * returns. Looks like a compiler bug, should test with gcc-3.0 to see - * if it got fixed -- Erik - */ -/* void Reboot(void) __attribute__ ((noreturn)) ; */ - int main(void) { u32 blockSize = 0x00800000; @@ -200,6 +195,8 @@ Flash(commandline + 6, &status); } else if(MyStrNCmp(commandline, "help", 4) == 0) { PrintHelp(); + } else if(MyStrNCmp(commandline, "reblob", 6) == 0) { + Reblob(); } else if(MyStrNCmp(commandline, "reboot", 6) == 0) { Reboot(); } else if(MyStrNCmp(commandline, "reload ", 7) == 0) { @@ -409,6 +406,7 @@ SerialOutputString("* download {blob|kernel|ramdisk} Download kernel or ramdisk image to RAM\n"); SerialOutputString("* flash {blob|kernel|ramdisk} Copy kernel or 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 kernel or ramdisk from flash to RAM\n"); SerialOutputString("* reset Reset terminal\n"); @@ -604,20 +602,24 @@ void Reboot(void) { - u32 startTime, currentTime; - SerialOutputString("Rebooting...\n\n"); - /* sleep for half a second */ - TimerClearOverflow(); - startTime = TimerGetTime(); - - do { - currentTime = TimerGetTime(); - if(TimerDetectOverflow()) - break; - } while((currentTime - startTime) < TICKS_PER_SECOND/2); - + msleep(500); + RCSR = 0; RSRR = 1; +} + + + + +void Reblob(void) +{ + void (*blob)(void) = (void (*)(void))BLOB_RAM_BASE; + + SerialOutputString("Restarting blob from RAM...\n\n"); + + msleep(500); + + blob(); } Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.11 retrieving revision 1.1.1.1.2.12 diff -u -r1.1.1.1.2.11 -r1.1.1.1.2.12 --- start.S 2001/07/22 22:54:26 1.1.1.1.2.11 +++ start.S 2001/07/24 13:23:54 1.1.1.1.2.12 @@ -166,12 +166,20 @@ subs r0, r0, #(8 * 4) bne clear_loop + + /* get a clue where we are running, so we know what to copy */ + and r0, pc, #0xff000000 /* we don't care about the low bits */ + /* relocate the second stage loader */ - mov r0, #0x400 /* skip first 1024 bytes */ + add r2, r0, #(128 * 1024) /* blob is 128kB */ + add r0, r0, #0x400 /* skip first 1024 bytes */ ldr r1, MEM_START - mov r2, #(128 * 1024) /* blob is 128kB */ + /* r0 = source address + * r1 = target address + * r2 = source end address + */ copy_loop: ldmia r0!, {r3-r10} stmia r1!, {r3-r10} Index: time.c =================================================================== RCS file: /cvsroot/blob/blob/src/time.c,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- time.c 2001/07/22 22:54:26 1.1.1.1.2.2 +++ time.c 2001/07/24 13:23:54 1.1.1.1.2.3 @@ -100,3 +100,43 @@ OSSR = OSSR_M0; } + + + +void msleep(unsigned int msec) +{ + u32 ticks, start, end; + int will_overflow = 0; + int has_overflow = 0; + int reached = 0; + + if(msec == 0) + return; + + ticks = (TICKS_PER_SECOND * msec) / 1000; + + start = TimerGetTime(); + + /* this could overflow, but it nicely wraps around which is + * exactly what we want + */ + end = start + ticks; + + /* detect the overflow */ + if(end < start) { + TimerClearOverflow(); + will_overflow = 1; + } + + do { + if(will_overflow && !has_overflow) { + if(TimerDetectOverflow()) + has_overflow = 1; + + continue; + } + + if(TimerGetTime() >= end) + reached = 1; + } while(!reached); +} |
From: Erik M. <er...@us...> - 2001-07-24 13:23:57
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv9911/include Modified Files: Tag: blob_1_0_9_hack time.h Log Message: - "reblob" command that allows you to start a just downloaded blob from RAM - updated documentation - start.S updated for reblob, it now finds out where it is running from - made msleep() function for Reboot() and Reblob() Index: time.h =================================================================== RCS file: /cvsroot/blob/blob/include/time.h,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- time.h 2001/07/20 18:39:03 1.1.1.1.2.1 +++ time.h 2001/07/24 13:23:54 1.1.1.1.2.2 @@ -56,6 +56,8 @@ void TimerClearOverflow(void); +/* suspend execution for interval of milliseconds */ +void msleep(unsigned int msec); |
From: Russ D. <ru...@us...> - 2001-07-23 21:24:59
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv23797/src Modified Files: Tag: blob_1_0_9_hack flash.c Log Message: Tell blob to use AMD flash for the NESA board Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1.2.7 retrieving revision 1.1.1.1.2.8 diff -u -r1.1.1.1.2.7 -r1.1.1.1.2.8 --- flash.c 2001/07/23 20:30:54 1.1.1.1.2.7 +++ flash.c 2001/07/23 21:24:56 1.1.1.1.2.8 @@ -115,7 +115,7 @@ u32 data_from_flash(u32 what); u32 data_to_flash(u32 what); -#if defined SHANNON +#if defined SHANNON || defined NESA #define READ_ARRAY 0x00F000F0 #define UNLOCK1 0x00AA00AA #define UNLOCK2 0x00550055 @@ -189,7 +189,7 @@ volatile u32 *flashBase; u32 result; int maxLength, i; -#if defined SHANNON +#if defined SHANNON || defined NESA #define READY 1 #define ERR 2 int chip1, chip2; @@ -240,7 +240,7 @@ SerialOutputByte('\n'); #endif -#if defined SHANNON +#if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK_BYPASS); @@ -255,7 +255,7 @@ *flashBase = data_to_flash(PGM_SETUP); *flashBase = *source; -#if defined SHANNON +#if defined SHANNON || defined NESA /* This is a pretty similar situation to the erasing status below * Bit 7 is ~(data bit 7) until the flash is complete. If bit 5 @@ -300,7 +300,7 @@ } } -#if defined SHANNON +#if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(READ_ARRAY); #endif } /* WriteBlocksFromMem */ @@ -314,7 +314,7 @@ volatile u32 *writeMe = (u32 *)whichOne; u32 result; -#if defined SHANNON +#if defined SHANNON || defined NESA int chip1, chip2; #endif @@ -324,7 +324,7 @@ SerialOutputByte('\n'); #endif -#if defined SHANNON +#if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); *(u32 *)FLASH_ADDR1 = data_to_flash(ERASE_SETUP); |
From: Tim R. <tim...@us...> - 2001-07-23 20:30:59
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv11698/src Modified Files: Tag: blob_1_0_9_hack flash.c Log Message: typo Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1.2.6 retrieving revision 1.1.1.1.2.7 diff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7 --- flash.c 2001/07/23 05:44:26 1.1.1.1.2.6 +++ flash.c 2001/07/23 20:30:54 1.1.1.1.2.7 @@ -337,7 +337,6 @@ * but bit 5 is 1, its an error, however, after these status reads * are done, erased flash goes to 0xff...sooo...each chip has to * be caught where the bits are the status bits */ - */ chip1 = chip2 = 0; do { result = data_from_flash(*writeMe); |
From: Russ D. <ru...@us...> - 2001-07-23 05:44:29
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv15048/src Modified Files: Tag: blob_1_0_9_hack flash.c main.c Log Message: Initial AMD flash support (tuxscreen) Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1.2.5 retrieving revision 1.1.1.1.2.6 diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6 --- flash.c 2001/07/22 22:54:26 1.1.1.1.2.5 +++ flash.c 2001/07/23 05:44:26 1.1.1.1.2.6 @@ -115,6 +115,22 @@ u32 data_from_flash(u32 what); u32 data_to_flash(u32 what); +#if defined SHANNON +#define READ_ARRAY 0x00F000F0 +#define UNLOCK1 0x00AA00AA +#define UNLOCK2 0x00550055 +#define ERASE_SETUP 0x00800080 +#define ERASE_CONFIRM 0x00300030 +#define PGM_SETUP 0x00A000A0 +#define UNLOCK_BYPASS 0x00200020 +#define FLASH_ADDR1 (0x00000555 << 2) +#define FLASH_ADDR2 (0x000002AA << 2) +#define ERASE_DONE 0x00800080 +#define RDY_MASK 0x00800080 +#define STATUS_PGM_ERR 0x00200020 +#define STATUS_ERASE_ERR 0x00000001 + +#else #define READ_ARRAY 0x00FF00FF #define ERASE_SETUP 0x00200020 #define ERASE_CONFIRM 0x00D000D0 @@ -124,9 +140,8 @@ #define STATUS_BUSY 0x00800080 #define STATUS_ERASE_ERR 0x00200020 #define STATUS_PGM_ERR 0x00100010 - - +#endif void EraseBlocks(tBlockType which) { @@ -174,6 +189,11 @@ volatile u32 *flashBase; u32 result; int maxLength, i; +#if defined SHANNON +#define READY 1 +#define ERR 2 + int chip1, chip2; +#endif if((u32)source & 0x03) { SerialOutputString("*** Source is not on a word boundary: 0x"); @@ -219,6 +239,12 @@ SerialOutputHex((u32)flashBase); SerialOutputByte('\n'); #endif + +#if defined SHANNON + *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); + *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); + *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK_BYPASS); +#endif for(i = 0; i < length; i+= 4, flashBase++, source++) { if((i % MAIN_BLOCK_SIZE) == 0) { @@ -229,7 +255,36 @@ *flashBase = data_to_flash(PGM_SETUP); *flashBase = *source; +#if defined SHANNON + + /* This is a pretty similar situation to the erasing status below + * Bit 7 is ~(data bit 7) until the flash is complete. If bit 5 + * gets set before this happens, there is an error, but this could + * happen near the clock edge, and bit 5 could be the actual data + * before bit 7 changes, so we have to read again. + */ + chip1 = chip2 = 0; do { + result = data_from_flash(*flashBase); + + if (!chip1 && ((result & 0x80) == (*source & 0x80))) chip1 = READY; + if (!chip1 && ((result & 0xFFFF) & STATUS_PGM_ERR)) { + result = data_from_flash(*flashBase); + if ((result & 0x80) == (*source & 0x80)) chip1 = READY; + else chip1 = ERR; + } + if (!chip2 && ((result & (0x80 << 16)) == (*source & (0x80 << 16)))) chip2 = READY; + if (!chip2 && ((result >> 16) & STATUS_PGM_ERR)) { + result = data_from_flash(*flashBase); + if ((result & (0x80 << 16)) == (*source & (0x80 << 16))) chip2 = READY; + else chip2 = ERR; + } + + } while (!chip1 || !chip2); + + if (chip1 == ERR || chip2 == ERR || *flashBase != *source) { +#else + do { *flashBase = data_to_flash(STATUS_READ); result = data_from_flash(*flashBase); } while((~result & STATUS_BUSY) != 0); @@ -237,17 +292,21 @@ *flashBase = data_to_flash(READ_ARRAY); if((result & STATUS_PGM_ERR) != 0 || *flashBase != *source) { +#endif SerialOutputString("\n*** Write error at address 0x"); SerialOutputHex((u32)flashBase); SerialOutputByte('\n'); return; } } + +#if defined SHANNON + *(u32 *)FLASH_ADDR1 = data_to_flash(READ_ARRAY); +#endif } /* WriteBlocksFromMem */ - static u32 EraseOne(const char *whichOne) { /* Routine to erase one block of flash */ @@ -255,12 +314,46 @@ volatile u32 *writeMe = (u32 *)whichOne; u32 result; +#if defined SHANNON + int chip1, chip2; +#endif + #ifdef BLOB_DEBUG SerialOutputString(__FUNCTION__ "(): erasing block at address 0x"); SerialOutputHex((u32)whichOne); SerialOutputByte('\n'); #endif +#if defined SHANNON + *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); + *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); + *(u32 *)FLASH_ADDR1 = data_to_flash(ERASE_SETUP); + *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); + *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); + *writeMe = data_to_flash(ERASE_CONFIRM); + + /* I just can't find clean ways of dealing with this flash... + * The error bit is a *set* bit, so if its read, and bit 7 is 0, + * but bit 5 is 1, its an error, however, after these status reads + * are done, erased flash goes to 0xff...sooo...each chip has to + * be caught where the bits are the status bits */ + */ + chip1 = chip2 = 0; + do { + result = data_from_flash(*writeMe); + if (!chip1 && (result & 0xFFFF) & ERASE_DONE) chip1 = READY; + if (!chip1 && (result & 0xFFFF) & STATUS_PGM_ERR) chip1 = ERR; + if (!chip2 && (result >> 16) & ERASE_DONE) chip2 = READY; + if (!chip2 && (result >> 16) & STATUS_PGM_ERR) chip2 = ERR; + + } while(!chip1 || !chip2); + + *(u32 *)FLASH_ADDR1 = data_to_flash(READ_ARRAY); + + if (chip1 == ERR || chip2 == ERR) return 1; + return 0; +#else + *writeMe = data_to_flash(ERASE_SETUP); *writeMe = data_to_flash(ERASE_CONFIRM); @@ -271,8 +364,8 @@ *writeMe = data_to_flash(READ_ARRAY); return result; +#endif } /* EraseOne */ - Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.9 retrieving revision 1.1.1.1.2.10 diff -u -r1.1.1.1.2.9 -r1.1.1.1.2.10 --- main.c 2001/07/22 22:54:26 1.1.1.1.2.9 +++ main.c 2001/07/23 05:44:26 1.1.1.1.2.10 @@ -261,8 +261,7 @@ #elif defined PLEB theKernel(0, 20); #elif defined SHANNON -#warning "This is NOT the correct SHANNON architecture number!" - theKernel(0, 18); + theKernel(0, 97); #else /* Be generic and just tell the kernel that we are an SA1100 architecture */ |
From: Russ D. <ru...@us...> - 2001-07-23 05:44:29
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv15048/include Modified Files: Tag: blob_1_0_9_hack flash.h main.h Log Message: Initial AMD flash support (tuxscreen) Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/flash.h,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 --- flash.h 2001/07/23 00:28:23 1.1.1.1.2.4 +++ flash.h 2001/07/23 05:44:26 1.1.1.1.2.5 @@ -78,15 +78,15 @@ #define INITRD_LEN 0x280000 #define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE) #elif defined SHANNON -#define BLOB_START 0x00000 -#define BLOB_LEN 0x8000 -#define NUM_BLOB_BLOCKS (BLOB_LEN / MAIN_BLOCK_SIZE) -#define KERNEL_START 0x8000 -#define KERNEL_LEN 0xe0000 -#define NUM_KERNEL_BLOCKS (KERNEL_LEN / MAIN_BLOCK_SIZE) +#define BLOB_START (INT_FLASH_BASE) +#define NUM_BLOB_BLOCKS (1) +#define BLOB_LEN (NUM_BLOB_BLOCKS * MAIN_BLOCK_SIZE) +#define KERNEL_START (INT_FLASH_BASE + MAIN_BLOCK_SIZE) +#define NUM_KERNEL_BLOCKS (7) +#define KERNEL_LEN (NUM_KERNEL_BLOCKS * MAIN_BLOCK_SIZE) #define INITRD_START (KERNEL_START + KERNEL_LEN) -#define INITRD_LEN 0x200000 -#define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE) +#define NUM_INITRD_BLOCKS (24) +#define INITRD_LEN (NUM_INITRD_BLOCKS * MAIN_BLOCK_SIZE) #else #define BLOB_START (INT_FLASH_BASE) #define NUM_BLOB_BLOCKS (1) Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/main.h,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.h 2001/07/23 00:28:23 1.1.1.1.2.4 +++ main.h 2001/07/23 05:44:26 1.1.1.1.2.5 @@ -41,7 +41,7 @@ /* where does blob live when we download it */ #if defined SHANNON -#define BLOB_RAM_BASE (0xc8000000) +#define BLOB_RAM_BASE (0xc0100000) #else #define BLOB_RAM_BASE (0xc1000000) #endif @@ -59,7 +59,7 @@ #if defined ASSABET # define RAMDISK_RAM_BASE (0xC0800000) #elif defined SHANNON -# define RAMDISK_RAM_BASE (0xC0200000) +# define RAMDISK_RAM_BASE (0xC8000000) #else # define RAMDISK_RAM_BASE (0xC0400000) #endif |
From: Russ D. <ru...@us...> - 2001-07-23 00:28:26
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv17465/include Modified Files: Tag: blob_1_0_9_hack flash.h main.h Log Message: Fixes for tuxscreen memory layout Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/flash.h,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 --- flash.h 2001/07/18 23:49:41 1.1.1.1.2.3 +++ flash.h 2001/07/23 00:28:23 1.1.1.1.2.4 @@ -82,10 +82,10 @@ #define BLOB_LEN 0x8000 #define NUM_BLOB_BLOCKS (BLOB_LEN / MAIN_BLOCK_SIZE) #define KERNEL_START 0x8000 -#define KERNEL_LEN 0xf8000 +#define KERNEL_LEN 0xe0000 #define NUM_KERNEL_BLOCKS (KERNEL_LEN / MAIN_BLOCK_SIZE) #define INITRD_START (KERNEL_START + KERNEL_LEN) -#define INITRD_LEN 0x280000 +#define INITRD_LEN 0x200000 #define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE) #else #define BLOB_START (INT_FLASH_BASE) Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/main.h,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 --- main.h 2001/07/22 22:54:26 1.1.1.1.2.3 +++ main.h 2001/07/23 00:28:23 1.1.1.1.2.4 @@ -40,7 +40,11 @@ /* where does blob live when we download it */ -#define BLOB_RAM_BASE (0xC1000000) +#if defined SHANNON +#define BLOB_RAM_BASE (0xc8000000) +#else +#define BLOB_RAM_BASE (0xc1000000) +#endif #define BLOB_BLOCK_OFFSET (0x00000000) |
From: Russ D. <ru...@us...> - 2001-07-22 23:55:25
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv9849 Modified Files: Tag: blob_1_0_9_hack util.c Log Message: forgot a \r->\n Index: util.c =================================================================== RCS file: /cvsroot/blob/blob/src/util.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 --- util.c 2001/06/27 19:47:42 1.1.1.1 +++ util.c 2001/07/22 23:55:22 1.1.1.1.2.1 @@ -62,7 +62,7 @@ } #ifdef BLOB_DEBUG - SerialOutputString(" done\r"); + SerialOutputString(" done\n"); #endif } /* MyMemCpy */ |
From: Erik M. <er...@us...> - 2001-07-22 22:54:30
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv28848/include Modified Files: Tag: blob_1_0_9_hack Makefile.am main.h Added Files: Tag: blob_1_0_9_hack led.h memory.h sa1100.h Log Message: - added memory tester - switch off LED just before we jump to RAM and immediately swith it on again in main() so we can see if something went wrong - LED definitions are now in include/led.h - toggle LED at serial input - moved the #define __ASM_ARCH_HARDWARE_H hack to sa1100.h so we have that hack only in one file - minor documentation updates ***** Error reading new file: [Errno 2] No such file or directory: 'led.h' ***** Error reading new file: [Errno 2] No such file or directory: 'memory.h' ***** Error reading new file: [Errno 2] No such file or directory: 'sa1100.h' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/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:41 1.1.1.1 +++ Makefile.am 2001/07/22 22:54:26 1.1.1.1.2.1 @@ -15,8 +15,11 @@ clock.h \ command.h \ flash.h \ + led.h \ main.h \ + memory.h \ registers.h \ + sa1100.h \ serial.h \ time.h \ types.h \ Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/main.h,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- main.h 2001/07/18 23:49:41 1.1.1.1.2.2 +++ main.h 2001/07/22 22:54:26 1.1.1.1.2.3 @@ -34,19 +34,24 @@ #ifndef BLOB_MAIN_H #define BLOB_MAIN_H -/* were does blob live when we download it */ +/* memory start and end */ +#define MEMORY_START (0xc0000000) +#define MEMORY_END (0xe0000000) + + +/* where does blob live when we download it */ #define BLOB_RAM_BASE (0xC1000000) #define BLOB_BLOCK_OFFSET (0x00000000) -/* were does the kernel live in RAM */ +/* where does the kernel live in RAM */ #define KERNEL_RAM_BASE (0xC0008000) #define KERNEL_BLOCK_OFFSET (0x00008000) -/* were does the ramdisk live in RAM */ +/* where does the ramdisk live in RAM */ #if defined ASSABET # define RAMDISK_RAM_BASE (0xC0800000) #elif defined SHANNON |
From: Erik M. <er...@us...> - 2001-07-22 22:54:30
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv28848 Modified Files: Tag: blob_1_0_9_hack ChangeLog README Log Message: - added memory tester - switch off LED just before we jump to RAM and immediately swith it on again in main() so we can see if something went wrong - LED definitions are now in include/led.h - toggle LED at serial input - moved the #define __ASM_ARCH_HARDWARE_H hack to sa1100.h so we have that hack only in one file - minor documentation updates Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,v retrieving revision 1.1.1.1.2.5 retrieving revision 1.1.1.1.2.6 diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6 --- ChangeLog 2001/07/18 23:53:52 1.1.1.1.2.5 +++ ChangeLog 2001/07/22 22:54:26 1.1.1.1.2.6 @@ -12,6 +12,7 @@ - Resume from suspend Erik Mouw - New "reboot" command Erik Mouw - Download and flash blob without JTAG dongle Erik Mouw +- Memory tester Erik Mouw blob-1.0.8-pre2: - Assabet fixes Justin Seger Index: README =================================================================== RCS file: /cvsroot/blob/blob/README,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- README 2001/07/17 14:19:43 1.1.1.1.2.2 +++ README 2001/07/22 22:54:26 1.1.1.1.2.3 @@ -278,6 +278,7 @@ * download {kernel|ramdisk} Download kernel or ramdisk image to RAM * flash {kernel|ramdisk} Copy kernel or ramdisk from RAM to flash * help Get this help + * reboot Reboot system * reload {kernel|ramdisk} Reload kernel or ramdisk from flash to RAM * reset Reset terminal * speed Set download speed @@ -371,6 +372,12 @@ for the other architectures. +*** "reboot" +------------ + +This command simply reboots the system. + + *** "reload" ------------ @@ -532,13 +539,13 @@ ** Edit LED defines ------------------- -If your board has a LED on a GPIO pin, edit src/ledasm.S in an editor +If your board has a LED on a GPIO pin, edit include/led.h in an editor to switch it on early in the boot stage. Let's assume the foobar board has the LED on GPIO pin 1, so add the following lines just before the PLEB definition: #elif defined FOOBAR - LED: .long 0x00000002 + # define LED_GPIO 0x00000002 /* GPIO 1 */ ** Compile blob |
From: Erik M. <er...@us...> - 2001-07-22 22:54:30
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv28848/src Modified Files: Tag: blob_1_0_9_hack Makefile.am clock.c flash.c led.c ledasm.S main.c serial.c start.S time.c Added Files: Tag: blob_1_0_9_hack memory.c Log Message: - added memory tester - switch off LED just before we jump to RAM and immediately swith it on again in main() so we can see if something went wrong - LED definitions are now in include/led.h - toggle LED at serial input - moved the #define __ASM_ARCH_HARDWARE_H hack to sa1100.h so we have that hack only in one file - minor documentation updates ***** Error reading new file: [Errno 2] No such file or directory: 'memory.c' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- Makefile.am 2001/07/11 18:59:03 1.1.1.1.2.2 +++ Makefile.am 2001/07/22 22:54:26 1.1.1.1.2.3 @@ -48,16 +48,18 @@ blob_rest_elf32_SOURCES = \ trampoline.S \ - testmem2.S \ flashasm.S \ + testmem2.S \ + clock.c \ + command.c \ + flash.c \ + led.c \ main.c \ + memory.c \ serial.c \ - command.c \ - clock.c \ - util.c \ time.c \ - uucodec.c \ - flash.c + util.c \ + uucodec.c blob_rest_elf32_LDFLAGS += \ Index: clock.c =================================================================== RCS file: /cvsroot/blob/blob/src/clock.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 --- clock.c 2001/06/27 19:47:42 1.1.1.1 +++ clock.c 2001/07/22 22:54:26 1.1.1.1.2.1 @@ -36,12 +36,11 @@ #endif #include "types.h" -#include "util.h" +#include "sa1100.h" #include "serial.h" #include "time.h" +#include "util.h" -#define __ASM_ARCH_HARDWARE_H -#include <asm/arch-sa1100/SA-1100.h> /* It should be possible to improve this function */ /* Determine if the given character is a 0 to 9 or a to z, Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.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 --- flash.c 2001/07/20 18:39:03 1.1.1.1.2.4 +++ flash.c 2001/07/22 22:54:26 1.1.1.1.2.5 @@ -35,6 +35,7 @@ # include "config.h" #endif +#include "led.h" #include "main.h" #include "util.h" #include "serial.h" @@ -155,6 +156,7 @@ for(i = 0; i < numBlocks; i++, thisBlock += MAIN_BLOCK_SIZE) { SerialOutputByte('.'); + led_toggle(); if((EraseOne(thisBlock) & STATUS_ERASE_ERR) != 0) { SerialOutputString("\n*** Erase error at address 0x"); SerialOutputHex((u32)thisBlock); @@ -219,8 +221,10 @@ #endif for(i = 0; i < length; i+= 4, flashBase++, source++) { - if((i % MAIN_BLOCK_SIZE) == 0) + if((i % MAIN_BLOCK_SIZE) == 0) { SerialOutputByte('.'); + led_toggle(); + } *flashBase = data_to_flash(PGM_SETUP); *flashBase = *source; Index: led.c =================================================================== RCS file: /cvsroot/blob/blob/src/led.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 --- led.c 2001/06/27 19:47:42 1.1.1.1 +++ led.c 2001/07/22 22:54:26 1.1.1.1.2.1 @@ -8,72 +8,71 @@ * Modified by: Erik Mouw <J.A...@it...> * Modified at: Mon Aug 16 16:55:21 1999 *-----------------------------------------------------------------------*/ +/* + * led.c: simple LED control functions + * + * Copyright (C) 1999 2001 Erik Mouw (J.A...@it...) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* + * All functions assume that the LED is properly initialised by the code + * in ledasm.S. + * + */ #ident "$Id$" -/* function prototypes */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -void blink_led(void); +#include "led.h" +#include "sa1100.h" -static inline void init_gpio(void); -static inline void led_on(void); -static inline void led_off(void); -static inline void waitloop(void); -static inline void init_gpio(void) -{ - /* GPIO Pin Direction Register */ - register unsigned int *gpdr = (unsigned int *)0x90040004; - - /* bit 23 is the LED */ - *gpdr = 0x00800000; -} - - - +static int led_state; -static inline void led_on(void) -{ - register unsigned int *gpsr = (unsigned int *)0x90040008; - - *gpsr = 0x00800000; -} - -static inline void led_off(void) +void led_on(void) { - register unsigned int *gpcr = (unsigned int *)0x9004000c; - - *gpcr = 0x00800000; + GPSR = LED_GPIO; + led_state = 1; } -static inline void waitloop(void) +void led_off(void) { - __asm__ __volatile__ ( - " mov r4, #0x8000\n" - "0: subs r4, r4, #1\n" - " bne 0b\n"); + GPCR = LED_GPIO; + led_state = 0; } -void blink_led(void) +void led_toggle(void) { - init_gpio(); - - for(;;) - { - led_on(); - waitloop(); - led_off(); - waitloop(); - } + if(led_state) + led_off(); + else + led_on(); } Index: ledasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/ledasm.S,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- ledasm.S 2001/07/17 14:18:38 1.1.2.4 +++ ledasm.S 2001/07/22 22:54:26 1.1.2.5 @@ -32,31 +32,22 @@ # include <config.h> #endif +#define ASSEMBLY +#include "led.h" .text -#if defined ASSABET -LED: .long 0x00020000 /* GPIO 17 */ -#elif (defined CLART) || (defined LART) || (defined NESA) -LED: .long 0x00800000 /* GPIO 23 */ -#elif defined PLEB -LED: .long 0x00010000 /* GPIO 16 */ -#else -#warning "FIXME: Include code to turn on one of the LEDs on your board" -LED: .long 0x00000000 /* safe mode: no GPIO, so no LED */ -#endif - - - +LED: .long LED_GPIO GPIO_BASE: .long 0x90040000 #define GPDR 0x00000004 #define GPSR 0x00000008 #define GPCR 0x0000000c - - - + + + + .globl ledinit /* initialise LED GPIO and turn LED on. * clobbers r0 and r1 Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.8 retrieving revision 1.1.1.1.2.9 diff -u -r1.1.1.1.2.8 -r1.1.1.1.2.9 --- main.c 2001/07/20 18:39:03 1.1.1.1.2.8 +++ main.c 2001/07/22 22:54:26 1.1.1.1.2.9 @@ -12,8 +12,9 @@ /* * main.c: main file for the blob bootloader * - * Copyright (C) 1999 Jan-Derk Bakker (J.D...@it...) and - * Erik Mouw (J.A...@it...) + * Copyright (C) 1999 2000 2001 + * Jan-Derk Bakker (J.D...@it...) and + * Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,16 +41,15 @@ #include "clock.h" #include "command.h" #include "flash.h" +#include "led.h" +#include "main.h" +#include "memory.h" +#include "sa1100.h" #include "serial.h" #include "time.h" -#include "main.h" #include "util.h" #include "uucodec.h" -/* Tell SA-1100.h to shut up; we're including it anyway. Nyah nyah ;-) */ -#define __ASM_ARCH_HARDWARE_H -#include <asm/arch-sa1100/SA-1100.h> - typedef enum { @@ -106,6 +106,11 @@ blobStatus status; int i; int retval = 0; + + /* Turn the LED on again, so we can see that we safely made it + * into C code. + */ + led_on(); /* We really want to be able to communicate, so initialise the * serial port at 9k6 (which works good for terminals) @@ -127,6 +132,9 @@ SerialOutputString("under certain conditions; " "read the GNU GPL for details.\n\n"); + + /* get the amount of memory */ + get_memory_map(); /* initialise status */ status.kernelSize = 0; Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/serial.c,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- serial.c 2001/07/20 18:39:03 1.1.1.1.2.2 +++ serial.c 2001/07/22 22:54:26 1.1.1.1.2.3 @@ -11,7 +11,7 @@ /* * serial.c: Serial utilities for blob * - * Copyright (C) 1999 Erik Mouw (J.A...@it...) + * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,10 +35,8 @@ # include "config.h" #endif -/* Tell SA-1100.h to shut up; we're including it anyway. Nyah nyah ;-) */ -#define __ASM_ARCH_HARDWARE_H -#include <asm/arch-sa1100/SA-1100.h> - +#include "led.h" +#include "sa1100.h" #include "serial.h" #include "time.h" @@ -224,21 +222,17 @@ SerialOutputByte('#'); else if(err & UTSR1_ROR) SerialOutputByte('$'); -#if 0 - else - SerialOutputByte(*c); -#endif /* We currently only care about framing and parity errors */ if((err & (UTSR1_PRE | UTSR1_FRE)) != 0) { return SerialInputByte(c); - } - else + } else { + led_toggle(); return(1); - } - else { - /* no bit ready */ - return(0); + } + } else { + /* no bit ready */ + return(0); } } /* SerialInputByte */ Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.10 retrieving revision 1.1.1.1.2.11 diff -u -r1.1.1.1.2.10 -r1.1.1.1.2.11 --- start.S 2001/07/18 23:49:41 1.1.1.1.2.10 +++ start.S 2001/07/22 22:54:26 1.1.1.1.2.11 @@ -179,6 +179,12 @@ ble copy_loop + /* turn off the LED. if it stays off it is an indication that + * we didn't make it into the C code + */ + bl led_off + + /* set up the stack pointer */ ldr r0, MEM_START add r1, r0, #(1024 * 1024) Index: time.c =================================================================== RCS file: /cvsroot/blob/blob/src/time.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- time.c 2001/07/20 18:39:03 1.1.1.1.2.1 +++ time.c 2001/07/22 22:54:26 1.1.1.1.2.2 @@ -11,7 +11,7 @@ /* * timer.c: Timer functions for blob * - * Copyright (C) 1999 Erik Mouw (J.A...@it...) + * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,10 +35,8 @@ # include "config.h" #endif -/* Tell SA-1100.h to shut up; we're including it anyway. Nyah nyah ;-) */ -#define __ASM_ARCH_HARDWARE_H -#include <asm/arch-sa1100/SA-1100.h> - +#include "led.h" +#include "sa1100.h" #include "time.h" @@ -76,8 +74,16 @@ /* returns the time in 1/TICKS_PER_SECOND seconds */ u32 TimerGetTime(void) { + /* turn LED always on after one second so the user knows that + * the board is on + */ + if((OSCR % TICKS_PER_SECOND) < (TICKS_PER_SECOND >>7)) + led_on(); + return((u32) OSCR); } + + int TimerDetectOverflow(void) |
From: Erik M. <er...@us...> - 2001-07-20 18:39:06
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv23505/src Modified Files: Tag: blob_1_0_9_hack command.c flash.c main.c serial.c time.c uucodec.c Log Message: - Use OS counter for timeouts instead of Real Time Clock. Not completely clean yet, because we're not yet testing for overflows, but at least it fixes the 'doesn't time out after reboot' problem. - Comment out the uuencode uploading code. - Change \r into \n and change SerialOutputByte() to reflect the changes. It now looks more like real UNIX source :) Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/command.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 --- command.c 2001/06/27 19:47:42 1.1.1.1 +++ command.c 2001/07/20 18:39:03 1.1.1.1.2.1 @@ -65,6 +65,8 @@ int numRead; int maxRead = len - 1; + TimerClearOverflow(); + startTime = TimerGetTime(); for(numRead = 0, i = 0; numRead < maxRead;) { @@ -85,7 +87,7 @@ command[i++] = '\0'; /* print newline */ - SerialOutputByte('\r'); + SerialOutputByte('\n'); return(numRead); } else if(c == '\b') { /* FIXME: is this backspace? */ if(i > 0) { Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,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 --- flash.c 2001/07/18 23:53:52 1.1.1.1.2.3 +++ flash.c 2001/07/20 18:39:03 1.1.1.1.2.4 @@ -156,9 +156,9 @@ for(i = 0; i < numBlocks; i++, thisBlock += MAIN_BLOCK_SIZE) { SerialOutputByte('.'); if((EraseOne(thisBlock) & STATUS_ERASE_ERR) != 0) { - SerialOutputString("\r*** Erase error at address 0x"); + SerialOutputString("\n*** Erase error at address 0x"); SerialOutputHex((u32)thisBlock); - SerialOutputByte('\r'); + SerialOutputByte('\n'); return; } } @@ -176,7 +176,7 @@ if((u32)source & 0x03) { SerialOutputString("*** Source is not on a word boundary: 0x"); SerialOutputHex((u32)source); - SerialOutputByte('\r'); + SerialOutputByte('\n'); return; } @@ -215,7 +215,7 @@ SerialOutputHex((u32)source); SerialOutputString(" to 0x"); SerialOutputHex((u32)flashBase); - SerialOutputByte('\r'); + SerialOutputByte('\n'); #endif for(i = 0; i < length; i+= 4, flashBase++, source++) { @@ -233,9 +233,9 @@ *flashBase = data_to_flash(READ_ARRAY); if((result & STATUS_PGM_ERR) != 0 || *flashBase != *source) { - SerialOutputString("\r*** Write error at address 0x"); + SerialOutputString("\n*** Write error at address 0x"); SerialOutputHex((u32)flashBase); - SerialOutputByte('\r'); + SerialOutputByte('\n'); return; } } @@ -254,7 +254,7 @@ #ifdef BLOB_DEBUG SerialOutputString(__FUNCTION__ "(): erasing block at address 0x"); SerialOutputHex((u32)whichOne); - SerialOutputByte('\r'); + SerialOutputByte('\n'); #endif *writeMe = data_to_flash(ERASE_SETUP); Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.7 retrieving revision 1.1.1.1.2.8 diff -u -r1.1.1.1.2.7 -r1.1.1.1.2.8 --- main.c 2001/07/18 23:49:41 1.1.1.1.2.7 +++ main.c 2001/07/20 18:39:03 1.1.1.1.2.8 @@ -114,18 +114,18 @@ TimerInit(); /* Print the required GPL string */ - SerialOutputString("\rConsider yourself LARTed!\r\r"); - SerialOutputString(PACKAGE " version " VERSION "\r" + SerialOutputString("\nConsider yourself LARTed!\n\n"); + SerialOutputString(PACKAGE " version " VERSION "\n" "Copyright (C) 1999 2000 2001 " - "Jan-Derk Bakker and Erik Mouw\r" + "Jan-Derk Bakker and Erik Mouw\n" "Copyright (C) 2000 " - "Johan Pouwelse\r"); + "Johan Pouwelse\n"); SerialOutputString(PACKAGE " comes with ABSOLUTELY NO WARRANTY; " - "read the GNU GPL for details.\r"); + "read the GNU GPL for details.\n"); SerialOutputString("This is free software, and you are welcome " - "to redistribute it\r"); + "to redistribute it\n"); SerialOutputString("under certain conditions; " - "read the GNU GPL for details.\r\r"); + "read the GNU GPL for details.\n\n"); /* initialise status */ @@ -146,13 +146,13 @@ /* print some information */ SerialOutputString("Running from "); if(RunningFromInternal()) - SerialOutputString("internal flash\r"); + SerialOutputString("internal flash\n"); else - SerialOutputString("external flash\r"); + SerialOutputString("external flash\n"); SerialOutputString(", blockSize = 0x"); SerialOutputHex(blockSize); - SerialOutputByte('\r'); + SerialOutputByte('\n'); #endif /* wait 10 seconds before starting autoboot */ SerialOutputString("Autoboot in progress, press any key to stop "); @@ -171,15 +171,15 @@ BootKernel(commandline); } - SerialOutputString("\rAutoboot aborted\r"); - SerialOutputString("Type \"help\" to get a list of commands\r"); + SerialOutputString("\nAutoboot aborted\n"); + SerialOutputString("Type \"help\" to get a list of commands\n"); /* the command loop. endless, of course */ for(;;) { DisplayPrompt(NULL); - /* wait an hour to get a command */ - numRead = GetCommand(commandline, 128, 3600); + /* wait 10 minutes for a command */ + numRead = GetCommand(commandline, 128, 600); if(numRead > 0) { if(MyStrNCmp(commandline, "boot", 4) == 0) { @@ -206,7 +206,7 @@ } else { SerialOutputString("*** Unknown command: "); SerialOutputString(commandline); - SerialOutputByte('\r'); + SerialOutputByte('\n'); } } } @@ -225,12 +225,12 @@ #warning "FIXME: should set kernel commandline parameters -- Erik" #ifdef BLOB_DEBUG - SerialOutputString("\r*** Ignoring kernel parameters\r"); + SerialOutputString("\n*** Ignoring kernel parameters\n"); #endif /* we assume that the kernel is in place */ /* See linux/include/asm-arm/system.h for architecture numbers */ - SerialOutputString("\rStarting kernel ...\r\r"); + SerialOutputString("\nStarting kernel ...\n\n"); /* turn off I-cache */ asm ("mrc p15, 0, %0, c1, c0, 0": "=r" (i)); @@ -262,7 +262,7 @@ theKernel(0,18); #endif - SerialOutputString("Hey, the kernel returned! This should not happen.\r"); + SerialOutputString("Hey, the kernel returned! This should not happen.\n"); } @@ -295,27 +295,27 @@ } else { SerialOutputString("*** Don't know how to download \""); SerialOutputString(commandline); - SerialOutputString("\"\r"); + SerialOutputString("\"\n"); return; } SerialOutputString("Switching to "); PrintSerialSpeed(status->downloadSpeed); - SerialOutputString(" baud\r"); + SerialOutputString(" baud\n"); - SerialOutputString("You have 60 seconds to switch your terminal emulator to the same speed and\r"); - SerialOutputString("start downloading. After that " PACKAGE " will switch back to 9600 baud.\r"); + 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"); SerialInit(status->downloadSpeed); *numRead = UUDecode((char *)startAddress, bufLen); - SerialOutputString("\r(Please switch your terminal emulator back to 9600 baud)\r"); + SerialOutputString("\n(Please switch your terminal emulator back to 9600 baud)\n"); if(*numRead < 0) { /* something went wrong */ - SerialOutputString("*** Uudecode receive failed\r"); + SerialOutputString("*** Uudecode receive failed\n"); /* reload the correct memory */ Reload(commandline, status); @@ -327,7 +327,7 @@ SerialOutputDec(*numRead); SerialOutputString(" (0x"); SerialOutputHex(*numRead); - SerialOutputString(") bytes.\r"); + SerialOutputString(") bytes.\n"); SerialInit(baud9k6); @@ -348,7 +348,7 @@ numBytes = status->blobSize; if(status->blobType == fromFlash) { - SerialOutputString("*** No blob downloaded\r"); + SerialOutputString("*** No blob downloaded\n"); return; } @@ -359,7 +359,7 @@ numBytes = status->kernelSize; if(status->kernelType == fromFlash) { - SerialOutputString("*** No kernel downloaded\r"); + SerialOutputString("*** No kernel downloaded\n"); return; } @@ -370,7 +370,7 @@ numBytes = status->ramdiskSize; if(status->ramdiskType == fromFlash) { - SerialOutputString("*** No ramdisk downloaded\r"); + SerialOutputString("*** No ramdisk downloaded\n"); return; } @@ -378,14 +378,14 @@ } else { SerialOutputString("*** Don't know how to flash \""); SerialOutputString(commandline); - SerialOutputString("\"\r"); + SerialOutputString("\"\n"); return; } EraseBlocks(block); SerialOutputByte(' '); WriteBlocksFromMem(block, (u32 *)startAddress, numBytes); - SerialOutputString(" done\r"); + SerialOutputString(" done\n"); } @@ -393,20 +393,20 @@ void PrintHelp(void) { - SerialOutputString("Help for " PACKAGE " " VERSION ", the LART bootloader\r"); - SerialOutputString("The following commands are supported:\r"); - SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\r"); - SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\r"); - SerialOutputString(" Set the SA1100 core clock and DRAM timings\r"); - SerialOutputString(" (WARNING: dangerous command!)\r"); - SerialOutputString("* download {blob|kernel|ramdisk} Download kernel or ramdisk image to RAM\r"); - SerialOutputString("* flash {blob|kernel|ramdisk} Copy kernel or ramdisk from RAM to flash\r"); - SerialOutputString("* help Get this help\r"); - SerialOutputString("* reboot Reboot system\r"); - SerialOutputString("* reload {blob|kernel|ramdisk} Reload kernel or ramdisk from flash to RAM\r"); - SerialOutputString("* reset Reset terminal\r"); - SerialOutputString("* speed Set download speed\r"); - SerialOutputString("* status Display current status\r"); + 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 kernel or ramdisk image to RAM\n"); + SerialOutputString("* flash {blob|kernel|ramdisk} Copy kernel or ramdisk from RAM to flash\n"); + SerialOutputString("* help Get this help\n"); + SerialOutputString("* reboot Reboot system\n"); + SerialOutputString("* reload {blob|kernel|ramdisk} Reload kernel or ramdisk from flash to RAM\n"); + SerialOutputString("* reset Reset terminal\n"); + SerialOutputString("* speed Set download speed\n"); + SerialOutputString("* status Display current status\n"); } @@ -441,14 +441,14 @@ } else { SerialOutputString("*** Invalid download speed value \""); SerialOutputString(commandline); - SerialOutputString("\"\r*** Valid values are:\r"); - SerialOutputString("*** 1200, 9600, 19200, 38400, 57600, 115200,\r"); - SerialOutputString("*** 1k2, 9k6, 19k2, 38k4, 57k6, and 115k2\r"); + SerialOutputString("\"\n*** Valid values are:\n"); + SerialOutputString("*** 1200, 9600, 19200, 38400, 57600, 115200,\n"); + SerialOutputString("*** 1k2, 9k6, 19k2, 38k4, 57k6, and 115k2\n"); } SerialOutputString("Download speed set to "); PrintSerialSpeed(status->downloadSpeed); - SerialOutputString(" baud\r"); + SerialOutputString(" baud\n"); } @@ -456,8 +456,8 @@ void PrintStatus(blobStatus *status) { - SerialOutputString("Bootloader : " PACKAGE "\r"); - SerialOutputString("Version : " VERSION "\r"); + SerialOutputString("Bootloader : " PACKAGE "\n"); + SerialOutputString("Version : " VERSION "\n"); SerialOutputString("Running from : "); if(RunningFromInternal()) @@ -465,38 +465,38 @@ else SerialOutputString("external"); - SerialOutputString(" flash\rBlocksize : 0x"); + SerialOutputString(" flash\nBlocksize : 0x"); SerialOutputHex(status->blockSize); - SerialOutputString("\rDownload speed: "); + SerialOutputString("\nDownload speed: "); PrintSerialSpeed(status->downloadSpeed); - SerialOutputString(" baud\r"); + SerialOutputString(" baud\n"); SerialOutputString("Blob : "); if(status->blobType == fromFlash) { - SerialOutputString("from flash\r"); + SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(status->blobSize); - SerialOutputString(" bytes\r"); + SerialOutputString(" bytes\n"); } SerialOutputString("Kernel : "); if(status->kernelType == fromFlash) { - SerialOutputString("from flash\r"); + SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(status->kernelSize); - SerialOutputString(" bytes\r"); + SerialOutputString(" bytes\n"); } SerialOutputString("Ramdisk : "); if(status->ramdiskType == fromFlash) { - SerialOutputString("from flash\r"); + SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(status->ramdiskSize); - SerialOutputString(" bytes\r"); + SerialOutputString(" bytes\n"); } } @@ -510,7 +510,7 @@ SerialInit(baud9k6); SerialOutputString(" c"); for(i = 0; i < 100; i++) - SerialOutputByte('\r'); + SerialOutputByte('\n'); SerialOutputString("c"); } @@ -548,12 +548,12 @@ } else { SerialOutputString("*** Don't know how to reload \""); SerialOutputString(commandline); - SerialOutputString("\"\r"); + SerialOutputString("\"\n"); return; } MyMemCpy(src, dst, numWords); - SerialOutputString(" done\r"); + SerialOutputString(" done\n"); } @@ -597,6 +597,20 @@ void Reboot(void) { - SerialOutputString("Rebooting...\r\r"); + u32 startTime, currentTime; + + SerialOutputString("Rebooting...\n\n"); + + /* sleep for half a second */ + TimerClearOverflow(); + startTime = TimerGetTime(); + + do { + currentTime = TimerGetTime(); + if(TimerDetectOverflow()) + break; + } while((currentTime - startTime) < TICKS_PER_SECOND/2); + + RCSR = 0; RSRR = 1; } Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/serial.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- serial.c 2001/07/07 21:19:57 1.1.1.1.2.1 +++ serial.c 2001/07/20 18:39:03 1.1.1.1.2.2 @@ -93,10 +93,6 @@ */ void SerialOutputByte(const char c) { - /* If \r, also do \n */ - if(c == '\r') - SerialOutputByte('\n'); - #if defined USE_SERIAL1 /* wait for room in the tx FIFO */ while((Ser1UTSR0 & UTSR0_TFS) == 0) ; @@ -110,6 +106,10 @@ #else #error "Configuration error: No serial port used at all!" #endif + + /* If \n, also do \r */ + if(c == '\n') + SerialOutputByte('\r'); } Index: time.c =================================================================== RCS file: /cvsroot/blob/blob/src/time.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 --- time.c 2001/06/27 19:47:42 1.1.1.1 +++ time.c 2001/07/20 18:39:03 1.1.1.1.2.1 @@ -44,32 +44,53 @@ +static int numOverflows; + + + + void TimerInit(void) { - u32 old_rcnr = RCNR; + /* clear counter */ + OSCR = 0; - /* Force 32-kHz oscillator on */ - PCFR |= PCFR_FO; + /* we don't want to be interrupted */ + OIER = 0; - /* disable timer interrupts and clear the AL and HZ bits*/ - RTSR = (RTSR_AL | RTSR_HZ); + /* wait until OSCR > 0 */ + while(OSCR == 0) + ; - /* put the counter to 0 */ - /* strange enough, this doesn't seem to work -- Erik */ - /* RCNR = 0x0; */ + /* clear match register 0 */ + OSMR0 = 0; - /* RCNR writes may be delayed by a 32-kHz clock cycle */ - RCNR = 0x0; + /* clear match bit for OSMR0 */ + OSSR = OSSR_M0; - while (RCNR > old_rcnr) - ; + numOverflows = 0; } -/* returns the time in seconds */ +/* returns the time in 1/TICKS_PER_SECOND seconds */ u32 TimerGetTime(void) +{ + return((u32) OSCR); +} + + +int TimerDetectOverflow(void) +{ + return(OSSR & OSSR_M0); +} + + + +void TimerClearOverflow(void) { - return((u32) RCNR); + if(TimerDetectOverflow()) + numOverflows++; + + OSSR = OSSR_M0; } Index: uucodec.c =================================================================== RCS file: /cvsroot/blob/blob/src/uucodec.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 --- uucodec.c 2001/06/27 19:47:42 1.1.1.1 +++ uucodec.c 2001/07/20 18:39:03 1.1.1.1.2.1 @@ -48,7 +48,7 @@ #define TEST_MAX_RETRIES do { \ if(retries++ > MAX_RETRIES) { \ - SerialOutputString("\r*** Timeout exceeded. Aborting.\r"); \ + SerialOutputString("\n*** Timeout exceeded. Aborting.\n"); \ return -1; \ } \ } while(0) @@ -58,9 +58,9 @@ /* #define IS_DEC(c) (1) */ #define OUT_OF_RANGE do { \ - SerialOutputByte('\r'); \ + SerialOutputByte('\n'); \ SerialOutputString(buf); \ - SerialOutputString("\r*** Received character out of range. Aborting.\r"); \ + SerialOutputString("\n*** Received character out of range. Aborting.\n"); \ return -1; \ } while(0) @@ -94,7 +94,7 @@ /* for each input line */ for (;;) { if (SerialInputString(p = buf, sizeof(buf), 2) == 0) { - SerialOutputString("\r*** Short file. Aborting\r"); + SerialOutputString("\n*** Short file. Aborting\n"); return -1; } /* Status print to show where we are at right now */ @@ -145,15 +145,17 @@ } } } - SerialOutputByte('\r'); + SerialOutputByte('\n'); if (SerialInputString(p = buf, sizeof(buf), 2) == 0 || (MyStrNCmp(buf, "end", 3))) { - SerialOutputString("*** No \"end\" line. Aborting.\r"); + SerialOutputString("*** No \"end\" line. Aborting.\n"); return(-1); } return(bytesWritten); } /* UUDecode */ +/* we currently don't need to upload files, so disable UUEncode() */ +#if 0 /* ENC is the basic 1 character encoding function to make a char printing */ #define ENC(c) ((c) ? ((c) & 077) + ' ': '`') @@ -163,7 +165,7 @@ register char *p; char buf[80]; - SerialOutputString("begin 644 testme.jdb\r"); + SerialOutputString("begin 644 testme.jdb\n"); while (bufLen > 0) { n = (bufLen > 45) ? 45 : bufLen; MyMemCpyChar(buf, bufBase, n); @@ -185,11 +187,12 @@ ch = ENC(ch); SerialOutputByte(ch); } - SerialOutputByte('\r'); + SerialOutputByte('\n'); } ch = ENC('\0'); SerialOutputByte(ch); - SerialOutputByte('\r'); - SerialOutputString("end\r"); + SerialOutputByte('\n'); + SerialOutputString("end\n"); } /* UUEncode */ +#endif |
From: Erik M. <er...@us...> - 2001-07-20 18:39:06
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv23505/include Modified Files: Tag: blob_1_0_9_hack time.h Log Message: - Use OS counter for timeouts instead of Real Time Clock. Not completely clean yet, because we're not yet testing for overflows, but at least it fixes the 'doesn't time out after reboot' problem. - Comment out the uuencode uploading code. - Change \r into \n and change SerialOutputByte() to reflect the changes. It now looks more like real UNIX source :) Index: time.h =================================================================== RCS file: /cvsroot/blob/blob/include/time.h,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 --- time.h 2001/06/27 19:47:42 1.1.1.1 +++ time.h 2001/07/20 18:39:03 1.1.1.1.2.1 @@ -42,16 +42,19 @@ -#define TICKS_PER_SECOND 32768 +#define TICKS_PER_SECOND 3686400 - /* initialise timer */ void TimerInit(void); -/* returns the time in 1/32768 seconds */ +/* returns the time in 1/TICKS_PER_SECOND seconds */ u32 TimerGetTime(void); + +int TimerDetectOverflow(void); + +void TimerClearOverflow(void); |
From: Erik M. <er...@us...> - 2001-07-18 23:53:55
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv27342 Modified Files: Tag: blob_1_0_9_hack ChangeLog Log Message: - Forgot to save the ChangeLog :) - Get rid of compiler warnings Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,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 --- ChangeLog 2001/07/16 21:44:18 1.1.1.1.2.4 +++ ChangeLog 2001/07/18 23:53:52 1.1.1.1.2.5 @@ -1,5 +1,7 @@ (If somebody can show me how to update the ChangeLog from CVS, I'd be more than grateful -- Erik) + +$Id$ blob-1.0.9: - we moved to SourceForge! @@ -8,6 +10,8 @@ - NESA support Russ Dill - SHANNON (aka TuxScreen) support Tim Riker - Resume from suspend Erik Mouw +- New "reboot" command Erik Mouw +- Download and flash blob without JTAG dongle Erik Mouw blob-1.0.8-pre2: - Assabet fixes Justin Seger |
From: Erik M. <er...@us...> - 2001-07-18 23:53:55
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv27342/src Modified Files: Tag: blob_1_0_9_hack flash.c Log Message: - Forgot to save the ChangeLog :) - Get rid of compiler warnings Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- flash.c 2001/07/18 23:49:41 1.1.1.1.2.2 +++ flash.c 2001/07/18 23:53:52 1.1.1.1.2.3 @@ -147,6 +147,10 @@ thisBlock = (char *)INITRD_START; numBlocks = NUM_INITRD_BLOCKS; break; + + default: + /* this should not happen */ + return; } for(i = 0; i < numBlocks; i++, thisBlock += MAIN_BLOCK_SIZE) { @@ -195,6 +199,10 @@ flashBase = (u32 *)INITRD_START; maxLength = INITRD_LEN; break; + + default: + /* this should not happen */ + return; } if(length > maxLength) |
From: Erik M. <er...@us...> - 2001-07-18 23:49:45
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv26212/src Modified Files: Tag: blob_1_0_9_hack flash.c main.c start.S Log Message: - clean first MB of memory from start.S (this should help to get a .bss segment) - download, flash, and reload now know about the "blob" target so you can upgrade blob without a JTAG dongle - new command "reboot" to be able to reboot blob after a new version was flashed Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/flash.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- flash.c 2001/07/08 22:34:14 1.1.1.1.2.1 +++ flash.c 2001/07/18 23:49:41 1.1.1.1.2.2 @@ -132,12 +132,21 @@ char *thisBlock; int numBlocks, i; - if(which == blKernel) { + switch(which) { + case blBlob: + thisBlock = (char *)BLOB_START; + numBlocks = NUM_BLOB_BLOCKS; + break; + + case blKernel: thisBlock = (char *)KERNEL_START; numBlocks = NUM_KERNEL_BLOCKS; - } else { + break; + + case blRamdisk: thisBlock = (char *)INITRD_START; numBlocks = NUM_INITRD_BLOCKS; + break; } for(i = 0; i < numBlocks; i++, thisBlock += MAIN_BLOCK_SIZE) { @@ -170,14 +179,22 @@ if(length & 0x03) length += 0x04; length &= ~((u32) 0x03); - - if(type == blKernel) { + + switch(type) { + case blBlob: + flashBase = (u32 *)BLOB_START; + maxLength = BLOB_LEN; + break; + + case blKernel: flashBase = (u32 *)KERNEL_START; maxLength = KERNEL_LEN; - } - else { + break; + + case blRamdisk: flashBase = (u32 *)INITRD_START; maxLength = INITRD_LEN; + break; } if(length > maxLength) Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/main.c,v retrieving revision 1.1.1.1.2.6 retrieving revision 1.1.1.1.2.7 diff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7 --- main.c 2001/07/16 21:40:41 1.1.1.1.2.6 +++ main.c 2001/07/18 23:49:41 1.1.1.1.2.7 @@ -46,6 +46,9 @@ #include "util.h" #include "uucodec.h" +/* Tell SA-1100.h to shut up; we're including it anyway. Nyah nyah ;-) */ +#define __ASM_ARCH_HARDWARE_H +#include <asm/arch-sa1100/SA-1100.h> @@ -64,6 +67,9 @@ int ramdiskSize; blockSource ramdiskType; + int blobSize; + blockSource blobType; + u32 blockSize; eBauds downloadSpeed; @@ -81,6 +87,13 @@ void ResetTerminal(void); void Reload(char *commandline, blobStatus *status); void PrintSerialSpeed(eBauds speed); +void Reboot(void); + +/* Hmm, the compiler complains that the 'noreturn' function + * returns. Looks like a compiler bug, should test with gcc-3.0 to see + * if it got fixed -- Erik + */ +/* void Reboot(void) __attribute__ ((noreturn)) ; */ @@ -125,6 +138,7 @@ /* Load kernel and ramdisk from flash to RAM */ + Reload("blob", &status); Reload("kernel", &status); Reload("ramdisk", &status); @@ -178,6 +192,8 @@ Flash(commandline + 6, &status); } else if(MyStrNCmp(commandline, "help", 4) == 0) { PrintHelp(); + } else if(MyStrNCmp(commandline, "reboot", 6) == 0) { + Reboot(); } else if(MyStrNCmp(commandline, "reload ", 7) == 0) { Reload(commandline + 7, &status); } else if(MyStrNCmp(commandline, "reset", 5) == 0) { @@ -258,7 +274,13 @@ int bufLen; int *numRead = 0; - if(MyStrNCmp(commandline, "kernel", 6) == 0) { + if(MyStrNCmp(commandline, "blob", 4) == 0) { + /* download blob */ + startAddress = BLOB_RAM_BASE; + bufLen = status->blockSize - BLOB_BLOCK_OFFSET; + numRead = &status->blobSize; + status->blobType = fromDownload; + } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { /* download kernel */ startAddress = KERNEL_RAM_BASE; bufLen = status->blockSize - KERNEL_BLOCK_OFFSET; @@ -319,8 +341,19 @@ u32 startAddress = 0; tBlockType block; int numBytes = 0;; + + if(MyStrNCmp(commandline, "blob", 4) == 0) { + startAddress = BLOB_RAM_BASE; + block = blBlob; + numBytes = status->blobSize; - if(MyStrNCmp(commandline, "kernel", 6) == 0) { + if(status->blobType == fromFlash) { + SerialOutputString("*** No blob downloaded\r"); + return; + } + + SerialOutputString("Saving blob to flash "); + } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { startAddress = KERNEL_RAM_BASE; block = blKernel; numBytes = status->kernelSize; @@ -362,17 +395,18 @@ { SerialOutputString("Help for " PACKAGE " " VERSION ", the LART bootloader\r"); SerialOutputString("The following commands are supported:\r"); - SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\r"); + SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\r"); SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\r"); - SerialOutputString(" Set the SA1100 core clock and DRAM timings\r"); - SerialOutputString(" (WARNING: dangerous command!)\r"); - SerialOutputString("* download {kernel|ramdisk} Download kernel or ramdisk image to RAM\r"); - SerialOutputString("* flash {kernel|ramdisk} Copy kernel or ramdisk from RAM to flash\r"); - SerialOutputString("* help Get this help\r"); - SerialOutputString("* reload {kernel|ramdisk} Reload kernel or ramdisk from flash to RAM\r"); - SerialOutputString("* reset Reset terminal\r"); - SerialOutputString("* speed Set download speed\r"); - SerialOutputString("* status Display current status\r"); + SerialOutputString(" Set the SA1100 core clock and DRAM timings\r"); + SerialOutputString(" (WARNING: dangerous command!)\r"); + SerialOutputString("* download {blob|kernel|ramdisk} Download kernel or ramdisk image to RAM\r"); + SerialOutputString("* flash {blob|kernel|ramdisk} Copy kernel or ramdisk from RAM to flash\r"); + SerialOutputString("* help Get this help\r"); + SerialOutputString("* reboot Reboot system\r"); + SerialOutputString("* reload {blob|kernel|ramdisk} Reload kernel or ramdisk from flash to RAM\r"); + SerialOutputString("* reset Reset terminal\r"); + SerialOutputString("* speed Set download speed\r"); + SerialOutputString("* status Display current status\r"); } @@ -438,6 +472,15 @@ PrintSerialSpeed(status->downloadSpeed); SerialOutputString(" baud\r"); + SerialOutputString("Blob : "); + if(status->blobType == fromFlash) { + SerialOutputString("from flash\r"); + } else { + SerialOutputString("downloaded, "); + SerialOutputDec(status->blobSize); + SerialOutputString(" bytes\r"); + } + SerialOutputString("Kernel : "); if(status->kernelType == fromFlash) { SerialOutputString("from flash\r"); @@ -481,7 +524,14 @@ u32 *dst = 0; int numWords; - if(MyStrNCmp(commandline, "kernel", 6) == 0) { + if(MyStrNCmp(commandline, "blob", 4) == 0) { + src = (u32 *)BLOB_RAM_BASE; + dst = (u32 *)BLOB_START; + numWords = BLOB_LEN / 4; + status->blobSize = 0; + status->blobType = fromFlash; + SerialOutputString("Loading blob from flash "); + } else if(MyStrNCmp(commandline, "kernel", 6) == 0) { src = (u32 *)KERNEL_RAM_BASE; dst = (u32 *)KERNEL_START; numWords = KERNEL_LEN / 4; @@ -542,3 +592,11 @@ } } + + + +void Reboot(void) +{ + SerialOutputString("Rebooting...\r\r"); + RSRR = 1; +} Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.9 retrieving revision 1.1.1.1.2.10 diff -u -r1.1.1.1.2.9 -r1.1.1.1.2.10 --- start.S 2001/07/17 14:18:38 1.1.1.1.2.9 +++ start.S 2001/07/18 23:49:41 1.1.1.1.2.10 @@ -95,16 +95,19 @@ mov r1, #0x00 str r1, [r0, #ICMR] + /* switch CPU to correct speed */ ldr r0, PWR_BASE LDR r1, cpuspeed str r1, [r0, #PPCR] + /* setup memory */ bl memsetup /* init LED */ bl ledinit + /* check if this is a wake-up from sleep */ ldr r0, RST_BASE @@ -122,12 +125,14 @@ ldr r1, [r0, #PSPR] mov pc, r1 + normal_boot: /* enable I-cache */ mrc p15, 0, r1, c1, c0, 0 @ read control reg orr r1, r1, #0x1000 @ set Icache mcr p15, 0, r1, c1, c0, 0 @ write it back + /* check the first 1MB in increments of 4k */ mov r7, #0x1000 mov r6, r7, lsl #8 /* 4k << 2^8 = 1MB */ @@ -142,8 +147,27 @@ add r5, r5, r7 subs r6, r6, r7 bne mem_test_loop + - /* the first megabyte is OK, so let's copy ourself to it */ + /* the first megabyte is OK, so let's clear it */ + mov r0, #((1024 * 1024) / (8 * 4)) /* 1MB in steps of 32 bytes */ + ldr r1, MEM_START + mov r2, #0 + mov r3, #0 + mov r4, #0 + mov r5, #0 + mov r6, #0 + mov r7, #0 + mov r8, #0 + mov r9, #0 + +clear_loop: + stmia r1!, {r2-r9} + subs r0, r0, #(8 * 4) + bne clear_loop + + + /* relocate the second stage loader */ mov r0, #0x400 /* skip first 1024 bytes */ ldr r1, MEM_START mov r2, #(128 * 1024) /* blob is 128kB */ @@ -154,10 +178,12 @@ cmp r0, r2 ble copy_loop + /* set up the stack pointer */ ldr r0, MEM_START add r1, r0, #(1024 * 1024) sub sp, r1, #0x04 + /* blob is copied to ram, so jump to it */ mov pc, r0 |
From: Erik M. <er...@us...> - 2001-07-18 23:49:45
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv26212/include Modified Files: Tag: blob_1_0_9_hack flash.h main.h Log Message: - clean first MB of memory from start.S (this should help to get a .bss segment) - download, flash, and reload now know about the "blob" target so you can upgrade blob without a JTAG dongle - new command "reboot" to be able to reboot blob after a new version was flashed Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/flash.h,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 --- flash.h 2001/07/07 21:14:33 1.1.1.1.2.2 +++ flash.h 2001/07/18 23:49:41 1.1.1.1.2.3 @@ -47,7 +47,9 @@ #define BLOCK_IN_USE(x) (x.signature == BLOCK_HDR_SIG) typedef enum { - blRamdisk, blKernel + blBlob, + blKernel, + blRamdisk } tBlockType; static inline int RunningFromInternal(void) { @@ -66,6 +68,9 @@ #define INT_FLASH_BASE (RunningFromInternal() ? CS0_BASE : CS1_BASE) #ifdef ASSABET // Assabet settings come from linux/drivers/block/flash_mem.h +#define BLOB_START 0x00000 +#define BLOB_LEN 0x10000 +#define NUM_BLOB_BLOCKS (BLOB_LEN / MAIN_BLOCK_SIZE) #define KERNEL_START 0x10000 #define KERNEL_LEN 0xc0000 #define NUM_KERNEL_BLOCKS (KERNEL_LEN / MAIN_BLOCK_SIZE) @@ -73,6 +78,9 @@ #define INITRD_LEN 0x280000 #define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE) #elif defined SHANNON +#define BLOB_START 0x00000 +#define BLOB_LEN 0x8000 +#define NUM_BLOB_BLOCKS (BLOB_LEN / MAIN_BLOCK_SIZE) #define KERNEL_START 0x8000 #define KERNEL_LEN 0xf8000 #define NUM_KERNEL_BLOCKS (KERNEL_LEN / MAIN_BLOCK_SIZE) @@ -80,6 +88,9 @@ #define INITRD_LEN 0x280000 #define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE) #else +#define BLOB_START (INT_FLASH_BASE) +#define NUM_BLOB_BLOCKS (1) +#define BLOB_LEN (NUM_BLOB_BLOCKS * MAIN_BLOCK_SIZE) #define KERNEL_START (INT_FLASH_BASE + MAIN_BLOCK_SIZE) #define NUM_KERNEL_BLOCKS (7) #define KERNEL_LEN (NUM_KERNEL_BLOCKS * MAIN_BLOCK_SIZE) Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/main.h,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- main.h 2001/07/07 19:24:40 1.1.1.1.2.1 +++ main.h 2001/07/18 23:49:41 1.1.1.1.2.2 @@ -34,30 +34,33 @@ #ifndef BLOB_MAIN_H #define BLOB_MAIN_H +/* were does blob live when we download it */ +#define BLOB_RAM_BASE (0xC1000000) +#define BLOB_BLOCK_OFFSET (0x00000000) +/* were does the kernel live in RAM */ #define KERNEL_RAM_BASE (0xC0008000) -#ifdef ASSABET -#define RAMDISK_RAM_BASE (0xC0800000) -#else -#ifdef SHANNON -#define RAMDISK_RAM_BASE (0xC0200000) -#else -#define RAMDISK_RAM_BASE (0xC0400000) -#endif -#endif - #define KERNEL_BLOCK_OFFSET (0x00008000) -#ifdef ASSABET -#define RAMDISK_BLOCK_OFFSET (0x00800000) -#else -#ifdef SHANNON -#define RAMDISK_BLOCK_OFFSET (0x00200000) + +/* were does the ramdisk live in RAM */ +#if defined ASSABET +# define RAMDISK_RAM_BASE (0xC0800000) +#elif defined SHANNON +# define RAMDISK_RAM_BASE (0xC0200000) #else -#define RAMDISK_BLOCK_OFFSET (0x00400000) +# define RAMDISK_RAM_BASE (0xC0400000) #endif + +#if defined ASSABET +# define RAMDISK_BLOCK_OFFSET (0x00800000) +#elif defined SHANNON +# define RAMDISK_BLOCK_OFFSET (0x00200000) +#else +# define RAMDISK_BLOCK_OFFSET (0x00400000) #endif + #endif |
From: Erik M. <er...@us...> - 2001-07-17 14:19:46
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv12242 Modified Files: Tag: blob_1_0_9_hack README Log Message: - updated documentation - added a blob porting guide Index: README =================================================================== RCS file: /cvsroot/blob/blob/README,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- README 2001/07/07 19:24:39 1.1.1.1.2.1 +++ README 2001/07/17 14:19:43 1.1.1.1.2.2 @@ -18,20 +18,44 @@ other people also contributed to blob. Blob started its life as a boot loader for the LART, but nowadays it -has been ported to the Intel Assabet SA-1110 evaluation platform by -Jeff Sutherland and Chester, to the Intel Brutus SA-1100 evaluation -platform by Erik Mouw, and to the PLEB Linux board by Adam Wiggins. +has been ported to the Intel Assabet SA-1110 evaluation platform, the +Intel Brutus SA-1100 evaluation platform, the PLEB board, the Nesa +board, the TuxScreen (aka Shannon), and to the CreditLART board. +** Where is the latest blob source available? +--------------------------------------------- + +The latest and greatest blob source is available from SourceForge, see +http://www.sourceforge.net/projects/blob/ . The latest source is +available from anonymous CVS. First log in to the CVS server: + + cvs -d:pserver:ano...@cv...:/cvsroot/blob login + +There is no password, so just press enter. Now check out the blob source: + + cvs -z3 -d:pserver:ano...@cv...:/cvsroot/blob co blob + +If you're using the blob CVS source, it's a good idea to subscribe to +the blob-cvs-commit mailing list so you know about blob patches. See +http://lists.sourceforge.net/lists/listinfo/blob-cvs-commit . The +general blob discussion is done on the LART mailing list, see +http://www.lart.tudelft.nl/list/ for more information. + +Blob also has a home page: http://www.lart.tudelft.nl/lartware/blob/ . + + + + ** So what is LART? ------------------- LART is the Linux Advanced Radio Terminal, a small low power computing -element used in the MMC project and the Ubiquitous Communications -programme (see http://www.lart.tudelft.nl, http://www.mmc.tudelft.nl/ , -and http://www.ubicom.tudelft.nl/). +element used in the MMC project and the Ubiquitous Communications +programme (see http://www.lart.tudelft.nl, http://www.mmc.tudelft.nl, +and http://www.ubicom.tudelft.nl ). LART features: @@ -85,9 +109,9 @@ - Run "./configure --with-linux-prefix=/path/to/armlinux/source \ --with-board=boardname arm-lart-linux-gnu" - There are currently four valid board names, choose from: assabet, - brutus, lart, or pleb. If the board name is ommited, lart will be - choosen as a default. + There are currently a couple of valid board names, choose from: + assabet, brutus, creditlart, lart, nesa, pleb, or shannon. If the + board name is ommited, lart will be chosen as a default. If you want to do some serious hacking on blob, consider using the "--enable-maintainer-mode" flag. This will automatically regenerate @@ -102,12 +126,12 @@ - Run "./configure --with-board=boardname" - Run "make" - -The binary image is in src/blob, src/blob-elf32 is the image with -complete ELF headers. To disassemble "blob-elf32", use: +The binary image is in src/blob, src/blob-start-elf32 and +src/blob-rest-elf32 are the two parts of the images with complete ELF +headers. To disassemble "blob-start-elf32", use: - objdump --disassemble-all blob-elf32 + arm-linux-objdump -D -S blob-start-elf32 To see the actual hex codes of blob, use: @@ -121,12 +145,24 @@ *** LART -------- + +The current wisdom to install blob on a LART is: -Use whatever tool you need to download the blob image (src/blob) at -address 0x00000000 of your SA-1100 target. The LART project currently -uses the following wisdom to install blob: +- Connect the JTAG dongle to the LART +- Connect the other end of the JTAG dongle to the parallel port of + your PC +- Power up the LART +- Use the jflash utility (available from the LART web site) to write + blob (you usually need to be root for this): jflash blob +The JTAG flash burn code however is now worked out as a set of Linux +executables provided by the JTAG flash project located at the LART page +as well as JTAG executables ported to support the TuxScreen screen phone. + +The LART project initially used the following wisdom to install blob: + Required hardware & software: + - The LART itself with 4 Mbyte flash memory - An external 128 kbyte flash board - A PCI 7200 (???) digital I/O card with a Linux driver @@ -136,7 +172,7 @@ written into the flash memory using the flash burn program. The external flash board is connected to the LART low speed interface. The external flash chip is mapped at address 0x00000000, and the internal -flash is remapped at 0x08000000. As soon as the LART boots, the +flash is re-mapped at 0x08000000. As soon as the LART boots, the external flash is copied to the first 128 kbyte of the internal flash. The next time the LART is started without external flash board, it starts from its internal flash which now contains the just @@ -149,9 +185,6 @@ we say more?). To meet a deadline, we decided to make a special board with 128 kbyte external flash memory (and an LCD interface). -The JTAG flash burn code however is now worked out as a set of Linux -executables provided by the jtag flash project located at the LART page -as well as JTAG executables ported to support the TuxScreen screen phone. *** Assabet ----------- @@ -166,21 +199,9 @@ *** SHANNON (TuxScreen phone) ----------- - -Try these steps for use on a tuxscreen. Replace /usr/src/linux with the -location of your arm linux kernel sources that you will be running on the -tuxscreen: - -If you got the sources from CVS you will need to do: - -tools/rebuild-gcc && tools/rebuild-gcc - -(Yes, twice) Then do: - -CC=arm-linux-gcc ./configure --with-linux-prefix=/usr/src/linux \ - --enable-maintainer-mode --with-board=shannon arm-linux -make +The idea is to write the SHANNON flash via the jflash utility in much +the same way as you would do it on LART or Assabet. ** Making a distribution @@ -263,8 +284,6 @@ * status Display current status - - *** "boot" ---------- @@ -282,8 +301,6 @@ ... - - *** "clock" ----------- @@ -301,8 +318,6 @@ say that we didn't warn you! - - *** "download" -------------- @@ -342,8 +357,6 @@ command. - - *** "flash" ----------- @@ -352,14 +365,12 @@ with: blob> flash kernel - Saving kernel to flash ..... .................... done + Saving kernel to flash ..... .... done -Currently this command only works when blob is started from the -external flash board. +Currently this command only works for LART, we are working on support +for the other architectures. - - *** "reload" ------------ @@ -373,8 +384,6 @@ The "reload command" will overwrite a just downloaded a kernel or ramdisk. - - *** "reset" ----------- @@ -383,8 +392,6 @@ emulator back to 9600 baud after downloading a kernel or ramdisk. - - *** "speed" ----------- @@ -396,8 +403,6 @@ Download speed set to 19200 baud - - *** "status" ------------ @@ -414,3 +419,168 @@ Depending on what commands you used before, these values may or may not be different. + + + + +* Porting blob +============== + +Porting blob to a new SA11x0 platform is quite easy and consist of +four steps: + +1. Define the features of the architecture +2. Write some architecture specific code +3. Test the new architecture +4. Submit the patch + +The next couple of paragraphs describe the process of porting blob to +the "foobar" platform. + + +** Define the architecture in configure.in +------------------------------------------ + +First you need two know a couple of things: the name of the board, +what kind of CPU the board uses (SA1100 or SA1110), what kind of RAM +it uses (EDODRAM or SDRAM), and which serial port will be the console +(port 1 or 3). Let's assume the foobar platform has an SA1100 CPU, +uses EDODRAM, and serial port 1 as console. The correct lines for +configure.in will be: + + foobar) + AC_MSG_RESULT(foobar) + AC_DEFINE(FOOBAR) + AC_DEFINE(USE_SA1100) + AC_DEFINE(USE_EDODRAM) + AC_DEFINE(USE_SERIAL1) + ;; + +Put this just after the CreditLART definition. + + +** Define the architecture in acconfig.h +---------------------------------------- + +Because configure.in was instructed to define FOOBAR for the foobar +platform, we have to define the symbol in acconfig.h as well. Add the +following two lines to acconfig.h, just after the CLART define: + + /* Define for foobar boards */ + #undef FOOBAR + + +** Update the build system +-------------------------- + +Run the following commands to update the configure script, +include/config.h.in, and the Makefile.in files: + + tools/rebuild-gcc + tools/rebuild-gcc + +(yes, twice) + + +** Configure blob +----------------- + +Configure blob for the new foobar architecture: + + setenv CC arm-linux-gcc + ./configure --with-linux-prefix=/path/to/armlinux/source \ + --with-board=foobar --enable-maintainer-mode \ + --enable-blob-debug arm-unknown-linux-gnu + +We're using maintainer-mode and debug information to help the +port. See the section about "Configuring and compiling the package" +for general information. + + +** Select correct clock speed +----------------------------- + +Open src/start.S in an editor, and add a line to select the correct +clock speed (just before the SHANNON definition): + + #if defined FOOBAR + cpuspeed: .long 0x09 /* 190 MHz */ + + +** Edit memory settings +----------------------- + +Edit src/memsetup.c and add the correct memory setting for the foobar +architecture. Add these (example) settings right before the PLEB +definitions: + + #if defined FOOBAR + mdcas0: .long 0x1c71c01f + mdcas1: .long 0xff1c71c7 + mdcas2: .long 0xffffffff + mdcnfg: .long 0x0334b21f + #endif + +Note that the SA1110 memory settings are not as modular as the SA1100 +settings, so you'll have to use your imagination over there to get +proper memory settings. + +Right now, the basic blob functionality is ported to your board and +you should be able to compile blob by running "make". + + +** Edit LED defines +------------------- + +If your board has a LED on a GPIO pin, edit src/ledasm.S in an editor +to switch it on early in the boot stage. Let's assume the foobar board +has the LED on GPIO pin 1, so add the following lines just before the +PLEB definition: + + #elif defined FOOBAR + LED: .long 0x00000002 + + +** Compile blob +--------------- + +Now compile blob by running: + + make + +If everything went right, you have a new blob binary in src/blob. + + +** Test blob +------------ + +You are now ready to flash blob to your board and test it. If +something goes wrong in the early boot process, blob will flash the +LED (that's why you should always have a LED on your board), or not +work at all. As soon as you get character on the serial port the most +difficult part is done and you should be ready to port arm-linux to +your board. + + +** Submit the patch +------------------- + +First run "make distclean" in your blob tree so you'll get a clean +source tree. Now rename your current tree and untar the original blob +source (assuming that you're hacking on blob-2.0.3): + + cd .. + mv blob-2.0.3 blob-2.0.3-foobar + gzip -dc blob-2.0.3.tar.gz | tar xvf - + +Diff the two trees and create a patch file: + + diff -urN blob-2.0.3 blob-2.0.3-foobar > foobar.diff + +Now send the patch to me (er...@us...) and be sure to +CC a couple of other blob developers (for the current list of blob +developers, see +https://sourceforge.net/project/memberlist.php?group_id=30155 ). The +best way to send the patch is to attach it as plain text to your +message because in that way email clients have less chance to corrupt +the patch. |
From: Erik M. <er...@us...> - 2001-07-17 14:18:41
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv11810 Modified Files: Tag: blob_1_0_9_hack ledasm.S start.S Log Message: minor changes to make porting blob easier Index: ledasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/ledasm.S,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- ledasm.S 2001/07/16 23:19:40 1.1.2.3 +++ ledasm.S 2001/07/17 14:18:38 1.1.2.4 @@ -38,18 +38,14 @@ .text #if defined ASSABET -LED: .long 0x00200000 -#elif defined CLART -LED: .long 0x00800000 -#elif defined LART -LED: .long 0x00800000 -#elif defined NESA -LED: .long 0x00800000 +LED: .long 0x00020000 /* GPIO 17 */ +#elif (defined CLART) || (defined LART) || (defined NESA) +LED: .long 0x00800000 /* GPIO 23 */ #elif defined PLEB -LED: .long 0x00010000 +LED: .long 0x00010000 /* GPIO 16 */ #else -LED: .long 0x00000000 #warning "FIXME: Include code to turn on one of the LEDs on your board" +LED: .long 0x00000000 /* safe mode: no GPIO, so no LED */ #endif Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.8 retrieving revision 1.1.1.1.2.9 diff -u -r1.1.1.1.2.8 -r1.1.1.1.2.9 --- start.S 2001/07/16 23:21:56 1.1.1.1.2.8 +++ start.S 2001/07/17 14:18:38 1.1.1.1.2.9 @@ -75,10 +75,14 @@ /* The initial CPU speed. Note that the SA11x0 CPUs can be safely overclocked: * 190 MHz CPUs are able to run at 221 MHz, 133 MHz CPUs can do 206 Mhz. */ -#if defined SHANNON +#if (defined ASSABET) || (defined CLART) || (defined LART) \ + || (defined NESA) || (defined NESA) +cpuspeed: .long 0x0b /* 221 MHz */ +#elif defined SHANNON cpuspeed: .long 0xa0 /* 206 MHz */ #else -cpuspeed: .long 0x0b /* 221 MHz */ +#warning "FIXME: Include code to use the correct clock speed for your board" +cpuspeed: .long 0x05 /* safe 133 MHz speed */ #endif @@ -140,7 +144,7 @@ bne mem_test_loop /* the first megabyte is OK, so let's copy ourself to it */ - mov r0, #0x400 + mov r0, #0x400 /* skip first 1024 bytes */ ldr r1, MEM_START mov r2, #(128 * 1024) /* blob is 128kB */ @@ -150,14 +154,12 @@ cmp r0, r2 ble copy_loop - /* set up the stack pointer */ - ldr r1, MEM_START - add r1, r1, #(1024 * 1024) + ldr r0, MEM_START + add r1, r0, #(1024 * 1024) sub sp, r1, #0x04 /* blob is copied to ram, so jump to it */ - ldr r0, MEM_START mov pc, r0 |
From: Erik M. <er...@us...> - 2001-07-16 23:21:59
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv31406 Modified Files: Tag: blob_1_0_9_hack start.S Log Message: - remove old LED codein favour of led_on/led_off - rewrite blinky - first MB memory tester works Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.1.1.1.2.7 retrieving revision 1.1.1.1.2.8 diff -u -r1.1.1.1.2.7 -r1.1.1.1.2.8 --- start.S 2001/07/16 21:43:20 1.1.1.1.2.7 +++ start.S 2001/07/16 23:21:56 1.1.1.1.2.8 @@ -129,18 +129,16 @@ mov r6, r7, lsl #8 /* 4k << 2^8 = 1MB */ ldr r5, MEM_START -/*wook found that this loop never completes! */ -test_loop: -// mov r0, r5 -// bl testram -// tst r0, #1 -// beq badram - -// add r5, r5, r7 -// sub r6, r6, r7 -// bne test_loop +mem_test_loop: + mov r0, r5 + bl testram + teq r0, #1 + beq badram + + add r5, r5, r7 + subs r6, r6, r7 + bne mem_test_loop - /* the first megabyte is OK, so let's copy ourself to it */ mov r0, #0x400 ldr r1, MEM_START @@ -163,42 +161,34 @@ mov pc, r0 +badram: + b blinky + + + + blinky: /* This is test code to blink the LED very useful if nothing else works */ - mov r2, #0x90000000 - add r2, r2, #0x40000 - mov r1, #0x00800000 - -old_led_on: - /* turn on the LED by writing the GPSR (GPIO Pin output Set - Register) */ - str r1, [r2, #0x08] - mov r4, #0x10000 -loop1: - subs r4, r4, #1 - bne loop1 - -old_led_off: - /* turn off the LED by writing the GPCR (GPIO Pin output Clear - Register) */ - str r1, [r2, #0x0c] - - mov r4, #0x10000 -loop2: - subs r4, r4, #1 - bne loop2 - - /* and loop forever */ - b old_led_on - - -badram: - /* should do something useful over here */ - b badram - + bl led_on + bl wait_loop + bl led_off + bl wait_loop + b blinky + +wait_loop: + /* busy wait loop*/ + mov r2, #0x1000000 +wait_loop1: + subs r2, r2, #1 + bne wait_loop1 + mov pc, lr + + + + undefined_instruction: - b undefined_instruction + b blinky @@ -209,34 +199,34 @@ * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT * simply because blob is not angel. -- Erik */ - b software_interrupt + b blinky prefetch_abort: - b prefetch_abort + b blinky data_abort: - b data_abort + b blinky not_used: - b not_used + b blinky irq: - b irq + b blinky fiq: - b fiq + b blinky |
From: Erik M. <er...@us...> - 2001-07-16 23:20:27
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv31101 Modified Files: Tag: blob_1_0_9_hack testmem.S testmem2.S Log Message: fix the obvious "duh" bug (s/si/r4/) Index: testmem.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/testmem.S,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- testmem.S 2001/07/08 22:34:14 1.1.2.1 +++ testmem.S 2001/07/16 23:20:25 1.1.2.2 @@ -32,25 +32,25 @@ .text .globl testram - @ r0 = address to test - @ returns r0 = 0 - ram present, r0 = 1 - no ram + @ r0 = address to test + @ returns r0 = 0 - ram present, r0 = 1 - no ram @ clobbers r1 - r4 testram: - ldmia r0, {r1, r2} - mov r3, #0x55 @ write 0x55 to first word - mov ip, #0xaa @ 0xaa to second - stmia r0, {r3, ip} - ldmia r0, {r3, ip} @ read it back - teq r3, #0x55 @ do the values match + ldmia r0, {r1, r2} @ store current value in r1 and r2 + mov r3, #0x55 @ write 0x55 to first word + mov r4, #0xaa @ 0xaa to second + stmia r0, {r3, r4} + ldmia r0, {r3, r4} @ read it back + teq r3, #0x55 @ do the values match teqeq r4, #0xaa - bne bad @ oops, no - mov r3, #0xaa @ write 0xaa to first word - mov r4, #0x55 @ 0x55 to second - stmia r0, {r3, ip} - ldmia r0, {r3, ip} @ read it back - teq r3, #0xaa @ do the values match + bne bad @ oops, no + mov r3, #0xaa @ write 0xaa to first word + mov r4, #0x55 @ 0x55 to second + stmia r0, {r3, r4} + ldmia r0, {r3, r4} @ read it back + teq r3, #0xaa @ do the values match teqeq r4, #0x55 -bad: stmia r0, {r1, r2} @ in any case, restore old data - moveq r0, #0 @ ok - all values matched - movne r0, #1 @ no ram at this location +bad: stmia r0, {r1, r2} @ in any case, restore old data + moveq r0, #0 @ ok - all values matched + movne r0, #1 @ no ram at this location mov pc, lr Index: testmem2.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/testmem2.S,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- testmem2.S 2001/07/08 22:34:14 1.1.2.1 +++ testmem2.S 2001/07/16 23:20:25 1.1.2.2 @@ -31,26 +31,26 @@ .text .globl testram - @ r0 = address to test - @ returns r0 = 0 - ram present, r0 = 1 - no ram + @ r0 = address to test + @ returns r0 = 0 - ram present, r0 = 1 - no ram @ doesnt clobber r1 - r4 testram: stmdb sp!, {r1-r4, lr} ldmia r0, {r1, r2} - mov r3, #0x55 @ write 0x55 to first word - mov ip, #0xaa @ 0xaa to second - stmia r0, {r3, ip} - ldmia r0, {r3, ip} @ read it back - teq r3, #0x55 @ do the values match + mov r3, #0x55 @ write 0x55 to first word + mov r4, #0xaa @ 0xaa to second + stmia r0, {r3, r4} + ldmia r0, {r3, r4} @ read it back + teq r3, #0x55 @ do the values match teqeq r4, #0xaa - bne bad @ oops, no - mov r3, #0xaa @ write 0xaa to first word - mov r4, #0x55 @ 0x55 to second - stmia r0, {r3, ip} - ldmia r0, {r3, ip} @ read it back - teq r3, #0xaa @ do the values match + bne bad @ oops, no + mov r3, #0xaa @ write 0xaa to first word + mov r4, #0x55 @ 0x55 to second + stmia r0, {r3, r4} + ldmia r0, {r3, r4} @ read it back + teq r3, #0xaa @ do the values match teqeq r4, #0x55 -bad: stmia r0, {r1, r2} @ in any case, restore old data - moveq r0, #0 @ ok - all values matched - movne r0, #1 @ no ram at this location +bad: stmia r0, {r1, r2} @ in any case, restore old data + moveq r0, #0 @ ok - all values matched + movne r0, #1 @ no ram at this location ldmia sp!, {r1-r4, pc} |
From: Erik M. <er...@us...> - 2001-07-16 23:19:42
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv30887 Modified Files: Tag: blob_1_0_9_hack ledasm.S Log Message: - add functions to switch the LED on and off - minor cleanup Index: ledasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/ledasm.S,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- ledasm.S 2001/07/16 14:55:07 1.1.2.2 +++ ledasm.S 2001/07/16 23:19:40 1.1.2.3 @@ -18,6 +18,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +/* + * Documentation: + * [1] Intel Corporation, "Intel StrongARM SA-1100 Microprocessor + * Developer's Manual", April 1999 + * [2] Intel Corporation, "Intel StrongARM SA-1110 Microprocessor + * Advanced Developer's manual, December 1999 + */ .ident "$Id$" @@ -45,15 +52,44 @@ #warning "FIXME: Include code to turn on one of the LEDs on your board" #endif -GPIO_BASE: .long 0x90040000 + +GPIO_BASE: .long 0x90040000 +#define GPDR 0x00000004 +#define GPSR 0x00000008 +#define GPCR 0x0000000c .globl ledinit + /* initialise LED GPIO and turn LED on. + * clobbers r0 and r1 + */ ledinit: ldr r0, GPIO_BASE + ldr r1, LED + str r1, [r0, #GPDR] /* LED GPIO is output */ + str r1, [r0, #GPSR] /* turn LED on */ + mov pc, lr + + + + +.globl led_on + /* turn LED on. clobbers r0 and r1 */ +led_on: + ldr r0, GPIO_BASE + ldr r1, LED + str r1, [r0, #GPSR] + mov pc, lr + + + + +.globl led_off + /* turn LED off. clobbers r0 and r1 */ +led_off: + ldr r0, GPIO_BASE ldr r1, LED - str r1, [r0, #0x04] /* write GPDR (LED GPIO is output) */ - str r1, [r0, #0x08] /* write GPSR to turn LED on */ - mov pc,lr + str r1, [r0, #GPCR] + mov pc, lr |
From: Erik M. <er...@us...> - 2001-07-16 21:44:23
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv12776 Modified Files: Tag: blob_1_0_9_hack ChangeLog Log Message: ChangeLog layout like Alan Cox -ac linux series Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,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 --- ChangeLog 2001/07/08 22:34:14 1.1.1.1.2.3 +++ ChangeLog 2001/07/16 21:44:18 1.1.1.1.2.4 @@ -3,25 +3,31 @@ blob-1.0.9: - we moved to SourceForge! -- run from RAM +- run from RAM Erik Mouw & Wookey +- PLEB updates Adam Wiggins +- NESA support Russ Dill +- SHANNON (aka TuxScreen) support Tim Riker +- Resume from suspend Erik Mouw blob-1.0.8-pre2: -- Assabet fixes by Justin Seger -- RTC fix by Mark Huang +- Assabet fixes Justin Seger +- RTC fix Mark Huang blob-1.0.8-pre1: -- Assabet support by Jeff Sutherland and Chester -- Brutus support by Erik Mouw (without a Brutus) -- PLEB support by Erik Mouw +- Assabet support Jeff Sutherland & + Chester +- Brutus support (without a Brutus) Erik Mouw +- PLEB support Erik Mouw blob-1.07b: -- Boots with linux-2.3.99-pre8-rmk1-np1 +- Boots with linux-2.3.99-pre8-rmk1-np1 Erik Mouw blob-1.0.6: -- Clock scaling support by Johan Pouwelse +- Clock scaling support Johan Pouwelse blob-1.0.5: -- Fix flash write bug +- Fix flash write bug Erik Mouw blob-1.0.0: -- Initial release +- Initial release Jan-Derk Bakker & + Erik Mouw |