Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mipi read returns 0 bytes #147

Open
hmbedded opened this issue Mar 28, 2019 · 1 comment
Open

mipi read returns 0 bytes #147

hmbedded opened this issue Mar 28, 2019 · 1 comment

Comments

@hmbedded
Copy link

Hello,

I'm trying to get a Startek 5 inch touchscreen working on a RaspberryPi 3 B. It's running latest raspbian with a 4.14.98 kernel. I have added the patches from this pull request: raspberrypi#2693 and verified that the Official display works.

The Startek panel use an Ilitek ILI9806E controller device. It is hard wired for 2 lanes and only has the DSI interface available (so no I2C or SPI). There is an upstream driver for an ILI9881C device: ili9881.c from which I created an ili9806e driver. When the kernel boots everything looks good: vc4-drm binds dsi1, /dev/fb0 is created and indeed xorg log indicates happiness but the display remains blank (backlight is permanently powered by an external supply).

In an attempt to debug I added some code to the prepare function in the driver to try and read the device ID just after resetting the panel. However, although the read apparently succeeds it returns 0 bytes:

[ 5.442202] [drm:vc4_dsi_host_transfer [vc4]] ERROR DSI returned 0b, expecting 1b
[ 5.442272] [drm:vc4_dsi_host_transfer [vc4]] ERROR DSI transfer failed, resetting: -6

Reading the device ID requires firstly switching to command page 1 in the ILI9806E and then reading the ID register. To switch you have to write a 5 byte sequence to register 255 so the fact it's reading 0 bytes suggests it's reading from the wrong register. A couple of questions spring to mind:

  1. The official display is single lane so is this potentially an issue with having 2 lanes or is vc4-dsi known to work with 2 lanes?
  2. What about reading over the dsi interface, is that known to work?

Here's the full dmesg output. dmesg.txt

Any thoughts, pointers, suggestions very much appreciated.

@anholt
Copy link
Owner

anholt commented Apr 10, 2019

The Raspberry Pi panel's bridge apparently doesn't respond well to reads, so I've never used them. Looking at the code, the IRQ handler wakes up the transfer's completion on TXPKT1_DONE, while for a read you'd want to wait until RX1_PKT. Perhaps that will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants