芒果派提供的SDK默认存储介质是SD卡,现在将其切换成SPI NAND
1. 更改 sys_config.fex
文件路径 Tina-Linux/device/config/chips/t113/configs/mq_r
storage_type 更改成 storage_type = 5
2. 更改 env.fex
bootcmd=run setargs_nand boot_normal
3. 更改board.dts
&spi0 {
clock-frequency = <100000000>;
pinctrl-0 = <&spi0_pins_a &spi0_pins_b>;
pinctrl-1 = <&spi0_pins_c>;
pinctrl-names = "default", "sleep";
/*spi-supply = <®_dcdc1>;*/
spi_slave_mode = <0>;
spi0_cs_number = <1>;
spi0_cs_bitmap = <1>;
status = "okay";
spi-nand@0 {
compatible = "spi-nand";
spi-max-frequency=<100000000>;
reg = <0x0>;
spi-rx-bus-width=<0x01>;
spi-tx-bus-width=<0x01>;
status="okay";
};
spi-nor@0 {
compatible = "jedec,spi-nor";
spi-max-frequency=<30000000>;
reg = <0x0>;
spi-rx-bus-width=<0x01>;
spi-tx-bus-width=<0x01>;
status="disabled";
};
};
4. 确认 u-boot 的 configs/sun8iw20p1_defconfig 开启UBIFS
使用 cboot 可以跳转到 u-boot 目录
CONFIG_SUNXI_UBIFS=y
5. 内核配置
make kernel_menuconfig 层层选中
内核驱动配置
Device Driver --->
Memory Technology Device (MTD) support --->
sunxi-nand --->
<*> AWNAND CHOICE (Allwinner MTD SPINAND Device Support) --->
-*- Enable UBI - Unsorted block images --->
[*] Read-only block devices on top of UBI volumes
内核文件系统配置
File systems --->
[*] Miscellaneous filesystems --->
<*> UBIFS file system support
6. Tina 环境配置
make menuconfig 层层选中
Target Images --->
Boot (SD Card) Kernel format (boot.img) ---> //默认选中
[ ] For storage less than 32M, enable this when using ota //取消勾选
Global build settings --->
[*] Strip unnecessary functions from libraries //取消勾选
Utilities --->
<*> mtd-utils --->
<*> mtd-utils-mkfs.ubifs
7. 重新编译打包
参考链接:Tina Linux 存储介质切换:eMMC,SPI NAND,SPI NOR,SD Card,SD NAND | 全志在线开发者论坛 (aw-ol.com)