nomdediot
Posts: 52
Joined: Sat Feb 02, 2013 3:04 pm

Using DSI or CSI for another purpose?

Tue Jan 07, 2020 7:31 am

Hi

I wonder if it s possible to use csi or dsi interfaces for another purpose using specific device tree? I not sure the SOC is pin configurable there?

I m currently making a specific product with cm3+ and routing is a little bit difficult due to the position of the pins. Moving some GPIO or I2c for example in place of dsi or CSI (not used at all in my project) can be great to simplify the board.

Thanks for any info about this subject

Joel

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 8:18 am

You can not repurpose DSI and CSI!

nomdediot
Posts: 52
Joined: Sat Feb 02, 2013 3:04 pm

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 8:27 am

I would like to have an "official" confirmation, on which information do you base your answer?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 9:01 am

Have you read the CM schematics? They're as official as they come, and they show that both CSI and DSI have dedicated pins on the SoC, hence no chance to reuse them for something else.

User avatar
DougieLawson
Posts: 37593
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 9:05 am

nomdediot wrote:
Tue Jan 07, 2020 8:27 am
I would like to have an "official" confirmation, on which information do you base your answer?
A Bug's Worst Nightmare is the absolute expert on all things to do with the Official Display, a wide range of other OEM display screens and OEM LVDS boards for laptop screens. His opinions will absolutely match anything from the RPF or RPT folks. I wonder why you doubt his expertise.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 9:15 am

I was about to write that nomdediot is probably a new user, but I see he's been around longer than you, Dougie, albeit with slightly fewer posts, so who knows.

Although not an employee of Raspberry Pi themself ("they" as a singular pronoun was the Merriam Webster word of 2019), aBUGSworstnightmare (like a few of the regulars) has more experience of the Pi hardware than many of us - I wouldn't expect an "official" answer to be consistently more correct.

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 10:13 am

TBH, some of my answers to stuff have proven to be complete nonsense, yet some may regard them as official. I must try harder.

Anyway, as above, the DSI and CSI pins are dedicated. However, it is possible to use the DSI interface in other ways if you have enough skill to build the hardware and write the software to use it. There is a user space driver for it in KMS.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 11:02 am

jamesh wrote:
Tue Jan 07, 2020 10:13 am
TBH, some of my answers to stuff have proven to be complete nonsense, yet some may regard them as official. I must try harder.

Anyway, as above, the DSI and CSI pins are dedicated. However, it is possible to use the DSI interface in other ways if you have enough skill to build the hardware and write the software to use it. There is a user space driver for it in KMS.
And so he immediately proves his first paragraph correct! ;)

KMS is Kernel Mode Setting.
Yes it allows configuration of the DSI transmitter peripheral, but userspace will only get to drive it as a display device via the HVS, pixel valve, etc, adding image layers to be composed and displayed on the output.
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.

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 11:04 am

6by9 wrote:
Tue Jan 07, 2020 11:02 am
jamesh wrote:
Tue Jan 07, 2020 10:13 am
TBH, some of my answers to stuff have proven to be complete nonsense, yet some may regard them as official. I must try harder.

Anyway, as above, the DSI and CSI pins are dedicated. However, it is possible to use the DSI interface in other ways if you have enough skill to build the hardware and write the software to use it. There is a user space driver for it in KMS.
And so he immediately proves his first paragraph correct! ;)

KMS is Kernel Mode Setting.
Yes it allows configuration of the DSI transmitter peripheral, but userspace will only get to drive it as a display device via the HVS, pixel valve, etc, adding image layers to be composed and displayed on the output.
Exactly!

How do you use the DSI interface from userspace? Sure you have mentioned it's possible, or does it have to be a kernel driver?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 11:08 am

jamesh wrote:
Tue Jan 07, 2020 11:04 am
6by9 wrote:
Tue Jan 07, 2020 11:02 am
And so he immediately proves his first paragraph correct! ;)

KMS is Kernel Mode Setting.
Yes it allows configuration of the DSI transmitter peripheral, but userspace will only get to drive it as a display device via the HVS, pixel valve, etc, adding image layers to be composed and displayed on the output.
Exactly!

How do you use the DSI interface from userspace? Sure you have mentioned it's possible, or does it have to be a kernel driver?
If attaching a display, then you generate the right device tree to "attach" a display to the interface. https://github.com/raspberrypi/linux/bl ... verlay.dts is an example for DPI. I don't think any DSI devices have been merged as yet (mainly due to I2C issues).

There are no direct userspace users of DSI that I am aware of. AFAIK It's not a peripheral that can be separated from the HVS/PV, therefore to send non-image data you need to do some funky formatting and create a fake image to be displayed.
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.

nomdediot
Posts: 52
Joined: Sat Feb 02, 2013 3:04 pm

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 9:32 pm

First of all thanks for all the answers! I will try to comment for each of them below.

To introduce myself: I'm not a usual raspberry pi user and i'm not used to look or respond on the forum. I have read some topics and answered to some trivial of them recently, that's all. I'm an embedded electronic project manager working in the industry. I'm currently looking at the CM3+ for a new project (mainly because of the cost).

@DougieLawson and @PhilE: I don't know aBUGSworstnightmare, and I was not doubting of his expertise. I just want technical response, not just something I have to believe.

@jamesh: "However, it is possible to use the DSI interface in other ways if you have enough skill to build the hardware and write the software to use it. There is a user space driver for it in KMS." do you mean it's possible to use the interface for something else ? Or with a non official screen maybe ? Has indicated, i'm working in the industry, I'm not a hobbyist. Currently I'm building my system with Yocto, building the kernel is not an issue, developing some modules or patchs is also possible.

