Tina 一般支持nor, nand, mmc 三种介质。
更具体的,nand分为并口nand和spinand,mmc分emmc和sd卡
主要需要区分的是nor和其他介质,因为需要打包的部分有所不同。
即,emmc和nand,sd卡一般可共用一份固件,而nor则需使用另一份固件
sys_config配置
在sys_config中有一个配置项,storage_type,取值及含义如下
;----------------------------------------------------------------------------------
; storage_type 0:nand 1:sd 2:emmc 3:spinor 4:emmc3 5:spinand 6:sd1
;----------------------------------------------------------------------------------
[target]
storage_type = xxx
对于nor的方案,必须配置为
storage_type = 3
对于其他介质,storage_type则不能配置为3
spinand切换为spinor
sys_config 设置介质为nor
[target]
storage_type = 3
配置所用nor的大小
[norflash]
size = 16
内核配置
make kernel_menuconfig --->
Device Drivers --->
< >Block devices (取消选中)
Device Drivers --->
<*>Memory Technology Device (MTD) support
<*>OpenFirmware partitioning information support
<*>SUNXI partitioning support
<*> Caching block device access to MTD devices
<*> SPI-NOR device support (对于linux4.9,先选这个,下面的选项才出现)
Self-contained MTD device drivers --->
<*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)
File systems --->
< > The Extended 4 (ext4) filesystem(取消选中)
File systems --->
[*] Miscellaneous filesystems --->
<*> Journalling Flash File System v2 (JFFS2) support(选中)
[*] Enable the block layer --->
[ ] Support for large (2TB+) block devices and files(取消选中)
menuconfig配置
make menuconfig --->
Utilities --->
<*> mtd-utils (选择) --->
<*> mtd-utils-mkfs.jffs2
make menuconfig --->
Utilities --->
Filesystem --->
< > e2fsprogs(取消选择)
spinor切换为spinand
sys_config 设置介质为spinand
[target]
storage_type = 5
内核配置
make kernel_menuconfig --->
Device Drivers --->
[*]Block devices --->
<*> sunxi nand flash driver
Device Drivers --->
< >Memory Technology Device (MTD) support(取消选择)
[*] Enable the block layer --->
[*] Support for large (2TB+) block devices and files
File systems --->
<*> The Extended 4 (ext4) filesystem
menuconfig 配置
make menuconfig --->
Utilities --->
< > mtd-utils (取消选择)
Filesystem --->
<*> e2fsprogs
分区表配置
注意点
对于nand,rootfs_data分区,使用ext4格式。分配太小的话可能会创建失败。
FAQ
使用mkfs.ext4等工具的时候出现
/usr/sbin/fsck.ext4 -y /dev/by-name/rootfs_data
Error loading shared library /home/wuguanling/workspace/project/v316-sdv-tina/out/v316-sdv/staging_dir/target/rootfs/lib/libc.so: No such file or directory (needed by /usr/lib/libext2fs.so.2)
关闭以下选项:
make menuconfig
| --- Global build settings
| --- []strip unnecessary functions for libraries