修改include/configs/mini2440.h 头文件
- /*-----------------------------------------------------------------------
- * FLASH and environment organization
- */
- #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
第175行添加如下代码:
- #ifdef CONFIG_AMD_LV160
- #define PHYS_FLASH_SIZE 0x00200000 /* 2MB */
- #define CONFIG_SYS_MAX_FLASH_SECT (35) /* max number of sectors on one chip */
- #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) /* addr of environment */
- #endif
修改board/samsung/mini2440/flash.c 文件
第74行左右添加如下代码:
- #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);
第152行左右添加如下代码:
- case (AMD_ID_LV800B & FLASH_TYPEMASK):
- printf ("1x Amd29LV800BB (8Mbit) ");
- break;
- case (AMD_ID_LV160B & FLASH_TYPEMASK):
- printf ("1x Amd29LV160B (2M) ");
- break;
可以看出,uboot自带的Flash文件是用来支持Nor Flash的