When trying to setup the parameters for a custom LVDS display on the IMX8MP native LVDS (ldb) interface, we noticed that it's not possible to achieve the needed 60MHz Pixel Clock:
&panel_lvds {
status = "okay";
backlight = <&backlight_lvds>;
data-mapping = "vesa-24";
compatible = "panel-lvds";
width-mm = <199>;
height-mm = <112>;
panel-timing {
clock-frequency = <60000000>;
hactive = <1280>;
hback-porch = <32>;
hfront-porch = <32>;
hsync-len = <44>;
vactive = <720>;
vback-porch = <9>;
vfront-porch = <9>;
vsync-len = <5>;
};
video_pll1_ref_sel 1 1 0 24000000 0 0 50000
video_pll1 1 1 0 1039500000 0 0 50000
video_pll1_bypass 1 1 0 1039500000 0 0 50000
video_pll1_out 2 2 0 1039500000 0 0 50000
media_ldb 1 1 0 519750000 0 0 50000
media_ldb_root_clk 1 1 0 519750000 0 0 50000
media_disp2_pix 1 1 0 74250000 0 0 50000
media_disp2_pix_root_clk 1 1 0 74250000 0 0 50000
media_mipi_phy1_ref 0 0 0 47250000 0 0 50000
Looking through the code, we can see that the pixel clock options seem to be limited at the driver (drivers/gpu/drm/imx/imx8mp-ldb.c):
static int
imx8mp_ldb_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
...
/*
* Due to limited video PLL frequency points on i.MX8mp,
* we do mode fixup here in case any mode is unsupported.
*/
if (ldb->dual)
mode->clock = mode->clock > 100000 ? 148500 : 74250;
else
mode->clock = 74250;
return 0;
}
However, if we bypass this check (commenting these lines out) and setup a different root clock for the chain we're able to achieve the desired pixel clock:
video_pll1_ref_sel 1 1 0 24000000 0 0 50000
video_pll1 1 1 0 960000000 0 0 50000
video_pll1_bypass 1 1 0 960000000 0 0 50000
video_pll1_out 2 2 0 960000000 0 0 50000
media_ldb 1 1 0 480000000 0 0 50000
media_ldb_root_clk 1 1 0 480000000 0 0 50000
media_disp2_pix 1 1 0 60000000 0 0 50000
media_disp2_pix_root_clk 1 1 0 60000000 0 0 50000
The code that I showed above is from linux 5.4 but I already checked on 5.15 and the check for the pixel clocks is still there.
Considering this, I would like to ask:
What is the reason for this limitation? It seems that the hardware supports other options than 75Mhz or 150Mhz and this is also stated in the Reference manual:

Thank you in advance for the help,
Rafael