Add EDID binary into kernel image on XU4

This document introduces to add your EDID binary into a kernel image on XU4. You need to build a kernel to do this.
Refer to the link below for more information on how to build a kernel on the XU4.
How to build a kernel on XU4

Please refer to this guide to make your own EDID. Build your own EDID

You can see the other EDID files in it. https://github.com/hardkernel/linux/tree/odroid-5.4.y/firmware/edid

odroid@odroid:~/work/linux$ cp 480x1280_tweaks.bin firmware/edid/

In a menuconfig, append your edid path to this location.

Device Drivers ->
  Generic Driver Options ->
    Firmware loader ->
      Firmware loading facility ->

And build your kernel source and apply it to your XU4 image.

Add a videoconfig=“drm.edid_firmware=edid/480x1280_tweaks.bin” line in “config.ini” file.

...
...
 
; 480x320 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x320.bin"
 
videoconfig="drm.edid_firmware=edid/480x1280_tweaks.bin"
 
; vout : hdmi or dvi
; hdmi / dvi
vout=hdmi
 
...
...

In the case of the old XU4 image that have not the “config.ini” file, add the videoconfig=“drm.edid_firmware=edid/480x1280_tweaks.bin” line in the “boot.ini” file.

...
...
 
setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x1280_tweaks.bin"
 
# Boot Args
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0 ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
 
...
...

And then reboot your system.

reboot

After the reboot, you can verify with some command if your EDID is applied well.

You can find “edid_firmware” parameter in “cmdline”

odroid@odroid:~$ sudo cat /proc/cmdline
console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0 drm.edid_firmware=edid/480x1280_tweaks.bin HPD=false vout=hdmi usbhid.quirks=0x0eef
:0x0005:0x0004 smsc95xx.macaddr=00:1e:06:61:7a:39 false drm.debug=0xff s5p_mfc.mem=16M

Verify the HDMI mode is “480×1280”.

odroid@odroid:~$ cat /sys/class/drm/card0-HDMI-A-1/modes
480x1280

Verify the EDID with “edid-decode” util.

odroid@odroid:~$ sudo apt install edid-decode
odroid@odroid:~$ sudo edid-decode /sys/class/drm/card0-HDMI-A-1/edid
edid-decode (hex):
 
00 ff ff ff ff ff ff 00 21 6c 00 00 00 00 00 00
0c 1b 01 03 80 0c 21 78 ea 5e c0 a4 59 4a 98 25
20 50 54 00 00 00 1d c0 01 01 01 01 01 01 01 01
01 01 01 01 01 01 64 19 e0 5e 11 00 19 50 64 28
a2 00 7d 4d 01 00 00 1e 00 00 00 ff 00 4c 69 6e
75 78 20 23 30 0a 20 20 20 20 00 00 00 fd 00 3b
3d 4d 4f 07 00 0a 20 20 20 20 20 20 00 00 00 fc
00 34 38 30 78 31 32 38 30 0a 20 20 20 20 00 cf
 
----------------
 
EDID version: 1.3
Manufacturer: HKL Model 0 Serial Number 0
Made in week 12 of 2017
Digital display
Maximum image size: 12 cm x 33 cm
Gamma: 2.20
DPMS levels: Standby Suspend Off
RGB color display
First detailed timing is preferred timing
Color Characteristics
  Red:   0.6416, 0.3486
  Green: 0.2919, 0.5957
  Blue:  0.1474, 0.1250
  White: 0.3125, 0.3281
Established Timings I & II: none
Standard Timings
    480x272    59.997 Hz  16:9    16.919 kHz   9.204 MHz (GTF)
Detailed mode: Clock 65.000 MHz, 125 mm x 333 mm
                480  580  620  830 (100  40 210)
               1280 1290 1292 1305 ( 10   2  13)
               +hsync +vsync
               VertFreq: 60.010 Hz, HorFreq: 78.313 kHz
Display Product Serial Number: Linux #0
Display Range Limits
  Monitor ranges (GTF): 59-61 Hz V, 77-79 kHz H, max dotclock 70 MHz
Display Product Name: 480x1280
Checksum: 0xcf