www.pudn.com > drivers.rar > dev.c


/****************************************************************************** 
 * Flash File System (ffs) 
 * Idea, design and coding by Mads Meisner-Jensen, mmj@ti.com 
 * 
 * ffs flash device definitions 
 * 
 * $Id: dev.c 1.34.1.25 Thu, 18 Dec 2003 10:50:52 +0100 tsj $ 
 * 
 ******************************************************************************/ 
 
#include "../ffs.h" 
#include "drv.h"  
 
/****************************************************************************** 
 
 Flash memories supported: 
 
 The real flash device names are listed in the Device column. The names of 
 compatible/similar devices are listed in the "aliases" column. 
 Compatible/similar devices are e.g. combo devices using that particular 
 flash device. 
 
 The size column denotes the full device memory size in megabits (Mb). For 
 dual and multi-bank devices, two or more numbers indicate the sizes of the 
 respective banks, starting from the lowest address. 
 
 ---------------+--------+------------------------------------------------- 
 Device         |    Size| Aliases and Notes 
 ---------------+--------+----------------------------------------------------- 
 AMD            |        |  
 29DL161T       |15.5+0.5|  
 29DL162T       |14.0+2.0|  
 29DL163T       |12.0+4.0|  
 29DL164T       | 8.0+8.0|  
 29DL322T       |28.0+4.0|  
 29DL323T       |24.0+8.0|  
 ---------------+--------+----------------------------------------------------- 
 Fujitsu        |        | 
 29DL161T       |15.5+0.5| (Am29DL161) 
 29DL162T       |14.0+2.0| (Am29DL162) 
 29DL163T       |12.0+4.0| (Am29DL163) 
 29DL164T       | 8.0+8.0| (Am29DL164) 
 29DL321TD      |        | (Am29DL321), MB84VD22181, MB84VD22081, MB84VD22191 
 29DL322TD      |28.0+4.0| (Am29DL322), MB84VD22182, MB84VD22082, MB84VD22192 
 29DL323TD      |24.0+8.0| (Am29DL323), MB84VD22183, MB84VD22083, MB84VD22193, 
                |        | BSample device 
 ---------------+--------+----------------------------------------------------- 
 Samsung        |        | 
 K5A3240YT      |24+8    |  
 K5A3240YB      | 8+24   | 
 K5A3340YT      |16+16   | 
 K5A3340YB      |14+18   | (!?) 
 ---------------+--------+----------------------------------------------------- 
 SST            |        | 
 SST36VF1601    |        | 
 ---------------+--------+----------------------------------------------------- 
 Toshiba        |        | 
 ?              |        | TH50VSF2581AASB 
 ---------------+--------+----------------------------------------------------- 
 Intel          |        | 
 28F160C3       |    16.0| Both Top and Bottom boot 
 28F320C3       |    32.0| Both Top and Bottom boot 
 28F640C3       |    64.0| Both Top and Bottom boot 
 28F640W30      |    64.0| Both Top and Bottom boot, DSample device 
 ---------------+--------+----------------------------------------------------- 
 Test           |        | 
                |        | 
 ---------------+--------+----------------------------------------------------- 
 
******************************************************************************/ 
 
 
/****************************************************************************** 
 * Flash Device Memory Maps 
 ******************************************************************************/ 
 
// The memory map, flash_AAxBB[], used by each flash device definition in 
// the flash_info[] array below can be either one of the pre-defined ones 
// below or a custom-defined one. Each line in the memory map represents one 
// physical device sector. The columns in the memory map has the following 
// meaning: 
// 
// 1. Relative address offset of sector. 
// 2. Base 2 logarithm of sector byte size, e.g. 64kB ~ 2^16. 
// 
// Note that does NOT support a flash definition with different sized blocks 
// so all blocks contained in the device definition MUST be the same size! 
 
