上一篇博文:《mini2440移植uboot 2014.04(六)》
代码已经上传到github上: https://github.com/qiaoyuguo/u-boot-2014.04-mini2440
(十一)将环境变量放入到nand flash并屏蔽DEBUG宏
虽然nand flash已经基本上可用了,但是现在环境变量仍然是放在Nor flash,需要修改成放入Nand flash内。
修改include/configs/mini2440.h:
/* #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服务:
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显示信息如下:
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 #