We are using a customized BSP based on 3.02b for an iMX6ULL together with an Aster carrier board.
A display with an ILI9341 controller in 9-bit mode is connected to the SPI. The device tree and the kernel were modified to use a framebuffer for accessing the display (small TFT support in kernel together with staged drivers).
During tests we noticed that the 9 bits per word transmission on SPI isn’t working correct if multible words will be sent. Instead of 9 bits always 16 bits will be sent for multible word transmission.
For further analyses and to rule out problems with our customized BSP we flashed the Toradex Console image 3.0b2 and made some tests with spidev_test.
Toradex Console image 3.0b2
We see the same bahavior as we noticed with our custom BSP:
Single 9-bit word transmission is okay:
./spidev_test -D /dev/spidev0.0 -D -s 1000000 -b 9 -p \\x31\\x01
[upload|pFLVF2ypGN9Dkqi2rlyAnipzeWc=]
Multible 9-bit word transmission is wrong:
./spidev_test -D /dev/spidev0.0 -D -s 1000000 -b 8 -p 10203040 -> data sent = 10203040 (Tx buffer: 31 30 32 30 33 30 34 30)
Encode with 9 bits per word:
[upload|8TL9RppSQVybBSydwts57XK8/6U=]
Encoded with 16 bits per word:
[upload|UEQZvuscp/nsUaPO1YzR/V9j5kQ=]
=> 9 bits per word is set but 16 bits per word will be used and only the first 8 bits will be taken.
After that we downgraded the module to Toradex console image 2.8b6:
Toradex console image 2.8b6
Single 9-bit word transmission is okay.
Multible 9-bit word transmission is also okay:
./spidev_test -D /dev/spidev0.0 -D -s 1000000 -b 8 -p 10203040 -> data sent = 10203040 (Tx buffer: 31 30 32 30 33 30 34 30)
Encode with 9 bits per word:
[upload|39huHJqLkhjvgSFA787OWQBXM+c=]
Findings:
- Single word SPI transmission with 9 bit per word work with BSB 2.8b6 and BSP 3.0b2.
- Multible word transmission with 9 bits per word work with BSP 2.8b6 but not with 3.0b2.
Is there a SPI bug in 3.0b2? What can we do to solve the problem?