// 128x64kw 
static const struct block_info_s flash_128x64kw[] = 
{ 
  	{ 0x000000, 17 }, 
    { 0x020000, 17 }, 
    { 0x040000, 17 }, 
    { 0x060000, 17 }, 
    { 0x080000, 17 }, 
    { 0x0A0000, 17 }, 
    { 0x0C0000, 17 }, 
    { 0x0E0000, 17 }, 
    { 0x100000, 17 }, 
    { 0x120000, 17 }, 
    { 0x140000, 17 }, 
    { 0x160000, 17 }, 
    { 0x180000, 17 }, 
    { 0x1A0000, 17 }, 
    { 0x1C0000, 17 }, 
    { 0x1E0000, 17 }, 
    { 0x200000, 17 }, 
    { 0x220000, 17 }, 
    { 0x240000, 17 }, 
    { 0x260000, 17 }, 
    { 0x280000, 17 }, 
    { 0x2A0000, 17 }, 
    { 0x2C0000, 17 }, 
    { 0x2E0000, 17 }, 
    { 0x300000, 17 }, 
    { 0x320000, 17 }, 
    { 0x340000, 17 }, 
    { 0x360000, 17 }, 
    { 0x380000, 17 }, 
    { 0x3A0000, 17 }, 
    { 0x3C0000, 17 }, 
    { 0x3E0000, 17 }, 
    { 0x400000, 17 }, 
    { 0x420000, 17 }, 
    { 0x440000, 17 }, 
    { 0x460000, 17 }, 
    { 0x480000, 17 }, 
    { 0x4A0000, 17 }, 
    { 0x4C0000, 17 }, 
    { 0x4E0000, 17 }, 
    { 0x500000, 17 }, 
    { 0x520000, 17 }, 
    { 0x540000, 17 }, 
    { 0x560000, 17 }, 
    { 0x580000, 17 }, 
    { 0x5A0000, 17 }, 
    { 0x5C0000, 17 }, 
    { 0x5E0000, 17 }, 
    { 0x600000, 17 }, 
    { 0x620000, 17 }, 
    { 0x640000, 17 }, 
    { 0x660000, 17 }, 
    { 0x680000, 17 }, 
    { 0x6A0000, 17 }, 
    { 0x6C0000, 17 }, 
    { 0x6E0000, 17 }, 
    { 0x700000, 17 }, 
    { 0x720000, 17 }, 
    { 0x740000, 17 }, 
    { 0x760000, 17 }, 
    { 0x780000, 17 }, 
    { 0x7A0000, 17 }, 
    { 0x7C0000, 17 }, 
    { 0x7E0000, 17 }, 
    { 0x800000, 17 }, 
    { 0x820000, 17 }, 
    { 0x840000, 17 }, 
    { 0x860000, 17 }, 
    { 0x880000, 17 }, 
    { 0x8A0000, 17 }, 
    { 0x8C0000, 17 }, 
    { 0x8E0000, 17 }, 
    { 0x900000, 17 }, 
    { 0x920000, 17 }, 
    { 0x940000, 17 }, 
    { 0x960000, 17 }, 
    { 0x980000, 17 }, 
    { 0x9A0000, 17 }, 
    { 0x9C0000, 17 }, 
    { 0x9E0000, 17 }, 
    { 0xA00000, 17 }, 
    { 0xA20000, 17 }, 
    { 0xA40000, 17 }, 
    { 0xA60000, 17 }, 
    { 0xA80000, 17 }, 
    { 0xAA0000, 17 }, 
    { 0xAC0000, 17 }, 
    { 0xAE0000, 17 }, 
    { 0xB00000, 17 }, 
    { 0xB20000, 17 }, 
    { 0xB40000, 17 }, 
    { 0xB60000, 17 }, 
    { 0xB80000, 17 }, 
    { 0xBA0000, 17 }, 
    { 0xBC0000, 17 }, 
    { 0xBE0000, 17 }, 
    { 0xC00000, 17 }, 
    { 0xC20000, 17 }, 
    { 0xC40000, 17 }, 
    { 0xC60000, 17 }, 
    { 0xC80000, 17 }, 
    { 0xCA0000, 17 }, 
    { 0xCC0000, 17 }, 
    { 0xCE0000, 17 }, 
    { 0xE00000, 17 }, 
    { 0xE20000, 17 }, 
    { 0xE40000, 17 }, 
    { 0xE60000, 17 }, 
    { 0xE80000, 17 }, 
    { 0xEA0000, 17 }, 
    { 0xEC0000, 17 }, 
    { 0xEE0000, 17 }, 
    { 0xF00000, 17 }, 
    { 0xF20000, 17 }, 
    { 0xF40000, 17 }, 
    { 0xF60000, 17 }, 
    { 0xF80000, 17 }, 
    { 0xFA0000, 17 }, 
    { 0xFC0000, 17 }, 
    { 0xFE0000, 17 } 
 
}; 
 
 
 
