mini2440移植uboot 2014.04(七) mini2440移植uboot 2014.04(六)

上一篇博文:《mini2440移植uboot 2014.04(六)html

代碼已經上傳到github上: https://github.com/qiaoyuguo/u-boot-2014.04-mini2440git

(十一)將環境變量放入到nand flash並屏蔽DEBUG宏github

雖然nand flash已經基本上可用了,可是如今環境變量仍然是放在Nor flash,須要修改爲放入Nand flash內。post

修改include/configs/mini2440.h:url

/* #define DEBUG */

#if 0
 #define CONFIG_ENV_ADDR                        (CONFIG_SYS_FLASH_BASE + 0x070000)
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_SIZE                        0x10000
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
#endif

#define CONFIG_ENV_IS_IN_NAND 1
#define CONFIG_ENV_OFFSET 0xC0000
#define CONFIG_ENV_SIZE  0x20000
#define CONFIG_ENV_OVERWRITE

從新編譯,將生成的u-boot-nand.bin拷貝到nfs文件夾,重啓nfs服務:spa

cp u-boot-nand.bin /home/host/nfs/mini2440
sudo /etc/init.d/nfs-kernel-server restart

進入uboot命令行,執行下面命令:命令行

nfs 0x33e00000 /home/host/nfs/mini2440/u-boot-nand.bin
nand erase 0 0x100000
nand write 0x33e00000 0 0x100000
reset

 

而後在控制檯上看到uboot顯示信息以下:rest

U-Boot 2014.04-g15a1d15-dirty (Jul 03 2014 - 15:13:31)

CPUID: 32440001
FCLK:      405 MHz
HCLK:  101.250 MHz
PCLK:   50.625 MHz
DRAM:  64 MiB
WARNING: Caches not enabled
Flash: ERROR: too many flash sectors
ERROR: too many flash sectors
2 MiB
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dm9000
MINI2440 # 
相關文章
相關標籤/搜索