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. <J.A...@it...> - 2002-01-23 08:45:28
|
On Tue, Jan 22, 2002 at 06:44:36PM -0800, Christopher Hoover wrote: > On the BadgePAD platform, the code in CVS as of 1/17 works just fine. > The latest code on the trunk doesn't work as far as "reblob" is > concerned -- it just hangs. Perhaps the code works from a proper > reset, but just not via "reblob" -- I can't test that scenario right now > without risking turning my BadgePad into a paperweight as I don't have > access to my JTAG rig at this moment. Hmm. Just did a "cvs diff -D 'last week' -D 'today'" to see the differences. The major change that affects all platforms is the split up of the first stage loader in a machine dependent and a machine independent part, but that shouldn't bite you with reblob because we use blob-chain in that case. I tested the new first stage loader on LART and Assabet and it shouldn't break any platform because it is functionally the same (it only moves the code around). The other major change I can see is the parameter block stuff. Both LART and Assabet have PARAM_START not defined, so the ptag stuff doesn't get executed on those platforms. Could you comment out parse_ptag() in main() and see if that fixes your problem? Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Christopher H. <ch...@mu...> - 2002-01-23 02:44:40
|
Fyi- On the BadgePAD platform, the code in CVS as of 1/17 works just fine. The latest code on the trunk doesn't work as far as "reblob" is concerned -- it just hangs. Perhaps the code works from a proper reset, but just not via "reblob" -- I can't test that scenario right now without risking turning my BadgePad into a paperweight as I don't have access to my JTAG rig at this moment. Cheers, -ch |
From: Russ D. <ru...@us...> - 2002-01-21 23:31:27
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv16425/include/blob/arch Modified Files: nesa.h Log Message: small layout change Index: nesa.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/nesa.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- nesa.h 2002/01/21 19:46:44 1.4 +++ nesa.h 2002/01/21 23:31:25 1.5 @@ -61,9 +61,9 @@ #define PARAM_FLASH_LEN (2 * 32 * 1024) #define NESA_ERASE_BLOCK (2 * 64 * 1024) #define KERNEL_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) -#define KERNEL_FLASH_LEN (NESA_ERASE_BLOCK * 5) +#define KERNEL_FLASH_LEN (NESA_ERASE_BLOCK * 3) #define RAMDISK_FLASH_BASE (KERNEL_FLASH_BASE + KERNEL_FLASH_LEN) -#define RAMDISK_FLASH_LEN (NESA_ERASE_BLOCK * (32 - 6)) +#define RAMDISK_FLASH_LEN (NESA_ERASE_BLOCK * (32 - 4)) #define PARAM_START PARAM_FLASH_BASE #define PARAM_LEN PARAM_FLASH_LEN |
From: Russ D. <ru...@us...> - 2002-01-21 20:15:57
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv17775/utils/mkparamblock Modified Files: sample.config mkparamblock.c Log Message: added hwaddr to mkparamblock Index: sample.config =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/sample.config,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sample.config 2001/08/31 06:21:30 1.1 +++ sample.config 2002/01/21 20:15:54 1.2 @@ -4,4 +4,5 @@ bootdelay 1 # default is 10 cmdline console=ttySA0,9600 console=tty1 root=/dev/mtdblock2 init=/linuxrc baud 9600, 115k2 # these are the defaults +hwaddr eth0 00:11:22:33:44:55 Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- mkparamblock.c 2002/01/21 19:45:16 1.10 +++ mkparamblock.c 2002/01/21 20:15:54 1.11 @@ -64,7 +64,24 @@ return -1; } +int read_mac(char *token, char *mac) +{ + int i; + unsigned long retval; + char *endptr; + for (i = 0; i < 6; i++) { + retval = strtoul(token, &endptr, 16); + if (endptr == token) break; + if (retval < 0 || retval > 0xFF) break; + mac[i] = retval; + if (*endptr != ':' && i < 5) break; + token = endptr + 1; + } + if (i != 6) return -1; + return 0; +} + int tack_ramdisk(char *line, FILE *fp) { struct ptag tag; @@ -136,6 +153,25 @@ return 0; } +int tack_hwaddr(char *line, FILE *fp) +{ + char *token; + struct ptag tag; + tag.hdr.ptag = PTAG_HWADDR; + tag.hdr.size = ptag_size(ptag_hwaddr); + tag.hdr.conf = 0; + + token = strtok(line, "\t\n "); + if (!token) return -1; + strncpy(tag.u.hwaddr.name, token, 10); + tag.u.hwaddr.name[9] = '\0'; + token = strtok(NULL, "\t\n "); + if (!token) return -1; + if (read_mac(token, tag.u.hwaddr.hwaddr) < 0) return -1; + + fwrite(&tag, ptag_size(ptag_hwaddr), 4, fp); + return 0; +} void tack_core(FILE *fp) { @@ -149,7 +185,6 @@ fwrite(&tag, ptag_size(ptag_core), 4, fp); } - void tack_none(FILE *fp) { struct ptag tag; @@ -167,6 +202,7 @@ {"bootdelay", tack_bootdelay}, {"cmdline", tack_cmdline}, {"baud", tack_baud}, + {"hwaddr", tack_hwaddr}, }; |
From: Russ D. <ru...@us...> - 2002-01-21 19:46:47
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv18358/include/blob/arch Modified Files: nesa.h Log Message: nesa updates Index: nesa.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/nesa.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- nesa.h 2001/11/04 23:04:37 1.3 +++ nesa.h 2002/01/21 19:46:44 1.4 @@ -54,16 +54,19 @@ /* and where do they live in flash */ -#warning "Please check NESA default flash layout!" #define BLOB_FLASH_BASE (0x00000000) -#define BLOB_FLASH_LEN (64 * 1024) -#define PARAM_FLASH_BASE (BLOB_FLASH_BASE + BLOB_FLASH_LEN) -#define PARAM_FLASH_LEN (64 * 1024) +#define BLOB_FLASH_LEN (2 * 16 * 1024) +#define CONFIG_FLASH_LEN (2 * 2 * 8 * 1024) +#define PARAM_FLASH_BASE (BLOB_FLASH_BASE + BLOB_FLASH_LEN + CONFIG_FLASH_LEN) +#define PARAM_FLASH_LEN (2 * 32 * 1024) +#define NESA_ERASE_BLOCK (2 * 64 * 1024) #define KERNEL_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) -#define KERNEL_FLASH_LEN ((1024 - 128) * 1024) +#define KERNEL_FLASH_LEN (NESA_ERASE_BLOCK * 5) #define RAMDISK_FLASH_BASE (KERNEL_FLASH_BASE + KERNEL_FLASH_LEN) -#define RAMDISK_FLASH_LEN (4 * 1024 * 1024 - BLOB_FLASH_LEN - PARAM_FLASH_LEN - KERNEL_FLASH_LEN) +#define RAMDISK_FLASH_LEN (NESA_ERASE_BLOCK * (32 - 6)) +#define PARAM_START PARAM_FLASH_BASE +#define PARAM_LEN PARAM_FLASH_LEN /* the position of the kernel boot parameters */ #define BOOT_PARAMS (0xc0000100) |
From: Russ D. <ru...@us...> - 2002-01-21 19:46:46
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv18358/src/blob Modified Files: nesa.c Log Message: nesa updates Index: nesa.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/nesa.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- nesa.c 2002/01/03 16:07:18 1.5 +++ nesa.c 2002/01/21 19:46:44 1.6 @@ -33,13 +33,20 @@ /* flash descriptor for NESA flash */ -/* 2x AMD *whatever* flash (4MB) */ +/* 2x AMD Am29LV160DB flash (4MB) */ static flash_descriptor_t nesa_flash_descriptors[] = { -#warning "Please fix NESA flash descriptor" - { + { + size: 2 * 16 * 1024, + num: 1, + }, + { size: 2 * 8 * 1024, - num: 8, + num: 2, + }, + { + size: 2 * 32 * 1024, + num: 1, }, { size: 2 * 64 * 1024, |
From: Russ D. <ru...@us...> - 2002-01-21 19:45:19
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv17530/src/blob Modified Files: main.c param_block.c Log Message: simplified paramater block \(WARNING: breaks old param blocks\!\) Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- main.c 2002/01/15 02:57:44 1.26 +++ main.c 2002/01/21 19:45:17 1.27 @@ -78,7 +78,7 @@ int numRead = 0; char commandline[MAX_COMMANDLINE_LENGTH]; #ifdef PARAM_START - u32 conf; + u32 conf = 0; #endif /* call subsystems */ Index: param_block.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/param_block.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- param_block.c 2002/01/15 01:59:34 1.6 +++ param_block.c 2002/01/21 19:45:17 1.7 @@ -96,16 +96,6 @@ __ptagtable(PTAG_BAUD, parse_ptag_baud); -static int parse_ptag_gpio(const struct ptag *ptag) -{ - GPDR &= ~ptag->u.gpio.mask; - if ((GPSR & ptag->u.gpio.mask) == ptag->u.gpio.level) - return -1; - else return 0; -} - -__ptagtable(PTAG_GPIO, parse_ptag_gpio); - /* * Scan the tag table for this tag, and call its parse function. * The tag table is built by the linker from all the __ptagtable @@ -117,14 +107,8 @@ struct ptagtable *t; for (t = &__ptagtable_begin; t < &__ptagtable_end; t++) - if (ptag->hdr.ptag == t->ptag && - ((*conf & ptag->hdr.conf_mask) == ptag->hdr.conf)) { - if (t->parse(ptag) == -1) { - *conf |= ptag->hdr.fail_set_mask; - *conf &= ~ptag->hdr.fail_clear_mask; - } - break; - } + if (ptag->hdr.ptag == t->ptag && *conf == ptag->hdr.conf) + t->parse(ptag); return t < &__ptagtable_end; } |
From: Russ D. <ru...@us...> - 2002-01-21 19:45:19
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv17530/include/blob Modified Files: param_block.h Log Message: simplified paramater block \(WARNING: breaks old param blocks\!\) Index: param_block.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/param_block.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- param_block.h 2001/10/07 15:27:35 1.2 +++ param_block.h 2002/01/21 19:45:16 1.3 @@ -46,14 +46,8 @@ u32 size; u32 ptag; - /* the tag is proccessed if current_conf & conf_mask == conf */ - u32 conf_mask; + /* which config this tag belongs to */ u32 conf; - - /* if the tag fails, then current_conf |= fail_set_mask, and - * current_config &= ~fail_clear_mask */ - u32 fail_set_mask; - u32 fail_clear_mask; }; /* The list must start with an PTAG_CORE node */ @@ -78,7 +72,7 @@ #define PTAG_BOOTDELAY (PTAG_MAGIC | 3) struct ptag_bootdelay { - u32 delay; /* boot delay in seconds, 0 for none */ + u32 delay; /* boot delay in seconds, 0 to drop directly to blob */ }; @@ -115,15 +109,6 @@ }; -/* check a GPIO */ -#define PTAG_GPIO (PTAG_MAGIC | 8) - -struct ptag_gpio { - u32 mask; - u32 level; -}; - - struct ptag { struct ptag_header hdr; union { @@ -134,7 +119,6 @@ struct ptag_baud baud; struct ptag_splash splash; struct ptag_hwaddr hwaddr; - struct ptag_gpio gpio; } u; }; |
From: Russ D. <ru...@us...> - 2002-01-21 19:45:19
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv17530/utils/mkparamblock Modified Files: mkparamblock.c Log Message: simplified paramater block \(WARNING: breaks old param blocks\!\) Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mkparamblock.c 2002/01/15 01:59:34 1.9 +++ mkparamblock.c 2002/01/21 19:45:16 1.10 @@ -70,7 +70,6 @@ struct ptag tag; tag.hdr.ptag = PTAG_RAMDISK; tag.hdr.size = ptag_size(ptag_ramdisk); - tag.hdr.conf_mask = 0; tag.hdr.conf = 0; if ((tag.u.ramdisk.flags = read_yn(line)) == -1) return -1; @@ -85,7 +84,6 @@ struct ptag tag; tag.hdr.ptag = PTAG_BOOTDELAY; tag.hdr.size = ptag_size(ptag_bootdelay); - tag.hdr.conf_mask = 0; tag.hdr.conf = 0; if ((tag.u.bootdelay.delay = strtoul(line, 0, 0)) == ULONG_MAX) @@ -102,7 +100,6 @@ int zero = 0; tag.hdr.ptag = PTAG_CMDLINE; tag.hdr.size = (sizeof(tag.hdr) + strlen(line) + 1 + 4) >> 2; - tag.hdr.conf_mask = 0; tag.hdr.conf = 0; fwrite(&tag, sizeof(tag.hdr), 1, fp); @@ -118,11 +115,10 @@ char *arg; u32 terminal, download; fpos_t bookmark; + tag.hdr.conf = 0; tag.hdr.ptag = PTAG_BAUD; tag.hdr.size = ptag_size(ptag_baud); - tag.hdr.conf_mask = 0; - tag.hdr.conf = 0; if (!(arg = strtok(line, "\t =,"))) return -1; if ((terminal = convert_baud(arg)) < 0) return -1; @@ -146,7 +142,6 @@ struct ptag tag; tag.hdr.ptag = PTAG_CORE; tag.hdr.size = ptag_size(ptag_core); - tag.hdr.conf_mask = 0; tag.hdr.conf = 0; tag.u.core.terminal = baud_9600; @@ -160,7 +155,6 @@ struct ptag tag; tag.hdr.ptag = PTAG_NONE; tag.hdr.size = 0; - tag.hdr.conf_mask = 0; tag.hdr.conf = 0; fwrite(&tag, sizeof(tag.hdr), 1, fp); |
From: Erik M. <er...@us...> - 2002-01-21 13:13:37
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv13855/include/blob Modified Files: crc32.h Log Message: Careful profiling and some hand loop unrolling makes crc32() faster than the table implementation. Also added lots of comments. Index: crc32.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/crc32.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- crc32.h 2002/01/20 23:26:46 1.2 +++ crc32.h 2002/01/21 13:13:33 1.3 @@ -1,7 +1,8 @@ /* * crc32.h: calculate CRC32 * - * Copyright (C) 2002 Erik Mouw <J.A...@it...> + * Copyright (C) 2002 Erik Mouw <J.A...@it...> and + * Jan-Derk Bakker <J.D...@it...> * based on linux/drivers/net/am79c961a.c * Copyright (C) 1995-2001 Russell King <rm...@ar...> * |
From: Erik M. <er...@us...> - 2002-01-21 13:13:36
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv13855/src/lib Modified Files: crc32.c Log Message: Careful profiling and some hand loop unrolling makes crc32() faster than the table implementation. Also added lots of comments. Index: crc32.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/crc32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- crc32.c 2002/01/20 23:26:46 1.2 +++ crc32.c 2002/01/21 13:13:33 1.3 @@ -1,7 +1,8 @@ /* * crc32.c: calculate CRC32 * - * Copyright (C) 2002 Erik Mouw <J.A...@it...> + * Copyright (C) 2002 Erik Mouw <J.A...@it...> and + * Jan-Derk Bakker <J.D...@it...> * based on linux/drivers/net/am79c961a.c * Copyright (C) 1995-2001 Russell King <rm...@ar...> * @@ -22,15 +23,160 @@ * */ /* - * Note: this implementation doesn't use the usual lookup table - * implementation by Gary S. Brown. The lookup table is quite large - * (1kB) and it's quite slow because we run with d-cache enabled. The - * i-cache is enabled, so computing the crc will be a lot faster. And - * of course this implementation is a lot smaller :) - * + * There are many ways to calculate a CRC32. The most common is the + * table lookup variant by Gary S. Brown: + * + * const u32 crc32_table[256] = { + * 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + * 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + * 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + * 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + * 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + * 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + * 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + * 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + * 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + * 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + * 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + * 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + * 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + * 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + * 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + * 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + * 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + * 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + * 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + * 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + * 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + * 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + * 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + * 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + * 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + * 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + * 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + * 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + * 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + * 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + * 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + * 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + * 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + * 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + * 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + * 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + * 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + * 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + * 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + * 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + * 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + * 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + * 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + * 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + * 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + * 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + * 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + * 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + * 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + * 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + * 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + * 0x2d02ef8dL + * }; + * + * u32 crc32_tbl(u32 val, const void *ss, int len) + * { + * const unsigned char *s = ss; + * + * while (--len >= 0) + * val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8); + * + * return val; + * } + * + * The performance of this function on a StrongARM SA-1100 running at + * 221MHz with i-cache enabled and d-cache disabled is 1.29 s on a 3MB + * data block. The lookup table makes this function quite large (1068 + * bytes), which is not what we want in blob. + * + * To get the code size smaller, we can take advantage of the fact + * that we run with i-cache enabled and d-cache disabled and compute + * the CRC on the fly. This function is by Russell King: + * + * static inline u32 update_crc(u32 crc, u8 byte) + * { + * int i; + * u32 polynome = POLYNOME; + * + * for (i = 8; i != 0; i--) { + * byte ^= crc & 1; + * crc >>= 1; + * + * if (byte & 1) + * crc ^= polynome; + * + * byte >>= 1; + * } + * + * return crc; + * } + * + * u32 crc32(u32 val, const void *data, int len) + * { + * u32 crc = val; + * u8 *tmp = (u8 *)data; + * + * while(len--) + * crc = update_crc(crc, *tmp++); + * + * return crc; + * } + * + * The function is a lot smaller: only 84 bytes, but unfortunately it + * is three times as slow on our benchmark: 3.13 seconds. + * + * Jan-Derk Bakker suggested to rewrite update_crc() like this: + * + * static inline u32 update_crc(u32 crc, u8 byte) + * { + * int i; + * u32 polynome = POLYNOME; + * + * crc ^= byte; + * + * for (i = 8; i != 0; i--) { + * if(crc & 1) { + * crc >>= 1; + * crc ^= polynome; + * } + * else + * crc >>= 1; + * } + * + * return crc; + * } + * + * The compiler generates a very tight inner loop for this: + * + * c020354: tst r0, #1 ; 0x1 + * eorne r0, lr, r0, lsr #1 + * moveq r0, r0, lsr #1 + * subs r12, r12, #1 ; 0x1 + * bne c020354 + * + * Which really pays off: code size is 68 bytes and it scores 2.25 s + * on the benchmark. + * + * Unfortunately it is still slower than the table lookup variant, and + * some analysis shows that the for() loop is the culprit: the + * subtract costs 1 clock cycle, and the conditional branch another + * three, so we waste 32 cycles for each CRC byte in the loop. + * + * To get the code faster, we do loop unrolling by hand (like the + * function is right now). The code size almost doubles (124 bytes), + * but the speed almost halves: 1.23 s on the benchmark. Not a bad + * result at all: faster than the table implementation at only 12% of + * the size. + * */ - #ident "$Id$" #ifdef HAVE_CONFIG_H @@ -47,47 +193,47 @@ -static inline u32 update_crc(u32 crc, u8 byte) -{ - int i; - u32 polynome = POLYNOME; - /* the above might look stupid, but it is a cludge to get - * better code. with the -Os flag, the compiler moves the - * POLYNOME into the .rodata segment and reloads it on every - * run. this kinda defeats the purpose of doing CRC32 without - * a lookup table. by moving the polynome explicitly out of - * the loop, the compiler will allocate a register for it - * making the resulting code faster. -- Erik - */ - - for (i = 8; i != 0; i--) { - byte ^= crc & 1; - crc >>= 1; - - if (byte & 1) - crc ^= polynome; - - byte >>= 1; - } - - return crc; -} - - - - /* calculate CRC32 on len bytes pointed by data. the usual * initialisation is to put 0xffffffff in val, but by supplying a * previous CRC value into it it can be used to calculate the CRC on * streams of data */ -u32 crc32(u32 val, const void *data, int len) +u32 crc32(u32 crc, const void *data, int len) { - u32 crc = val; u8 *tmp = (u8 *)data; + u32 polynome = POLYNOME; + /* The above might look stupid, but it is a cludge to get + * better code. With the -Os flag, the compiler Moves the + * POLYNOME into the .rodata segment and reloads it on every + * run. This kinda defeats the purpose of doing CRC32 without + * a lookup table. By moving the polynome explicitly out of + * the loop, the compiler will allocate a register for it + * making the resulting code faster. JDB commented that the + * CSE module of GCC is broken, but it works perfectly well + * with -O2. It's just that memory size is more important than + * speed with -Os. -- Erik + */ - while(len--) - crc = update_crc(crc, *tmp++); +#define DO_CRC \ + if(crc & 1) { \ + crc >>= 1; \ + crc ^= polynome; \ + } else { \ + crc >>= 1; \ + } + + while(len--) { + crc ^= *tmp++; + + DO_CRC; + DO_CRC; + DO_CRC; + DO_CRC; + DO_CRC; + DO_CRC; + DO_CRC; + DO_CRC; + } return crc; } |
From: Erik M. <er...@us...> - 2002-01-20 23:26:49
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv3765/src/lib Modified Files: crc32.c Log Message: Put the copyright attributions the right way. Also add some comments and fix a typo. Index: crc32.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/crc32.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- crc32.c 2002/01/20 23:16:18 1.1 +++ crc32.c 2002/01/20 23:26:46 1.2 @@ -1,9 +1,9 @@ /* * crc32.c: calculate CRC32 * - * Copyright (C) 1995-2001 Russell King <rm...@ar...> - * based on linux/drivers/net/am79c961a.c * Copyright (C) 2002 Erik Mouw <J.A...@it...> + * based on linux/drivers/net/am79c961a.c + * Copyright (C) 1995-2001 Russell King <rm...@ar...> * * $Id$ * @@ -76,6 +76,11 @@ +/* calculate CRC32 on len bytes pointed by data. the usual + * initialisation is to put 0xffffffff in val, but by supplying a + * previous CRC value into it it can be used to calculate the CRC on + * streams of data + */ u32 crc32(u32 val, const void *data, int len) { u32 crc = val; |
From: Erik M. <er...@us...> - 2002-01-20 23:26:49
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv3765/include/blob Modified Files: crc32.h Log Message: Put the copyright attributions the right way. Also add some comments and fix a typo. Index: crc32.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/crc32.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- crc32.h 2002/01/20 23:16:18 1.1 +++ crc32.h 2002/01/20 23:26:46 1.2 @@ -1,5 +1,5 @@ /* - * crc32.c: calculate CRC32 + * crc32.h: calculate CRC32 * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * based on linux/drivers/net/am79c961a.c |
From: Erik M. <er...@us...> - 2002-01-20 23:16:21
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv335/src/lib Modified Files: Makefile.am Added Files: crc32.c Log Message: I've been playing with Russ' JFFS2 patch and had some problems with its CRC32 implementation (both size and performance). Luckily Russell King wrote a CRC32 implementation without the huge table, and after some tuning it is both small and fast (on ARM). --- NEW FILE: crc32.c --- /* * crc32.c: calculate CRC32 * * Copyright (C) 1995-2001 Russell King <rm...@ar...> * based on linux/drivers/net/am79c961a.c * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: crc32.c,v 1.1 2002/01/20 23:16:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 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 * */ /* * Note: this implementation doesn't use the usual lookup table * implementation by Gary S. Brown. The lookup table is quite large * (1kB) and it's quite slow because we run with d-cache enabled. The * i-cache is enabled, so computing the crc will be a lot faster. And * of course this implementation is a lot smaller :) * */ #ident "$Id: crc32.c,v 1.1 2002/01/20 23:16:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/types.h> #define POLYNOME (0xedb88320) static inline u32 update_crc(u32 crc, u8 byte) { int i; u32 polynome = POLYNOME; /* the above might look stupid, but it is a cludge to get * better code. with the -Os flag, the compiler moves the * POLYNOME into the .rodata segment and reloads it on every * run. this kinda defeats the purpose of doing CRC32 without * a lookup table. by moving the polynome explicitly out of * the loop, the compiler will allocate a register for it * making the resulting code faster. -- Erik */ for (i = 8; i != 0; i--) { byte ^= crc & 1; crc >>= 1; if (byte & 1) crc ^= polynome; byte >>= 1; } return crc; } u32 crc32(u32 val, const void *data, int len) { u32 crc = val; u8 *tmp = (u8 *)data; while(len--) crc = update_crc(crc, *tmp++); return crc; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 2002/01/06 18:59:40 1.9 +++ Makefile.am 2002/01/20 23:16:18 1.10 @@ -27,6 +27,7 @@ libblob_a_SOURCES = \ command.c \ + crc32.c \ error.c \ icache.c \ init.c \ |
From: Erik M. <er...@us...> - 2002-01-20 23:16:21
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv335/include/blob Modified Files: Makefile.am Added Files: crc32.h Log Message: I've been playing with Russ' JFFS2 patch and had some problems with its CRC32 implementation (both size and performance). Luckily Russell King wrote a CRC32 implementation without the huge table, and after some tuning it is both small and fast (on ARM). --- NEW FILE: crc32.h --- /* * crc32.c: calculate CRC32 * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * based on linux/drivers/net/am79c961a.c * Copyright (C) 1995-2001 Russell King <rm...@ar...> * * $Id: crc32.h,v 1.1 2002/01/20 23:16:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 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 * */ #ident "$Id: crc32.h,v 1.1 2002/01/20 23:16:18 erikm Exp $" #ifndef BLOB_CRC32_H #define BLOB_CRC32_H #include <blob/types.h> u32 crc32(u32 val, const void *data, int len); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 2002/01/06 18:59:40 1.13 +++ Makefile.am 2002/01/20 23:16:18 1.14 @@ -18,6 +18,7 @@ arch.h \ command.h \ command_hist.h \ + crc32.h \ errno.h \ error.h \ flash.h \ |
From: Tim R. <tim...@us...> - 2002-01-20 17:09:12
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv10667/src/blob Modified Files: idr.c Log Message: init later Index: idr.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/idr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- idr.c 2002/01/20 05:15:54 1.5 +++ idr.c 2002/01/20 17:09:08 1.6 @@ -92,7 +92,7 @@ PA_DWR |= GPIO_GPIO2; } -__initlist(sa1111_init, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(sa1111_init, INIT_LEVEL_OTHER_HARDWARE); static void init_idr_flash_driver(void) |
From: Erik M. <J.A...@it...> - 2002-01-20 13:31:08
|
On Sat, Jan 19, 2002 at 09:15:56PM -0800, Tim Riker wrote: > Update of /cvsroot/blob/blob/src/blob > In directory usw-pr-cvs1:/tmp/cvs-serv4728/src/blob > > Modified Files: > idr.c > Log Message: > init sa1111 and enable flash writes > > Index: idr.c > =================================================================== > RCS file: /cvsroot/blob/blob/src/blob/idr.c,v > retrieving revision 1.4 > retrieving revision 1.5 > diff -u -d -r1.4 -r1.5 > --- idr.c 2002/01/03 16:07:17 1.4 > +++ idr.c 2002/01/20 05:15:54 1.5 > @@ -28,6 +28,8 @@ > #include <blob/flash.h> > #include <blob/init.h> > #include <blob/serial.h> > +#include <blob/sa1100.h> > +#include <blob/sa1111.h> > > /* flash descriptor for IDR flash */ > /* 1x Intel 28F128J3A strataflash (16MB) */ > @@ -42,6 +44,56 @@ > /* NULL block */ > }, > }; > + > +static void sa1111_init() > +{ > + /* switch on clock for sa1111 */ > + GAFR |= GPIO_32_768kHz; > + GPDR |= GPIO_32_768kHz; > + TUCR = TUCR_3_6864MHz; > + > + /* Now, set up the PLL and RCLK in the SA-1111: */ > + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_OE_EN; > + msleep(100); > + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RCLKEN | SKCR_RDYEN | SKCR_OE_EN; > + > + SerialOutputString( "SA1111 ID: " ); > + SerialOutputHex( SBI_SKID ); > + SerialOutputString( "\n" ); You're running this function at INIT_LEVEL_INITIAL_HARDWARE, so there is no guarantee that the serial driver and the timer are already initialised at this point. Either run at INIT_LEVEL_OTHER_HARDWARE, or at INIT_LEVEL_INITIAL_HARDWARE + 1. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Tim R. <tim...@us...> - 2002-01-20 05:15:57
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv4728/src/blob Modified Files: idr.c Log Message: init sa1111 and enable flash writes Index: idr.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/idr.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- idr.c 2002/01/03 16:07:17 1.4 +++ idr.c 2002/01/20 05:15:54 1.5 @@ -28,6 +28,8 @@ #include <blob/flash.h> #include <blob/init.h> #include <blob/serial.h> +#include <blob/sa1100.h> +#include <blob/sa1111.h> /* flash descriptor for IDR flash */ /* 1x Intel 28F128J3A strataflash (16MB) */ @@ -42,6 +44,56 @@ /* NULL block */ }, }; + +static void sa1111_init() +{ + /* switch on clock for sa1111 */ + GAFR |= GPIO_32_768kHz; + GPDR |= GPIO_32_768kHz; + TUCR = TUCR_3_6864MHz; + + /* Now, set up the PLL and RCLK in the SA-1111: */ + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_OE_EN; + msleep(100); + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RCLKEN | SKCR_RDYEN | SKCR_OE_EN; + + SerialOutputString( "SA1111 ID: " ); + SerialOutputHex( SBI_SKID ); + SerialOutputString( "\n" ); + + /* + * SA-1111 Register Access Bus should now be available. Clocks for + * any other SA-1111 functional blocks must be enabled separately + * using the SKPCR. + */ + SKPCR |= SKPCR_DCLKEN | SKPCR_PWMCLKEN; + + /* + * If the system is going to use the SA-1111 DMA engines, set up + * the memory bus request/grant pins. Also configure the shared + * memory controller on the SA-1111 (SA-1111 Developer's Manual, + * section 3.2.3) and power up the DMA bus clock: + */ + GAFR |= (GPIO_MBGNT | GPIO_MBREQ); + GPDR |= GPIO_MBGNT; + GPDR &= ~GPIO_MBREQ; + TUCR |= TUCR_MR; + + SBI_SMCR = (SMCR_DTIM | SMCR_MBGE | + FInsrt(FExtr(MDCNFG, MDCNFG_SA1110_DRAC0), SMCR_DRAC) | + ((FExtr(MDCNFG, MDCNFG_SA1110_TDL0)==3) ? SMCR_CLAT : 0)); + + /* + * flash_enable on GPIO_A2 + * since we are planning jffs2, flash_enable should always be set. but + * there is no accounting for taste. Tim Riker <Ti...@Ri...> + */ + PA_DDR &= ~(GPIO_GPIO2); + PA_DWR |= GPIO_GPIO2; +} + +__initlist(sa1111_init, INIT_LEVEL_INITIAL_HARDWARE); + static void init_idr_flash_driver(void) { |
From: Tim R. <tim...@us...> - 2002-01-20 05:15:57
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv4728/include/blob/arch Modified Files: idr.h Log Message: init sa1111 and enable flash writes Index: idr.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/idr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- idr.h 2001/12/16 07:38:50 1.2 +++ idr.h 2002/01/20 05:15:53 1.3 @@ -33,6 +33,10 @@ /* GPIO for the LED */ #define LED_GPIO (0x00000000) /* safe mode: no GPIO, no LED */ +/* need gpio on sa1111 to do flash_enable */ +#define SA1111_BASE (0x40000000) +#define SA1111_VBASE (0x40000000) + /* the base address were BLOB is loaded by the first stage loader */ #define BLOB_ABS_BASE_ADDR (0xc0200400) |
From: Tim R. <tim...@us...> - 2002-01-20 04:56:23
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv1725/src/blob Modified Files: shannon.c Log Message: whitespace Index: shannon.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/shannon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- shannon.c 2002/01/03 16:07:18 1.6 +++ shannon.c 2002/01/20 04:56:20 1.7 @@ -29,9 +29,6 @@ #include <blob/init.h> #include <blob/serial.h> - - - /* flash descriptor for SHANNON flash */ /* 2x AMD *whatever* flash (4MB) */ static flash_descriptor_t shannon_flash_descriptors[] = @@ -49,9 +46,6 @@ }, }; - - - static void init_shannon_flash_driver(void) { flash_descriptors = shannon_flash_descriptors; @@ -59,9 +53,6 @@ } __initlist(init_shannon_flash_driver, INIT_LEVEL_DRIVER_SELECTION); - - - static void shannon_init_hardware(void) { |
From: Erik M. <er...@us...> - 2002-01-18 22:32:03
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv25602 Modified Files: start.S start-sa11x0.S Log Message: All machine specific initialisation is now done in start-sa11x0.S. This should make it easier to port blob to non-StrongARM architectures. Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start.S,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- start.S 2002/01/12 01:45:57 1.7 +++ start.S 2002/01/18 22:32:00 1.8 @@ -42,6 +42,7 @@ #include <blob/arch.h> + .text /* Jump vector table as in table 3.1 in [1] */ @@ -71,7 +72,7 @@ mov r0, r5 bl testram teq r0, #1 - beq badram + moveq pc, lr /* oops, something went wrong :( */ add r5, r5, r7 subs r6, r6, r7 @@ -97,89 +98,6 @@ 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 - - /* blob is copied to ram, so jump to it */ ldr r0, BLOB_START mov pc, r0 - - -badram: - mov r6, #2 - b endless_blink - - - -endless_blink: - bl wait - mov r0, r6 - bl led_blink - b endless_blink - -wait: - /* busy wait loop*/ - mov r5, #0x1000000 -wait0: - subs r5, r5, #1 - bne wait0 - mov pc, lr - - - - -undefined_instruction: - mov r6, #3 - b endless_blink - - - - -software_interrupt: - /* NOTE: This is NOT an error! If you think that blob should return - * from software interrupts, you're plain WRONG. The source of the - * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT - * simply because blob is not angel. -- Erik - */ - mov r6, #4 - b endless_blink - - - - - -prefetch_abort: - mov r6, #5 - b endless_blink - - - - -data_abort: - mov r6, #6 - b endless_blink - - - - -not_used: - /* we *should* never reach this */ - mov r6, #7 - b endless_blink - - - - -irq: - mov r6, #8 - b endless_blink - - - - -fiq: - mov r6, #9 - b endless_blink Index: start-sa11x0.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start-sa11x0.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- start-sa11x0.S 2002/01/12 01:45:57 1.1 +++ start-sa11x0.S 2002/01/18 22:32:00 1.2 @@ -94,7 +94,7 @@ ldr r1, [r0, #RCSR] and r1, r1, #0x0f teq r1, #0x08 - bne normal_boot /* no, continue booting */ + bne real_reset /* no, continue booting */ /* yes, a wake-up. clear RCSR by writing a 1 (see 9.6.2.1 from [1]) */ mov r1, #0x08 @@ -114,11 +114,111 @@ ldr r1, [r0, #PSPR] mov pc, r1 +real_reset: + /* 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 + /* everything is said and done over here, call normal_boot in * the generic startup code to continue the boot procedure */ bl normal_boot + /* oops, normal_boot returns, something went wrong. signal an + * error to the user */ + mov r6, #2 + b endless_blink + + + + +/* we could choose to handle all exceptions in a nice way, but the + * best is to treat them as errors because blob should not contain + * errors + */ + +/* Undefined instruction exception */ +.globl undefined_instruction +undefined_instruction: + mov r6, #3 + b endless_blink + + + + +/* SWI */ +.globl software_interrupt +software_interrupt: + /* NOTE: This is NOT an error! If you think that blob should return + * from software interrupts, you're plain WRONG. The source of the + * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT + * simply because blob is not angel. -- Erik + */ + mov r6, #4 + b endless_blink + + + + +/* prefetch exception. shouldn't happen though we usually run with + * i-cache enabled */ +.globl prefetch_abort +prefetch_abort: + mov r6, #5 + b endless_blink + + +/* data abort */ +.globl data_abort +data_abort: + mov r6, #6 + b endless_blink + + + + +/* we *should* never reach this */ +.globl not_used +not_used: + mov r6, #7 + b endless_blink + + + + +/* interrupt. we could handle this differently later if some kind of + * driver in blob wants to be interrupt driven. for the time being we + * treat it as an error. + */ +.globl irq +irq: + mov r6, #8 + b endless_blink + + +/* FIQ. same as IRQ */ +.globl fiq +fiq: + mov r6, #9 + b endless_blink + + + + +/* endless loop that blinks the LED. r6 contains the number of blinks */ +endless_blink: + bl wait + mov r0, r6 + bl led_blink + b endless_blink + +wait: + /* busy wait loop*/ + mov r5, #0x1000000 +wait0: + subs r5, r5, #1 + bne wait0 + mov pc, lr |
From: Erik M. <er...@us...> - 2002-01-16 23:19:31
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv1744 Modified Files: flash.c Log Message: Change print_flash_map() in such a way that its body actually doesn't get compiled when BLOB_DEBUG is not defined. Also move it up in the file so we don't get compile-time warnings about undefined functions. Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- flash.c 2002/01/15 22:52:11 1.12 +++ flash.c 2002/01/16 23:19:27 1.13 @@ -77,6 +77,43 @@ +/* debug function: just print out the flash map and if the blocks are + * locked or not + */ +static void print_flash_map(void) +{ +#ifdef BLOB_DEBUG + int i; + + SerialOutputString("Flash map:\n"); + for(i = 0; i < num_flash_blocks; i++) { + u32 start = flash_blocks[i].start; + + SerialOutputDec(i); + SerialOutputString(":\t0x"); + SerialOutputHex(flash_blocks[i].size); + SerialOutputString(" @ 0x"); + SerialOutputHex(start); + SerialOutputString(" ("); + SerialOutputDec(flash_blocks[i].size / 1024); + SerialOutputString(" kB),\t"); + + if(flash_blocks[i].lockable && + flash_driver->query_block_lock) { + if ((flash_driver->query_block_lock)((u32 *) start)) + SerialOutputString("locked\n"); + else + SerialOutputString("unlocked\n"); + } else { + SerialOutputString("not lockable\n"); + } + } +#endif +} + + + + /* initialise the flash blocks table */ static void init_flash(void) { @@ -142,9 +179,7 @@ i++; } -#ifdef BLOB_DEBUG print_flash_map(); -#endif } @@ -316,36 +351,6 @@ return 0; } - -static void print_flash_map(void) -{ - int i; - - SerialOutputString("Flash map:\n"); - for(i = 0; i < num_flash_blocks; i++) { - u32 start = flash_blocks[i].start; - - SerialOutputDec(i); - SerialOutputString(":\t0x"); - SerialOutputHex(flash_blocks[i].size); - SerialOutputString(" @ 0x"); - SerialOutputHex(start); - SerialOutputString(" ("); - SerialOutputDec(flash_blocks[i].size / 1024); - SerialOutputString(" kB),\t"); - - if(flash_blocks[i].lockable && - flash_driver->query_block_lock) { - if ((flash_driver->query_block_lock)((u32 *) start)) - SerialOutputString("locked"); - else - SerialOutputString("unlocked"); - } else { - SerialOutputString("not lockable"); - } - SerialOutputString("\n"); - } -} /* given an address, return the flash block index number (or negative * error number otherwise |
From: Christopher H. <ch...@us...> - 2002-01-16 20:51:05
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv20578/src/blob Modified Files: flash-commands.c Log Message: lose fl prefix from command names Index: flash-commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash-commands.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flash-commands.c 2002/01/15 22:52:11 1.1 +++ flash-commands.c 2002/01/16 20:51:02 1.2 @@ -71,7 +71,7 @@ -static int FlLock(int argc, char *argv[]) +static int Lock(int argc, char *argv[]) { int rv; u32 *addr, length; @@ -99,15 +99,15 @@ return 0; } -static char fllockhelp[] = "fllock {blob|param|kernel|ramdisk}\n" +static char lockhelp[] = "fllock {blob|param|kernel|ramdisk}\n" "Lock <argument> region of flash\n"; -__commandlist(FlLock, "fllock", fllockhelp); +__commandlist(Lock, "lock", lockhelp); -static int FlUnlock(int argc, char *argv[]) +static int Unlock(int argc, char *argv[]) { int rv; u32 *addr, length; @@ -135,14 +135,14 @@ return 0; } -static char flunlockhelp[] = "flunlock {blob|param|kernel|ramdisk}\n" +static char unlockhelp[] = "unlock {blob|param|kernel|ramdisk}\n" "Unlock <argument> region of flash\n"; -__commandlist(FlUnlock, "flunlock", flunlockhelp); +__commandlist(Unlock, "unlock", unlockhelp); -static int FlErase(int argc, char *argv[]) +static int Erase(int argc, char *argv[]) { int rv; u32 *addr, length; @@ -170,7 +170,7 @@ return 0; } -static char flerasehelp[] = "flerase {blob|param|kernel|ramdisk}\n" +static char erasehelp[] = "erase {blob|param|kernel|ramdisk}\n" "Erase <argument> region of flash\n"; -__commandlist(FlErase, "flerase", flerasehelp); +__commandlist(Erase, "erase", erasehelp); |
From: Christopher H. <ch...@us...> - 2002-01-15 22:52:14
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv25309/src/blob Modified Files: Makefile.am flash.c Added Files: flash-commands.c Log Message: flash lock, unlock, and erase commands --- NEW FILE: flash-commands.c --- /*------------------------------------------------------------------------- * Filename: flash-commands.c * Version: $Id: flash-commands.c,v 1.1 2002/01/15 22:52:11 choover Exp $ * Copyright: Copyright (C) 2002, Hewlett-Packard Company * Author: Christopher Hoover <ch...@hp...> * Description: Flash commands for blob * Created at: Tue Jan 15 02:27:30 UTC 2002 *-----------------------------------------------------------------------*/ /* * flash-commands.c: Flash commands for blob * * Copyright (C) 2002 Hewlett-Packard Company * * 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 * */ #ident "$Id: flash-commands.c,v 1.1 2002/01/15 22:52:11 choover Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> #include <blob/errno.h> #include <blob/error.h> #include <blob/util.h> #include <blob/serial.h> #include <blob/flash.h> #include <blob/command.h> static int parse_partition(char *s, u32 **addr, u32 *length) { /* this will eventually be replaced by some functionality in the partition manager */ if(strncmp(s, "blob", 5) == 0) { *addr = (u32 *)BLOB_FLASH_BASE; *length = BLOB_FLASH_LEN; #ifdef PARAM_START } else if(strncmp(s, "param", 6) == 0) { *addr = (u32 *)PARAM_FLASH_BASE; *length = PARAM_FLASH_LEN; #endif } else if(strncmp(s, "kernel", 7) == 0) { *addr = (u32 *)KERNEL_FLASH_BASE; *length = KERNEL_FLASH_LEN; } else if(strncmp(s, "ramdisk", 8) == 0) { *addr = (u32 *)RAMDISK_FLASH_BASE; *length = RAMDISK_FLASH_LEN; } else { return -EINVAL; } return 0; } static int FlLock(int argc, char *argv[]) { int rv; u32 *addr, length; if(argc != 2) return -ENOPARAMS; if (!flash_driver->unlock_block) { printerror(EINVAL, argv[1]); return 0; } rv = parse_partition(argv[1], &addr, &length); if (rv < 0) { printerror(rv, argv[1]); return 0; } rv = flash_lock_region(addr, length >> 2); if (rv < 0) { printerror(rv, argv[1]); return 0; } return 0; } static char fllockhelp[] = "fllock {blob|param|kernel|ramdisk}\n" "Lock <argument> region of flash\n"; __commandlist(FlLock, "fllock", fllockhelp); static int FlUnlock(int argc, char *argv[]) { int rv; u32 *addr, length; if(argc != 2) return -ENOPARAMS; if (!flash_driver->unlock_block) { printerror(EINVAL, argv[1]); return 0; } rv = parse_partition(argv[1], &addr, &length); if (rv < 0) { printerror(rv, argv[1]); return 0; } rv = flash_unlock_region(addr, length >> 2); if (rv < 0) { printerror(rv, argv[1]); return 0; } return 0; } static char flunlockhelp[] = "flunlock {blob|param|kernel|ramdisk}\n" "Unlock <argument> region of flash\n"; __commandlist(FlUnlock, "flunlock", flunlockhelp); static int FlErase(int argc, char *argv[]) { int rv; u32 *addr, length; if(argc != 2) return -ENOPARAMS; if (!flash_driver->unlock_block) { printerror(EINVAL, argv[1]); return 0; } rv = parse_partition(argv[1], &addr, &length); if (rv < 0) { printerror(rv, argv[1]); return 0; } rv = flash_erase_region(addr, length >> 2); if (rv < 0) { printerror(rv, argv[1]); return 0; } return 0; } static char flerasehelp[] = "flerase {blob|param|kernel|ramdisk}\n" "Erase <argument> region of flash\n"; __commandlist(FlErase, "flerase", flerasehelp); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile.am 2002/01/12 01:45:57 1.16 +++ Makefile.am 2002/01/15 22:52:11 1.17 @@ -126,6 +126,7 @@ bootldrpart.c \ commands.c \ flash.c \ + flash-commands.c \ initcalls.c \ linux.c \ main.c \ Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- flash.c 2002/01/03 16:07:17 1.11 +++ flash.c 2002/01/15 22:52:11 1.12 @@ -143,21 +143,7 @@ } #ifdef BLOB_DEBUG - SerialOutputString("Flash map:\n"); - for(i = 0; i < num_flash_blocks; i++) { - SerialOutputString(" 0x"); - SerialOutputHex(flash_blocks[i].size); - SerialOutputString(" @ 0x"); - SerialOutputHex(flash_blocks[i].start); - SerialOutputString(" ("); - SerialOutputDec(flash_blocks[i].size / 1024); - SerialOutputString(" kB), "); - - if(!flash_blocks[i].lockable) - SerialOutputString("not "); - - SerialOutputString("lockable\n"); - } + print_flash_map(); #endif } @@ -331,7 +317,35 @@ } +static void print_flash_map(void) +{ + int i; + + SerialOutputString("Flash map:\n"); + for(i = 0; i < num_flash_blocks; i++) { + u32 start = flash_blocks[i].start; + + SerialOutputDec(i); + SerialOutputString(":\t0x"); + SerialOutputHex(flash_blocks[i].size); + SerialOutputString(" @ 0x"); + SerialOutputHex(start); + SerialOutputString(" ("); + SerialOutputDec(flash_blocks[i].size / 1024); + SerialOutputString(" kB),\t"); + if(flash_blocks[i].lockable && + flash_driver->query_block_lock) { + if ((flash_driver->query_block_lock)((u32 *) start)) + SerialOutputString("locked"); + else + SerialOutputString("unlocked"); + } else { + SerialOutputString("not lockable"); + } + SerialOutputString("\n"); + } +} /* given an address, return the flash block index number (or negative * error number otherwise |
From: Christopher H. <ch...@mu...> - 2002-01-15 22:45:08
|
OK, I'll nuke that part. > -----Original Message----- > From: blo...@li... > [mailto:blo...@li...] On > Behalf Of Erik Mouw > Sent: Tuesday, January 15, 2002 2:40 PM > To: Christopher Hoover > Cc: blo...@li... > Subject: Re: flash commands > > > On Mon, Jan 14, 2002 at 07:30:55PM -0800, Christopher Hoover wrote: > > Any interest in the flash commands I wrote? I placed the > code into a > > separate file (see below) and hacked the commands to use > (u32 *start, > > u32 nwords) ranges as that seems to be the preferred > interface for the > > flash functions. If a different organization is preferred, let me > > know. > > > > [The code will have to changed a bit once the new partition > code goes > > in, but hopefully the changes will be isolated to a single > function, > > parse_partition.] > > Agreed. The only thing I don't like is the print_flash_map() > function. Printing the complete flash map is really only a > debug function, it isn't needed for normal use. > > > Erik > > -- > J.A.K. (Erik) Mouw, Information and Communication Theory > Group, Faculty of Information Technology and Systems, Delft > University of Technology, PO BOX 5031, 2600 GA Delft, The > Netherlands Phone: +31-15-2783635 > Fax: +31-15-2781843 Email: J.A...@it... > WWW: http://www-ict.its.tudelft.nl/~erik/ > > _______________________________________________ > blob-cvs-commit mailing list blo...@li... > https://lists.sourceforge.net/lists/listinfo/blob-cvs-commit > |