LaurentGom
Posts: 2
Joined: Mon Jun 13, 2016 6:22 am

Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 6:41 am

Hi

I'm designing a commercial product, and so far the Raspberry Pi compute module seems to be a perfect choice for what I'm doing. However it seems that the MIPI interfaces (I need both DSI and CSI) can only work with the official display & camera, because the driver is built into the GPU.

So, is there really no way to use the Raspberry Pi compute module with other CSI/DSI peripherals?

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

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 7:48 am

Hi,
would also love to use the MIPI for attaching un-official MIPI or LVDS displays (bridging MIPI to LVDS).

According to this https://www.raspberrypi.org/blog/open-s ... userspace/ the Videocore IV graphics core should be available now with an open source driver on git.

So might be worth checking this.
Let us know if you managed to attach other displays to the RPi by using DSI.

aBUGSworstnightmare

fruitoftheloom
Posts: 20727
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 8:02 am

LaurentGom wrote:Hi

I'm designing a commercial product, and so far the Raspberry Pi compute module seems to be a perfect choice for what I'm doing. However it seems that the MIPI interfaces (I need both DSI and CSI) can only work with the official display & camera, because the driver is built into the GPU.

So, is there really no way to use the Raspberry Pi compute module with other CSI/DSI peripherals?
Auvidea have attempted to create a HDMi Capture Input Product and is discussed here: viewtopic.php?t=120702&p=815961
Retired disgracefully.....

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23682
Joined: Sat Jul 30, 2011 7:41 pm

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 8:29 am

LaurentGom wrote:Hi

I'm designing a commercial product, and so far the Raspberry Pi compute module seems to be a perfect choice for what I'm doing. However it seems that the MIPI interfaces (I need both DSI and CSI) can only work with the official display & camera, because the driver is built into the GPU.

So, is there really no way to use the Raspberry Pi compute module with other CSI/DSI peripherals?
Not really right now. There is raw access to the camera, but you miss the entire ISP pipeline with that (have to do all your own processing on the bayer, unless sensor does it for you). DSI I don't think you can use yet.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 9:03 am

You don't say what you want to do with those interfaces. Hook up alternative cameras and displays, or use as general purpose I/O.

https://github.com/anholt/linux/commits/drm-vc4-dsi is one of the upstream development branches for the OpenGL stack, and now includes commits for driving DSI. It is still in development, so expect rough edges.

The CSI interface via V4L2 is being worked on, but whilst Eric is employed to do the OpenGL stuff, my Pi efforts are in my spare time. There is a way to access image data via the GPU as an intermediary, leaving all sensor setup to the ARM - see viewtopic.php?f=43&t=109137 and viewtopic.php?f=38&t=120702

Please ignore references to driving the Auvidea TC358743 HDMI input board. Support was added to the GPU firmware for a demo using that specific chip - that is currently not open source. Ongoing work will be to use the kernel driver for that chip with a V4L2 CSI receiver component.
aBUGSworstnightmare wrote:would also love to use the MIPI for attaching un-official MIPI or LVDS displays (bridging MIPI to LVDS).

According to this https://www.raspberrypi.org/blog/open-s ... userspace/ the Videocore IV graphics core should be available now with an open source driver on git.

So might be worth checking this.
Spectacularly out of context! Post was dated 24 Oct 2012 and states
As of right now, all of the VideoCore driver code which runs on the ARM is available under a FOSS license
None of the GPU drivers run on the ARM, so they are not open source.
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.

LaurentGom
Posts: 2
Joined: Mon Jun 13, 2016 6:22 am

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 9:32 am

