分类: 嵌入式
2009-07-31 12:14:15
Flash 型号:S29AL016D90TFI001
016是flash 的大小
Get the Flash Erase Block Size.
In boot:
EVM # flinfo
Bank # 1: MY AMD 29LV256M (256 Mbit)
Size: 16 MB in 256 Sectors
Sector Start Addresses:
02000000 02010000 02020000 (RO) 02030000 (RO) 02040000
02050000 02060000 02070000 02080000 02090000
. .
02FA0000 02FB0000 02FC0000 02FD0000 02FE0000
02FF0000
You can calculate the erase size in
Bytes by either:
1.(size/sectors) * 1024 * 1024 =
(16/256) * 1024 * 1024 = 65536 bytes (0x10000)
NOTE that
size and sectors are obtained from the "Size:" line in the flinfo
output
2.Observing the difference between
two adjacent sectors. i.e.
0x2010000 -
0x2000000 = 0x10000
In linux:
target$ cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "bootloader"
mtd1: 00020000 00010000 "params"
mtd2: 00400000 00010000 "kernel"
mtd3: 00bc0000 00010000 "filesystem"
开发板增加了一片 flash , 现在有两片flash 所以要修改 boot .
# vi package/devs/flash/arm/w90n740/current/src/arm_w90n740_flash.c
把 #define CYGNUM_FLASH_INTERLEAVE (1) ---flash的片数
改为 #define CYGNUM_FLASH_INTERLEAVE (2)
该文件的其它宏:
#define CYGNUM_FLASH_BASE (0xff000000u)
---基地址
#define CYGNUM_FLASH_WIDTH (16)
---位宽