zynq u-boot启动中提示SF: unrecognized JEDEC id bytes: c2, 20, 19

技术文章 8个月前 完美者
1,725 0

标签:read   turn   方法   end   option   c中   ash   rgba   ++   

错误现象:

 

技术图片

 

 原因分析:

\u-boot-xlnx-xilinx-v2018.1\u-boot-xlnx-xilinx-v2018.1\drivers\mtd\spi\ spi_flash.c中

static const struct spi_flash_info *spi_flash_read_id(struct spi_flash *flash)
{
    int                tmp;
    u8                id[SPI_FLASH_MAX_ID_LEN];
    const struct spi_flash_info    *info;

#ifdef CONFIG_SPI_GENERIC
    if (flash->spi->option & SF_DUAL_PARALLEL_FLASH)
            flash->spi->flags |= SPI_XFER_LOWER;
#endif

    tmp = spi_flash_cmd(flash->spi, CMD_READ_ID, id, SPI_FLASH_MAX_ID_LEN);
    if (tmp < 0) {
        printf("SF: error %d reading JEDEC ID\n", tmp);
        return ERR_PTR(tmp);
    }

    info = spi_flash_ids;
    for (; info->name != NULL; info++) {
        if (info->id_len) {
            if (!memcmp(info->id, id, info->id_len))
                return info;
        }
    }

    printf("SF: unrecognized JEDEC id bytes: %02x, %02x, %02x\n",
           id[0], id[1], id[2]);
    return ERR_PTR(-ENODEV);
}

spi_flash_read_id(struct spi_flash *flash)函数中需要读flashID,info = spi_flash_ids;对应的时ID列表,

u-boot-xlnx-xilinx-v2018.1\u-boot-xlnx-xilinx-v2018.1\drivers\mtd\spi\ spi_flash_ids.c中定义了

#ifdef CONFIG_SPI_FLASH_MACRONIX    /* MACRONIX */
    {"mx25l2006e",       INFO(0xc22012, 0x0, 64 * 1024,     4, 0) },
    {"mx25l4005",       INFO(0xc22013, 0x0, 64 * 1024,     8, 0) },
    {"mx25l8005",       INFO(0xc22014, 0x0, 64 * 1024,    16, 0) },
    {"mx25l1605d",       INFO(0xc22015, 0x0, 64 * 1024,    32, 0) },
    {"mx25l3205d",       INFO(0xc22016, 0x0, 64 * 1024,    64, 0) },
    {"mx25l6405d",       INFO(0xc22017, 0x0, 64 * 1024,   128, 0) },
    {"mx25l12805",       INFO(0xc22018, 0x0, 64 * 1024,   256, RD_FULL | WR_QPP) },
    {"mx25l25635f",       INFO(0xc22019, 0x0, 64 * 1024,   512, RD_FULL | WR_QPP) },
    {"mx25l51235f",       INFO(0xc2201a, 0x0, 64 * 1024,  1024, RD_FULL | WR_QPP) },
    {"mx25u6435f",       INFO(0xc22537, 0x0, 64 * 1024,   128, RD_FULL | WR_QPP) },
    {"mx25l12855e",       INFO(0xc22618, 0x0, 64 * 1024,   256, RD_FULL | WR_QPP) },
    {"mx25u1635e",     INFO(0xc22535, 0x0, 64 * 1024,  32, SECT_4K) },
    {"mx66u51235f",    INFO(0xc2253a, 0x0, 64 * 1024,  1024, RD_FULL | WR_QPP) },
    {"mx66l1g45g",     INFO(0xc2201b, 0x0, 64 * 1024,  2048, RD_FULL | WR_QPP) },
    {"mx66u1g45g",     INFO(0xc2253b, 0x0, 64 * 1024,  2048, RD_FULL | WR_QPP) },
#endif

因此生成u-boot的过程中,需要添加

CONFIG_SPI_FLASH_MACRONIX

解决方法:

在gedit configs/zynq_zed_defconfig 中添加

CONFIG_SPI_FLASH_MACRONIX=y

 问题解决

 

zynq u-boot启动中提示SF: unrecognized JEDEC id bytes: c2, 20, 19

标签:read   turn   方法   end   option   c中   ash   rgba   ++   

原文地址:https://www.cnblogs.com/cqlc/p/13898146.html

版权声明:完美者 发表于 2020-10-30 12:16:08。
转载请注明:zynq u-boot启动中提示SF: unrecognized JEDEC id bytes: c2, 20, 19 | 完美导航

暂无评论

暂无评论...