MISO of spidev only receives one byte on mainline kernel 4.14 for Colibri T30

Hello Toradex Community,
I want to use a spi on a linux using the 4.14.8 mainline kernel. I’m using the Colibri T30 on Iris carrier board.
I build the kernel based on the tegra_defconfig and activated the spi_dev. In kernel and Devie-tree
[upload|eb2IXS87+ux3ZDI7D1buzAYEgTA=]
[upload|d6NmZhtO71YauTKOYG8ieroxsUU=]

To check the spi-communication i compiled spi-tools and spi-test.
I lopped the MOSI to MISO and the some test messages. To verify communication i connect
a oscilloscope and check signals.
The result is that Clock, MOSI and CS work as expected. But the spi-test only receive the first byte of the communciation.

[upload|rW/jWNvr/LYWfGXAsi0oBqI+1Vo=]

After that i tried to the spi-gpio module. With the GPIO SPI all worked fine.
Has anyone had similar experiences or ideas that could help me?

I’ve just tried with 4.18.0-rc2-00037-g6f0d349d922b kernel using tegra30-colibri-eval-v3.dtb from kernel. It seams to work:

./spidev_test -D /dev/spidev0.1 -p "1234345678905" -v
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 31 32 33 34 33 34 35 36 37 38 39 30 35 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  | 1234345678905
RX | 31 32 33 34 33 34 35 36 37 38 39 30 35 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  | 1234345678905

do you have any other devices on the SPI bus? I’ve usd spidev_test included in 4.18-rc2 kernel sources, where did you get yours?

Hi dominik.tx,

for the test i haven’T connect any Spi devices. But I now know that the problem lies in using the irisboard.

But thx for the try.

I have debuged spi driver and the hardware of the iris board and have find the solution.
The SPI miso is mapped on two pins.
One is the Tegra pin 90, that is used on the iris board as defaut for the spi1
the other is the Tegra pin 104 which is connected to the UART-B/C RS - 232 header.for force off.
This pin is connected to a 100k Resistor which pull the SPI MISO up and we only receive a high pegel.
I have solved the problem by export control of the GPIO 191 (Tegra x.07) to userspace and set it to output value 1.

HI
Thanks for the information. You could also mux the SODIMM PIN104 (GPIO-X.07) to alternate function3 using device tree blob, so you don’t have to export it as GPIO in userspace.

This should now be taken care of by the following commit.