evankrall
Posts: 10
Joined: Tue Mar 23, 2021 3:21 am

sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Sun Aug 22, 2021 4:36 am

I'm trying to get my Pi 4 (and eventually a CM4) to interface with the LVDS display from a 1st generation iPad. So far, I have:

[*] Built a PCB with the SN65DSI83 which has connectors for DSI (from the Pi) and LVDS (to the display)
[*] Added a panel definition for my LVDS panel to panel-simple.c
[*] Written a device tree overlay which includes the panel and the SN65DSI83 bridge.

For reasons (slightly messed up the DSI ribbon cable pinout), I've got the sn65dsi83 connected to i2c1 (gpio 2/3) instead of the i2c bus on the DSI connector.

I've worked out a few kinks in my device tree overlay, and have finally gotten it applying cleanly. However, when I watch various pins with my logic analyzer while I run `sudo dtoverlay pipad_screen`, all I see is the voltage regulator's enable pin going high, and the sn65dsi83's enable pin going low (that GPIO starts high on boot for some reason). I see no I2C traffic, even though the i2c address is marked as busy (UU) in i2cdetect.

I feel like I'm missing a step here to get the kernel/other software to actually start _using_ the DSI output.

What am I missing? What should I try next?

evankrall
Posts: 10
Joined: Tue Mar 23, 2021 3:21 am

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Sun Aug 22, 2021 5:19 am

Welp, turns out if I add the overlay to config.txt so it loads at boot time (instead of loading it manually with the dtoverlay command), it actually enables the bridge and then configures it over i2c.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 12155
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Sun Aug 22, 2021 8:09 am

Your overlay needs to be loaded at the same time as vc4-kms-v3d(-pi4) as the DRM subsystem waits until all dependencies have probed before then binding them all together. If your devices aren't defined at that point then they won't be considered part of the subsystem.

I'm assuming you're using the sn65dsi83 driver that was recently merged to mainline? There's a thread discussing getting the chip working at viewtopic.php?f=44&t=305690. It seems to be a little fussy about the initialisation phase, and I'm still trying to work out the kinks.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aBUGSworstnightmare
Posts: 3898
Joined: Tue Jun 30, 2015 1:35 pm

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Sun Aug 22, 2021 4:51 pm

4-lane DSI never worked so far, so get that fixed in your overlay as well (in case you'll try on an CM4)

For me the driver in 5.14 kernel never worked so far.

On a Pi4 you only have 2-lane DSI, which should be no problem with the iPad display.

There is an overlay in the thread linked by 6by9 which works just fine
Image
Image
pics were showing a 1280x800pixels display connected to DSI0 in dual-lane DSI config.

evankrall
Posts: 10
Joined: Tue Mar 23, 2021 3:21 am

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 5:17 am

I'm assuming you're using the sn65dsi83 driver that was recently merged to mainline? There's a thread discussing getting the chip working at viewtopic.php?f=44&t=305690. It seems to be a little fussy about the initialisation phase, and I'm still trying to work out the kinks.
Yeah, I discovered and read that thread today (took me a while :lol:). I had been trying with the upstream driver; I've now compiled 6by9's rpi-5.10.y-sn65dsi8x-marek branch and am trying a modified version of the vc4-kms-dsi-ti-sn65dsi83 overlay on that branch.

Your overlay needs to be loaded at the same time as vc4-kms-v3d(-pi4) as the DRM subsystem waits until all dependencies have probed before then binding them all together. If your devices aren't defined at that point then they won't be considered part of the subsystem.
Ah, that's the trick. That also explains why it stopped happening on boot when I switched to the cm4io: my cm4's /boot/config.txt didn't have dtoverlay=vc4-kms-v3d, but my pi4 did.

aBUGSworstnightmare
Posts: 3898
Joined: Tue Jun 30, 2015 1:35 pm

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 5:54 am

evankrall wrote:
Mon Aug 23, 2021 5:17 am
Yeah, I discovered and read that thread today (took me a while :lol:). I had been trying with the upstream driver; I've now compiled 6by9's rpi-5.10.y-sn65dsi8x-marek branch and am trying a modified version of the vc4-kms-dsi-ti-sn65dsi83 overlay on that branch.
...
Ah, that's the trick. That also explains why it stopped happening on boot when I switched to the cm4io: my cm4's /boot/config.txt didn't have dtoverlay=vc4-kms-v3d, but my pi4 did.
which modifications on the overlay do we speak of?
Might be better to continue this discussion in the existing thread (altough it's a long one already. Doing so will keep all the info/details known so far in one place, way easier to assess for others who want to go in he same direction).

evankrall
Posts: 10
Joined: Tue Mar 23, 2021 3:21 am

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 6:11 am

which modifications on the overlay do we speak of?
Just tweaks to match my hardware: i2c address (mine is at 0x2d), gpio pins, number of DSI lanes, adding an entry for the regulator... https://github.com/EvanKrall/raspberryp ... 8c74602de1

Looks like the sn65 is able to generate something approximating a test pattern if I run:

Code: Select all

i2cset -f -y 10 0x2d 0x3c 0x10
IMG_5764.jpg
IMG_5764.jpg (242.73 KiB) Viewed 792 times
(please don't mind the electrical tape on the screen)

I think I need to adjust some parameters. What is this test pattern supposed to look like? (I don't think it's supposed to have black bars going across it.)

aBUGSworstnightmare
Posts: 3898
Joined: Tue Jun 30, 2015 1:35 pm

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 10:39 am

evankrall wrote:
Mon Aug 23, 2021 6:11 am
which modifications on the overlay do we speak of?
Just tweaks to match my hardware: i2c address (mine is at 0x2d), gpio pins, number of DSI lanes, adding an entry for the regulator... https://github.com/EvanKrall/raspberryp ... 8c74602de1

Looks like the sn65 is able to generate something approximating a test pattern if I run:

Code: Select all

i2cset -f -y 10 0x2d 0x3c 0x10
IMG_5764.jpg

(please don't mind the electrical tape on the screen)

I think I need to adjust some parameters. What is this test pattern supposed to look like? (I don't think it's supposed to have black bars going across it.)
looks like your timing is wrong (black lines should not be there or is this tape as well?).

this is what it looks for me (for a display which is portrait mode, yours is landscape (1024cx768):
Image
which is what I would expect when looking at an 'official test pattern picture'
Image

evankrall
Posts: 10
Joined: Tue Mar 23, 2021 3:21 am

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 5:42 pm

looks like your timing is wrong (black lines should not be there or is this tape as well?).
The thin black lines going all the way across the screen (and the even thinner faint vertical lines visible near the top of the screen) are actually displayed by the screen. The angled black rectangle on the right side and the two small black sections on the bottom corners are tape.

Thanks for the "screenshots". I wonder why TI decided that the left and/or right bars shouldn't line up evenly with the edge of the screen.

aBUGSworstnightmare
Posts: 3898
Joined: Tue Jun 30, 2015 1:35 pm

Re: sn65dsi83: device tree overlay applies cleanly, but no I2C traffic happens

Mon Aug 23, 2021 5:54 pm

evankrall wrote:
Mon Aug 23, 2021 5:42 pm
Thanks for the "screenshots". I wonder why TI decided that the left and/or right bars shouldn't line up evenly with the edge of the screen.
Maybe ask TI *lol*

I assume this depends on the display resolution

Return to “Interfacing (DSI, CSI, I2C, etc.)”