Configuration for 1C4L
This section provides an example to configure the parameters in 1C4L MIPI driver. The
following code block is an example of the output
file:
dpi_timing = { //800x1280, 24 bits, 59.68 Hz
.pixelclock = 66000000,
.hactive = 800 ,
.hfront_porch = 44 ,
.hback_porch = 5 ,
.hsync_len = 5 ,
.vactive = 1280 ,
.vfront_porch = 5 ,
.vback_porch = 5 ,
.vsync_len = 5 ,
},
.dsi_timing = {
.dlanes = 4 ,
.bitrate = 400000000,
.hsa = 66 ,
.hbp = 64 ,
.hfp = 57 ,
.hact = 2400 ,
},
- For the 1C4L MIPI channel, to support a new screen, it is necessary to modify the
driver file panel-jadard-jd9365da-h3.c under
/Linux/drivers/gpu/drm/panel.This driver file servers as an
i2c
device by default, and theprobe
interface will use thei2c
command to read the panel ID, and verify whether the current screen is connected properly based on the return value. When debugging a new screen, there are two cases:- If the
i2c
command can read the panel ID, theprobe
function needs to support thei2c
interface; Inseed_ panel_ enable
function, the panel should be enabled according to the specific command ofi2c
. - If the
i2c
command cannot read panel ID, you are recommand to remove thei2c
related command, then theprobe
process can be completed, so that the screen is in connected status by default.Note: It is necessary to remove alli2c
read/write command.
- If the
dpi_timing
is the timing of the panel, which needs to be added in the panel driver. It corresponds tocz101b4001_desc
under the path of \linux\drivers\gpu\drm\panel.- Enter
starfive_drm_seedpanel.c
file. - Modify the parameters under this function according to the output file.
- After configuration, it will be synchronized to the DC controller driver and MIPI DSI driver. For example, to set the lanes to 4, you can change the corresponding parameters in the input file. The corresponding driver code is shown in the following figure:
- Enter
-
Follow the steps below to configure MIPI DSI.
- Open starfive_drm_dsi.c file under the path of \linux\drivers\gpu\drm\verisilicon in Linux.
- Locate cdns_dsi_mode2cfg function to modify the
value of hsa, hbp and
hfp in channel 1 to 66, 64,
57.Note: Modifying parameters should based on the corresponding channel. 1C2L corresponds to channel 0 while 1C4L corresponds to channel 1.
- Then locate cdns_dsi_adjust_phy_config function to modify the bitrate to 400000000.