DB120修改适合16M Flash及分区分析

环境:Board Type:DB120, CPU: ar9344

1. 修改target/linux/ar71xx/image/Makefile中对应语句为

db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)
$(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),150732814876672,RKuImage))

上面修改完成后,重新编译即可

2. 16M-Uboot环境变量设置

tftp 0x80060000 openwrt-ar71xx-db12x-16M-qca-legacy-uboot.bin && erase 0x9f000000 +0x30000 && cp.b $fileaddr 0x9f000000 $filesize
setenv lok 'tftp 0x80060000 openwrt-ar71xx-generic-db120-kernel.bin && erase 0x9fe80000 +${filesize} && cp.b $fileaddr 0x9fe80000 0x170000';
setenv lof 'tftp 0x80060000 openwrt-ar71xx-generic-db120-rootfs-squashfs.bin && erase 0x9f050000 +${filesize} && cp.b $fileaddr 0x9f050000 $filesize'
setenv bootargs console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)
setenv bootcmd bootm 0x9fe80000

3. 进入后查看flash分区

root@OpenWrt:/# cat proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00e30000 00010000 "rootfs"
mtd3: 00be0000 00010000 "rootfs_data"
mtd4: 00170000 00010000 "kernel"
mtd5: 00010000 00010000 "art"
mtd6: 00fa0000 00010000 "firmware"

4. 16M-flash分区layout及分析

DB120修改适合16M Flash及分区分析_第1张图片

补充:16000k@0x50000(firmware)含义:
(1)16000k:代表kernel+rootfs两者分区大小总和,也就是firmware大小;
(2) 0x50000代表rootfs起始地址;

你可能感兴趣的:(openwrt)