// 256x64kb 
static const struct block_info_s flash_256x64[] = 
{ 
  { 0x00000, 16 }, 
  { 0x10000, 16 }, 
  { 0x20000, 16 }, 
  { 0x30000, 16 }, 
  { 0x40000, 16 }, 
  { 0x50000, 16 }, 
  { 0x60000, 16 }, 
  { 0x70000, 16 }, 
  { 0x80000, 16 }, 
  { 0x90000, 16 }, 
  { 0xa0000, 16 }, 
  { 0xb0000, 16 }, 
  { 0xc0000, 16 }, 
  { 0xd0000, 16 }, 
  { 0xe0000, 16 }, 
  { 0xf0000, 16 }, 
  { 0x100000, 16 }, 
  { 0x110000, 16 }, 
  { 0x120000, 16 }, 
  { 0x130000, 16 }, 
  { 0x140000, 16 }, 
  { 0x150000, 16 }, 
  { 0x160000, 16 }, 
  { 0x170000, 16 }, 
  { 0x180000, 16 }, 
  { 0x190000, 16 }, 
  { 0x1a0000, 16 }, 
  { 0x1b0000, 16 }, 
  { 0x1c0000, 16 }, 
  { 0x1d0000, 16 }, 
  { 0x1e0000, 16 }, 
  { 0x1f0000, 16 }, 
  { 0x200000, 16 }, 
  { 0x210000, 16 }, 
  { 0x220000, 16 }, 
  { 0x230000, 16 }, 
  { 0x240000, 16 }, 
  { 0x250000, 16 }, 
  { 0x260000, 16 }, 
  { 0x270000, 16 }, 
  { 0x280000, 16 }, 
  { 0x290000, 16 }, 
  { 0x2a0000, 16 }, 
  { 0x2b0000, 16 }, 
  { 0x2c0000, 16 }, 
  { 0x2d0000, 16 }, 
  { 0x2e0000, 16 }, 
  { 0x2f0000, 16 }, 
  { 0x300000, 16 }, 
  { 0x310000, 16 }, 
  { 0x320000, 16 }, 
  { 0x330000, 16 }, 
  { 0x340000, 16 }, 
  { 0x350000, 16 }, 
  { 0x360000, 16 }, 
  { 0x370000, 16 }, 
  { 0x380000, 16 }, 
  { 0x390000, 16 }, 
  { 0x3a0000, 16 }, 
  { 0x3b0000, 16 }, 
  { 0x3c0000, 16 }, 
  { 0x3d0000, 16 }, 
  { 0x3e0000, 16 }, 
  { 0x3f0000, 16 }, 
  { 0x400000, 16 }, 
  { 0x410000, 16 }, 
  { 0x420000, 16 }, 
  { 0x430000, 16 }, 
  { 0x440000, 16 }, 
  { 0x450000, 16 }, 
  { 0x460000, 16 }, 
  { 0x470000, 16 }, 
  { 0x480000, 16 }, 
  { 0x490000, 16 }, 
  { 0x4a0000, 16 }, 
  { 0x4b0000, 16 }, 
  { 0x4c0000, 16 }, 
  { 0x4d0000, 16 }, 
  { 0x4e0000, 16 }, 
  { 0x4f0000, 16 }, 
  { 0x500000, 16 }, 
  { 0x510000, 16 }, 
  { 0x520000, 16 }, 
  { 0x530000, 16 }, 
  { 0x540000, 16 }, 
  { 0x550000, 16 }, 
  { 0x560000, 16 }, 
  { 0x570000, 16 }, 
  { 0x580000, 16 }, 
  { 0x590000, 16 }, 
  { 0x5a0000, 16 }, 
  { 0x5b0000, 16 }, 
  { 0x5c0000, 16 }, 
  { 0x5d0000, 16 }, 
  { 0x5e0000, 16 }, 
  { 0x5f0000, 16 }, 
  { 0x600000, 16 }, 
  { 0x610000, 16 }, 
  { 0x620000, 16 }, 
  { 0x630000, 16 }, 
  { 0x640000, 16 }, 
  { 0x650000, 16 }, 
  { 0x660000, 16 }, 
  { 0x670000, 16 }, 
  { 0x680000, 16 }, 
  { 0x690000, 16 }, 
  { 0x6a0000, 16 }, 
  { 0x6b0000, 16 }, 
  { 0x6c0000, 16 }, 
  { 0x6d0000, 16 }, 
  { 0x6e0000, 16 }, 
  { 0x6f0000, 16 }, 
  { 0x700000, 16 }, 
  { 0x710000, 16 }, 
  { 0x720000, 16 }, 
  { 0x730000, 16 }, 
  { 0x740000, 16 }, 
  { 0x750000, 16 }, 
  { 0x760000, 16 }, 
  { 0x770000, 16 }, 
  { 0x780000, 16 }, 
  { 0x790000, 16 }, 
  { 0x7a0000, 16 }, 
  { 0x7b0000, 16 }, 
  { 0x7c0000, 16 }, 
  { 0x7d0000, 16 }, 
  { 0x7e0000, 16 }, 
  { 0x7f0000, 16 }, 
 
  { 0x800000, 16 }, 
  { 0x810000, 16 }, 
  { 0x820000, 16 }, 
  { 0x830000, 16 }, 
  { 0x840000, 16 }, 
  { 0x850000, 16 }, 
  { 0x860000, 16 }, 
  { 0x870000, 16 }, 
  { 0x880000, 16 }, 
  { 0x890000, 16 }, 
  { 0x8a0000, 16 }, 
  { 0x8b0000, 16 }, 
  { 0x8c0000, 16 }, 
  { 0x8d0000, 16 }, 
  { 0x8e0000, 16 }, 
  { 0x8f0000, 16 }, 
  { 0x900000, 16 }, 
  { 0x910000, 16 }, 
  { 0x920000, 16 }, 
  { 0x930000, 16 }, 
  { 0x940000, 16 }, 
  { 0x950000, 16 }, 
  { 0x960000, 16 }, 
  { 0x970000, 16 }, 
  { 0x980000, 16 }, 
  { 0x990000, 16 }, 
  { 0x9a0000, 16 }, 
  { 0x9b0000, 16 }, 
  { 0x9c0000, 16 }, 
  { 0x9d0000, 16 }, 
  { 0x9e0000, 16 }, 
  { 0x9f0000, 16 }, 
  { 0xa00000, 16 }, 
  { 0xa10000, 16 }, 
  { 0xa20000, 16 }, 
  { 0xa30000, 16 }, 
  { 0xa40000, 16 }, 
  { 0xa50000, 16 }, 
  { 0xa60000, 16 }, 
  { 0xa70000, 16 }, 
  { 0xa80000, 16 }, 
  { 0xa90000, 16 }, 
  { 0xaa0000, 16 }, 
  { 0xab0000, 16 }, 
  { 0xac0000, 16 }, 
  { 0xad0000, 16 }, 
  { 0xae0000, 16 }, 
  { 0xaf0000, 16 }, 
  { 0xb00000, 16 }, 
  { 0xb10000, 16 }, 
  { 0xb20000, 16 }, 
  { 0xb30000, 16 }, 
  { 0xb40000, 16 }, 
  { 0xb50000, 16 }, 
  { 0xb60000, 16 }, 
  { 0xb70000, 16 }, 
  { 0xb80000, 16 }, 
  { 0xb90000, 16 }, 
  { 0xba0000, 16 }, 
  { 0xbb0000, 16 }, 
  { 0xbc0000, 16 }, 
  { 0xbd0000, 16 }, 
  { 0xbe0000, 16 }, 
  { 0xbf0000, 16 }, 
  { 0xc00000, 16 }, 
  { 0xc10000, 16 }, 
  { 0xc20000, 16 }, 
  { 0xc30000, 16 }, 
  { 0xc40000, 16 }, 
  { 0xc50000, 16 }, 
  { 0xc60000, 16 }, 
  { 0xc70000, 16 }, 
  { 0xc80000, 16 }, 
  { 0xc90000, 16 }, 
  { 0xca0000, 16 }, 
  { 0xcb0000, 16 }, 
  { 0xcc0000, 16 }, 
  { 0xcd0000, 16 }, 
  { 0xce0000, 16 }, 
  { 0xcf0000, 16 }, 
  { 0xd00000, 16 }, 
  { 0xd10000, 16 }, 
  { 0xd20000, 16 }, 
  { 0xd30000, 16 }, 
  { 0xd40000, 16 }, 
  { 0xd50000, 16 }, 
  { 0xd60000, 16 }, 
  { 0xd70000, 16 }, 
  { 0xd80000, 16 }, 
  { 0xd90000, 16 }, 
  { 0xda0000, 16 }, 
  { 0xdb0000, 16 }, 
  { 0xdc0000, 16 }, 
  { 0xdd0000, 16 }, 
  { 0xde0000, 16 }, 
  { 0xdf0000, 16 }, 
  { 0xe00000, 16 }, 
  { 0xe10000, 16 }, 
  { 0xe20000, 16 }, 
  { 0xe30000, 16 }, 
  { 0xe40000, 16 }, 
  { 0xe50000, 16 }, 
  { 0xe60000, 16 }, 
  { 0xe70000, 16 }, 
  { 0xe80000, 16 }, 
  { 0xe90000, 16 }, 
  { 0xea0000, 16 }, 
  { 0xeb0000, 16 }, 
  { 0xec0000, 16 }, 
  { 0xed0000, 16 }, 
  { 0xee0000, 16 }, 
  { 0xef0000, 16 }, 
  { 0xf00000, 16 }, 
  { 0xf10000, 16 }, 
  { 0xf20000, 16 }, 
  { 0xf30000, 16 }, 
  { 0xf40000, 16 }, 
  { 0xf50000, 16 }, 
  { 0xf60000, 16 }, 
  { 0xf70000, 16 }, 
  { 0xf80000, 16 }, 
  { 0xf90000, 16 }, 
  { 0xfa0000, 16 }, 
  { 0xfb0000, 16 }, 
  { 0xfc0000, 16 }, 
  { 0xfd0000, 16 }, 
  { 0xfe0000, 16 }, 
  { 0xff0000, 16 } 
 
   
}; 
 
 
 
 
// 128x64kb 
static const struct block_info_s flash_128x64[] = 
{ 
  { 0x00000, 16 }, 
  { 0x10000, 16 }, 
  { 0x20000, 16 }, 
  { 0x30000, 16 }, 
  { 0x40000, 16 }, 
  { 0x50000, 16 }, 
  { 0x60000, 16 }, 
  { 0x70000, 16 }, 
  { 0x80000, 16 }, 
  { 0x90000, 16 }, 
  { 0xa0000, 16 }, 
  { 0xb0000, 16 }, 
  { 0xc0000, 16 }, 
  { 0xd0000, 16 }, 
  { 0xe0000, 16 }, 
  { 0xf0000, 16 }, 
  { 0x100000, 16 }, 
  { 0x110000, 16 }, 
  { 0x120000, 16 }, 
  { 0x130000, 16 }, 
  { 0x140000, 16 }, 
  { 0x150000, 16 }, 
  { 0x160000, 16 }, 
  { 0x170000, 16 }, 
  { 0x180000, 16 }, 
  { 0x190000, 16 }, 
  { 0x1a0000, 16 }, 
  { 0x1b0000, 16 }, 
  { 0x1c0000, 16 }, 
  { 0x1d0000, 16 }, 
  { 0x1e0000, 16 }, 
  { 0x1f0000, 16 }, 
  { 0x200000, 16 }, 
  { 0x210000, 16 }, 
  { 0x220000, 16 }, 
  { 0x230000, 16 }, 
  { 0x240000, 16 }, 
  { 0x250000, 16 }, 
  { 0x260000, 16 }, 
  { 0x270000, 16 }, 
  { 0x280000, 16 }, 
  { 0x290000, 16 }, 
  { 0x2a0000, 16 }, 
  { 0x2b0000, 16 }, 
  { 0x2c0000, 16 }, 
  { 0x2d0000, 16 }, 
  { 0x2e0000, 16 }, 
  { 0x2f0000, 16 }, 
  { 0x300000, 16 }, 
  { 0x310000, 16 }, 
  { 0x320000, 16 }, 
  { 0x330000, 16 }, 
  { 0x340000, 16 }, 
  { 0x350000, 16 }, 
  { 0x360000, 16 }, 
  { 0x370000, 16 }, 
  { 0x380000, 16 }, 
  { 0x390000, 16 }, 
  { 0x3a0000, 16 }, 
  { 0x3b0000, 16 }, 
  { 0x3c0000, 16 }, 
  { 0x3d0000, 16 }, 
  { 0x3e0000, 16 }, 
  { 0x3f0000, 16 }, 
  { 0x400000, 16 }, 
  { 0x410000, 16 }, 
  { 0x420000, 16 }, 
  { 0x430000, 16 }, 
  { 0x440000, 16 }, 
  { 0x450000, 16 }, 
  { 0x460000, 16 }, 
  { 0x470000, 16 }, 
  { 0x480000, 16 }, 
  { 0x490000, 16 }, 
  { 0x4a0000, 16 }, 
  { 0x4b0000, 16 }, 
  { 0x4c0000, 16 }, 
  { 0x4d0000, 16 }, 
  { 0x4e0000, 16 }, 
  { 0x4f0000, 16 }, 
  { 0x500000, 16 }, 
  { 0x510000, 16 }, 
  { 0x520000, 16 }, 
  { 0x530000, 16 }, 
  { 0x540000, 16 }, 
  { 0x550000, 16 }, 
  { 0x560000, 16 }, 
  { 0x570000, 16 }, 
  { 0x580000, 16 }, 
  { 0x590000, 16 }, 
  { 0x5a0000, 16 }, 
  { 0x5b0000, 16 }, 
  { 0x5c0000, 16 }, 
  { 0x5d0000, 16 }, 
  { 0x5e0000, 16 }, 
  { 0x5f0000, 16 }, 
  { 0x600000, 16 }, 
  { 0x610000, 16 }, 
  { 0x620000, 16 }, 
  { 0x630000, 16 }, 
  { 0x640000, 16 }, 
  { 0x650000, 16 }, 
  { 0x660000, 16 }, 
  { 0x670000, 16 }, 
  { 0x680000, 16 }, 
  { 0x690000, 16 }, 
  { 0x6a0000, 16 }, 
  { 0x6b0000, 16 }, 
  { 0x6c0000, 16 }, 
  { 0x6d0000, 16 }, 
  { 0x6e0000, 16 }, 
  { 0x6f0000, 16 }, 
  { 0x700000, 16 }, 
  { 0x710000, 16 }, 
  { 0x720000, 16 }, 
  { 0x730000, 16 }, 
  { 0x740000, 16 }, 
  { 0x750000, 16 }, 
  { 0x760000, 16 }, 
  { 0x770000, 16 }, 
  { 0x780000, 16 }, 
  { 0x790000, 16 }, 
  { 0x7a0000, 16 }, 
  { 0x7b0000, 16 }, 
  { 0x7c0000, 16 }, 
  { 0x7d0000, 16 }, 
  { 0x7e0000, 16 }, 
  { 0x7f0000, 16 } 
}; 
 
