u-boot-2012.04.01移植到mini2440②

首先添加调试,在\u-boot-2012.04.01\include\configs\Mini2440.h中添加#define DEBUG 1

编译完的程序运行后出现

 

\drivers\mtd\Cfi_flash.c中的代码可以查找到debug("JEDEC PROBE: ID %x %x %x\n"

跟踪jedec_flash_match函数找到jedec_flash.c(drivers/mtd)

添加

{
                    .mfr_id = 1,
                    .dev_id = 0x2249,
                    .name = "Am29LV160DB",
                    .uaddr = {
                        [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
                    },
                    .DevSize = SIZE_2MiB,
                    .CmdSet = CFI_CMDSET_AMD_LEGACY,
                    .NumEraseRegions = 4,
                    .regions = {
                        ERASEINFO(0x04000, 1),
                        ERASEINFO(0x02000, 2),
                        ERASEINFO(0x08000, 1),
                        ERASEINFO(0x10000, 31),
                    }
            },

提示Flash: ERROR: too many flash sectors
    搜索发现#define CONFIG_SYS_MAX_FLASH_SECT (19)  //(z:\u-boot-2012.04.01\include\configs\Mini2440.h)
    修改大一点#define CONFIG_SYS_MAX_FLASH_SECT (128)

posted @ 2013-04-15 16:26  memoryaty  阅读(163)  评论(0编辑  收藏  举报