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: Russ D. <ru...@us...> - 2003-11-27 08:03:08
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1:/tmp/cvs-serv9521/include/blob Modified Files: Makefile.am flash.h Added Files: cfi.h Log Message: flesh out cfi probing, and only compile it in if requested by the arch file --- NEW FILE: cfi.h --- /*------------------------------------------------------------------------- * Filename: cfi.h * Version: $Id: cfi.h,v 1.1 2003/11/27 08:02:31 russd Exp $ * Copyright: Copyright (C) 1999, Jan-Derk Bakker * Author: Jan-Derk Bakker <J.D...@it...> * Description: CFI functions for the blob loader * Created at: Mon Aug 23 20:00:00 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sun Oct 3 21:35:12 1999 *-----------------------------------------------------------------------*/ /* * cfi.h: CFI functions for the blob bootloader * * Copyright (C) 1999 Jan-Derk Bakker (J.D...@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 * */ #ident "$Id: cfi.h,v 1.1 2003/11/27 08:02:31 russd Exp $" #ifndef BLOB_CFI_H #define BLOB_CFI_H #include <blob/types.h> /* exported functions */ int flash_query_descriptors_cfi16(u32 *flashAddr, flash_descriptor_t **out); int flash_query_descriptors_cfi32(u32 *flashAddr, flash_descriptor_t **out); /* CFI offsets ... useful to many flavors of flash */ #define CFI_MANUF_CODE 0x00 #define CFI_DEVICE_CODE 0x01 #define CFI_DEVICE_SIZE_LG2 0x27 #define CFI_ERASE_REGION_COUNT 0x2c #define CFI_ERASE_REGION_XBLKS(n) (0x2d + 4 * (n)) #define CFI_ERASE_REGION_XSIZE(n) (0x2f + 4 * (n)) #define CFI16_MANUF_CODE CFI_MANUF_CODE #define CFI16_DEVICE_CODE CFI_DEVICE_CODE #define CFI16_DEVICE_SIZE_LG2 CFI_DEVICE_SIZE_LG2 #define CFI16_ERASE_REGION_COUNT CFI_ERASE_REGION_COUNT #define CFI16_ERASE_REGION_XBLKS(n) CFI_ERASE_REGION_XBLKS(n) #define CFI16_ERASE_REGION_XSIZE(n) CFI_ERASE_REGION_XSIZE(n) #define CFI32_MANUF_CODE (CFI_MANUF_CODE << 1) #define CFI32_DEVICE_CODE (CFI_DEVICE_CODE << 1) #define CFI32_DEVICE_SIZE_LG2 (CFI_DEVICE_SIZE_LG2 << 1) #define CFI32_ERASE_REGION_COUNT (CFI_ERASE_REGION_COUNT << 1) #define CFI32_ERASE_REGION_XBLKS(n) (CFI_ERASE_REGION_XBLKS(n) << 1) #define CFI32_ERASE_REGION_XSIZE(n) (CFI_ERASE_REGION_XSIZE(n) << 1) #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Makefile.am 4 Sep 2003 17:46:59 -0000 1.21 +++ Makefile.am 27 Nov 2003 08:02:31 -0000 1.22 @@ -18,6 +18,7 @@ noinst_HEADERS = \ arch.h \ cf.h \ + cfi.h \ command.h \ command_hist.h \ compr_rubin.h \ Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- flash.h 3 Sep 2003 01:44:27 -0000 1.14 +++ flash.h 27 Nov 2003 08:02:31 -0000 1.15 @@ -82,12 +82,21 @@ /* should be filled out by the architecture dependent files */ extern flash_driver_t *flash_driver; -/* should be filled out by the architecture dependent files; can - * be set to QUERY_FLASH_FOR_DESCRIPTORS() if driver supports that */ -#define QUERY_FLASH_FOR_DESCRIPTORS(flash_addr) \ - { { .size = (u32) flash_addr, .num = -1 } } +/* Two methods of getting flash descriptors: */ + +/* Method 1: Define the below struct in your achitecture + * file. This is the most compact way of doing it */ extern const flash_descriptor_t *flash_descriptors; +/* Method 2: Set flash_driver->query_descriptors to the + * proper cfi function. This will construct the table on + * the fly and will adapt to differnt flash configurations. + * However, this method will pull in another 600 or 700 + * bytes. */ + +/* architecture dependent files should set this if the flash + * memory does not reside at 0x0 */ +extern u32 flash_base; /* flash data mangle functions */ u32 data_from_flash(u32 what); @@ -105,13 +114,5 @@ int flash_get_next_block_address(u32* addr, u32 current); int flash_get_block_size(u32 address); u32 flash_get_size( void ); - -/* CFI offsets ... useful to many flavors of flash */ -#define CFI_MANUF_CODE 0x00 -#define CFI_DEVICE_CODE 0x01 -#define CFI_DEVICE_SIZE_LG2 0x27 -#define CFI_ERASE_REGION_COUNT 0x2c -#define CFI_ERASE_REGION_XBLKS(n) (0x2d + 4 * (n)) -#define CFI_ERASE_REGION_XSIZE(n) (0x2f + 4 * (n)) #endif |
From: Russ D. <ru...@us...> - 2003-11-27 08:03:05
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9521/src/lib Modified Files: Makefile.am Added Files: cfi16.c cfi32.c Log Message: flesh out cfi probing, and only compile it in if requested by the arch file --- NEW FILE: cfi16.c --- /* * cfi16: CFI functions for 16 bit flash * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * Copyright (C) 1999 Jan-Derk Bakker (J.D...@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 * */ #ident "$Id: cfi16.c,v 1.1 2003/11/27 08:02:30 russd Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/flash.h> #include <blob/util.h> #include <blob/debug.h> #include <blob/cfi.h> /* flash commands for a single 16 bit cfi flash chip */ #define READ_ARRAY 0x000000FF #define READ_QUERY 0x00000098 /* automatic descriptor support */ #define MAX_AUTO_DESCRIPTORS 4 static flash_descriptor_t auto_descriptors[MAX_AUTO_DESCRIPTORS + 1]; int flash_query_descriptors_cfi16(u32 *flashAddr, flash_descriptor_t **out) { u16 *addr = (u16 *) flashAddr; int result, nregions, n; addr[0x55] = READ_QUERY; barrier(); if (addr[0x10] != 'Q' && addr[0x11] != 'R' && addr[0x12] != 'Y') { result = -EINVAL; goto out; } dprintf("cfi16: manuf_code = %02X\n", addr[CFI16_MANUF_CODE]); dprintf("cfi16: device code = %02X\n", addr[CFI16_DEVICE_CODE]); dprintf("cfi16: device size = 2^%d bytes\n", addr[CFI16_DEVICE_SIZE_LG2]); nregions = addr[CFI16_ERASE_REGION_COUNT]; #define READ_U16LE(off) ((addr[(off)]) | (addr[(off) + 1]<<8)) for (n = 0; n < nregions && n < MAX_AUTO_DESCRIPTORS; n++) { u32 xcount = READ_U16LE(CFI16_ERASE_REGION_XBLKS(n)); u32 count = xcount + 1; u32 xsize = READ_U16LE(CFI16_ERASE_REGION_XSIZE(n)); u32 size = (xsize == 0) ? 128 : xsize * 256; dprintf("cfi16: erase region #%d\n", n); dprintf("cfi16: count = %d\n", count); dprintf("cfi16: size = %d\n", size); auto_descriptors[n].size = size; auto_descriptors[n].num = count; auto_descriptors[n].lockable = 1; /* fix me */ } #undef READ_U16LE auto_descriptors[n].size = 0; auto_descriptors[n].num = 0; *out = auto_descriptors; result = 0; out: /* put flash back into Read Array mode */ barrier(); *addr = READ_ARRAY; barrier(); return result; } --- NEW FILE: cfi32.c --- /* * cfi32: CFI functions for 32 bit flash * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * Copyright (C) 1999 Jan-Derk Bakker (J.D...@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 * */ #ident "$Id: cfi32.c,v 1.1 2003/11/27 08:02:31 russd Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/flash.h> #include <blob/util.h> #include <blob/debug.h> #include <blob/cfi.h> /* flash commands for two interleaved 16 bit flash chips */ #define READ_ARRAY 0x00FF00FF #define READ_QUERY 0x00980098 /* automatic descriptor support */ #define MAX_AUTO_DESCRIPTORS 4 static flash_descriptor_t auto_descriptors[MAX_AUTO_DESCRIPTORS + 1]; int flash_query_descriptors_cfi32(u32 *addr, flash_descriptor_t **out) { int result, nregions, n; addr[0x55] = READ_QUERY; barrier(); if (addr[0x10] != ('Q' | ('Q' << 16)) && addr[0x11] != ('R' | ('R' << 16)) && addr[0x12] != ('Y' | ('Y' << 16))) { result = -EINVAL; goto out; } dprintf("cfi32: manuf_code = %02X\n", addr[CFI32_MANUF_CODE] & 0xff); dprintf("cfi32: device code = %02X\n", addr[CFI32_DEVICE_CODE] & 0xff); dprintf("cfi32: device size = 2^%d bytes\n", addr[CFI32_DEVICE_SIZE_LG2] & 0xff); dprintf("cfi32: manuf_code = %02X\n", addr[CFI32_MANUF_CODE] >> 16); dprintf("cfi32: device code = %02X\n", addr[CFI32_DEVICE_CODE] >> 16); dprintf("cfi32: device size = 2^%d bytes\n", addr[CFI32_DEVICE_SIZE_LG2] >> 16); /* From here on out, assume both chips return the same data */ nregions = addr[CFI32_ERASE_REGION_COUNT] & 0xffff; #define READ_U16LE(off) ((addr[(off)] & 0xff) | ((addr[(off) + 1] & 0xff)<<8)) for (n = 0; n < nregions && n < MAX_AUTO_DESCRIPTORS; n++) { u32 xcount = READ_U16LE(CFI32_ERASE_REGION_XBLKS(n)); u32 count = xcount + 1; u32 xsize = READ_U16LE(CFI32_ERASE_REGION_XSIZE(n)); u32 size = (xsize == 0) ? 128 : xsize * 256; dprintf("cfi32: erase region #%d\n", n); dprintf("cfi32: count = %d\n", count); dprintf("cfi32: size = %d\n", size); auto_descriptors[n].size = size; auto_descriptors[n].num = count; auto_descriptors[n].lockable = 1; /* fix me */ } #undef READ_U32LE auto_descriptors[n].size = 0; auto_descriptors[n].num = 0; *out = auto_descriptors; result = 0; out: /* put flash back into Read Array mode */ barrier(); *addr = READ_ARRAY; barrier(); return result; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Makefile.am 10 Nov 2003 17:06:41 -0000 1.34 +++ Makefile.am 27 Nov 2003 08:02:31 -0000 1.35 @@ -26,6 +26,8 @@ libblob_a_SOURCES = \ + cfi16.c \ + cfi32.c \ command.c \ crc32.c \ download.c \ |
From: Russ D. <ru...@us...> - 2003-11-27 08:02:39
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv9521/src/blob Modified Files: flash.c intel16.c amd16.c badge4.c Log Message: flesh out cfi probing, and only compile it in if requested by the arch file Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- flash.c 24 Jan 2003 09:26:00 -0000 1.19 +++ flash.c 27 Nov 2003 08:02:32 -0000 1.20 @@ -61,6 +61,7 @@ static flash_block_t flash_blocks[NUM_FLASH_BLOCKS]; static int num_flash_blocks; +u32 flash_base = 0; const flash_descriptor_t *flash_descriptors; flash_driver_t *flash_driver; @@ -116,11 +117,6 @@ int j; u32 start = 0; - if(flash_descriptors == NULL) { - deprintf("undefined flash_descriptors\n"); - return; - } - if(flash_driver == NULL) { deprintf("undefined flash_driver\n"); return; @@ -133,8 +129,7 @@ if(flash_driver->disable_vpp == NULL) flash_driver->disable_vpp = flash_dummy_ok; - if (flash_descriptors[0].num == -1) { - u32 *flashAddr = (u32 *) flash_descriptors[0].size; + if (!flash_descriptors) { flash_descriptor_t *d; int rc; @@ -144,7 +139,7 @@ return; } - rc = flash_driver->query_descriptors(flashAddr, &d); + rc = flash_driver->query_descriptors(flash_base, &d); if (rc) { deprintf("driver failed to query flash for descriptors\n"); flash_descriptors = 0; @@ -156,6 +151,9 @@ /* initialise flash blocks table */ num_flash_blocks = 0; + + /* Setup the flash base */ + start = flash_base; while(flash_descriptors[i].size != 0) { dprintf("%i x 0x%08x, ", Index: intel16.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/intel16.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- intel16.c 4 Sep 2003 17:39:00 -0000 1.9 +++ intel16.c 27 Nov 2003 08:02:33 -0000 1.10 @@ -326,66 +326,6 @@ } -/* automatic descriptor support */ - -#define MAX_AUTO_DESCRIPTORS 4 -static flash_descriptor_t auto_descriptors[MAX_AUTO_DESCRIPTORS + 1]; - -static int flash_query_descriptors_intel16(u32 *flashAddr, - flash_descriptor_t **out) -{ - u16 *addr = (u16 *) flashAddr; - int result, nregions, n; - - addr[0x55] = READ_QUERY; - barrier(); - - if (addr[0x10] != 'Q' && addr[0x11] != 'R' && addr[0x12] != 'Y') { - result = -EINVAL; - goto out; - } - - dprintf("intel16: manuf_code = %02X\n", addr[CFI_MANUF_CODE]); - dprintf("intel16: device code = %02X\n", addr[CFI_DEVICE_CODE]); - dprintf("intel16: device size = 2^%d bytes\n", addr[CFI_DEVICE_SIZE_LG2]); - - nregions = addr[CFI_ERASE_REGION_COUNT]; - -#define READ_U16LE(off) ((addr[(off)]) | (addr[(off) + 1]<<8)) - - for (n = 0; n < nregions && n < MAX_AUTO_DESCRIPTORS; n++) { - u32 xcount = READ_U16LE(CFI_ERASE_REGION_XBLKS(n)); - u32 count = xcount + 1; - u32 xsize = READ_U16LE(CFI_ERASE_REGION_XSIZE(n)); - u32 size = (xsize == 0) ? 128 : xsize * 256; - - dprintf("intel16: erase region #%d\n", n); - dprintf("intel16: count = %d\n", count); - dprintf("intel16: size = %d\n", size); - - auto_descriptors[n].size = size; - auto_descriptors[n].num = count; - auto_descriptors[n].lockable = 1; /* fix me */ - } - -#undef READ_U16LE - - auto_descriptors[n].size = 0; - auto_descriptors[n].num = 0; - - *out = auto_descriptors; - result = 0; - -out: - /* put flash back into Read Array mode */ - barrier(); - - *addr = READ_ARRAY; - barrier(); - - return result; -} - /* flash driver structure */ flash_driver_t intel16_flash_driver = { .erase = flash_erase_intel16, @@ -393,5 +333,4 @@ .lock_block = flash_lock_block_intel16, .unlock_block = flash_unlock_block_intel16, .query_block_lock = flash_query_block_lock_intel16, - .query_descriptors = flash_query_descriptors_intel16 }; Index: amd16.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/amd16.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- amd16.c 3 Sep 2003 01:44:28 -0000 1.1 +++ amd16.c 27 Nov 2003 08:02:33 -0000 1.2 @@ -32,6 +32,9 @@ #include <blob/flash.h> #include <blob/util.h> #include <blob/serial.h> +#include <blob/arch.h> +#include <blob/debug.h> +#include <blob/cfi.h> /* flash commands for a 16 bit AMD flash chips */ @@ -39,24 +42,24 @@ #define UNLOCK1 0x00AA #define UNLOCK2 0x0055 #define CONFIG_QUERY 0x0090 +#define CFI_QUERY 0x0098 #define EXIT_UNLOCK1 0x0090 #define EXIT_UNLOCK2 0x0000 #define ERASE_SETUP 0x0080 #define ERASE_CONFIRM 0x0030 #define PGM_SETUP 0x00A0 #define UNLOCK_BYPASS 0x0020 -#define FLASH_ADDR1 (0x00005555 << 1) -#define FLASH_ADDR2 (0x00002AAA << 1) +#define FLASH_ADDR1 (0x5555 << 1) +#define FLASH_ADDR2 (0x2AAA << 1) #define ERASE_DONE (1 << 7) #define RDY_MASK (1 << 7) #define TOGGLE_BIT (1 << 6) #define STATUS_PGM_ERR (1 << 5) #define STATUS_ERASE_ERR (1 << 0) - -static void flash_read_array_amd16(void) +inline void flash_cmd_amd16(u32 offset, u16 cmd) { - *(u16 *)FLASH_ADDR1 = READ_ARRAY; + *((u16 *)(flash_base | offset)) = cmd; barrier(); } @@ -95,23 +98,18 @@ static int flash_erase_amd16(u32 *addr) { /* prepare for erase */ - *(u16 *)FLASH_ADDR1 = UNLOCK1; - barrier(); - *(u16 *)FLASH_ADDR2 = UNLOCK2; - barrier(); - *(u16 *)FLASH_ADDR1 = ERASE_SETUP; - barrier(); + flash_cmd_amd16(FLASH_ADDR1, UNLOCK1); + flash_cmd_amd16(FLASH_ADDR2, UNLOCK2); + flash_cmd_amd16(FLASH_ADDR1, ERASE_SETUP); /* erase command */ - *(u16 *)FLASH_ADDR1 = UNLOCK1; - barrier(); - *(u16 *)FLASH_ADDR2 = UNLOCK2; - barrier(); + flash_cmd_amd16(FLASH_ADDR1, UNLOCK1); + flash_cmd_amd16(FLASH_ADDR2, UNLOCK2); *((u16 *) addr) = ERASE_CONFIRM; if (get_status_amd16((u16 *) addr) < 0) { /* put flash back into Read Array mode */ - flash_read_array_amd16(); + flash_cmd_amd16(FLASH_ADDR1, READ_ARRAY); return -EFLASHERASE; } @@ -123,12 +121,9 @@ { int ret; - *(u16 *)FLASH_ADDR1 = UNLOCK1; - barrier(); - *(u16 *)FLASH_ADDR2 = UNLOCK2; - barrier(); - *(u16 *)FLASH_ADDR1 = PGM_SETUP; - barrier(); + flash_cmd_amd16(FLASH_ADDR1, UNLOCK1); + flash_cmd_amd16(FLASH_ADDR2, UNLOCK2); + flash_cmd_amd16(FLASH_ADDR1, PGM_SETUP); *dst = *src; barrier(); @@ -138,7 +133,7 @@ barrier(); if (ret < 0 || *dst != *src) { barrier(); - flash_read_array_amd16(); + flash_cmd_amd16(FLASH_ADDR1, READ_ARRAY); return -EFLASHPGM; } @@ -173,26 +168,22 @@ static int flash_query_block_lock_amd16(u32 *blockStart) { int result; - *(u16 *)FLASH_ADDR1 = UNLOCK1; - barrier(); - *(u16 *)FLASH_ADDR2 = UNLOCK2; - barrier(); - *(u16 *)FLASH_ADDR1 = CONFIG_QUERY; - barrier(); + flash_cmd_amd16(FLASH_ADDR1, UNLOCK1); + flash_cmd_amd16(FLASH_ADDR2, UNLOCK2); + flash_cmd_amd16(FLASH_ADDR1, CONFIG_QUERY); result = *(u16 *)(((u16 *)blockStart) + 2); - flash_read_array_amd16(); + flash_cmd_amd16(FLASH_ADDR1, READ_ARRAY); return !!result; } - /* flash driver structure */ flash_driver_t amd16_flash_driver = { erase: flash_erase_amd16, write: flash_write_amd16, lock_block: flash_lock_block_amd16, unlock_block: flash_unlock_block_amd16, - query_block_lock: flash_query_block_lock_amd16 + query_block_lock: flash_query_block_lock_amd16, }; Index: badge4.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/badge4.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- badge4.c 4 Sep 2003 17:39:00 -0000 1.18 +++ badge4.c 27 Nov 2003 08:02:33 -0000 1.19 @@ -39,6 +39,7 @@ #include <blob/partition.h> #include <blob/led.h> #include <blob/time.h> +#include <blob/cfi.h> #define DEBUG @@ -57,10 +58,6 @@ .private= &badge4_i2c_bus_gpio_private }; -/* flash descriptors for BadgePAD 4 flash */ -static const flash_descriptor_t badge4_flash_descriptors[] = - QUERY_FLASH_FOR_DESCRIPTORS(0); - /* default partition table for BadgePAD 4 */ static blob_partition_t badge4_default_partition_table[] = { @@ -141,7 +138,7 @@ timer_driver = &intelarm_timer_driver; flash_driver = &intel16_flash_driver; - flash_descriptors = badge4_flash_descriptors; + flash_driver->query_descriptors = flash_query_descriptors_cfi16; } __initlist(badge4_select_drivers, INIT_LEVEL_DRIVER_SELECTION); |
From: Russ D. <ru...@us...> - 2003-11-27 03:38:23
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv2385 Modified Files: ledasm-s3c2500.S Log Message: updates to s3c2500 ledasm driver Index: ledasm-s3c2500.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/ledasm-s3c2500.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ledasm-s3c2500.S 4 Sep 2003 18:03:09 -0000 1.1 +++ ledasm-s3c2500.S 27 Nov 2003 03:38:20 -0000 1.2 @@ -43,7 +43,6 @@ * clobbers r0 and r1 */ ledinit: - #if defined (NO_GPIO_LED_SUPPORT) mov pc, lr #endif @@ -98,7 +97,7 @@ /* busy wait loop. clobbers r0 */ wait_loop: - mov r0, #0x40000 + mov r0, #0x10000000 wait_loop1: subs r0, r0, #1 bne wait_loop1 |
From: Russ D. <ru...@us...> - 2003-11-27 03:36:59
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv2207 Modified Files: memsetup-s3c2500.S Log Message: add protection unit and remap for s3c2500 Index: memsetup-s3c2500.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memsetup-s3c2500.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- memsetup-s3c2500.S 4 Sep 2003 18:03:09 -0000 1.1 +++ memsetup-s3c2500.S 27 Nov 2003 03:36:56 -0000 1.2 @@ -47,33 +47,21 @@ .text .globl memsetup -MEM_START: .long 0x40000000 - -/* - * CFGREG : SDRAM Configuration 0 register - * note that ras, rc, rcd, and rp regs are *actual* values, not - * the value + 1 - */ -cfgreg: .long \ - (RAS(6) | RC(9) | RCD(3) | RP(3) | \ - D1_128M | D0_128M | CL(3) | NO_AP | XW32) - +/* CFGREG : SDRAM Configuration 0 register */ +cfgreg: .long CFGREG_VAL /* defined in board header */ /* CMDREG : SDRAM Configuration 1 register */ cmdreg: .long (0) /* refresh rate */ -refcyc: .long \ - (GET_MHz(BUS_SPEED) * 15 + ((GET_MHz(BUS_SPEED) * 6) / 10)) +refcyc: .long REFCYC_VAL /* defined in board header */ -/* Flash config, may need to be put into the board file */ -#define FLASH_SPEED 90 +/* Flash config, FLASH_SPEED is defined in the board header */ b0con: .long \ (DW16 | BS(2) | \ TACC((FLASH_SPEED * GET_MHz(BUS_SPEED) + 999) / 1000) | \ TPA(0xE) | TACS(0) | TCOS(0) | TCOH(0)) - /* Architecture headers can customized the memory setup behavior with * the following defines: * @@ -112,15 +100,16 @@ str r1, [r0, #CMDREG] /* Step 3: Write 0xF into the refresh timer register. - mov r1, #0x20 + mov r1, #0xF str r1, [r0, #REFREG] /* Step 4: Wait 120 clock cycles to get at least 8 refreshes */ - mov r4, #0x78 + mov r4, #120 1: subs r4, r4, #1 /* more than 120 cycles */ bne 1b - /* Step 5: Program the normal operational value into the refresh timer */ + /* Step 5: Program the normal operational value into the refresh + * timer */ ldr r1, refcyc str r1, [r0, #REFREG] @@ -140,7 +129,7 @@ ldr r1, cmdreg str r1, [r0, #CMDREG] - mov r1, #0 + mov r1, #0 /* No writebuffer */ str r1, [r0, #WBTOREG] /* Setup the flash bank */ @@ -148,9 +137,76 @@ orr r0, r0, #BCONB ldr r1, b0con str r1, [r0, #B0CON] - + mov pc, lr #endif + + +/* Region definitions (from board config file) */ +regions: +.long REGION0 +.long REGION1 +.long REGION2 +.long REGION3 +.long REGION4 +.long REGION5 +.long REGION6 +.long REGION7 + +/* Setup the protection unit what the kernel is expecting */ +.globl protectionsetup +protectionsetup: + adr r8, regions + ldmia r8, {r0-r7} + mcr p15, 0, r0, c6, c0, 0 + mcr p15, 0, r0, c6, c0, 1 + + mcr p15, 0, r1, c6, c1, 0 + mcr p15, 0, r1, c6, c1, 1 + + mcr p15, 0, r2, c6, c2, 0 + mcr p15, 0, r2, c6, c2, 1 + + mcr p15, 0, r3, c6, c3, 0 + mcr p15, 0, r3, c6, c3, 1 + + mcr p15, 0, r4, c6, c4, 0 + mcr p15, 0, r4, c6, c4, 1 + + mcr p15, 0, r5, c6, c5, 0 + mcr p15, 0, r5, c6, c5, 1 + + mcr p15, 0, r6, c6, c6, 0 + mcr p15, 0, r6, c6, c6, 1 + + mcr p15, 0, r7, c6, c7, 0 + mcr p15, 0, r7, c6, c7, 1 + + mov r0, #REGIONCACHE @ Enable appropriate caches + mcr p15, 0, r0, c2, c0, 0 + mcr p15, 0, r0, c2, c0, 1 + + mov r0, #REGIONWB @ Enable write buffer where appropriate + mcr p15, 0, r0, c3, c0, 0 + mcr p15, 0, r0, c3, c0, 1 + + mov r0, #1<<16 @ Enable full access permission + subs r0, r0, #1 + mcr p15, 0, r0, c5, c0, 0 + mcr p15, 0, r0, c5, c0, 1 + + /* Flush I-cache/D-cache */ + mov r0, #0 + mcr p15, 0, r0, c7, c5, 0 @ I cache + mcr p15, 0, r0, c6, c5, 0 @ D cache + + /* Enable Caches and protection unit */ + mrc p15, 0, r0, c1, c0, 0 + orr r0, r0, #0x1000 @ I cache enabled + orr r0, r0, #0x5 @ D cache/protection unit + mcr p15, 0, r0, c1, c0, 0 + + mov pc, lr /* -------------------------------------------------- */ |
From: Russ D. <ru...@us...> - 2003-11-27 03:35:44
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv2073 Modified Files: param_block.c Log Message: fix assumption in param_block Index: param_block.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/param_block.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- param_block.c 4 Sep 2003 18:34:26 -0000 1.11 +++ param_block.c 27 Nov 2003 03:35:41 -0000 1.12 @@ -139,10 +139,11 @@ { #ifdef PARAM_START struct ptag *t = (struct ptag *) arg; + if (t->hdr.ptag == PTAG_CORE) { for (; t->hdr.size; t = ptag_next(t)) { - if (t < (struct ptag *) PARAM_START || - t > (struct ptag *) (PARAM_START + PARAM_LEN) || + if (t < (struct ptag *) arg || + t > (struct ptag *) (arg + PARAM_LEN) || t->hdr.size > 0x7FFFFFFF) { return; /* corrupt tags */ } |
From: Russ D. <ru...@us...> - 2003-11-27 03:34:40
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv1944 Modified Files: smdk2500.c Log Message: update smdk2500.c to reflect map switch Index: smdk2500.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/smdk2500.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- smdk2500.c 4 Sep 2003 18:34:25 -0000 1.2 +++ smdk2500.c 27 Nov 2003 03:34:37 -0000 1.3 @@ -73,7 +73,7 @@ /* start of table */ magic: BLOB_DEFAULT_PART_TABLE_MAGIC, next: sizeof(blob_partition_t), - offset: 0x00000000, /* absolute base address */ + offset: 0x80000000, /* absolute base address */ size: 2 * 1024 * 1024 /* total size of the flash */ }, { @@ -92,6 +92,7 @@ offset: PARAM_FLASH_BASE, size: PARAM_FLASH_LEN, name: "param", + mem_base: PARAM_RAM_BASE, flags: BLOB_PART_FLAG_PTABLE }, { @@ -106,18 +107,6 @@ mem_base: KERNEL_RAM_BASE, entry_point: KERNEL_RAM_BASE }, -#if 0 - { - /* ramdisk */ - magic: BLOB_PART_VALID_MAGIC, - next: sizeof(blob_partition_t), - offset: RAMDISK_FLASH_BASE, - size: RAMDISK_FLASH_LEN, - name: "ramdisk", - flags: BLOB_PART_FLAG_LOAD, - mem_base: RAMDISK_RAM_BASE - }, -#endif { /* last entry */ magic: BLOB_PART_LAST_MAGIC @@ -138,7 +127,7 @@ * put the pointer at 0x0000000 and let the partition table * parser figure out. */ - flash_partition_table = (blob_partition_t*)0x00000000; + flash_partition_table = (blob_partition_t*)0x80000000; /* select drivers */ reboot_driver = &s3c2500_reboot_driver; |
From: Russ D. <ru...@us...> - 2003-11-27 03:34:05
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv1884 Modified Files: start-s3c2500.S Log Message: update start-s3c2500.S for remap and proper reboot/reblob Index: start-s3c2500.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start-s3c2500.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- start-s3c2500.S 4 Sep 2003 18:03:09 -0000 1.1 +++ start-s3c2500.S 27 Nov 2003 03:34:02 -0000 1.2 @@ -42,10 +42,14 @@ cpu_speed: .word CPU_SPEED bus_speed: .word BUS_SPEED -/* We start by implementing *all* exception vectors */ +piggy_start: .word __piggy_start -/* Reset vector: this initialises the machine */ +/* We start by implementing *all* exception vectors */ + +/* Reset vector: this initializes the machine */ +/* note: the s3c2500 doesn't have a real reset, so we need to + * reset a lot of registers manually */ .globl reset reset: /* Disable interrupts */ @@ -53,13 +57,24 @@ orr r0, r0, #I_BIT | F_BIT msr cpsr, r0 - /* Enable "custom" clocks */ + /* Disable caches/protection unit */ + mrc p15, 0, r0, c1, c0, 0 + bic r0, r0, #0x1000 @ Disable I-cache + bic r0, r0, #5 @ Disable D-cache/protection unit + mcr p15, 0, r0, c1, c0, 0 + + /* Disable Custom clocking */ mov r0, #ASIC_BASE orr r0, r0, #SYSCFG_BASEB - - mov r1, #CPLLREN | SPLLREN + mov r0, #0 str r1, [r0] + /* Disable any clock division */ + str r1, [r0, #CLKCON] + + /* Make sure all external clocks are enabled */ + str r1, [r0, #PCLKDIS] + /* Set CPU clock */ ldr r1, cpu_speed str r1, [r0, #CPLL] @@ -68,12 +83,71 @@ ldr r1, bus_speed str r1, [r0, #SPLL] + /* Enable "custom" clocks */ + mov r1, #CPLLREN | SPLLREN + str r1, [r0] + /* init LED */ bl ledinit /* setup memory */ bl memsetup + /* We need to do a map switch, now is a good time to do it + * copy the first stage of the loader into sdram, and do + * the switch */ + + /* First check to see if the map is already switched... */ + mov r0, #ASIC_BASE + orr r0, r0, #SYSCFG_BASEB + ldr r1, [r0, #SYSCFG] + tst r1, #REMAP + bne remapped + + /* Do this thing with the map unswitched */ + /* copy blob start to RAM */ + mov r0, #0 + mov r1, #S3C2500_SDRAM_BANK0 + + b 1f + +remapped: + /* Do this thing with the map already switched */ + /* copy blob start to RAM (for a switched map) */ + mov r0, #0x80000000 + mov r1, #0 + +1: + ldr r2, piggy_start + add r2, r2, r0 + + /* do the copy */ + + /* r0 = source address + * r1 = target address + * r2 = source end address + */ +copy_loop: + ldmia r0!, {r3-r10} + stmia r1!, {r3-r10} + cmp r0, r2 + ble copy_loop + + /* we have a copy of the stage1 loader, do the switch if its + * not already done */ + mov r0, #ASIC_BASE + orr r0, r0, #SYSCFG_BASEB + ldr r1, [r0, #SYSCFG] + orr r1, r1, #REMAP + str r1, [r0, #SYSCFG] + + /* Switch around the PC for a "manual remap" if needed */ + bic pc, pc, #0x80000000 + nop + + /* Setup protection unit */ + bl protectionsetup + /* 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 @@ -176,7 +250,7 @@ wait: /* busy wait loop*/ - mov r5, #0x100000 + mov r5, #0x40000000 wait0: subs r5, r5, #1 bne wait0 |
From: Russ D. <ru...@us...> - 2003-11-27 03:32:31
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv1705 Modified Files: start.S Log Message: add logic in start.S for s3c2500 switched map. Also, changed sign comparison (ble) to unsigned (bls) Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start.S,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- start.S 6 Aug 2003 22:55:41 -0000 1.12 +++ start.S 27 Nov 2003 03:32:28 -0000 1.13 @@ -83,6 +83,16 @@ relocate: /* relocate the second stage loader */ adr r1, _start +#if defined(S3C2500) + /* If we are reblobing, then copy from our position, otherwise + * we need to copy from mapswitched flash */ + cmp r1, #0 + bne reblobed + + /* its no longer _start because there is a map switch */ + orr r1, r1, #0x80000000 +reblobed: +#endif ldr r0, piggy_start add r0, r0, r1 @@ -99,7 +109,7 @@ ldmia r0!, {r3-r10} stmia r1!, {r3-r10} cmp r0, r2 - ble copy_loop + bls copy_loop /* blob is copied to ram, so jump to it */ ldr r0, BLOB_START |
From: Russ D. <ru...@us...> - 2003-11-27 03:30:53
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1524 Modified Files: ether-s3c2500.c Log Message: fix halts in s3c2500 ether driver Index: ether-s3c2500.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/ether-s3c2500.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ether-s3c2500.c 5 Sep 2003 01:09:45 -0000 1.2 +++ ether-s3c2500.c 27 Nov 2003 03:30:50 -0000 1.3 @@ -1,3 +1,4 @@ + /* * ether-s3c2500.c: Low-level ethernet polling functions * @@ -55,10 +56,9 @@ #define NFRAMESB 4 #define NFRAMES (1 << NFRAMESB) -struct buffer_t tx_buffer, rx_buffer[NFRAMES]; +#define __uncached __attribute__ ((__section__(".uncached"))) -/* rx buffers */ -u8 pkts[NFRAMES][PKT_SIZE]; +struct buffer_t *tx_buffer, *rx_buffer; static int dbg = 0; static u32 s3c2500_ether_chip_base = 0; @@ -125,31 +125,41 @@ u32 stat, len, base, pos, desc, copy_len; int ret = 0, i; u8 *copy_base; + int error = 0; if (!(base = s3c2500_ether_chip_base)) return -EINVAL; i = curr_desc; - /* do we own it yet? */ - if (rx_buffer[i].desc & BDMA_owner) return 0; - /* Read/clear stat */ stat = se_inw(base + BMRXSTAT); se_outw(base + BMRXSTAT, 0); + /* do we own it yet? */ + if (rx_buffer[i].desc & BDMA_owner) goto done; + /* do we have a packet? */ - if (!(rx_buffer[i].desc & BRxDone)) return 0; + if (!(rx_buffer[i].desc & BRxDone)) { + /* We have one, either there is a problem with it, + * or the engine isn't truly done yet */ + if (rx_buffer[i].desc & (DescMSO | DescHalted | DescRxParErr | + DescMUFS | DescOverflow | DescCRCErr | + DescAlignErr)) + error = 1; + else goto done; /* not quite ready yet */ + } pos = 0; len = rx_buffer[i].desc & 0xffff; len -= 4; /* Strip the FCS */ + if (len > length) error = 1; do { desc = rx_buffer[i].desc; - /* only do the copying if it will fit */ - if (len <= length) { + /* only do the copying if its ok */ + if (!error) { copy_base = rx_buffer[i].ptr; if (desc & DescEOF) copy_len = len - pos; else copy_len = PKT_SIZE; @@ -163,17 +173,21 @@ i = (i + 1) % NFRAMES; } while (!(desc & DescEOF)); - /* Reenable used (or discarded) for reception */ + /* Reenable used (or discarded) buffers for reception */ do { rx_buffer[curr_desc++].desc = BDMA_owner; if (curr_desc >= NFRAMES) curr_desc = 0; } while (i != curr_desc); + if (!error) ret = len; + +done: /* Make sure transmission is still enabled */ - se_bset(base + BDMARXCON, BRxEn); - se_bset(base + MACRXCON, MRxEn); + se_outw(base + BDMARXCON, BRxEn | (0x2 << BRxMSL) | + (NFRAMESB << BRxNBD)); + se_outw(base + MACRXCON, MRxEn); - return (len <= length) ? len : 0; + return ret; } @@ -193,11 +207,11 @@ } /* wait for the descriptor to free up */ - while (tx_buffer.desc & BDMA_owner); + while (tx_buffer->desc & BDMA_owner); /* Setup the descriptor */ - tx_buffer.ptr = (u8 *) data; - tx_buffer.desc = length | ((((u32) data) % 4) << 16) | BDMA_owner; + tx_buffer->ptr = (u8 *) data; + tx_buffer->desc = length | ((((u32) data) % 4) << 16) | BDMA_owner; /* Make sure everything is ready to go */ se_bset(base + BDMATXCON, BTxEn); @@ -210,7 +224,7 @@ se_outw(base + BMTXSTAT, 0x0); /* give it back */ - tx_buffer.desc = 0; + tx_buffer->desc = 0; return 0; } @@ -243,10 +257,20 @@ } +void *malloc_uncached(u32 size) +{ + static char *uncached_area = (char *) 0x1F00000L; + char *ret = uncached_area; + uncached_area += size; + return ret; +} + + /* Enable everything */ static void s3c2500_ether_enable(u32 base) { int i; + /* Set the MAC to full duplex */ se_outw(base + MACCON, MACFD); @@ -254,14 +278,14 @@ se_outw(base + BDMARXLEN, PKT_SIZE | MAX_FRAME << 16); /* point the chip to our buffers */ - se_outw(base + BDMATXDPTR, (u32) &tx_buffer); - se_outw(base + BDMARXDPTR, (u32) &rx_buffer); + se_outw(base + BDMATXDPTR, (u32) tx_buffer); + se_outw(base + BDMARXDPTR, (u32) rx_buffer); /* setup our buffer descriptors */ - tx_buffer.ptr = 0; - tx_buffer.desc = 0; + tx_buffer->ptr = 0; + tx_buffer->desc = 0; for (i = 0; i < NFRAMES; i++) { - rx_buffer[i].ptr = (u8 *) pkts[i]; + rx_buffer[i].ptr = malloc_uncached(PKT_SIZE); rx_buffer[i].desc = BDMA_owner; } curr_desc = 0; @@ -289,8 +313,10 @@ static int s3c2500_ether_init(u32 base) { - DBG(1, "%s(%08x)\n", __FUNCTION__, base); + + tx_buffer = malloc_uncached(sizeof(struct buffer_t)); + rx_buffer = malloc_uncached(sizeof(struct buffer_t) * NFRAMES); s3c2500_ether_chip_base = base; |
From: Russ D. <ru...@us...> - 2003-11-27 03:29:26
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1299 Modified Files: reboot-s3c2500.c Log Message: fixup s3c2500 reboot Index: reboot-s3c2500.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/reboot-s3c2500.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- reboot-s3c2500.c 4 Sep 2003 18:07:07 -0000 1.1 +++ reboot-s3c2500.c 27 Nov 2003 03:29:23 -0000 1.2 @@ -50,9 +50,9 @@ */ int i; typedef void (*func_t)(void); - func_t base = 0x0; + func_t base = (func_t) 0x80000000; WDT = (1 << 31) | (1 << 30) | 1; - for(i = 0; i < 10000; i++); + msleep(100); /* Give up and jump to 0x0000 */ base(); } |
From: Russ D. <ru...@us...> - 2003-11-27 03:26:31
|
Update of /cvsroot/blob/blob/include/blob/proc In directory sc8-pr-cvs1:/tmp/cvs-serv986/blob/proc Modified Files: s3c2500.h Log Message: change header to reflect remap Index: s3c2500.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/proc/s3c2500.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- s3c2500.h 4 Sep 2003 18:03:09 -0000 1.1 +++ s3c2500.h 27 Nov 2003 03:26:29 -0000 1.2 @@ -51,8 +51,8 @@ #include <blob/arch/s3c2500-regs.h> /* memory start and end */ -#define MEMORY_START (0x40000000) -#define MEMORY_END (0x48000000) +#define MEMORY_START (0x00000000) +#define MEMORY_END (0x08000000) /* bank2 is at 0x80000000 to 0x88000000 */ #endif |
From: Russ D. <ru...@us...> - 2003-11-27 03:25:56
|
Update of /cvsroot/blob/blob/include/blob/arch In directory sc8-pr-cvs1:/tmp/cvs-serv897 Modified Files: smdk2500.h Log Message: update the smdk2500 header Index: smdk2500.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/smdk2500.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- smdk2500.h 4 Sep 2003 18:10:42 -0000 1.1 +++ smdk2500.h 27 Nov 2003 03:25:52 -0000 1.2 @@ -27,50 +27,90 @@ #ifndef BLOB_ARCH_SMDK2500_H #define BLOB_ARCH_SMDK2500_H +/*------------------------------------------------------ + * Protection map for the SMDK2500 + * + * 0xFFFFFFFF +----------------------+ --------------------------------- + * ~ ~ + * + ASIC(2MB) + region 3 + * + I-Cache : OFF + (2 MB) + * + D-Cache : OFF + + * 0xF0000000 +----------------------+ ------------ + * ~ ~ + * + EXTIO(256MB) + region 2 region 0 + * + I-Cache : OFF + (2 MB) (4 GB) + * + D-Cache : OFF + + * 0x80000000 +----------------------+ --------------------- + * + SDRAM(1MB) I/D : OFF + region 7 (1 MB) + * +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ----------- + * + SDRAM(32MB) + region 1 + * + I-Cache : ON + (32 MB) + * + D-Cache : ON + + * 0x00000000 +----------------------+ --------------------------------- + * + */ +#define REGION0 0x00000000 | (SZ_4GB << 1) | 1 @ All memory +#define REGION1 0x00000000 | (SZ_32MB << 1) | 1 @ SDRAM +#define REGION2 0x80000000 | (SZ_256MB << 1) | 1 @ EXT IO +#define REGION3 0xf0000000 | (SZ_2MB << 1) | 1 @ ASIC +#define REGION4 0 @ Disabled +#define REGION5 0 @ Disabled +#define REGION6 0 @ Disabled +#define REGION7 0x01F00000 | (SZ_1MB << 1) | 1 @ Non-cacheable + +#define REGIONCACHE 0x02 +#define REGIONWB 0x00 #define TERMINAL_SPEED baud_115200 #define CPU_SPEED SPEED_166MHz #define BUS_SPEED SPEED_133MHz +/* + * CFGREG : SDRAM Configuration 0 register + * note that ras, rc, rcd, and rp regs are *actual* values, not + * the value + 1 + */ +#define CFGREG_VAL (RAS(6) | RC(9) | RCD(3) | RP(3) | \ + D1_128M | D0_128M | CL(3) | NO_AP | XW32) +//#define REFCYC_VAL (GET_MHz(BUS_SPEED) * 15 + ((GET_MHz(BUS_SPEED) * 6) / 10)) +#define REFCYC_VAL (0x800) +/* Flash speed in ns */ +#define FLASH_SPEED 90 /* GPIO for the LED */ #define LED_GPIO 0x00000001 /* GPIO 0 */ /* the base address were blob-rest is loaded by the first stage loader */ -#define BLOB_ABS_BASE_ADDR (0x40200400) +#define BLOB_ABS_BASE_ADDR (0x00200400) /* where do various parts live in RAM */ -#define BLOB_RAM_BASE (0x40100000) -#define PARAM_RAM_BASE (0x40110000) -#define KERNEL_RAM_BASE (0x40008000) -#define RAMDISK_RAM_BASE (0x40400000) -#define RAM_START (0x41000000) +#define BLOB_RAM_BASE (0x00100000) +#define PARAM_RAM_BASE (0x00110000) +#define KERNEL_RAM_BASE (0x00020000) +#define RAMDISK_RAM_BASE (0x00400000) +#define RAM_START (0x01000000) /* and where do they live in flash */ #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 SMDK2500_ERASE_BLOCK (64 * 1024) +#define BLOB_FLASH_LEN (SMDK2500_ERASE_BLOCK) +#define PARAM_FLASH_BASE (BLOB_FLASH_BASE + BLOB_FLASH_LEN) +#define PARAM_FLASH_LEN (SMDK2500_ERASE_BLOCK) #define KERNEL_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) #define KERNEL_FLASH_LEN (SMDK2500_ERASE_BLOCK * (32 - 2)) -#define LOAD_RAMDISK 0 /* load ramdisk into ram */ -#define RAMDISK_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) -#define RAMDISK_FLASH_LEN (SMDK2500_ERASE_BLOCK * (32 - 2)) #define PARAM_START PARAM_FLASH_BASE #define PARAM_LEN PARAM_FLASH_LEN /* the position of the kernel boot parameters */ -#define BOOT_PARAMS (0x40000100) - +#define BOOT_PARAMS (0x00000100) /* the size (in kbytes) to which the compressed ramdisk expands */ #define RAMDISK_SIZE (8 * 1024) - +#define LOAD_RAMDISK 0 /* don't load ramdisk into ram */ |
From: Russ D. <ru...@us...> - 2003-11-27 03:24:34
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1:/tmp/cvs-serv729 Modified Files: linux.h Log Message: change smdk2500 arch number Index: linux.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/linux.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- linux.h 17 Nov 2003 14:19:25 -0000 1.17 +++ linux.h 27 Nov 2003 03:24:31 -0000 1.18 @@ -71,7 +71,7 @@ #elif defined SHANNON # define ARCH_NUMBER (97) #elif defined SMDK2500 -# define ARCH_NUMBER (91) +# define ARCH_NUMBER (166) #elif defined PT_SYSTEM3 || defined PT_DAFIT # define ARCH_NUMBER (112) #elif defined TRIZEPS |
From: Russ D. <ru...@us...> - 2003-11-27 03:24:08
|
Update of /cvsroot/blob/blob/include/net In directory sc8-pr-cvs1:/tmp/cvs-serv679 Modified Files: s3c2500.h Log Message: add some more defines Index: s3c2500.h =================================================================== RCS file: /cvsroot/blob/blob/include/net/s3c2500.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- s3c2500.h 5 Sep 2003 01:09:45 -0000 1.2 +++ s3c2500.h 27 Nov 2003 03:24:06 -0000 1.3 @@ -23,7 +23,16 @@ #define DescSkipBD (1 << 30) #define DescSOF (1 << 29) #define DescEOF (1 << 28) +#define DescDone (1 << 27) +#define DescMSO (1 << 26) +#define DescHalted (1 << 25) +#define DescMRx10Stat (1 << 24) #define BRxDone (1 << 23) +#define DescRxParErr (1 << 22) +#define DescMUFS (1 << 21) +#define DescOverflow (1 << 20) +#define DescCRCErr (1 << 19) +#define DescAlignErr (1 << 18) #define BDMATXCON 0x00000 #define BTxMSL 4 @@ -47,6 +56,8 @@ #define TxComp (1 << 6) #define BMRXSTAT 0x00024 +#define Overflow (1 << 3) + #define BDMARXLEN 0x00028 #define CFTXSTAT 0x00030 |
From: Russ D. <ru...@us...> - 2003-11-27 03:23:27
|
Update of /cvsroot/blob/blob/include/blob/arch In directory sc8-pr-cvs1:/tmp/cvs-serv500 Modified Files: s3c2500-regs.h Log Message: change header to reflect remap Index: s3c2500-regs.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/s3c2500-regs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- s3c2500-regs.h 4 Sep 2003 18:03:09 -0000 1.1 +++ s3c2500-regs.h 27 Nov 2003 03:23:24 -0000 1.2 @@ -325,5 +325,21 @@ #define TIMER_TMD5 (1 << 16) #define TIMER_CLR5 (1 << 17) +/* + * Region sizes + */ +#define SZ_4GB 0x1f +#define SZ_2GB 0x1e +#define SZ_1GB 0x1d +#define SZ_512MB 0x1c +#define SZ_256MB 0x1b +#define SZ_128MB 0x1a +#define SZ_64MB 0x19 +#define SZ_32MB 0x18 +#define SZ_16MB 0x17 +#define SZ_8MB 0x16 +#define SZ_4MB 0x15 +#define SZ_2MB 0x14 +#define SZ_1MB 0x13 #endif |
From: Russ D. <ru...@us...> - 2003-11-27 01:09:44
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13918 Modified Files: ext2fs.c Log Message: change over simple cases with strncmp Index: ext2fs.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/ext2fs.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ext2fs.c 27 Apr 2002 04:16:35 -0000 1.1 +++ ext2fs.c 27 Nov 2003 01:09:40 -0000 1.2 @@ -573,7 +573,7 @@ printf("rec_len %d (%x), b %d\n", de->rec_len, de->rec_len, offset); } - if (/* FIXME de->file_type == 2 && */ strncmp(name, "boot", 5) == 0) { + if (/* FIXME de->file_type == 2 && */ strcmp(name, "boot") == 0) { if( verbose > 0) printf("found /boot dir\n"); if (verbose > 1) printf("/boot dir inode %d\n", de->inode); boot_inode_num = de->inode; |
From: Russ D. <ru...@us...> - 2003-11-27 01:05:14
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv13346 Modified Files: cramfs.c bootldrpart.c Log Message: simplify the simple strncmp cases Index: cramfs.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/cramfs.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cramfs.c 27 Apr 2002 07:32:40 -0000 1.4 +++ cramfs.c 27 Nov 2003 01:05:11 -0000 1.5 @@ -136,7 +136,7 @@ name = (char *) (inode + 1); /* FIXME - should use "filename" */ - if (!strncmp("linux\0\0", name, 8)) { + if (!strcmp("linux\0\0", name)) { size = cramfs_load_file(dest, part, inode); break; } Index: bootldrpart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/bootldrpart.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- bootldrpart.c 13 Feb 2002 00:17:32 -0000 1.3 +++ bootldrpart.c 27 Nov 2003 01:05:11 -0000 1.4 @@ -159,16 +159,14 @@ ptable->partition[i].flags |= PART_EXPAND; /* NOTE: this is a hack -- Erik */ - if(strncmp(ptable->partition[i].name, "kernel", - PART_PARTITION_NAMELEN) == 0) { + if(strcmp(ptable->partition[i].name, "kernel") == 0) { ptable->partition[i].mem_base = KERNEL_RAM_BASE; ptable->partition[i].entry_point = KERNEL_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; } /* NOTE: and this is a hack as well -- Erik */ - if(strncmp(ptable->partition[i].name, "ramdisk", - PART_PARTITION_NAMELEN) == 0) { + if(strcmp(ptable->partition[i].name, "ramdisk") == 0) { ptable->partition[i].mem_base = RAMDISK_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; } |
From: Russ D. <ru...@us...> - 2003-11-27 00:59:58
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1:/tmp/cvs-serv12254 Modified Files: util.h Log Message: Why keep making the developer guess (and possibly miss) string sizes? This should simplify things. A strcmp function with the same safegaurds could be written, but I don't know if it would save space. Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- util.h 17 Mar 2003 14:59:08 -0000 1.13 +++ util.h 27 Nov 2003 00:59:55 -0000 1.14 @@ -46,6 +46,11 @@ int memcmp(const void * cs,const void * ct,size_t count); +#define strcmp(s1, s2) \ + (__builtin_constant_p(s1) ? strncmp(s1, s2, sizeof(s1)) : \ + (__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2)) : \ + unsafe_strcmp_call(s1, s2))) + int strncmp(const char *s1, const char *s2, size_t maxlen); int strlen(const char *s); |
From: <ste...@el...> - 2003-11-24 13:52:43
|
On Mon, Nov 24, 2003 at 05:16:58PM +0530, Yamijala Sridhar wrote: > Hi All ! > > I would like to know whether there is any version of blob > which supports loading kernel and ramdisk from hard disk > apart from serial download or copying from flash. AFAIK there is ext2fs code in blob, which can be used to fetch files from a ext2 disk image. The problem is that you need to be able to access your disk somehow. There is low-level IDE and CF support in BLOB, but AFAIK there is some glue code missing. So: The bits are there, ist just a matter of putting them together. There were discussions recently on blobs IRC channel on that subject and it was agreed upon that IDE and CF code need proper massaging to put it into shape, like the current ethernet and serial code. The filesystem access code needs similar treatment. > > Or if no version supports, could someone please tell me > whether this is practially feasible and any guidelines on how > to do it? Well, simply fetch blobs current CVS version, look how the ethernet stuff is done (the low-level driver are nicely abstracted into a generic driver struct). The same is needed for the current IDE and CF code, and for the FS access stuff. > > Thank You > Sridhar -- Eletztrick Computing - Customized Linux Development Stefan Eletzhofer, Marktstrasse 43, DE-88214 Ravensburg http://www.eletztrick.de |
From: Yamijala S. <Sri...@si...> - 2003-11-24 11:49:04
|
Hi All ! I would like to know whether there is any version of blob which supports loading kernel and ramdisk from hard disk apart from serial download or copying from flash. Or if no version supports, could someone please tell me whether this is practially feasible and any guidelines on how to do it? Thank You Sridhar |
From: <ste...@el...> - 2003-11-19 14:01:27
|
On Wed, Nov 19, 2003 at 05:18:46PM +0530, Yamijala Sridhar wrote: > Hi All ! > Hi. [snip] > > After a H/W Reset, the instruction at address 0x00000000 is executed. > In the SA-1110 manual, it has been mentioned that this address corresponds > to the static memory selected by > nCS0.Let me say, it is a Flash memory. > > In blob, I found a comment that "The SA-1110 jumps to address 0x00000000 > after a reset. > We put a single branch code at this position, which jumps to a safe region > to do the actual setup". > > Also, in the SA-1110 manual, it has been given that 0x00000000 is the reset > vector address. > This means this is the first location where our processor should step into. > > So, is my assumption true that the flash is mapped to Static memory bank 0 > of SA-1110 from addresses 0x00000000 and that > _start: b reset > > is the first instruction to be executed after a reset? I am not exactly a Hardware guy, but as I understand things you're correct. > Moreover, how are the other branches namely: undefined_instruction, > software_interrupt etc. mapped in S/W to the actual vectors? > when/how is the first branch to these labels taken? These are jumped to when the processor encounters the corresponding exception, for example "undefined instruction" etc. As I understand it, these vectors are only used in BLOB, for example Linux defines them differently. > > Thank You > Sridhar -- Eletztrick Computing - Customized Linux Development Stefan Eletzhofer, Marktstrasse 43, DE-88214 Ravensburg http://www.eletztrick.de |
From: Yamijala S. <Sri...@si...> - 2003-11-19 11:51:00
|
Hi All ! I find that in blob/src, there are these files: start.S and ld-script. In ld-script, there is the declaration for _start (i suppose _start is a symbol) as: ENTRY(_start) I understand that _start is a global and is required by the linker to specify the first instruction to be executed in a program.The corresponding code in blob is: .globl _start _start: b reset b undefined_instruction b software_interrupt b abort_prefetch b abort_data b not_used b irq b fiq reset: - - - - - - - - - - - - - - - So, In blob the first instruction to be executed is the one in the reset label of start.S Now, could someone please clarify the following queries: After a H/W Reset, the instruction at address 0x00000000 is executed. In the SA-1110 manual, it has been mentioned that this address corresponds to the static memory selected by nCS0.Let me say, it is a Flash memory. In blob, I found a comment that "The SA-1110 jumps to address 0x00000000 after a reset. We put a single branch code at this position, which jumps to a safe region to do the actual setup". Also, in the SA-1110 manual, it has been given that 0x00000000 is the reset vector address. This means this is the first location where our processor should step into. So, is my assumption true that the flash is mapped to Static memory bank 0 of SA-1110 from addresses 0x00000000 and that _start: b reset is the first instruction to be executed after a reset? Moreover, how are the other branches namely: undefined_instruction, software_interrupt etc. mapped in S/W to the actual vectors? when/how is the first branch to these labels taken? Thank You Sridhar |
From: Stefan E. <se...@us...> - 2003-11-17 20:19:29
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv25461/src/lib Modified Files: printf.c Log Message: do_div() included from linux/include/asm-arm/div64.h is no more or moved in linux 2.6.0-test9-rmk1. Remove that dependency and define the macro directly. Index: printf.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/printf.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- printf.c 8 Feb 2002 12:49:03 -0000 1.1 +++ printf.c 17 Nov 2003 20:19:06 -0000 1.2 @@ -41,9 +41,22 @@ #include <blob/types.h> #include <blob/util.h> #include <blob/serial.h> -#include <asm/div64.h> #include <stdarg.h> +/* From linux/include/asm-arm/div64.h. We dont want to be dependent from + * the linux kernel. + * + * Specially true if these headers vanish later (2.6.0-test9-rmk1) + */ + +/* We're not 64-bit, but... */ +#define do_div(n,base) \ +({ \ + int __res; \ + __res = ((unsigned long)n) % (unsigned int)base; \ + n = ((unsigned long)n) / (unsigned int)base; \ + __res; \ +}) |
From: Stefan E. <se...@us...> - 2003-11-17 14:20:06
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1:/tmp/cvs-serv14618/include/blob Modified Files: linux.h Log Message: Add RotAlign Alpha arch number. Index: linux.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/linux.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- linux.h 4 Sep 2003 18:10:41 -0000 1.16 +++ linux.h 17 Nov 2003 14:19:25 -0000 1.17 @@ -78,6 +78,8 @@ # define ARCH_NUMBER (74) #elif defined CSIR_IMS # define ARCH_NUMBER (358) +#elif defined RA_ALPHA +# define ARCH_NUMBER (412) #else #warning "FIXME: Calling the kernel with a generic SA1100 architecture code. YMMV!" #define ARCH_NUMBER (18) |