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     ,
},
  1. 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 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.
  2. dpi_timing is the timing of the panel, which needs to be added in the panel driver. It corresponds to cz101b4001_desc under the path of \linux\drivers\gpu\drm\panel.
    1. Enter starfive_drm_seedpanel.c file.
    2. Modify the parameters 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
    3. 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:
      Figure 2. Driver Code
  3. Follow the steps below to configure MIPI DSI.
    1. Open starfive_drm_dsi.c file under the path of \linux\drivers\gpu\drm\verisilicon in Linux.
    2. 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.
      Figure 3. hsa hbp hfp
    3. Then locate cdns_dsi_adjust_phy_config function to modify the bitrate to 400000000.
      Figure 4. Bitrate
      Tip: The hs_clk_rate in the figure means bitrate.