For the 1C2L MIPI channel, to support a new screen, it is necessary to modify the
driver file starfive_drm_seeedpanel.c under
/Linux/drivers/gpu/drm/verisilicon.
This driver file servers as an i2c device by default, and the
probe interface will use the i2c 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, the
probe function needs to support the
i2c interface; In seed_ panel_
enable function, the panel should be enabled according to
the specific command of i2c.
If the i2c command cannot read panel ID, you are
recommand to remove the i2c related command, then the
probe process can be completed, so that the screen
is in connected status by default.
Note: It is
necessary to remove all i2c read/write
command.
dpi_timing is the timing of the panel, which needs to be added in
the panel driver. It corresponds to starfive_drm_seedpanel.c under
the path of \linux\drivers\gpu\drm\verisilicon, which maps
seeed_panel_modes.
Enter starfive_drm_seedpanel.c file.
Modify the parameters of PLL 1188M under this function according to the
output file.Figure 1. Modify the Parameters
Tip:
clock = pixelclock/1000
hdisplay = hactive
hsync_start = hactive + hfp
hsync_end = hactive + hfp + hbp
htotal = hactive + hfp + hbp+ hsync_len
vdisplay = vactive
vsync_start = vactive + vfp
vsync_end = vactive + vfp + vbp
vtotal = vactive + vfp + vbp + vsync_len
After configuration, it will be synchronized to the DC controller driver and
MIPI DSI driver. For example, to set the lanes to 1,
you can change the corresponding parameters in the input file. Figure 2. Example InputThe corresponding driver code is shown in the following figure:Figure 3. Driver Code
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 0 to 36, 108,
288.
Note: Modifying parameters should
based on the corresponding channel. 1C2L corresponds to channel 0
while 1C4L corresponds to channel 1.
Figure 4. hsa hbp hfp
Then locate cdns_dsi_adjust_phy_config function to
modify the bitrate to 750000000.Figure 5. Bitrate