I am using AM5718 IDK EVM,and ti-processor-sdk-linux-am57xx-evm-05.03.00.07.
I have enabled McSPI2 in DTS as given below:
&mcspi2 {
status = "okay";
ti,pindir-d0-out-d1-in;
mydev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
spi-cpol;
};
};
I am able to communicate with McSPI2 as master and the data sent is correctly received at slave side. User Space application is used to communicate with McSPI2.
Code fragment is given below:
---------------------------------------------------------------------------
/* Set the SPI bus speed in Hz */
unsigned long spi_bus_speed = 24000000;
if(ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &spi_bus_speed)==-1) {
perror("SPI: Failed to set SPI bus frequency |");
return -1;
}
if(ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &spi_bus_speed)==-1) {
perror("SPI: Failed to set SPI bus frequency |");
return -1;
}
......
/* Perform a SPI Transaction */
if (ioctl(fd, SPI_IOC_MESSAGE(1), &transfer_spidev)<0)
{
perror("SPI: SPI_IOC_MESSAGE Failed |");
return -1;
}
---------------------------------------------------------------------------
My problem is even if I set the clock frequency of McSPI2 above 24 MHz, only 24 Mhz (approximate) is shown in the Oscilloscope.
From Table 7-42. "Timing Requirements for SPI - Master Mode" (Page 262) in AM57XX TRM, I understand that maximum frequency of McSPI as master is 48 MHz. What else should I do to attain this frequency?
regards,
Anupama
