I have a card with P1025 with four devices on the SPI bus; flash, FRAM,
shift register and ADC. I'm using kernel drivers for all devices except
the ADC which isn't supported by the kernel. Instead it is configured as
spidev.
Then I do the following steps:
1) Access the flash, FRAM or shift register. It works perfect.
2) Run my program talking to spidev. It continuously reads the voltages
as expected.
3) Stop my program.
4) Repeat step 1). The kernel now hangs.
My program is based on the spidev_test.c included with the kernel.
I have tested this with kernel in SDK 1.5 and with 3.14.
Have anyone had similar experiences combining kernel drivers talking on
SPI with spidev on the same SPI bus?
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!
-----------------------------------------------------------------------------------------------------------------------