Maybe to ask the question differently I should give an example: I have recently worked with an iMX6 module (https://somlabs.com/product/visionsom-6ull/), the documentation of the vendor provide the complete functionalities of the SOC (here: https://wiki.somlabs.com/index.php/Visi ... and_Pinout) and the datasheet of the CPU is also available on the NXP website (https://www.nxp.com/products/processors ... e:i.MX6ULL). If you look at this SOC, you can notice the LCD and CSI interfaces can be used for other purpose thanks to the pin muxing. That's very common and not an exception, I'm used to see this on this kind of product.

Today I simply wonder if pin muxing is available on the CM3+ pins which are considered DSI/CSI pins, using alternative functions of the GPIOs ? I should simply look at the full datasheet from Allwinner but it seems it is not available (or I have not found it!)

Another detailed question on the same subject: HDMI has an I2C port available on pins 173 and 175 of the CM3+. This port is called "I2C2" in the device tree. Is this port available for something else (connecting sensors) if I'm not using the HDMI ?

Thanks!!

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

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 9:53 pm

Allwinner?

The Pi range uses Broadcom SoC's. No full datasheet available though.


Please read previous message from 6by9, they are better answers than mine. You can use different displays under certain circumstances, but you will need to set them up yourself.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

trejan
Posts: 1202
Joined: Tue Jul 02, 2019 2:28 pm

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 10:22 pm

nomdediot wrote:
Tue Jan 07, 2020 9:32 pm
do you mean it's possible to use the interface for something else ? Or with a non official screen maybe ?
No pin mux for those pins. You can interface something that understands MIPI CSI or DSI. This would be a camera, display or some custom hardware of your own that did the conversion. A lot of work and additional hardware so not viable for the vast majority of situations.
nomdediot wrote:
Tue Jan 07, 2020 9:32 pm
Another detailed question on the same subject: HDMI has an I2C port available on pins 173 and 175 of the CM3+. This port is called "I2C2" in the device tree. Is this port available for something else (connecting sensors) if I'm not using the HDMI ?
You can use it but you need to enable it with the i2c2_iknowwhatimdoing dtparam. The KMS module also enables it because it needs to read the EDID EEPROM from the ARM side but presumably you've got no display on this device.

You may want to also add hdmi_ignore_edid=1 as a precaution to stop the firmware from trying to access it if somebody ever accidentally runs tvservice.

nomdediot
Posts: 52
Joined: Sat Feb 02, 2013 3:04 pm

Re: Using DSI or CSI for another purpose?

Tue Jan 07, 2020 11:15 pm

Made a mistake, not Allwinner, but Broadcom.

Ok for the I2C on the HDMI interface, thanks.

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

Re: Using DSI or CSI for another purpose?

Wed Jan 08, 2020 9:32 am

From https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf page 11
CSI - Parallel CSI- Multimedia Peripherals
The CSI IP provides parallel CSI standard camera interface port. The CSI parallel data ports are up to 24 bits. It is designed to support 24-bit RGB888/YUV444, CCIR656 video interface, 8-bit YCbCr, YUV or RGB, and 8-bit/10-bit/16-bit Bayer data input.
Page 114 then lists the pinout as CSI_DATA00-CSI_DATA07, CSI_HSYNC, CSI_MCLK, CSI_PIXCLK, CSI_VSYNC.

That is NOT the MIPI CSI2 (Camera SERIAL Interface) standard.
MIPI CSI2 is a multi-lane, differential, serial interface, with switching of terminations and voltage levels. It requires a dedicated PHY, and therefore the pins are generally not available for general purpose use.

Refer to the IMX6 application note for CSI2 at https://www.nxp.com/docs/en/application-note/AN5305.pdf, page 11
The MIPI pins are not multiplexed with other peripherals and no port configuration is needed.
So, no, the IMX6 processors do not support pin muxing of the CSI pins, no different from the Pi.
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.

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

Re: Using DSI or CSI for another purpose?

Wed Jan 08, 2020 9:39 am

Looking at the same type of references for MIPI DSI on imx6,
https://cache.freescale.com/files/32bit ... 6DQIEC.pdf page 148 - none of the DSI_CLK* or DSI_DATA* lines are listed as general purpose.

The parallel LCD lines are listed as having alternate modes, but the same is true with the Pi where GPIO0-27 can be remuxed for DPI - see https://www.raspberrypi.org/documentati ... /README.md
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: 1673
Joined: Tue Jun 30, 2015 1:35 pm

Re: Using DSI or CSI for another purpose?

Wed Jan 08, 2020 2:24 pm

The only 'kind of multiplexing' for MIPI which I'm aware of is lane swapping. But the interface is still MIPI compliant and will not allow for connecting anything else to it.

And, btw. I'm also not the 'average RPI user' ;)

nomdediot
Posts: 52
Joined: Sat Feb 02, 2013 3:04 pm

Re: Using DSI or CSI for another purpose?

Fri Jan 10, 2020 7:19 am

Okk so to summarize, the csi and dsi on the pi are differential lines, explaining why they do not provide pin muxing. I call this a good reason to say we cannot use them for another purpose.

Exception with i2c interface of the hdmi which can be used for something else with the right config.

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

Re: Using DSI or CSI for another purpose?

Fri Jan 10, 2020 7:52 am

nomdediot wrote: Okk so to summarize, the csi and dsi on the pi are differential lines, explaining why they do not provide pin muxing. I call this a good reason to say we cannot use them for another purpose.

Exception with i2c interface of the hdmi which can be used for something else with the right config.
correct! MIPI is always differential

Return to “Device Tree”