Verdin IMX8MP LVDS device tree overlay

We’re trying to add a device tree overlay for an LVDS display on a custom carrier board. The steps we took:

  • Compile the overlay in a Yocto build for Verdin IMX8MP
  • Copy the dtbo to /boot/ostree/torizon-0ae6185bf9fb1de8f511a613c5be079038e6b2949b00449628b02d14dfad6613/dtb/overlays/lvds.dtbo
  • Append the dtbo to /boot/ostree/torizon-0ae6185bf9fb1de8f511a613c5be079038e6b2949b00449628b02d14dfad6613/dtb/overlays.txt

With this we ran into these errors:

failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_BADMAGIC

Would appreciate any help figuring out what we’re doing wrong.

The device tree file:

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,verdin-imx8mp";
};

#include "imx8mp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pwm/pwm.h>

&panel_lvds {
  compatible = "panel-lvds";
  backlight = <&backlight>;
  data-mapping = "vesa-24";
  height-mm = <224>;
  width-mm = <126>;
  status = "okay";

  panel-timing {
    clock-frequency = <71600000 72900000 85000000>;
    de-active = <1>;
    hactive = <1920>;
    hback-porch = <5 16 260>;
    hfront-porch = <24 26 260>;
    hsync-active = <0>;
    hsync-len = <10 12 255>;
    pixelclk-active = <1>;
    vactive = <1200>;
    vback-porch = <2 5 255>;
    vfront-porch = <5 8 260>;
    vsync-active = <0>;
    vsync-len = <1 3 20>;
  };

  port {
    panel_lvds_in: endpoint {
      remote-endpoint = <&lvds_out>;
    };
  };
};

&pwm1 {
	status = "okay";
};

&backlight {
  compatible = "pwm-backlight";
  brightness-levels = <0 45 63 88 119 158 203 255>;
  default-brightness-level = <4>;
  /* Verdin I2S_2_D_OUT (DSI_1_BKL_EN/DSI_1_BKL_EN_LVDS, SODIMM 46) */
  //enable-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_i2s_2_d_out_dsi_1_bkl_en>;
  /* Verdin PWM_3_DSI/PWM_3_DSI_LVDS (SODIMM 19) */
  pwms = <&pwm_lvds1 0 6666667 PWM_POLARITY_INVERTED>;
  status = "okay";
};

&ldb2 {
  status = "okay";

  lvds-channel@0 {
    fsl,data-mapping = "spwg";
    fsl,data-width = <24>;
    status = "okay";

    port@1 {
      reg = <1>;

      lvds_out_custom: endpoint {
        remote-endpoint = <&panel_lvds_in_custom>;
      };
    };
  };
};

Boot log:

-Boot SPL 2024.07-7.2.0-devel+git.3f772959501c (Jan 01 1970 - 00:00:00 +0000)
DDR configured as dual rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@30280000 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x4802f000, size 1068
Need continue download 1024
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.10.0  (release):android-14.0.0_2.2.0-rc2-0-g7c64d4e86-dirty
NOTICE:  BL31: Built : 00:00:00, Jan  1 1970


U-Boot 2024.07-7.2.0-devel+git.3f772959501c (Jan 01 1970 - 00:00:00 +0000)

CPU:   Freescale i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 49C
Reset cause: POR
DRAM:  8 GiB
Core:  176 devices, 31 uclasses, devicetree: separate
WDT:   Started watchdog@30280000 with servicing every 1000ms (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... Reading from MMC(2)... OK
get_tdx_eeprom: cannot find EEPROM by node
MISSING TORADEX CARRIER CONFIG BLOCKS
get_tdx_eeprom: cannot find EEPROM by node
In:    serial@30880000
Out:   serial@30880000
Err:   serial@30880000
Model: Toradex 0070 Verdin iMX8M Plus Quad 8GB WB IT V1.1A
Serial#: 15601687
SEC0:  RNG instantiated
Net:   eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
Found U-Boot script /boot.scr
969 bytes read in 1 ms (946.3 KiB/s)
## Executing script at 50280000
7005 bytes read in 1 ms (6.7 MiB/s)
88166 bytes read in 2 ms (42 MiB/s)
128 bytes read in 2 ms (62.5 KiB/s)
Working FDT set to 50200000
Applying Overlay: verdin-imx8mp_hdmi_overlay.dtbo
2219 bytes read in 2 ms (1.1 MiB/s)
Applying Overlay: verdin-imx8mp_dsi-to-hdmi_overlay.dtbo
4099 bytes read in 2 ms (2 MiB/s)
Applying Overlay: verdin-imx8mp_spidev_overlay.dtbo
561 bytes read in 3 ms (182.6 KiB/s)
Applying Overlay: lvds.dtbo
3202 bytes read in 2 ms (1.5 MiB/s)
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_BADMAGIC
11341637 bytes read in 36 ms (300.5 MiB/s)
13127676 bytes read in 43 ms (291.2 MiB/s)
   Uncompressing Kernel Image to 0
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
SCRIPT FAILED: continuing...
MMC: no card present
No EFI system partition
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
Loading Boot0000 'mmc 2' failed
EFI boot manager: Cannot load any image

tdx-info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.54-7.2.0-devel-g91c19e78f9da #1-Torizon SMP PREEMPT Fri Jan 31 15:24:42 UTC 2025
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/0ae6185bf9fb1de8f511a613c5be079038e6b2949b00449628b02d14dfad6613/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.2.0-devel-202502-build.5
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mp-15601687
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0070 V1.1A
Serial number:            15601687
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

It seems you’re encountering some issues with your device tree overlay for the LVDS display on your Verdin iMX8MP module. The errors ‘FDT_ERR_NOTFOUND’ and ‘FDT_ERR_BADMAGIC’ typically suggest problems with the overlay file or its application process. Here are some steps you can take to troubleshoot and resolve these errors:

  1. Verify the Overlay File: Use the Device Tree Compiler (dtc) to decompile your lvds.dtbo file back into a .dts file. This will allow you to check for any syntax errors or missing nodes that might be causing the issue.

  2. Check Overlay Path and Name: Ensure that the lvds.dtbo file is correctly placed in the directory and that the path specified in overlays.txt matches exactly. Any discrepancies in the file name or path can lead to ‘FDT_ERR_NOTFOUND’.

  3. Overlay Compatibility: Confirm that the overlay is compatible with the base device tree. The compatible property in your overlay should match the base device tree’s compatible string, which in your case should be “toradex,verdin-imx8mp”.

  4. Base Device Tree: Make sure the base device tree is correctly loaded and includes the necessary nodes that your overlay expects to modify. The ‘FDT_ERR_BADMAGIC’ error can occur if the base device tree is not found or is corrupted.

  5. Kernel and Overlay Version: Verify that the kernel version matches the version for which the overlay was compiled. Mismatches can lead to errors during the overlay application.

  6. Boot Log Analysis: Review the boot log for any additional error messages or warnings that might provide more context about the failure.

  7. Recompile and Redeploy: If issues persist, try recompiling the overlay and redeploying it. Ensure that the compilation process uses the correct kernel source and configuration.

By following these steps, you should be able to identify and resolve the issues with your device tree overlay. If the problem continues, consider simplifying the overlay to isolate the problematic section or node, which can help pinpoint the exact cause of the error.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

FDT_ERR_NOTFOUND Error DTB Verdin iMX8MM.

Maybe try to change: remote-endpoint = <&lvds_out>;
to: remote-endpoint = <&lvds_out_custom>;
since you defined that phandle further down yourself and lvds_out is defined in ldb not ldb2.

Best regards
Andre