u-boot-2010.03在tq6410上的移植详解(四)

来源:互联网 发布:北京建筑软件班 编辑:程序博客网 时间:2024/06/12 18:53

原创文章版权所有!如需转载,请注明出处: http://hi.baidu.com/liushuiyue1/myhome谢谢合作!!!!!

六.对Nor flash的支持:

从上图的启动信息可以看到flash0kbUboot还没有添加对Nor flash的支持。我们使用的nor flash型号是EN29LV160AB,与AMD的兼容,所以添加对Nor flash的支持。

 

#cd include/configs///

#gedit smdk6410.h //

/*-----------------------------------------------------------------------

* FLASH and environment organization

*/

#define CONFIG_SYS_FLASH_BASE     0x00000000//0x10000000Flash的基地址

#define CONFIG_SYS_MONITOR_BASE   0x00000000

 

#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max number of memory banks   */

//一定要定义为>0

/* AM29LV160B has 35 sectors, AM29LV800B - 19 */

#define CONFIG_SYS_MAX_FLASH_SECT 35//40硬件得来

 

#define CONFIG_AMD_LV800

//#define CONFIG_SYS_FLASH_CFI    1   /* Use CFI parameters (needed?) */

#define PHYS_FLASH_SIZE    0x200000 //2M Flash的大小

#define PHYS_FLASH_1    0x00000000

/* Use drivers/cfi_flash.c, even though the flash is not CFI-compliant   */

//CFI相关的屏蔽掉

//#define CONFIG_FLASH_CFI_DRIVER 1

//#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT

//#define CONFIG_FLASH_CFI_LEGACY

//#define CONFIG_SYS_FLASH_LEGACY_512Kx16

 

/* timeout values are in ticks */

#define CONFIG_SYS_FLASH_ERASE_TOUT   (5 * CONFIG_SYS_HZ) /* Timeout for Flash Erase   */

#define CONFIG_SYS_FLASH_WRITE_TOUT   (5 * CONFIG_SYS_HZ) /* Timeout for Flash Write   */

#define CONFIG_ENV_ADDR     0x00000

#define CONFIG_ENV_SIZE 0x4000    /* Total Size of Environment Sector */

说明:Uboot2010.03中支持Nor flash的两种读写方式:CFIJEDEC。本文章采用JEDEC的方式。因为S3C2440S3C6410nor flash接口兼容,所以将S3C2440目录下的flash.c复制到./board/samsung/s3c6410/下,并修改Makefile文件。

 

#cd board/samsung/s3c6410/Makefile//

#gedit Makefile //

COBJS-y    := smdk6410.o flash.o

重新编译Uboot并下载到Nand Flash中,串口打印信息如下。说明板子已经能检测到Nor flash

原创粉丝点击