要烧录的镜像路径
boot0
./out/pack_out/boot0_sdcard.fex
boot1+uboot
./out/pack_out/boot_package.fex
放logo的fat分区
./out/t113/evb1_auto/pack_out/boot-resource.fex
env与env-redund
./out/t113/evb1_auto/pack_out/env.fex
zImage与dtb分区
./out/t113/kernel/staging/boot.img
rootfs分区
./out/t113/evb1_auto/buildroot/buildroot/images/rootfs.ext4
白板烧录大致步骤
- 从卡启动uboot
- 使用gpt命令进行分区
- 使用fatformat命令对boot-resource进行格式化
- 使用mmc rescan分区使uboot重读分区
- 烧录各个镜像
gpt分区命令
gpt write mmc ${mmcdev} ${partitions}
环境变量partitions在include/configs/sunxi-common.h的设置:
...
#define PARTS_DEFAULT \
/* Linux partitions */ \
"uuid_disk=${uuid_gpt_disk};" \
"name=boot-resource,start=32M,size=17219K,uuid=${uuid_gpt_boot_resource};" \
"name=env,size=1M,uuid=${uuid_gpt_env};" \
"name=env-redund,size=1M,uuid=${uuid_gpt_env_redund};" \
"name=boot,size=17600K,uuid=${uuid_gpt_boot};" \
"name=rootfs,size=512M,uuid=${uuid_gpt_rootfs};" \
"name=dsp0,size=1M,uuid=${uuid_gpt_dsp0};" \
"name=private,size=1M,uuid=${uuid_gpt_private};" \
"name=recovery,size=64M,uuid=${uuid_gpt_recovery};" \
"name=UDISK,size=-,uuid=${uuid_gpt_udisk}\0"
#define ENV_IMG_NAME \
"ubootimgname=boot_package.fex\0" \
"logoimgname=bootlogo.bmp\0" \
"envimgname=env.fex\0" \
"kernelimgname=boot.img\0" \
"rootimgname=rootfs.ext4\0" \
#define SUNXI_SPRITE_ENV_SETTINGS \
ENV_IMG_NAME \
"partitions=" PARTS_DEFAULT \
...
环境变量partitions在device/config/chips/t113/configs/evb1_auto/buildroot/env.cfg的设置:
partitions=uuid_disk=${uuid_gpt_disk};name=boot-resource,start=32M,size=17M,uuid=${uuid_gpt_boot_resource};name=env,size=1M,uuid=${uuid_gpt_env};name=env-redund,size=1M,uuid=${uuid_gpt_env_redund};name=boot,size=18M,uuid=${uuid_gpt_boot};name=rootfs,size=1024M,uuid=${uuid_gpt_rootfs};name=dsp0,size=1M,uuid=${uuid_gpt_dsp0};name=private,size=16M,uuid=${uuid_gpt_private};name=recovery,size=64M,uuid=${uuid_gpt_recovery};name=UDISK,size=-,uuid=${uuid_gpt_udisk}
烧录镜像
boot0、uboot、boot-resource、boot、rootfs
存储分部
从官方文档《Linux_MMC_NOR离线烧录_开发指南.pdf》可知emmc存储分布图
制作启动卡
根据官方文档的存储emmc分部,那就可以推断出制卡命令:
//擦除SD卡前10MB
sudo dd if=/dev/zero of=/dev/sdc bs=1M count=10
//制卡
sudo dd if=./out/pack_out/boot0_sdcard.fex of=/dev/sdc bs=512 seek=16
sudo dd if=./out/pack_out/boot0_sdcard.fex of=/dev/sdc bs=512 seek=256
sudo dd if=./out/pack_out/boot_package.fex of=/dev/sdc bs=512 seek=32800
sudo dd if=./out/pack_out/boot_package.fex of=/dev/sdc bs=512 seek=24576
SD卡上第一个fat32分区建议从32MB后开始