// 16x64kB 
static const struct block_info_s flash_16x64[] = 
{ 
    { 0x00000, 16 }, 
    { 0x10000, 16 }, 
    { 0x20000, 16 }, 
    { 0x30000, 16 }, 
    { 0x40000, 16 }, 
    { 0x50000, 16 }, 
    { 0x60000, 16 }, 
    { 0x70000, 16 }, 
    { 0x80000, 16 }, 
    { 0x90000, 16 }, 
    { 0xA0000, 16 }, 
    { 0xB0000, 16 }, 
    { 0xC0000, 16 }, 
    { 0xD0000, 16 }, 
    { 0xE0000, 16 }, 
    { 0xF0000, 16 } 
}; 
 
// 8x128kB 
static const struct block_info_s flash_8x128[] = 
{ 
    { 0x00000, 17 }, 
    { 0x20000, 17 }, 
    { 0x40000, 17 }, 
    { 0x60000, 17 }, 
    { 0x80000, 17 }, 
    { 0xA0000, 17 }, 
    { 0xC0000, 17 }, 
    { 0xE0000, 17 } 
}; 
 
// 8x8kB 
static const struct block_info_s flash_8x8[] = 
{ 
    { 0x0000, 13 }, 
    { 0x2000, 13 }, 
    { 0x4000, 13 }, 
    { 0x6000, 13 }, 
    { 0x8000, 13 }, 
    { 0xa000, 13 }, 
    { 0xc000, 13 }, 
    { 0xe000, 13 } 
}; 
 
