我正在尝试使用MTD设备来存储在Licheepi上。我已经成功地添加和使用了i2c和spidev,但是我不能使jedec、spi-也不能在内核启动期间执行。
我的dts是(我尝试过许多不同的方法):
&spi0 {
pinctrl-0 = <&spi0_pins>; // tried without these two lines
pinctrl-names = "default";
status = "okay";
/* tried with and without this */
/*cs-gpios = <&pio 2 2 GPIO_ACTIVE_LOW>, <&pio 1 0 GPIO_ACTIVE_LOW>;*/
flash@0 {
compatible = "winbond,w25q64", "jedec,spi-nor"; // I tried deleting winbond,w25q64
status = "okay"; // I added this line on desperation
spi-max-frequency = <50000000>; // I tried lowering this to 10MHz
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
};
};当我使用这个dts引导内核时,我不能看到jedec,spi-也不能尝试探测NOR-FLASH,这就像"jedec,spi-nor“根本没有执行一样。我知道我的更改是有效的,因为如果我用flash@0{compatible="jedec,spi-nor";..}替换spidev@0{compatible = "spidev";..},我会得到一个spidev设备(它是功能性的),并且也可以在dmesg上看到它。
其他一些产出:
cat /proc/mtd
dev: size: erasesize namels /sys/class/mtd是空的
# cat /sys/class/spi_master/spi0/spi0.0/uevent
OF_NAME=flash
OF_FULLNAME=/soc/spi@1c68000/flash@0
OF_COMPATIBLE_0=winbond,w25q64
OF_COMPATIBLE_1=jedec,spi-nor
OF_COMPATIBLE_N=2
MODALIAS=spi:w25q64在menuconfig中启用了MTD_SPI_NOR。我还将其添加为一个模块,并尝试运行modprobe -v jedec_probe.ko和modprobe -v spi-nor.ko,但我绝对没有看到详细的内容。mtdinfo用户空间计数0 MTD设备。
我使用的linux内核是5.3.5。我要用建筑机把它补上。我检查并支持w25q64在jdec,spi(Linux5.3.5/drivers/mtd/ spi-nor /spi-nor.c)中。
发布于 2022-10-20 06:08:15
我好像很想CONFIG_MTD_M25P80,现在我明白了:
[ 0.781483] m25p80 spi0.0: found s25fl064k, expected w25q64
[ 0.787181] m25p80 spi0.0: s25fl064k (8192 Kbytes)https://stackoverflow.com/questions/74135141
复制相似问题