拿了个新板子,烧了程序,uboot冒出了这个错误.跟踪了一下,发现是不识别flash型号的问题.这...,都能跑uboot了,还不识别flash??追踪了下代码,却也发现了识别flash的合理性:
总得把flash的页大小,容量告诉uboot,之后uboot的读,写才能顺利进行.
/* search the table for matches in shift and id */
for (i = 0; i < ARRAY_SIZE(flashes); ++i)
if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
/* we have a match, call probe */
flash = flashes[i].probe(spi, idp);
if (flash)
break;
}
在uboot报错前,它已经对这个flash进行型号判断.flashes[]是一个结构体数组,内容是
static const struct {
const u8 shift;
const u8 idcode;
struct spi_flash *(*probe) (struct spi_slave *spi, u8 *idcode);
} flashes[] = {
/* Keep it sorted by define name */
#ifdef CONFIG_SPI_FLASH_ATMEL
{ 0, 0x1f, spi_flash_probe_atmel, },
#endif
#ifdef CONFIG_SPI_FLASH_EON
{ 0

在尝试烧录新板子上的uboot时遇到错误:SF:Unsupported manufacture。通过跟踪代码发现是uboot无法识别flash型号。解决方法是修改spi_flash_probe_stmicro()函数中的flash_table,添加对应芯片ID的条目。设置.pages_per_sector为256,表示每页256字节,.nr_sectors为128,表示128个页,以匹配64K单页大小的8M flash。

5592

被折叠的 条评论
为什么被折叠?