// 8x4kB 
static const struct block_info_s flash_8x4[] = 
{ 
    { 0x0000, 12 }, 
    { 0x1000, 12 }, 
    { 0x2000, 12 }, 
    { 0x3000, 12 }, 
    { 0x4000, 12 }, 
    { 0x5000, 12 }, 
    { 0x6000, 12 }, 
    { 0x7000, 12 } 
}; 
 
// wangwang :  
// 8x64kB 
static const struct block_info_s flash_8x64[] = 
{ 
    { 0x00000, 16 }, 
    { 0x10000, 16 }, 
    { 0x20000, 16 }, 
    { 0x30000, 16 }, 
    { 0x40000, 16 },   
    { 0x50000, 16 }, 
    { 0x60000, 16 }, 
    { 0x70000, 16 }, 
    { 0x80000, 16 }, 
    { 0x90000, 16 }, 
    { 0xA0000, 16 }, 
    { 0xB0000, 16 }, 
    { 0xC0000, 16 }, 
    { 0xD0000, 16 }, 
    { 0xE0000, 16 }, 
    
}; 
/****************************************************************************** 
 * Flash Device Info Array 
 ******************************************************************************/ 
 
// Each entry in the array below represents one flash device definition as 
// FFS needs it. The columns have the following meaning: 
// 
// 1. Device memory map. 
// 2. Absolute address of the first sector to be used by/for FFS. 
// 3. Manufacturer code. Values are from FFS_MANUFACTURER enumeration 
//    in drv.h 
// 4. Device code. Available from device datasheet. 
// 5. FFS device driver to use. Values are from FFS_DRIVER enumeration 
//    in drv.h 
// 6. Number of sectors to use, starting from the address given in 
//    column 2. 
 
