The i.MX 8M provides the embedded Mobile Industry Processor Interface (MIPI) - Display Serial Interface (DSI) controller. In the Emcraft i.MX 8M kit, the i.MX 8M MIPI-DSI interface port is available on the P3 (LCD Add-On) connector on the IMX8M-SOM-BSB carrier board. Refer to this page for detailed information on pin-out of the LCD Add-On connector.
This application note describes how to use the i.MX 8M MIPI-DSI interface to drive an HDMI display or TV using a DSI-to-HDMI adapter board. The specific adapter board that was used by Emcraft in the testing outlined below is the STmicro B-LCDAD-HDMI1, based on the ADV7533 chip:
http://www.st.com/en/development-tools/b-lcdad-hdmi1.html
To enable the DSI-to-HDMI adapter in the Linux kernel configuartion, make the following changes in the
meta-emcraft/recipes-kernel/linux/linux-imx/imx8m-som.dts file:
- Define the following constant at the beginning of the file:
#define MIPI_DSI_ENABLE
Add the adv_bridge device to the i2c1 bus:
&i2c1 {
...
adv_bridge: adv7535@3d {
compatible = "adi,adv7533";
reg = <0x3d>;
adi,dsi-lanes = <4>;
status = "okay";
port {
adv7535_in: endpoint {
remote-endpoint = <&mipi_dsi_bridge_out>;
};
};
};
...
};
Disable the ov5640_mipi devices on the i2c1 bus. Note that it is not possible to use the
B-LCDAD-HDMI1 adapter together with the NXP MINISASTOCSI camera board in a single configuration. The reason is that the ADV7533 utilizes several I2C addresses (0x38, 0x3C, 0x3D, 0x3F), which overlap with the I2C address (0x3C) used by the OV5640 camera sensor device on the MINISASTOCSI board.
&i2c1 {
...
ov5640_mipi: ov5640_mipi@3c {
compatible = "ovti,ov5640_mipi";
reg = <0x3c>;
status = "disabled";
...
};
ov5640_mipi2: ov5640_mipi2@3c {
compatible = "ovti,ov5640_mipi";
reg = <0x3c>;
status = "disabled";
...
};
...
};
Edit the mipi_dsi_bridge node, remove theĀ panel@0 node in it, and connect remote-endpoint to adv7535_in, so that the mipi_dsi_bridge looks as follows:
&mipi_dsi_bridge {
status = "okay";
port@1 {
mipi_dsi_bridge_out: endpoint {
remote-endpoint = <&adv7535_in>;
};
};
};
Rebuild the target images, validate as follows:
- Connect the DSI connector on the DSI-to-HDMI adapter to the P3 (LCD Add-On) connector on the IMX8M-SOM-BSB.
- Connect the HDMI connector on the DSI-to-HDMI adapter to your HDMI LCD/TV using an HDMI cable.
- Power on the IMX8M-SOM-BSB, boot the system using the .dtb defined as above.
- Observe the messages about successful DSI initialization in the system console:
...
[ 0.991730] [drm] Initialized
[ 1.010594] nwl_dsi-imx mipi_dsi@30A00000: Reset the panel
[ 1.373125] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.379757] [drm] No driver support for vblank timestamp query.
[ 1.385772] imx-drm display-subsystem: bound imx-dcss-crtc.0 (ops dcss_
crtc_ops)
[ 1.393251] nwl_dsi-imx mipi_dsi@30A00000: Using DCSS as input source
[ 1.399768] nwl_dsi-imx mipi_dsi@30A00000: [drm:imx_nwl_dsi_bind] id =
DSI0
[ 1.406932] nwl-mipi-dsi 30a00000.mipi_dsi_bridge: [drm:nwl_dsi_host_
attach] lanes=4, format=0x0 flags=0x215
[ 1.416837] imx-drm display-subsystem: bound mipi_dsi@30A00000 (ops imx_
nwl_dsi_component_ops)
[ 1.528414] random: fast init done
[ 1.561864] nwl_dsi-imx mipi_dsi@30A00000: [drm:imx_nwl_dsi_enable] id
= DSI0
[ 1.640515] Console: switching to colour frame buffer device 240x67
[ 2.369477] imx-drm display-subsystem: fb0: frame buffer device
...
From the Linux shell, run a test application to show a colored pattern on the display:
root@imx8m-som:~# lcdtest
1920x1080, 32bpp
The framebuffer can be accessed at the address 0xffffa5064000