MT7620官方的SDK版本4.1.1.0中uboot源码并没有支持winbond(华邦)的W25Q128,但是经过简单的修改可以让uboot支持,修改的代码如下:
Uboot>drivers>spi_flash.c文件:
static struct chip_info chips_data [] = {
/* REVISIT: fill in JEDEC ids, for parts that have them */
{ "AT25DF321", 0x1f, 0x47000000, 64 * 1024, 64, 0 },
{ "AT26DF161", 0x1f, 0x46000000, 64 * 1024, 32, 0 },
{ "FL016AIF", 0x01, 0x02140000, 64 * 1024, 32, 0 },
{ "FL064AIF", 0x01, 0x02160000, 64 * 1024, 128, 0 },
{ "MX25L1605D", 0xc2, 0x2015c220, 64 * 1024, 32, 0 },
{ "MX25L3205D", 0xc2, 0x2016c220, 64 * 1024, 64, 0 },
{ "MX25L6405D", 0xc2, 0x2017c220, 64 * 1024, 128, 0 },
{ "MX25L12805D", 0xc2, 0x2018c220, 64 * 1024, 256, 0 },
#ifndef NO_4B_ADDRESS_SUPPORT
{ "MX25L25635E", 0xc2, 0x2019c220, 64 * 1024, 512, 1 },
{ "S25FL256S", 0x01, 0x02194D01, 64 * 1024, 512, 1 },
#endif
{ "S25FL128P", 0x01, 0x20180301, 64 * 1024, 256, 0 },
{ "S25FL129P", 0x01, 0x20184D01, 64 * 1024, 256, 0 },
{ "S25FL032P", 0x01, 0x02154D00, 64 * 1024, 64, 0 },
{ "S25FL064P", 0x01, 0x02164D00, 64 * 1024, 128, 0 },
{ "F25L64QA", 0x8c, 0x41170000, 64 * 1024, 128, 0 }, //ESMT
{ "EN25F16", 0x1c, 0x31151c31, 64 * 1024, 32, 0 },
{ "EN25Q32B", 0x1c, 0x30161c30, 64 * 1024, 64, 0 },
{ "EN25F32", 0x1c, 0x31161c31, 64 * 1024, 64, 0 },
{ "EN25F64", 0x1c, 0x20171c20, 64 * 1024, 128, 0 }, //EN25P64
{ "EN25Q64", 0x1c, 0x30171c30, 64 * 1024, 128, 0 },
{ "W25Q32BV", 0xef, 0x40160000, 64 * 1024, 64, 0 }, //S25FL032K
{ "W25Q64BV", 0xef, 0x40170000, 64 * 1024, 128, 0 }, //S25FL064K
{ "W25Q128BV", 0xef, 0x40180000, 64 * 1024, 256, 0 }, //S25FL0128K
};
增加上述的红色行。
同时修改Uboot>drivers>spi_rt6855A_flash.c文件中:
static struct chip_info chips_data [] = {
/* REVISIT: fill in JEDEC ids, for parts that have them */
{ "AT25DF321", 0x1f, 0x47000000, 64 * 1024, 64, 0 },
{ "AT26DF161", 0x1f, 0x46000000, 64 * 1024, 32, 0 },
{ "FL016AIF", 0x01, 0x02140000, 64 * 1024, 32, 0 },
{ "FL064AIF", 0x01, 0x02160000, 64 * 1024, 128, 0 },
{ "MX25L1605D", 0xc2, 0x2015c220, 64 * 1024, 32, 0 },
{ "MX25L3205D", 0xc2, 0x2016c220, 64 * 1024, 64, 0 },
{ "MX25L6405D", 0xc2, 0x2017c220, 64 * 1024, 128, 0 },
{ "MX25L12805D", 0xc2, 0x2018c220, 64 * 1024, 256, 0 },
{ "MX25L25635E", 0xc2, 0x2019c220, 64 * 1024, 512, 1 },
{ "S25FL256S", 0x01, 0x02194D01, 64 * 1024, 512, 1 },
{ "S25FL128P", 0x01, 0x20180301, 64 * 1024, 256, 0 },
{ "S25FL129P", 0x01, 0x20184D01, 64 * 1024, 256, 0 },
{ "S25FL032P", 0x01, 0x02154D00, 64 * 1024, 64, 0 },
{ "S25FL064P", 0x01, 0x02164D00, 64 * 1024, 128, 0 },
{ "F25L64QA", 0x8c, 0x41170000, 64 * 1024, 128, 0 }, //ESMT
{ "EN25F16", 0x1c, 0x31151c31, 64 * 1024, 32, 0 },
{ "EN25F32", 0x1c, 0x31161c31, 64 * 1024, 64, 0 },
{ "EN25Q32", 0x1c, 0x30161c30, 64 * 1024, 64, 0 },
{ "EN25F64", 0x1c, 0x20171c20, 64 * 1024, 128, 0 }, //EN25P64
{ "EN25Q64", 0x1c, 0x30171c30, 64 * 1024, 128, 0 },
{ "W25Q32BV", 0xef, 0x40160000, 64 * 1024, 64, 0 },
{ "W25Q64BV", 0xef, 0x40170000, 64 * 1024, 128, 0 }, //S25FL064K
{ "W25Q128BV", 0xef, 0x40180000, 64 * 1024, 256, 0 }, //S25FL128K
};
重新编译Uboot,即可在新编译的Ubbot中支持16M的华邦W25Q128的SPI flash了。
|