/********** RAM configuration ************************************************* 
 * Note it is necessary to hardwire the configuration of the ram driver 
 * in cfgffs.c. The ram driver is configured like and pseudo flash 
 * device with only a few exceptions: Field 2 which is the absolute 
 * address of the first sector MUST be set to zero, instead the address 
 * is configured in cfgffs.c. Field 4 'Device code' is an arbitrary 
 * value and not a real device code. 
 ******************************************************************************/ 
 
/********** Multi-id configuration ******************************************** 
 * When 227Eh is output, it indicates that two additional codes, called 
 * Extended Device Codes, will be required. The two additional codes will be 
 * read and the lower byte of each code will be combined into one id, which 
 * is used for auto-detection of the flash configuration. The device code 
 * format for the multi-id devices is as follow: 0x227E, 0x22YY, 0x22ZZ -> 
 * 0xYYZZ. 
 ******************************************************************************/ 
 
const struct flash_info_s flash_info[] = 
{ 
    // Ram device 8x4kB. Note it is necessary to hardwire the conf 
    //in cfgffs.c 
    { &flash_8x4[0], 0, MANUFACT_RAM,  0x0404, 
      FFS_DRIVER_RAM,  4},     
 
    // BOARD 35/46. Ram device 8x4kB. Note it is necessary to hardwire the 
    //conf in cfgffs.c 
    { &flash_8x4[0], 0, MANUFACT_RAM,  0x0804, 
      FFS_DRIVER_RAM,  8},     
 
    // Ram device 8x8kB. Note it is necessary to hardwire the conf in cfgffs.c  
    { &flash_8x8[0], 0, MANUFACT_RAM,  0x080D, 
      FFS_DRIVER_RAM,  8},     
 
    /********** AMD Devices ***********************************************/ 
 
    // AMD Am29DL321DT does not exist as of 2000-0217 
 
    // AMD Am29DL322DT. Ignoring the 8kB sectors  
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_AMD,     0x2255, 
      FFS_DRIVER_AMD_SB, 7 }, 
 
    // AMD Am29DL323DT. Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x300000, MANUFACT_AMD,     0x2250, 
      FFS_DRIVER_AMD, 15 }, 
 
    // AMD Am29DL161DT. Using 8x8kB sectors. 
    { &flash_8x8[0],   (char *) 0x1F0000, MANUFACT_AMD,     0x2236, 
      FFS_DRIVER_AMD,  8 }, 
 
    // AMD Am29DL162DT. Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_AMD,     0x222D, 
      FFS_DRIVER_AMD,  3 }, 
 
    // AMD Am29DL163DT. Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x180000, MANUFACT_AMD,     0x2228, 
      FFS_DRIVER_AMD,  7 }, 
 
    // AMD Am29DL164DT. Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x100000, MANUFACT_AMD,     0x2233, 
      FFS_DRIVER_AMD, 15 }, 
  
    // Spansion S71PL129Jb0, Esample Rev4 flash device, Multi-id device: 
    // 0x227E, 0x2221, 0x2200 
    { &flash_16x64[0], (char *) 0x04700000, MANUFACT_AMD,   0x2100, 
      FFS_DRIVER_AMD_SB, 15 }, 
    // Esample Rev. 4. flash device:	 
    // Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x04700000, MANUFACT_AMD, 0x227E, 
      FFS_DRIVER_AMD_SB, 15 }, 
 
    // Spansion S71NS128JA0, LoCosto flash device, Multi-id(?) device: 
    // LoCosto device:	 
    // Ignoring the 8kB sectors 
   /* { &flash_16x64[0], (char *) 0x04700000, MANUFACT_AMD, 0x007E, 
      FFS_DRIVER_AMD_SB, 15 },   */ 
 
  /* spansion S29NS128J  Excluding 8kb sectors of bank A */ 
 { &flash_256x64[0], (char *) 0x06700000, MANUFACT_AMD, 0x007E, 
     //OMAPS62129 change to Pseudo SB type 
     FFS_DRIVER_AMD_NOR_PSEUDO_SB, 15 }, 
 
 
#if 0 
 
  /* spansion S29NS128N (Mirror bit)  Excluding 16k2 sectors of bank 15 */ 
 { &flash_128x64kw[0], (char *) 0x06700000, MANUFACT_AMD, 0x0900, 
      FFS_DRIVER_AMD_MIRROR_BIT,  15},    
