The general guidelines for recompiling the Linux kernel on Toradex modules are described in the following article from Toradex developer website:
Build U-Boot and Linux Kernel From Source Code
First you must have a cross-compilation toolchain installed, as described in Build U-Boot and Linux Kernel From Source Code - Toolchain
Specifically to your use case, you have to clone the correct iMX6 kernel branch as provided in the table from Build U-Boot and Linux Kernel From Source Code - Source Code - i.MX 6 Based Modules (Apalis/Colibri iMX6). From the link you provided in your question it seems to be toradex_4.9-2.3.x-imx
. Then to obtain the kernel source-code follow Build U-Boot and Linux Kernel From Source Code - Kernel Source
After that you have to configure the kernel for Apalis iMX6, using the apalis_imx6_defconfig
, as described in Build U-Boot and Linux Kernel From Source Code - Kernel Configuration - i.MX 6 based modules
Now is the time that you make the changes to the source-code file drivers/video/fbdev/mxc/mxc_edid.c.
After you finish, it's time to compíle the kernel, which is described in Build U-Boot and Linux Kernel From Source Code - Kernel Compilation - i.MX 6 Based Kernel (Apalis/Colibri iMX6). You may also need to recompile kernel modules as described in Build U-Boot and Linux Kernel From Source Code - Kernel Module Compilation, all Modules.
Finally update the kernel to the board as described in Build U-Boot and Linux Kernel From Source Code - Kernel Update.
Iterate the process of edit source code
--> re-build the kernel
--> re-deploy the kernel
--> test changes
until you nail it.
Alternatively, and possibly easier, you can edit the device-tree instead to add your display configuration.
The main reference for doing it is Device Tree Customization. Basically the device tree source comes with the kernel source, and Build U-Boot and Linux Kernel From Source Code also provide information how to compile the device tree.
Here is a code snippet highlighting relevant changes:
timing_wide: 1920x720 {
+ clock-frequency = <104600000>;
+ hactive = <1920>;
+ vactive = <720>;
+ hback-porch = <24>;
+ hfront-porch = <24>;
+ vback-porch = <8>;
+ vfront-porch = <57>;
+ hsync-len = <32>;
+ vsync-len = <5>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
Once you adapt it to your display, build and deploy to the device as documented in Build U-Boot and Linux Kernel From Source Code.
Once the device tree is deployed to the module, you just need to set the correct vidargs in U-Boot:
env set vidargs video=mxcfb0:dev=ldb,1920x720M@60,if=RGB666 ldb=sin0 fbmem=32M
env save
reset
Notice that you don't need to rebuild U-Boot. You must have access to the module terminal via:
1) debug UART, a.k.a serial console or;
2) A monitor and USB keyboard attached to the module.
Upon reboot or power cycle, you have to press any key (from the serial terminal emulator application in your computer if using 1) or directly on the module if using 2)) to access the U-Boot environment, where you execute the commands described above.
For reference about the device tree customization, below is a diff of the relevant device-tree file for supporting a custom LVDS display (which is not your display but can be used as an example):
diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
index cfaaa571c158..b3c92314367b 100644
--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -89,8 +89,8 @@
mxcfb1: fb@0 {
compatible = "fsl,mxc_sdc_fb";
disp_dev = "ldb";
- interface_pix_fmt = "RGB666";
- default_bpp = <16>;
+ interface_pix_fmt = "RGB24";
+ default_bpp = <24>;
int_clk = <0>;
late_init = <0>;
status = "disabled";
@@ -507,123 +507,135 @@
};
&ldb {
- status = "okay";
-// split-mode;
-// dual-mode;
-
- lvds-channel@0 {
- reg = <0>;
- fsl,data-mapping = "spwg"; /* "jeida"; */
- fsl,data-width = <18>;
- crtc = "ipu2-di1";
- primary;
- status = "okay";
-
- display-timings {
- native-mode = <&timing_xga>;
- /* LDB-AM-800600LTNQW-A0H */
- timing_svga: 800x600 {
- clock-frequency = <55000000>;
- hactive = <800>;
- vactive = <600>;
- hback-porch = <112>;
- hfront-porch = <32>;
- vback-porch = <3>;
- vfront-porch = <17>;
- hsync-len = <80>;
- vsync-len = <4>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- /* Standard XGA timing */
- timing_xga: 1024x768 {
- clock-frequency = <65000000>;
- hactive = <1024>;
- vactive = <768>;
- hback-porch = <160>;
- hfront-porch = <24>;
- vback-porch = <29>;
- vfront-porch = <3>;
- hsync-len = <136>;
- vsync-len = <6>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- timing_wxga: 1280x800 {
- clock-frequency = <68930000>;
- hactive = <1280>;
- vactive = <800>;
- hback-porch = <64>;
- hfront-porch = <64>;
- vback-porch = <5>;
- vfront-porch = <5>;
- hsync-len = <40>;
- vsync-len = <6>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- /* LTTD1280800101-L4WH-CT1, note that it needs
- fsl,data-mapping = "spwg"; fsl,data-width = <24>; */
- timing_wxga1: 1280x800-1 {
- clock-frequency = <71100000>;
- hactive = <1280>;
- vactive = <800>;
- hback-porch = <60>;
- hfront-porch = <60>;
- vback-porch = <7>;
- vfront-porch = <7>;
- hsync-len = <40>;
- vsync-len = <9>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- timing_fullhd: 1920x1080 {
- clock-frequency = <138500000>;
- hactive = <1920>;
- vactive = <1080>;
- hback-porch = <80>;
- hfront-porch = <48>;
- vback-porch = <23>;
- vfront-porch = <3>;
- hsync-len = <32>;
- vsync-len = <5>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- };
- };
-
- lvds-channel@1 {
- reg = <1>;
- fsl,data-mapping = "spwg";
- fsl,data-width = <18>;
- crtc = "ipu1-di0";
- status = "okay";
-
- display-timings {
-/* native-mode = <&timing_svga_ch2>;*/
- /* LDB-AM-800600LTNQW-A0H */
- timing_svga_ch2: 800x600 {
- clock-frequency = <55000000>;
- hactive = <800>;
- vactive = <600>;
- hback-porch = <112>;
- hfront-porch = <32>;
- vback-porch = <3>;
- vfront-porch = <17>;
- hsync-len = <80>;
- vsync-len = <4>;
- hsync-active = <0>;
- vsync-active = <0>;
- pixelclk-active = <0>;
- };
- };
- };
+ status = "okay";
+ split-mode; // split mode on
+// dual-mode;
+
+ lvds-channel@0 {
+ reg = <0>;
+ fsl,data-mapping = "spwg"; /* "jeida"; */
+ fsl,data-width = <24>;
+ crtc = "ipu2-di1";
+ primary;
+ status = "okay";
+
+ display-timings {
+ native-mode = <&timing_wide>;
+ /* LDB-AM-800600LTNQW-A0H */
+ timing_svga: 800x600 {
+ clock-frequency = <55000000>;
+ hactive = <800>;
+ vactive = <600>;
+ hback-porch = <112>;
+ hfront-porch = <32>;
+ vback-porch = <3>;
+ vfront-porch = <17>;
+ hsync-len = <80>;
+ vsync-len = <4>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ /* Standard XGA timing */
+ timing_xga: 1024x768 {
+ clock-frequency = <65000000>;
+ hactive = <1024>;
+ vactive = <768>;
+ hback-porch = <160>;
+ hfront-porch = <24>;
+ vback-porch = <29>;
+ vfront-porch = <3>;
+ hsync-len = <136>;
+ vsync-len = <6>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ timing_wxga: 1280x800 {
+ clock-frequency = <68930000>;
+ hactive = <1280>;
+ vactive = <800>;
+ hback-porch = <64>;
+ hfront-porch = <64>;
+ vback-porch = <5>;
+ vfront-porch = <5>;
+ hsync-len = <40>;
+ vsync-len = <6>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ timing_fullhd: 1920x1080 {
+ clock-frequency = <138500000>;
+ hactive = <1920>;
+ vactive = <1080>;
+ hback-porch = <80>;
+ hfront-porch = <48>;
+ vback-porch = <23>;
+ vfront-porch = <3>;
+ hsync-len = <32>;
+ vsync-len = <5>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ timing_wide: 1920x720 {
+ clock-frequency = <104600000>;
+ hactive = <1920>;
+ vactive = <720>;
+ hback-porch = <24>;
+ hfront-porch = <24>;
+ vback-porch = <8>;
+ vfront-porch = <57>;
+ hsync-len = <32>;
+ vsync-len = <5>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ };
+ };
+
+ lvds-channel@1 {
+ reg = <1>;
+ fsl,data-mapping = "spwg";
+ fsl,data-width = <18>;
+ crtc = "ipu1-di0";
+ status = "okay";
+
+ display-timings {
+ native-mode = <&timing_wide_ch2>;
+ /* LDB-AM-800600LTNQW-A0H */
+ timing_svga_ch2: 800x600 {
+ clock-frequency = <55000000>;
+ hactive = <800>;
+ vactive = <600>;
+ hback-porch = <112>;
+ hfront-porch = <32>;
+ vback-porch = <3>;
+ vfront-porch = <17>;
+ hsync-len = <80>;
+ vsync-len = <4>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ timing_wide_ch2: 1920x720 {
+ clock-frequency = <104600000>;
+ hactive = <1920>;
+ vactive = <720>;
+ hback-porch = <24>;
+ hfront-porch = <24>;
+ vback-porch = <8>;
+ vfront-porch = <57>;
+ hsync-len = <32>;
+ vsync-len = <5>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ pixelclk-active = <0>;
+ };
+ };
+ };
};