Hi,
In my project i need to use SPI2 signals(From the apalis T30 data sheet its clear that apalis SPI2 signals are mapped to T30 SPI controller 5).
So i tried to map the T30 SPI controller 5 to make the use of SPI2. I have made the below required changes.
- in the drivers/spi/spi-tegra.c
used “SLINK 2B-5 7000:dc00” to get the resource for the T30 controller 5. So in the probe i have used
base_ptr = ioremap_nocache(0x7000dc00 , 3072); //to get the base pointer for the controller 5.
then tried to set the required clock of 15Mhz(In the same way as i have done for the SPI1 and it is working fine) through
set_best_clk_source(tspi, 15000000);
Then in the spi-tegra driver made the changes to select the SPI2_CS2.
- In the device file (arch/arm/mach-tegra/devices.c) made the changes to get the resource for the tegra SPI5 device
kept the default name(spi_tegra) for the struct platform_device tegra_spi_device5 and for the other devices changed to different name to avoid the multiple instances of probe function.
eg: for spi device 5 i have kept the same name:
struct platform_device tegra_spi_device5 = {
.name = "spi_tegra",
but other devices, changed the names alone to avoide multiple instances.
struct platform_device tegra_spi_device1 = {
.name = "spi_tegra_0",
.id = 0,
…
…
After the changes once i am installing the spi-tegra.ko through insmod, i am not getting the required 15Mhz clock. Near 3Mhz clock is coming.
I also tried to change the clock from 15Mhz to other values but there is no effect.
In the device.c i tried to comment the “CONFIG_ARCH_TEGRA_2x_SOC” for the tegra spi device 5 and 6 but there is no effect.
I have also disabled LCD_SDOUT, LCD_SDIN, LCD_CS0_N and LCD_SCK from the “arch/arm/mach-tegra/board-apalis_t30-pinmux.c” to avoid the conflict but there is no effect.
I can see the SPI controller is registered.
root@apalis-t30:~#
root@apalis-t30:~# ls -l /sys/class/spi_master/spi4/
lrwxrwxrwx 1 root root 0 Jan 15 19:13 device → …/…/…/spi_tegra.4
drwxr-xr-x 2 root root 0 Jan 15 19:13 power
lrwxrwxrwx 1 root root 0 Jan 15 19:13 subsystem → …/…/…/…/…/class/spi_master
-rw-r–r-- 1 root root 4096 Jan 15 19:11 uevent
root@apalis-t30:~#
root@apalis-t30:~# ls -l /sys/class/spidev/
root@apalis-t30:~#
So can you please help me to get the required clock?