I'm trying to configure an LDB display. I'm noticing a discrepancy in what I set as the clock-frequency and what is actually done.
In my device tree, I specify these values.
/* LVDS data bridge */
&ldb {
status = "okay";
lvds-channel@0 {
fsl,data-mapping = "spwg";
fsl,data-width = <24>;
status = "okay";
crtc = "ipu1-di0";
primary;
display-timings {
native-mode = <&timing0>;
timing0: display0 {
clock-frequency = <71980800>;
hactive = <800>;
hback-porch = <24>;
hfront-porch = <72>;
hsync-len = <24>;
vactive = <1280>;
vback-porch = <10>;
vfront-porch = <12>;
vsync-len = <2>;
};
};
};
};
The problem is that when I actually use this device tree, the clock is NOT set according to `clock-frequency`
root@imx6dl:~# cat /sys/kernel/debug/clk/clk_summary | grep ldb
ldb_di0_sel 1 1 396000000 0 0
ldb_di0_div_7 0 0 56571428 0 0
ldb_di0_div_sel 0 0 56571428 0 0
ldb_di0_div_3_5 1 1 113142857 0 0
ldb_di0_podf 1 1 56571429 0 0
ldb_di0 1 1 56571429 0 0
ldb_di1_sel 0 0 396000000 0 0
ldb_di1_div_7 0 0 56571428 0 0
ldb_di1_div_sel 0 0 56571428 0 0
ldb_di1_div_3_5 0 0 113142857 0 0
ldb_di1_podf 0 0 56571429 0 0
ldb_di1 0 0 56571429 0 0
I have tried modified the `clock-frequency` variable in the device tree higher and lower with no success. I realized that these clocks are generated from PLLs and and in order to get the correct frequency I need to modify the "CS2CDR" register in the CCM. I'm not sure where to do this...
I don't need to change the pll once I'm running, so my ideal situation would be that I set it in the devicetree or on boot (or u-boot) and not worry about it anymore.
What is the appropriate way to make this selection?