#endif 
                      
   /* Caisheng: spansion S71NS128NB0 */ 
// { &flash_128x64kw[0], (char *) 0x06400000, MANUFACT_AMD, 0x0900, 
 /*{ &flash_128x64kw[0], (char *) 0x06800000, MANUFACT_AMD, 0x3500, 
      FFS_DRIVER_AMD_MIRROR_BIT,  63},  //fangcj:  last 4 blocks should be discard because its size is 32k bytes*/ 
     { &flash_128x64kw[0], (char *) 0x06300000, MANUFACT_AMD, 0x3500, 
      FFS_DRIVER_AMD_MIRROR_BIT,  8},   
 
    /********** Fujitsu Devices *******************************************/ 
 
    // Fujitsu MBM29DL321TD. Using 8x8kB sectors. 
    { &flash_8x8[0],   (char *) 0x3f0000, MANUFACT_FUJITSU, 0x2259, 
      FFS_DRIVER_AMD,  8 }, 
 
    // Fujitsu MBM29DL322TD. Ignoring all the 8kB sectors 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_FUJITSU, 0x2255, 
      FFS_DRIVER_AMD,  7 }, 
 
    // Fujitsu MBM29DL323TD (BSample). Dual bank device definition. 
    { &flash_16x64[0], (char *) 0x300000, MANUFACT_FUJITSU, 0x2250, 
      FFS_DRIVER_AMD, 15 }, 
 
    // Fujitsu MBM29DL161DT (similar to Am29DL161T).  
    { &flash_8x8[0],   (char *) 0x1F0000, MANUFACT_FUJITSU, 0x2236, 
      FFS_DRIVER_AMD,  8 }, 
 
    // Fujitsu MBM29DL162DT (similar to Am29DL162T). 
    { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_FUJITSU, 0x222D, 
      FFS_DRIVER_AMD,  3 }, 
 
    // Fujitsu MBM29DL163DT (similar to Am29DL163T). 
    { &flash_16x64[0], (char *) 0x180000, MANUFACT_FUJITSU, 0x2228, 
      FFS_DRIVER_AMD,  7 }, 
 
    // Fujitsu MBM29DL164DT (similar to Am29DL164T). 
    { &flash_16x64[0], (char *) 0x100000, MANUFACT_FUJITSU, 0x2233, 
      FFS_DRIVER_AMD, 15 }, 
 
    // RITA flash configuration Multi-id device: 0x227E, 0x220A, 0x2200  
    // Fujitsu MBM29DL320BF, Ignoring the 8kB sectors 
    { &flash_16x64[0], (char *) 0x320000, MANUFACT_FUJITSU, 0x0A00, 
      FFS_DRIVER_AMD_SB, 13 }, 
 
    // Fujitsu  84VF5F5F4J2, Multi-id device: 0x227E, 0x2202, 0x2201 
    { &flash_16x64[0], (char *) 0x04700000, MANUFACT_FUJITSU, 0x0201, 
      FFS_DRIVER_AMD_SB, 15 }, 
 
    // Fujitsu 84VP24491HK-70, Esample Rev3 Multi-id device: 0x227E, 0x2221, 
    // 0x2200 
    { &flash_16x64[0], (char *) 0x04700000, MANUFACT_FUJITSU, 0x2100, 
      FFS_DRIVER_AMD_SB, 15 }, 
 
    // Fujitsu MB84VF5F5F4J2 stacked device. Using the 2nd sub device. The 
    // 8x8kB blocks are located both in top and bottom, thus only 126 64kB 
    // blocks are used. 
    { &flash_128x64[0], (char *) 0x1810000, MANUFACT_FUJITSU, 0xB496, 
      FFS_DRIVER_AMD_SB, 126 }, 
 
    /********** Intel Devices *********************************************/ 
#ifdef INTEL_FLASH 
    // wangwang : this is for fwp 32x16 flash config 
    { &flash_8x64[0],   (char *) 0x06380000, MANUFACT_INTEL,   0x8872, 
      //FFS_DRIVER_INTEL, 15}, 
      //FFS_DRIVER_INTEL,10},//maggie 2007-10-06 
      FFS_DRIVER_INTEL,7},//maggie 2007-10-13 
      //FFS_DRIVER_INTEL,5},//maggie 2007-10-23 
       
    // Intel 28F160C3-T 16Mb. Using top-most 8x8kB (parameter) sectors. 
    { &flash_8x8[0],   (char *) 0x1F0000, MANUFACT_INTEL,   0x88C2, 
      FFS_DRIVER_INTEL_SB,  8 }, 
 
    // Intel 28F160C3-B, 16Mb. Using top-most 6x64kB sectors 
    { &flash_16x64[0], (char *) 0x1A0000, MANUFACT_INTEL,   0x88C3, 
      FFS_DRIVER_INTEL_SB,  6 }, 
 
    // Intel 28F320C3-T, 32Mb. Using top-most 8x8kB (parameter) sectors. 
    { &flash_8x8[0],   (char *) 0x3F0000, MANUFACT_INTEL,   0x88C4, 
      FFS_DRIVER_INTEL_SB,  8 }, 
 
    // Intel 28F320C3-B, 32Mb. Using top-most 8x64kB sectors 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_INTEL,   0x88C5, 
      FFS_DRIVER_INTEL_SB,  8 }, 
 
    // Intel 28F640C3-T, 64Mb. Using top-most 8x8kB (parameter) sectors. 
    { &flash_8x8[0],   (char *) 0x7F0000, MANUFACT_INTEL,   0x88CC, 
      FFS_DRIVER_INTEL_SB,  8 }, 
 
    // Intel 28F640C3-B, 64Mb. Using top-most 16x64kB sectors 
    { &flash_16x64[0], (char *) 0x700000, MANUFACT_INTEL,   0x88CD, 
      FFS_DRIVER_INTEL_SB, 15 }, 
 
    // Intel 28F640W30-T, 64Mb. Using top-most 8x8kB sectors 
    { &flash_8x8[0], (char *) 0x7F0000, MANUFACT_INTEL,   0x8854, 
      FFS_DRIVER_INTEL_SB, 8 }, 
 
    // Intel 28F640W30-B, 64Mb. (DSample). Using top-most 47x64kB sectors 
