(三) 支持Nor Flash

修改include/configs/mini2440.h 头文件
  1. /*----------------------------------------------------------------------- 
  2. * FLASH and environment organization 
  3. */  
  4. #if 0  
  5. #define CONFIG_AMD_LV400 1  /* uncomment this if you have a LV400 flash */  
  6. #define CONFIG_AMD_LV800 1  /* uncomment this if you have a LV800 flash */  
  7. #endif  
  8. #define CONFIG_AMD_LV160 1

 第175行添加如下代码:

  1. #ifdef CONFIG_AMD_LV160  
  2. #define PHYS_FLASH_SIZE 0x00200000 /* 2MB */  
  3. #define CONFIG_SYS_MAX_FLASH_SECT (35) /* max number of sectors on one chip */  
  4. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) /* addr of environment */  
  5. #endif

 

修改board/samsung/mini2440/flash.c 文件 

 第74行左右添加如下代码:

  1. #elif defined(CONFIG_AMD_LV800)  
  2. (AMD_MANUFACT & FLASH_VENDMASK) |  
  3. (AMD_ID_LV800B & FLASH_TYPEMASK);  
  4. #elif defined(CONFIG_AMD_LV160)  
  5.       (AMD_MANUFACT & FLASH_VENDMASK) |  
  6.       (AMD_ID_LV160B & FLASH_TYPEMASK); 

 第152行左右添加如下代码:

  1. case (AMD_ID_LV800B & FLASH_TYPEMASK):  
  2.     printf ("1x Amd29LV800BB (8Mbit) ");  
  3.     break;  
  4. case (AMD_ID_LV160B & FLASH_TYPEMASK):  
  5.     printf ("1x Amd29LV160B (2M) ");  
  6.     break;

 可以看出,uboot自带的Flash文件是用来支持Nor Flash的

原文地址:https://www.cnblogs.com/liuchengchuxiao/p/4210560.html