按照官方说法,移植uboot需要修改xls里的flash那栏,我们换的flash是MX25L25635FMI,看看各个参数
上面有很多例子了
看来只要配
name | jedec_id | ext_id | block_size | chip_size | clk | chip select |
mx25l1655d | 0xc2 0x26 0x15 | 0x0 | 65536 | 2097152 | 0x40100 | 1 |
就可以了
1. name是MX25l25635F
2. jedec_id是
RDID Command manufacturer ID memory type memory density
C2 26 15 //就是这个
RES Command electronic ID
26
REMS/REMS2/REMS4/
Command
manufacturer ID device ID
C2 26
所以我们的是
RDID 9Fh Manufactory ID Memory type Memory density
C2 20 19
3. ext_id不知是啥,spec中唯一提到的是
8-1. 256Mb Address Protocol
The original 24 bit address protocol of serial Flash can only access density size below 128Mb. For the memory
device of 256Mb and above, the 32bit address is requested for access higher memory size. The MX25L25635F
provides three different methods to access the whole 256Mb density:
(1)Command entry 4-byte address mode: Issue Enter 4-Byte mode command to set up the 4BYTE bit in
Configuration Register bit. After 4BYTE bit has been set, the number of address cycle become 32-bit.
(2)Extended Address Register (EAR): configure the memory device into two 128Mb segments to select which one
is active through the EAR bit “0”.
(3)4-byte Address Command Set: When issuing 4-byte address command set, 4-byte address (A31-A0) is
requested after the instruction code. Please note that it is not necessary to issue EN4B command before issuing
any of 4-byte command set.
就是说如果要分成两半访问,则要利用ear寄存器而已
4. block_size是65536。spec是这么写的
Program command is executed on byte basis, or page (256
bytes) basis, or word basis for erase command is executed on sector (4K-byte), block (32K-byte), or block (64K-byte),
or whole chip basis.有32k也有64k
5. chip_size
这个例子里的spec上写了16M:16,777,216 x 1 bit structure,而16777216/8正好是2097152,所以我们的mx25l256的size是16m的16倍,则是33554432
6. clk应该是外面提供的一样0x40100
7. chipselect 也是1
到此为止完成了xls的修改,接下来看uboot里的spi flash 流程