VFS: Cannot open root device “(null)” or unknown-block(0,0): error -6
OPEMWRT系统的MT7628换了FLASH后出现的错误。解决如下:
在openwrt_CC_mt76xx_zhuotk_source/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7628/linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c的spi_device_id spi_nor_ids[] 增加新FLASH型号和参数。
/* Intel/Numonyx – xxxs33b */
{ “160s33b”, INFO(0x898911, 0, 64 * 1024, 32, 0) },
{ “320s33b”, INFO(0x898912, 0, 64 * 1024, 64, 0) },
{ “640s33b”, INFO(0x898913, 0, 64 * 1024, 128, 0) },
/* ISSI */
{ "is25cd512", INFO(0x7f9d20, 0, 32 * 1024, 2, SECT_4K) },
{ "IS25LP512M", INFO(0x9d601a, 0, 64 * 1024, 1024, SECT_4K) },
其中IS25LP512M是我新增的。
然后修改对应的分区大小,在
openwrt_CC_mt76xx_zhuotk_source/target/linux/ramips/dts/MT7628.dts
spi@b00 {
status = “okay”;
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "en25q64";
reg = <0 0>;
linux,modalias = "w25q64", "w25q128", "w25q256";
spi-max-frequency = <10000000>;
m25p,chunked-io = <32>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
// reg = <0x50000 0x7b0000>; //8MB flash
// reg = <0x50000 0xfb0000>; //16MB flash
// reg = <0x50000 0x1fb0000>; //32MB flash
reg = <0x50000 0x3f00000>; //64MB flash
};