Thanks for the quick replies :)
You don't say what you want to do with those interfaces. Hook up alternative cameras and displays, or use as general purpose I/O.
Sorry for the lack of detail. I'd like to use alternative display and camera.
https://github.com/anholt/linux/commits/drm-vc4-dsi is one of the upstream development branches for the OpenGL stack, and now includes commits for driving DSI. It is still in development, so expect rough edges.
Is this already usable? If so, how would I start?
I understand that this is an ongoing development, but simply demonstrating that it can work would already be a huge step forward for me.
The CSI interface via V4L2 is being worked on, but whilst Eric is employed to do the OpenGL stuff, my Pi efforts are in my spare time.
Is there a rough estimate of when this work will be available? (again, I'm fine with unfinished stuff, as long as I can show that it works)

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

Re: Can MIPI be used with non-official peripherals?

Mon Jun 13, 2016 9:49 am

LaurentGom wrote:
https://github.com/anholt/linux/commits/drm-vc4-dsi is one of the upstream development branches for the OpenGL stack, and now includes commits for driving DSI. It is still in development, so expect rough edges.
Is this already usable? If so, how would I start?
I understand that this is an ongoing development, but simply demonstrating that it can work would already be a huge step forward for me.
How familiar are you with the kernel graphics composition architecture and device tree? I'm afraid on this one you won't be spoonfed everything preconfigured.
Just checking Eric's blog, it looks like DSI was giving him trouble, but he sorted DPI. That was a few months back so I don't know if he's overcome that.
The Pi official display uses a Toshiba TC358762 chip to convert from DSI to DPI data that can be fed into many LCD panels. That may be a useful strategy as the couple of differential lines of DSI are easier to get through EMC testing than the multiple single ended lines of DPI - assuming you're looking to sell your product, read https://www.raspberrypi.org/blog/the-ea ... i-display/ to get some idea on the joys of testing on this sort of stuff.
LaurentGom wrote:
The CSI interface via V4L2 is being worked on, but whilst Eric is employed to do the OpenGL stuff, my Pi efforts are in my spare time.
Is there a rough estimate of when this work will be available? (again, I'm fine with unfinished stuff, as long as I can show that it works)
Not really. There is a GPU based solution available which generally works but is standalone. For the V4L2 stuff I've just put out a plea on those other two threads for assistance - I'm just not finding the time at the moment.

As jamesh said, none of this work exposes the image processing pipeline inside the ISP, it is purely a receiver of the data from the sensor. If you're looking at using a Bayer sensor then there is a HUGE amount of image processing to get those images into a sensible format.
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.

enacirruh
Posts: 1
Joined: Tue Nov 28, 2017 10:10 pm

Re: Can MIPI be used with non-official peripherals?

Tue Nov 28, 2017 11:03 pm

Hi,

We are working on an interface board which is suitable for Raspberry PI3 on the DSI interface to driver LVDS display. We are using a Texas Instrument IC SN65DSI83. We are succesfully generated test pattern on the LVDS output for the screen with the clock coming from the Raspberry PI DSI port. But we are still getting protocol error when trying to translate the DSI image. Does anyone have a better documentation on this port of the Pi than what is available on the document site? It would be great to know what causes this error. Since the voltage levels are correct and the clock seems to be set exactly right as we set it in the IC configuration.

This is the error description based on the receivers documentation:
When the DSI channel A packet processor detects a low level protocol error, this bit is set; this bit is cleared by writing a ‘1’ value.
Low level protocol errors include SoT and EoT sync errors, Escape Mode entry command errors, LP transmission sync errors, and false control errors. Lane merge errors are reported by this status condition.
I am attaching the related parts from the documentation. Do you think this should match the way how Raspberry PI transmits the video stream?

Thanks
Attachments
DSI_18BPP.jpg
18 bit/pixel packet structure
DSI_18BPP.jpg (184.81 KiB) Viewed 3544 times
DSI_24BPP.png
24 bit/pixel packet structure
DSI_24BPP.png (139.15 KiB) Viewed 3544 times
DSI_2Lanes.png
DSI Configuration
DSI_2Lanes.png (83.29 KiB) Viewed 3544 times

Chris_G_Miller
Posts: 22
Joined: Sat Nov 14, 2015 3:45 pm
Location: Kent, England

Re: Can MIPI be used with non-official peripherals?

Mon Jul 30, 2018 8:02 pm

I have managed to get the TI chip you mention working, but ONLY if I spoof the R-Pi into switching on the DSI port by hotwiring the I2C lines to a genuine R-Pi official 7" display.
I found the DSI clock needed some pull-up resistors to get its DC level right for the TI chip to resolve the clock.

But I now have a big problem, in that - try as I might - I just cannot get the DSI interface to 'light up', despite weeks of tinkering with drivers and Device Tree Entries.
Did you manage to create a device-tree overlay which turns on the DSI port?

Initially, I tried basing my driver on"panel-raspberrypi-touchscreen.c", but whilst the I2C detction was all working, the DSI did not come on.
Then I tried using panel-simple.c - again - the driver loads, and all the DT entries *appear* to me to be correct, but the DSI clock and data lanes remain high impedance with no output.

I see there are entries recommended in the device tree along the lines of
&dsi1 {
power-domains = <&power RPI_POWER_DOMAIN_DSI1>;
status = "okay";
};

But what I have not been able to find out is whether this entry itself is meant to energise that part of the SOC, or whether it simply ties the power line for that part of the SOC to an entity called RPI_POWER_DOMAIN_DSI1, which then needs "something else" to instruct it to turn on. Reading the source of the driver power.c does not make it any clearer, and I've failed dismally in searching for documentation.

I am also unclear why many of the recommended entries include the line "status = "disabled"
Surely, we want them enabled - i.e. "okay"?

If somebody who understands exactly how this is to be used and could post a short "how to..." it would be fantastic. Somebody must know!

Chris_G_Miller
Posts: 22
Joined: Sat Nov 14, 2015 3:45 pm
Location: Kent, England

Re: Can MIPI be used with non-official peripherals?

Fri Aug 03, 2018 7:35 am

For the time being, I've resorted to programming a cheap PIC to emulate the I2C transactions which the Pi firmware is expecting. It acts as an I2C slave, and gives the responses observed on the I2C bus from a 'real' panel.
So now, if I allow the firmware to probe for an 'official' panel (i.e. do NOT have 'ignore_lcd=1' in my config.txt), it discovers my bogus I2C responder, and starts emitting the DSI signals on Clock and Lane 0.
This is a horrible hack, but it allows me to progress. I've been bogged down for a whole week trying to 'do it properly' without success (and with absolutely no responses on any of the fora I've been posting on, sadly).

Chris_G_Miller
Posts: 22
Joined: Sat Nov 14, 2015 3:45 pm
Location: Kent, England

Re: Can MIPI be used with non-official peripherals?

Wed Jun 26, 2019 7:14 am

I did eventually 'crack' getting the DSI to come on, and created a 'panel' driver for the TI chip you mention.
The basic requirements are:
- Switch off hardware detection of a display using ignore_lcd=1 and ignore_touchscreen=1 in /boot/config.txt
- Create a Device Tree Overlay which adds the i2c port to the DSI1 element (so you can configure the chip) and pointing to a GPIO line (so you can manage the reset/enable line into the chip)
- The DTO also needs to have a 'compatible' name which links to your driver
- Your panel driver - when probed (as a result of the 'compatible' name) - fish out the i2c interface detail and configure the TI chip, preceded by blipping its reset line

If there is anybody still interested in this, let me know, and I'll see if I can set up a git repository for my panel driver and device tree overlay.

bryce.schober
Posts: 2
Joined: Thu Aug 15, 2019 11:19 pm

Re: Can MIPI be used with non-official peripherals?

Thu Aug 15, 2019 11:22 pm

Chris_G_Miller wrote:
Wed Jun 26, 2019 7:14 am
If there is anybody still interested in this, let me know, and I'll see if I can set up a git repository for my panel driver and device tree overlay.
I'm definitely interested, did you ever get the details in a github repo?

s.risler
Posts: 4
Joined: Thu Sep 05, 2019 2:09 pm

Re: Can MIPI be used with non-official peripherals?

Fri Sep 06, 2019 8:01 am

Chris_G_Miller wrote:
Wed Jun 26, 2019 7:14 am
If there is anybody still interested in this, let me know, and I'll see if I can set up a git repository for my panel driver and device tree overlay.
I am also interested. We are trying to do the same. We would like to use the SN65DSI83, but we are not sure what we are about to face to make it work...

Thank you very much for your help !

User avatar
HermannSW
Posts: 1499
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Can MIPI be used with non-official peripherals?

Fri Sep 06, 2019 8:20 am

LaurentGom wrote:
Mon Jun 13, 2016 6:41 am
However it seems that the MIPI interfaces (I need both DSI and CSI) can only work with the official display & camera, because the driver is built into the GPU.
Most of the discussion sofar was on DSI.

On the CSI part of OP question, you can bring in your own cameras like Arducam did for their 0.3/1.0/2.0MP monochrome global shutter and 13/16/18MP color rolling shutter cameras, see this thread on those cameras:
https://www.raspberrypi.org/forums/view ... 3&t=249483

Their github repo is not fully open source (the userland SDK is provided as library only), but as you said the same is true for Raspberry camera software (userland code for raspivid/raspistill is open source, GPU code is closed source):
https://github.com/ArduCAM/MIPI_Camera/tree/master/RPI

As can be seen from library license, their software is raspiraw based, and not kernel code:
https://github.com/ArduCAM/MIPI_Camera/ ... ib/LICENCE
This dynamic library uses the code in the following code repository:
https://github.com/6by9/raspiraw/
...

Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

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