移植U-Boot-2009.08到mini2440(三) NorFlash设置

2014-11-24 14:12:38 · 作者: · 浏览: 3

一、环境


目标板:mini2440


u-boot版本:u-boot-2009.08


交叉编译器:arm-linux-gcc-4.3.2


二、目的


从上一节的成果我们观察到Flash的信息不正确,mini2440板子上为2M的Nor Flash(型号为SST39VF1601),还有就是提示*** Warning - bad CRC, using default environment的警告。


本节,笔者主要完成这2项的修改工作。





三、修改Flash配置


1、 修改命令行前的名字


这个一般是在.h文件里面定义,首先笔者查找了include/configs/mini2440.h。在115行找到如下语句


#define CONFIG_SYS_PROMPT "SMDK2410 # " /* Monitor Command Prompt */


我们将其修改为


#define CONFIG_SYS_PROMPT "mini2440/care # " /* Monitor Command Prompt */



2、 修改flash部分代码


使用source insight 阅读源代码,我们可以找到Flash:512KB的打印信息所对应的函数位置。


lib_arm/board.c [214行] void display_flash_config (ulongsize)函数


找到调用该函数的地方,在本文件329行



flash_init()函数定义在board/samsung/mini2440/flash.c


CONFIG_AMD_LV400并不是mini2440的NorFlash id。


#if 0


#define CONFIG_AMD_LV400 1 /*uncomment this if you have a LV400 flash */



#define CONFIG_AMD_LV800 1 /*uncomment this if you have a LV800 flash */


#endif


在176行后添加



修改flash_print_info函数