U-Boot2010.06移植(2440)-----移植NorFlash驱动

来源:互联网 发布:java读取xml配置文件 编辑:程序博客网 时间:2024/06/09 22:18

1、修改include/configs/smdk2440.h

(1)注释掉AM29LV400和AM29LV800的定义,并添加AM29LV160的定义
#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 
#define CONFIG_AMD_LV160 1


(2)根据实际NorFlash的信息定义一些宏
#ifdef CONFIG_AMD_LV160 
#define PHYS_FLASH_SIZE 0x00200000 /* 容量大小2MB */
#define CONFIG_SYS_MAX_FLASH_SECT (35) /* 最大扇区个数,查看手册*/ 
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) /* 环境变量的地址 */ 
#endif 


(3)定义环境变量宏
#define CONFIG_ENV_OFFSET 0x100000   //16M 环境变量的偏移地址,即Uboot分区中params分区
#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */  //2M params分区大小



2、修改board/samsung/smdk2440/flash.c

(1)在flash_init函数中加入flash_id
#elif defined(CONFIG_AMD_LV800) 
(AMD_MANUFACT &FLASH_VENDMASK) | 
(AMD_ID_LV800B &FLASH_TYPEMASK); 
#elif defined(CONFIG_AMD_LV160)
(AMD_MANUFACT & FLASH_VENDMASK) | 
(AMD_ID_LV160B & FLASH_TYPEMASK);

#else 



(2)flash_print_info函数加入显示flash_info语句
case (AMD_ID_LV800B &FLASH_TYPEMASK): 
printf("1x Amd29LV800BB (8Mbit)\n"); 
break; 
case (AMD_ID_LV160B & FLASH_TYPEMASK): 
printf ("1x Amd29LV160B (2M)\n"); 
break;
0 0
原创粉丝点击