Dear Team,
We are currently facing an issue with the SPI interface. The chip select (CS) line is expected to remain high by default; however, it is observed to be low, and there is some unexpected toggling during the boot process.
For your reference, we have attached the Device Tree Source (DTS) node,, and necessary changes are made in the RCW.
DTS File
&dspi2 {
status = "okay";
spidev@1 {
status = "okay";
compatible = "spidev"; # we have also tried setting the compatibility to rohm,dh2228fv
reg = <1>;
spi-max-frequency = <15000000>;
};
};
RCW Fields.
IIC5_PMUX=3
SDHC1_DIR_PMUX=3
SDHC1_DS_PMUX=2
Please Note: CLK, MOSI are generated correctly but CS isn't working the same.
SPI3_SOUT i.e. SPI 3 is used in the board.
The Yellow is Chip select, Green Data(MOSI), Pink Clock and Blue DIO (MISO)
This is a zoomed out image to show the time gap between Chip select Going low and the Incoming Data
Zoomed in version green as MOSI and yellow as Clock.
why is SPI driver is generating so much delay between CS-CLK.
Thanks,
Shivam
已解决! 转到解答。
SDHC1_DS_PMUX configuration:
Configures the functionality on SDHC1_DS
0b00 - SDHC1_DS
0b01 - GPIO_4[29]
0b10 - SPI3_SCK
0b11 - Reserved
SDHC1 and SPI3 cannot work at the same time.
RCW configuration:
SDHC1_DIR_PMUX=3, SDHC1_DS_PMUX=2, SDHC1_DS_PMUX=2
Please open CONFIG_SPI, CONFIG_SPI_FSL_DSPI and CONFIG_SPI_SPIDEV.
They are have been opened in arm64 defconfig.
Moreover, dts need modification, as below, under dspi node:
spidev0: spi@0
{
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <3000000>;
};
Please refer to the following dts configuration:
spidev@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "rohm,dh2228fv";
spi-cpol;
spi-cpha;
reg = <1>;
spi-max-frequency = <4000000>;
}
Please go to Linux Kernel and try the following command.
spidev_test -D /dev/spidev2.1 -H -O -s 16000000 -v -p "\x00\x00\x00\x00"
Heyy yipingwang,
We booted the board via emmc with all the changes and now the CS is working fine. However, CS with SD card BOOT is still not working.
Let us know what you think about it and further steps.
Thank you