最近在调自己的86盒项目:https://oshwhub.com/fanhuacloud/t113-s3-86panel
调试SPI Nand启动时,发现烧录存在失败,同时进入系统的时候,会无法挂载rootfs
此处给大家提供几个整改经验
- 初步判定是SPI Nand布线过长,导致的驱动能力不足,整改意见为修改GPIO驱动强度,修改后内核正常识别rootfs,启动正常
- 布线未做等长处理,此处需要硬件做整改,做等长
- 未做阻抗匹配:目前没有足够的理由确定是该原因,不过建议按照手册在CLK处添加33Ω电阻
解决方案:
- 解决无法烧录,或者烧录卡55% 7%的问题,烧录使用的是U-Boot中的USB从机代码,修改此处手动设置SPI Nand频率:
./lichee/brandy-2.0/u-boot-2018/drivers/mtd/awnand/spinand/physic/spic_op.c
相应的,uboot-board.dts也需要修改:spi-max-freqency,clock-frequency
同时修改spi-rx-bus-width,spi-tx-bus-width
- 解决内核分区挂载不上的问题,同时显示ECC报错问题:
spi-rx-bus-width,spi-tx-bus-width需要设置为1,此处T113-S3驱动存在问题,D1s就不存在该问题,有了解的大佬可以提出解决方案
&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";
};
};
- 解决内核启动失败的问题
修改引脚驱动能力drive-strength,此处默认为10,修改为30
spi0_pins_b: spi0@1 {
pins = "PC3";
function = "spi0";
drive-strength = <30>;
bias-pull-up; /* only CS should be pulled up */
};
spi0_pins_c: spi0@2 {
pins = "PC2", "PC3", "PC4", "PC5","PC6", "PC7";
function = "gpio_in";
drive-strength = <30>;
};