//    { &flash_128x64[0], (char *) 0x500000, MANUFACT_INTEL,   0x8855, 
//      FFS_DRIVER_INTEL_SB, 47 }, 
 
	// Intel 28F640W30-B, 64Mb. (DSample). Using top-most 15x64kB sectors 
    { &flash_16x64[0], (char *) 0x700000, MANUFACT_INTEL,   0x8855, 
      FFS_DRIVER_INTEL, 15 }, 
 
    // Intel 28F640W30-B, 64Mb. (DSample). Using top-most 15x64kB sectors 
    { &flash_16x64[0], (char *) 0x700000, MANUFACT_INTEL,   0x88FF, 
      FFS_DRIVER_INTEL_SB, 15 }, 
 
    // Intel StrataFlash (ESample).  
    { &flash_8x128[0], (char *) 0x4700000, MANUFACT_INTEL,   0x8812, 
      FFS_DRIVER_INTEL_BW, 8 }, 
       
  /* fangcj added intel flash */ 
 { &flash_128x64kw[0], (char *) 0x06400000, MANUFACT_INTEL, 0x8809, 
      FFS_DRIVER_INTEL_BW,  32},   
#endif 
    /********** MXIC Devices *******************************************/ 
 
        // Intel 28F640W30-T, 64Mb. Using top-most 8x8kB sectors 
    { &flash_8x8[0], (char *) 0x3F0000, MANUFACT_MXIC,   0x0024, 
      FFS_DRIVER_INTEL_SB, 8 }, 
 
 
    /********** Samsung Devices *******************************************/ 
 
    // Samsung K5A3240YT Top boot, 24Mb + 8Mb 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x22B7, 
      FFS_DRIVER_AMD_SB,  7 }, 
 
    // Samsung K5A3340YT Top boot, 16Mb + 16Mb 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x22BA, 
      FFS_DRIVER_AMD_SB,  7 }, 
 
    // Samsung K5A3240YB Bottom boot, 8Mb + 24Mb 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x223F, 
      FFS_DRIVER_AMD_SB,  8 }, 
 
    // Samsung K5A3340YB Bottom boot, 14Mb + 18Mb (!?) 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x223D, 
      FFS_DRIVER_AMD_SB,  8 }, 
 
 
    /********** SST Devices ***********************************************/ 
 
    // SST SST36VF1601 
    { &flash_16x64[0], (char *) 0x180000, MANUFACT_SST,     0x2761, 
      FFS_DRIVER_SST,  8 }, 
 
    /********** Toshiba Devices *******************************************/ 
 
    // Toshiba TH50VSF2581AASB Bottom boot combo device 
    { &flash_16x64[0], (char *) 0x380000, MANUFACT_TOSHIBA, 0x009C, 
      FFS_DRIVER_AMD,  8 }, 
 
 
    /********** Special/Test Devices **************************************/ 
 
    // For PC simulation the following syntax is used instead of the device 
    // code: 0xYYZZ where YY is number of blocks and ZZ is the size of the 
    // blocks but as 2^ZZ 
 
    // PC Test/Simulation flash 16x64kB (1MB) 
    { &flash_16x64[0], (char *) 0x000000, MANUFACT_TEST,    0x0F10, 
      FFS_DRIVER_TEST, 15 }, 
 
    // PC Test/Simulation flash 128x64kb (almost 8MB) 
    { &flash_128x64[0], (char *) 0x000000, MANUFACT_TEST,   0x8010, 
      FFS_DRIVER_TEST, 127 }, 
 
    // PC Test/Simulation flash 8x128kB (1MB strata alike block size) 
    { &flash_8x128[0], (char *) 0x000000, MANUFACT_TEST,    0x0811, 
      FFS_DRIVER_TEST_BW, 8 }, 
 
    // PC Test/Simulation flash 8x8kB (64kB) 
    { &flash_8x8[0],   (char *) 0x000000, MANUFACT_TEST,    0x080D, 
      FFS_DRIVER_TEST, 8 }, 
 
    // PC Test/Simulation flash 4x4kB (16kB) 
    { &flash_8x4[0],   (char *) 0x000000, MANUFACT_TEST,    0x0404, 
      FFS_DRIVER_TEST, 4 }, 
 
    // terminator 
    { 0, 0, 0, 0 } 
};