天天看點

Hi3531添加16GByte(128Gbit) NAND Flash支援

0.闆子上已有nor flash了,添加的nand flash型号為mt29f128g08cjabawp,進系統挂接nand作為一個分區

1.修改uboot

u-boot-2010.06/drivers/mtd/nand/nand_spl_ids.c

第108行,添加這個nand flash

{ {0x2c, 0x88, 0x05, 0xc6, 0x89, 0x00, 0x00, 0x00}, 8, _16g, null, "mt29f128g08cjaba", _4k,  _1m,       224,    0 },

2.編譯uboot

make arch=arm cross_compile=arm-hisiv100nptl-linux- godnet_config

make arch=arm cross_compile=arm-hisiv100nptl-linux-

...

cp ../../../uboot/u-boot-2010.06/u-boot.bin ./

./mkboot.sh reg_info_930_310_620_ddr0_ddr1_slow.bin u-boot.bin

3.修改核心

linux-3.0.y/drivers/mtd/nand/nand_spl_ids.c

第68行,添加這個裝置

4.編譯核心

cp arch/arm/configs/godnet_defconfig .config

make arch=arm cross_compile=arm-hisiv100nptl-linux- menuconfig

make arch=arm cross_compile=arm-hisiv100nptl-linux- uimage

cp arch/arm/boot/uimage ...

5.燒寫u-boot

sf probe 0

mw.b 82000000 ff 100000

tftp 0x82000000 u-boot.bin

sf erase 0 100000

sf write 82000000 0 100000

reset

6.燒寫核心

mw.b 82000000 ff 400000

tftp 82000000 uimage

sf erase 100000 400000

sf write 82000000 100000 400000

7.燒寫檔案系統

mw.b 82000000 ff b00000

tftp 0x82000000 rootfs_256k.jffs2

sf erase 500000 b00000

sf write 82000000 500000 b00000

8.設定啟動參數

setenv bootargs 'mem=64m console=ttyama0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1m(boot),4m(kernel),11m(rootfs);hinand:16g(nand)'

setenv bootcmd 'sf probe 0;sf read 0x82000000 0x100000 0x400000;bootm 0x82000000'

sa

9.擦除nand(可選)

nand erase

10.進入系統mount

mount /dev/mtdblock3 /mnt/ -t yaffs2

11.檢查

# df

filesystem           1k-blocks      used available use% mounted on

/dev/root                11264      4632      6632  41% /

tmpfs                    29196         4     29192   0% /dev

/dev/mtdblock3        16777216     13312  16763904   0% /mnt

一共16gbyte,拷貝速度很快

12.其實不修改uboot也可以,這樣uboot就認不到nand flash,也就沒法在uboot erase,不過進系統了也可以用。

繼續閱讀