看到openwrt有类似的方案,使用两个flash,主要目的是做双系统,或者单个flash空间不足,使用两个flash来做扩展
硬件方面:
两块flash除了cs引脚,其他都焊接在一起,第二片flash的cs连接到一个指定的IO
软件方面:
1.修改设备树
&pio {
spi0_cs_pins: spi0_cs_pins {
pins = "PC2", "PB2";
function = "gpio_out";
};
};
&spi0 {
status ="okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&pio 2 2 GPIO_ACTIVE_HIGH>, <&pio 1 2 GPIO_ACTIVE_HIGH>;
mx25l25635e:mx25l25635e@0 {
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-max-frequency = <50000000>;
#address-cells = <1>;
#size-cells = <1>;
};
ext_flash@0 {
compatible = "jedec,spi-nor";
spi-max-frequency = <50000000>;
reg = <1>;
#address-cells = <1>;
#size-cells = <1>;
};
};
好像没看到spi设备
2.修改mtdparts
原始的单flash
mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2
双flash
***待添加
大佬们有什么指导意见吗
最近编辑记录 a32425262 (2022-06-08 13:44:56)
离线
感谢晕哥
离线