Probably you could verify whether your SPI testing program could be applied to the SPI Flash device first. If it works normally, you need to consider the hardware problem.
I did a simple verification previously, please have a reference.
Add the test myspi.c in drivers/mtd/devices/ folder, and modified Makefile and Kconfig, configured and built the Kernel, also modified and rebuilt dts file.
Kernel configuration
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_M25P80 is not set
CONFIG_MTD_FSL_M25P80=y
CONFIG_TEST_SPI=y
CONFIG_M25PXX_USE_FAST_READ=y
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
Device tree
spi@7000 {
cell-index = <0>;
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,espi";
reg = <0x7000 0x1000>;
interrupts = <59 0x2>;
interrupt-parent = <&mpic>;
espi,num-ss-bits = <4>;
mode = "cpu";
spidev@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "linux,myspi";
reg = <1>;
spi-max-frequency = <40000000>;
};
Have a great day,
Yiping Wang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------