2.存储配置
存储是编译的固件是否可刷机的最重要的原因,但存储的更换要修改的地方比较多,因此我们建议的方案就是按照现存的工程仿写需要 Bringup 的开发板
1. SPINAND
1.1. 型号选择
SDK 默认支持了几种 SPINAND,编译之前需要确认开发板的型号被选中支持,如果不在支持列表中, 则需要参考 SPINAND 移植指南 进行移植
uboot 和 SPL 分区一般都比较小,开启的 SPINAND 型号过多的话存储容易越界,因此建议只打开需要用到的型号即可
1.1.1. uboot
通过 make um –> Device Drivers –> MTD Support 选择
(0x240000) Offset of bbt in nand
(0x40000) Range of bbt in nand
[*] Define U-boot binaries locations in SPI NAND
(0x100000) Location in SPI NAND to read U-Boot from
[ ] Support Micron SPI NAND
[ ] Support Macronix SPI NAND
[*] Support Winbond SPI NAND
[ ] Support Winbond SPI NAND CONTINUOUS READ MODE
[*] Support GigaDevice SPI NAND
[ ] Support Toshiba SPI NAND
[*] Support FudanMicro SPI NAND
[*] Support Foresee SPI NAND
[*] Support Zbit SPI NAND
[ ] Support Elite SPI NAND
[ ] Support ESMT SPI NAND
[ ] Support UMTEK SPI NAND
SPI Flash Support --->
UBI support --->
1.1.2. kernel
kernel 分区比较大,默认打开了 SDK 支持的所有型号,因此不用选择。
1.2. 文件系统
SPINAND 文件系统采用 UBIFS, 以 demo128_nand 工程为例,编译后生成固件的名称为: d211_xxx_page_2k_block_128k_v1.0.0.img
SDK 也支持 page size 为 4K(很少用到)的SPINAND,需要在工程的配置文件 target/d211/demo128_nand/image_cfg.json 进行配置
"info": { // Header information about image
"platform": "d211",
"product": "demo128_nand",
"version": "1.0.0",
"media": {
"type": "spi-nand",
"device_id": 0,
"array_organization": [
// { "page": "4k", "block": "256k" },
{ "page": "2k", "block": "128k" },
],
}
},