WiFi interface not appearing on Verdin iMX8MP SoM with Dahlia Carrier Board

Hardware:

Tooling:

Images tested:

  • Torizon
  • Linux Reference Minimal (dunfell)
  • Linux Reference Multimedia (dunfell)
  • Custom Yocto build with Toradex BSP (dunfell)

Issue:
The WiFi interface/adapter on the SoM does not appear, irrespective of the underlaying image

Background information:
The Verdin iMX8M Plus is available with optional on-module Wi-Fi and Bluetooth interfaces. The addition of “WB” in the product name indicates that a version features Wi-Fi and Bluetooth. These Verdin module versions make use of the AW-CM276NF Dual-Band Wi-Fi and Bluetooth module from AzureWave. From section 5.4 of Verdin iMX8MP Datasheet.

The AW-CM276NF is a Wi-Fi & Bluetooth M.2 LGA Type 1216 module. The device is based on the NXP 88W8997 (formerly Marvell 88W8997) chipset and implements the same reference design.

There are no Verdin modules or boards listed as compatible AND tested with AW-CM276NF (here AW-CM276NF - Azurewave). However, the Verdin iMX8M Plus Quad 4GB WB IT with the same part number (0058) and version 1.1A is listed as having this module here Azurewave AW-CM276NF Wi-Fi & Bluetooth module.

Supposedly, Toradex’s Embedded Linux BSPs come with out of the box support for the AW-CM276NF:

Toradex’s Embedded Linux BSPs only provide out-of-the-box software support for the LM816 USB WiFi, and Azurewave AW-CM276NF Wi-Fi & Bluetooth module (integrated on some of our CoMs). If you are using a Toradex CoM with embedded Wi-Fi, (see list above), the kernel support for the dual-antenna Wi-Fi client mode without concurrent Bluetooth use case is enabled by default on Toradex’s Embedded Linux BSPs and you can proceed to the next step.

Expected outcome:
WiFi should work out of the box (the adapter should at least be showing when ip addr or ifconfig -a is run.

Attempted steps:
When running ip addr or ifconfig -a there is no mlan entry. There is also no SDIO/Wifi entry in /proc/device-tree, /sys/kernel/debug also only has 2 MMC entries, according to the docs here, there should 3 (section 5.14 here Verdin iMX8MP Datasheet). Running dmesg | grep mmc/wifi/mw/net/sd does not yield any useful results.

Interestingly cat-ing /proc/device-tree/name and /proc/device-tree/toradex,product-id results in thinking the board is a Verdin Development board (instead of a Dahlia one, but maybe this is a generic name) and a product id of 0063 which is the same SoM but without the built-in WiFi module (the device does have a WiFi module on the SoM though), so the device-tree is lying.

Details on the WiFi adapter and SoM are here Toradex’s Linux Images - Toradex’s Linux Images - How to connect to a Wi-Fi network | Toradex Developer Center. Following the above guide with the minimal and multimedia reference images does not give the expected results (no mlan interface in ifconfig -a or ip addr) and while connmanctl works, trying to run scan wifi or enable wifi fails (Error wifi: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist) similar to this issue Wlan USB stick not working with Apalis TK1 or this issue Failed to enable BBB wifi. Running connmanctl technologies only yields the ethernet adapter, this person here seems to have a similar issue with a different SoM Enable Wi-Fi on Apalis iMX8QM.

The Dunfell versions of both the minimal (in file) and multimedia (in packagegroup-tdx-cli) reference images include packagegroup-wifi-* references which presumably install the firmware and things like connmanctl for network management. Mwifiexap is also included for imx8mp and imx8 devices here packagegroup-tdx-cli.bb « images « recipes-images - meta-toradex-demos.git - Toradex BSP layer, recipes for the demo images. Both of the recommended backports listed on this issue Enable Wi-Fi on Apalis iMX8QM are also already included by default.

I also tried a bunch of modprobe, insprobe, and hostapd stuff that I can’t 100% remember, but essentially:

  • Loaded and unloaded the sdio module (how the wifi antenna is connected) drivers
  • Checked that the firmware was installed
    • /sys/firmware/devicetree/base/
      • Could not find them
  • Checked that the drivers were installed
    • Could not find them
  • Checked for the presence of the WiFi module in /sys/devices, /sys/bus/sdio/devices/
    • Was not there
  • Reseated the sdio antenna

In addition to this I also:

  • Checked block diagrams
  • Reviewed the quickstart guide and detailed documentation
  • Checked board schematic diagrams
  • Searched for mwifi recursively through the file system
  • Re-seating the SoM + heatsink

Also tried with the Torizon reference image and nmcli -a (no wifi), nmcli device wifi list (no wifi), ip addr, and ifconfig -a but could not see the WiFi adapter, as outlined here Basic Wi-Fi Usage with Torizon.

Based on the presence of the enable-wifi.service in the meta-toradex-demos repo.

Running systemctl --type=service --all yields:

 UNIT                                                                            LOAD      ACTIVE   SUB     DESCRIPTION
  alsa-restore.service                                                           loaded    active   exited  Save/Restore Sound Card State
  alsa-state.service                                                             loaded    inactive dead    Manage Sound Card State (restore and store)
● auditd.service                                                                 not-found inactive dead    auditd.service
  avahi-daemon.service                                                           loaded    active   running Avahi mDNS/DNS-SD Stack
  busybox-klogd.service                                                          loaded    active   running Kernel Logging Service
  busybox-syslog.service                                                         loaded    active   running System Logging Service
● chronyd.service                                                                not-found inactive dead    chronyd.service
  connman.service                                                                loaded    active   running Connection service
  dbus.service                                                                   loaded    active   running D-Bus System Message Bus
● display-manager.service                                                        not-found inactive dead    display-manager.service
● dropbear.service                                                               not-found inactive dead    dropbear.service
  dropbear@0-fe80::c67:70ff:fe44:21a6:22-fe80::20c0:bada:fd2c:8ef8:56509.service loaded    active   running SSH Per-Connection Server ([fe80::20c0:bada:fd2c:8ef8]:56509)
  dropbearkey.service                                                            loaded    active   exited  SSH Key Generation
  emergency.service                                                              loaded    inactive dead    Emergency Shell
  getty@tty1.service                                                             loaded    active   running Getty on tty1
  gpsd.service                                                                   loaded    inactive dead    GPS (Global Positioning System) Daemon
● imx8-isp.service                                                               loaded    failed   failed  ISP i.MX 8Mplus daemon
  initrd-cleanup.service                                                         loaded    inactive dead    Cleaning Up and Shutting Down Daemons
  initrd-parse-etc.service                                                       loaded    inactive dead    Reload Configuration from the Real Root
  initrd-switch-root.service                                                     loaded    inactive dead    Switch Root
  initrd-udevadm-cleanup-db.service                                              loaded    inactive dead    Cleanup udevd DB
  ip6tables.service                                                              loaded    active   exited  IPv6 Packet Filtering Framework
  iptables.service                                                               loaded    active   exited  IPv4 Packet Filtering Framework
  kmod-static-nodes.service                                                      loaded    active   exited  Create list of static device nodes for the current kernel
  ldconfig.service                                                               loaded    active   exited  Rebuild Dynamic Linker Cache
  nfs-statd.service                                                              loaded    active   running NFS status monitor for NFSv2/3 locking.
  ofono.service                                                                  loaded    active   running Telephony service
● plymouth-quit-wait.service                                                     not-found inactive dead    plymouth-quit-wait.service
● plymouth-quit.service                                                          not-found inactive dead    plymouth-quit.service
● plymouth-start.service                                                         not-found inactive dead    plymouth-start.service
  rc-local.service                                                               loaded    inactive dead    /etc/rc.local Compatibility
● remount-rootfs.service                                                         not-found inactive dead    remount-rootfs.service
  rescue.service                                                                 loaded    inactive dead    Rescue Shell
  rngd.service                                                                   loaded    active   running Hardware RNG Entropy Gatherer Daemon
  rpcbind.service                                                                loaded    active   running RPC Bind
  run-postinsts.service                                                          loaded    active   exited  Run pending postinsts
  serial-getty@ttymxc2.service                                                   loaded    active   running Serial Getty on ttymxc2
  set-hostname.service                                                           loaded    inactive dead    set-hostname.service
  systemd-ask-password-console.service                                           loaded    inactive dead    Dispatch Password Requests to Console
  systemd-ask-password-wall.service                                              loaded    inactive dead    Forward Password Requests to Wall
  systemd-fsck-root.service                                                      loaded    active   exited  File System Check on Root Device
  systemd-hwdb-update.service                                                    loaded    inactive dead    Rebuild Hardware Database
  systemd-initctl.service                                                        loaded    inactive dead    initctl Compatibility Daemon
  systemd-journal-catalog-update.service                                         loaded    active   exited  Rebuild Journal Catalog
  systemd-journal-flush.service                                                  loaded    active   exited  Flush Journal to Persistent Storage
  systemd-journald.service                                                       loaded    active   running Journal Service
  systemd-logind.service                                                         loaded    active   running Login Service
  systemd-machine-id-commit.service                                              loaded    active   exited  Commit a transient machine-id on disk
  systemd-modules-load.service                                                   loaded    active   exited  Load Kernel Modules
  systemd-networkd.service                                                       loaded    active   running Network Service
  systemd-random-seed.service                                                    loaded    active   exited  Load/Save Random Seed
  systemd-remount-fs.service                                                     loaded    active   exited  Remount Root and Kernel File Systems
  systemd-resolved.service                                                       loaded    inactive dead    Network Name Resolution
  systemd-rfkill.service                                                         loaded    inactive dead    Load/Save RF Kill Switch Status
  systemd-sysctl.service                                                         loaded    active   exited  Apply Kernel Variables
  systemd-sysusers.service                                                       loaded    active   exited  Create System Users
  systemd-timesyncd.service                                                      loaded    active   running Network Time Synchronization
  systemd-tmpfiles-clean.service                                                 loaded    inactive dead    Cleanup of Temporary Directories
  systemd-tmpfiles-setup-dev.service                                             loaded    active   exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service                                                 loaded    active   exited  Create Volatile Files and Directories
  systemd-udev-settle.service                                                    loaded    active   exited  udev Wait for Complete Device Initialization
  systemd-udev-trigger.service                                                   loaded    active   exited  udev Coldplug all Devices
  systemd-udevd.service                                                          loaded    active   running udev Kernel Device Manager
  systemd-update-done.service                                                    loaded    active   exited  Update is Completed
  systemd-update-utmp-runlevel.service                                           loaded    inactive dead    Update UTMP about System Runlevel Changes
  systemd-update-utmp.service                                                    loaded    active   exited  Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service                                                  loaded    active   exited  Permit User Sessions
  systemd-vconsole-setup.service                                                 loaded    inactive dead    Setup Virtual Console
  timestamp.service                                                              loaded    active   exited  Timestamping service
  usbg.service                                                                   loaded    inactive dead    Load default USB gadget schema g1.schema
  user-runtime-dir@0.service                                                     loaded    active   exited  User Runtime Directory /run/user/0
  user@0.service                                                                 loaded    active   running User Manager for UID 0
  var-volatile-cache.service                                                     loaded    inactive dead    Bind mount volatile /var/cache
  var-volatile-lib.service                                                       loaded    inactive dead    Bind mount volatile /var/lib
  var-volatile-spool.service                                                     loaded    inactive dead    Bind mount volatile /var/spool
  var-volatile-srv.service                                                       loaded    inactive dead    Bind mount volatile /srv
  wayland-app-launch.service                                                     loaded    active   running Start a wayland application
  weston@root.service                                                            loaded    active   running Weston Wayland Compositor
  wpa_supplicant.service                                                         loaded    active   running WPA supplicant

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

Running systemctl list-unit-files yields:

UNIT FILE                              STATE
-.mount                                generated
boot.mount                             generated
dev-hugepages.mount                    static
dev-mqueue.mount                       static
sys-fs-fuse-connections.mount          static
sys-kernel-config.mount                static
sys-kernel-debug.mount                 static
tmp.mount                              static
var-volatile.mount                     generated
systemd-ask-password-console.path      static
systemd-ask-password-wall.path         static
session-c1.scope                       transient
alsa-restore.service                   static
alsa-state.service                     static
autovt@.service                        enabled
avahi-daemon.service                   enabled
bluealsa-aplay.service                 disabled
bluealsa.service                       enabled
bluetooth.service                      enabled
btuart.service                         disabled
busybox-klogd.service                  enabled
busybox-syslog.service                 enabled
connman.service                        enabled
console-getty.service                  disabled
container-getty@.service               static
dbus-org.bluez.service                 enabled
dbus-org.freedesktop.Avahi.service     enabled
dbus-org.freedesktop.hostname1.service static
dbus-org.freedesktop.locale1.service   static
dbus-org.freedesktop.login1.service    static
dbus-org.freedesktop.network1.service  enabled
dbus-org.freedesktop.resolve1.service  enabled
dbus-org.freedesktop.timedate1.service static
dbus-org.freedesktop.timesync1.service enabled
dbus-org.neard.service                 enabled
dbus.service                           static
debug-shell.service                    disabled
dropbear@.service                      static
dropbearkey.service                    static
emergency.service                      static
enable-wifi.service                    disabled
fstrim.service                         static
getty@.service                         enabled
gpsd.service                           disabled
gpsdctl@.service                       static
hostapd-example.service                disabled
hostapd.service                        disabled
imx8-isp.service                       enabled
initrd-cleanup.service                 static
initrd-parse-etc.service               static
initrd-switch-root.service             static
initrd-udevadm-cleanup-db.service      static
ip6tables.service                      enabled
iptables.service                       enabled
kmod-static-nodes.service              static
ldconfig.service                       static
neard.service                          enabled
nfs-statd.service                      enabled
ofono.service                          enabled
polkit.service                         static
ppp@.service                           disabled
ptpd.service                           disabled
quotaon.service                        static
rc-local.service                       static
rescue.service                         static
rngd.service                           enabled
rpcbind.service                        enabled
run-postinsts.service                  disabled
serial-getty@.service                  indirect
set-hostname.service                   enabled
syslog.service                         enabled
system-update-cleanup.service          static
systemd-ask-password-console.service   static
systemd-ask-password-wall.service      static
systemd-backlight@.service             static
systemd-boot-check-no-failures.service disabled
systemd-exit.service                   static
systemd-fsck-root.service              enabled-runtime
systemd-fsck@.service                  static
systemd-halt.service                   static
systemd-hibernate-resume@.service      static
systemd-hibernate.service              static
systemd-hostnamed.service              static

And running systemctl status enable-wifi yields:

Created symlink /etc/systemd/system/multi-user.target.wants/enable-wifi.service → /lib/systemd/system/enable-wifi.service.

The service then shows up as enabled under the unit files (systemctl list-unit-files) but disabled under the services list (systemctl --type=service --all)

UNIT FILE                              STATE
enable-wifi.service                    enabled
UNIT                                                                           LOAD      ACTIVE   SUB      DESCRIPTION
enable-wifi.service                                                            loaded    inactive  dead    Enable Wifi

Checking dmesg (nothing WLAN/WiFi related), systemctl status enable-wifi (same result as above), and journalctl -u enable-wifi (no logs)after performing these actions does not yield anything of interest.

-- Logs begin at Mon 2022-07-25 18:21:52 UTC, end at Wed 2022-08-10 03:45:21 UTC. --
-- No entries --

Both reference images are running off version 5.7.0+build.20 (2022-07-25) which are available here:

But artifactory itself only exposes up to release 12 Artifacts Toradex.

Hello @mastan-aware,
Could you check if the right device tree is being loaded on your module? On the u-boot prompt you could do:

printenv fdtfile

For the wi-fi variant you should have:

imx8mp-verdin-wifi-dev.dtb

The modules come by default with the dev device tree, and if you have the dahlia you can change it:

setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
saveenv

and then reboot and check if the wi-fi module is detected?

Regards,
Rafael Beims

Thanks for the reply @rafael.tx, it looks like the value of fdtfile was set to a non-WiFi variant, so I have updated that using your instructions.

Verdin iMX8MP # printenv fdtfile
fdtfile=imx8mp-verdin-nonwifi-dev.dtb
Verdin iMX8MP # setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
Verdin iMX8MP # printenv fdtfile
fdtfile=imx8mp-verdin-wifi-dahlia.dtb
Verdin iMX8MP # saveenv
Saving Environment to MMC... Writing to MMC(2)... OK
<manually power-cycled device>

However, when booting into the OS and printing out the device tree using (ls /proc/device-tree), I don’t see anything at the top-level regarding the WiFi adapter/networking:

#address-cells                 clock-ext4                     etm@28540000                   i2c-rpbus-3                    pcie-phy@32f00000              regulator-module-eth1phy       toradex,product-id
#size-cells                    clock-osc-24m                  etm@28640000                   imx_ion                        pcie@33800000                  regulator-usdhc2               usb-phy@381f0040
__symbols__                    clock-osc-32k                  etm@28740000                   interrupt-controller@38800000  pcie_ep@33800000               reserved-memory                usb-phy@382f0040
aliases                        compatible                     etr@28c06000                   interrupt-parent               pmu                            rpmsg                          usb@32f10100
backlight                      cpus                           funnel                         memory-controller@3d400000     power-domains                  serial-number                  usb@32f10108
backlight-mezzanine            ddr_pmu@3d800000               funnel@28c03000                memory@40000000                psci                           soc@0                          usb_1_id
busfreq                        display-subsystem              gpio-keys                      mix_gpu_ml                     regulator-1p8v                 sound-card                     vipsi@38500000
chosen                         dma-apbh@33000000              gpmi-nand@33002000             model                          regulator-3p3v                 sound-hdmi                     vpu_g1@38300000
clock-ext1                     dsp@3b6e8000                   gpu2d@38008000                 name                           regulator-aux-usb              thermal-zones                  vpu_g2@38310000
clock-ext2                     etf@28c04000                   gpu3d@38000000                 opp-table                      regulator-eth2phy              timer                          vpu_vc8000e@38320000
clock-ext3                     etm@28440000                   hsio-mix@32f10000              panel-lvds                     regulator-mipi-phy             toradex,board-rev

Searching the sub-folders for things like “wifi”, “net”, “sd”, “mw”, “wireless”, “wlan”, “mlan” didn’t seem to yield anything either.

I checked the services and service-units again, the enable-wifi service is still disabled (but I should be able to enable WiFi manually using connman and the unit is enabled.

Trying to manually enable WiFi failed with the same error as before:

root@verdin-imx8mp-07251034:~# connmanctl
connmanctl> enable wifi
Error wifi: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist

I then rebooted the device to check the value of the fdtfile again and it had reset to the non-WiFi value. Is there another way I should be booting into the main OS after updating the u-boot variable, such as running boot?

EDIT
I exited u-boot using boot and the WiFi adapter shows up (As mlan0) when I run ip addr or ifconfig, but the config resets after each boot (using the reboot command). Is there a way to make this persist?

Are you able to provide guidance on where in the device tree the WiFi adapter is expected to show and some next steps, please?

This configuration should be persistent. After a reboot, you should be able to see your changed fdtfile variable when you use
printenv fdtfile
I you are not seeing the right value we would need to figure out why this could happen.
There are two different things you could do to check that:

  1. Look on the serial console for the output confirming that the correct device tree was selected. It should print something around these lines:
## Executing script at 47000000
Loading DeviceTree: imx8mm-verdin-wifi-dev.dtb
  1. Check if the environment that is saved on the flash contains the fdtfile variable by typing this on the linux console:
fw_printenv|grep fdtfile

First boot

u-boot:

Verdin iMX8MP # printenv fdtfile
fdtfile=imx8mp-verdin-nonwifi-dev.dtb
Verdin iMX8MP # setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
Verdin iMX8MP # printenv fdtfile
fdtfile=imx8mp-verdin-wifi-dahlia.dtb
Verdin iMX8MP # saveenv
Saving Environment to MMC... Writing to MMC(2)... OK

Verdin iMX8MP # boot

Boot sequence:

MMC: no card present
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
Found U-Boot script /boot.scr
5754 bytes read in 8 ms (702.1 KiB/s)
## Executing script at 47000000
Loading DeviceTree: imx8mp-verdin-wifi-dahlia.dtb

Reference image (minimal):

root@verdin-imx8mp-07251034:~# fw_printenv | grep "fdtfile="
fdtfile=imx8mp-verdin-wifi-dahlia.dtb
root@verdin-imx8mp-07251034:~# reboot

Second boot - did not enter u-boot

Boot sequence:

U-Boot SPL 2020.04-5.7.0+git.33bb8e968332 (Jul 06 2022 - 12:21:53 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
Training FAILED
Quad die, dual rank failed, attempting dual die, single rank configuration.
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
Find FIT header 0x4803a600, size 969
Need continue download 1024
Download 840704, total fit 842160
NOTICE:  BL31: v2.2(release):toradex_imx_5.4.70_2.3.0-g2fa8c6349e
NOTICE:  BL31: Built : 12:30:42, May 17 2022


U-Boot 2020.04-5.7.0+git.33bb8e968332 (Jul 06 2022 - 12:21:53 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 35C
Reset cause: POR
DRAM:  4 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Verdin iMX8M Plus Quad 4GB IT V1.1A, Serial# 07251034
Carrier: Toradex Dahlia V1.1C, Serial# 10985475

 BuildInfo:
  - ATF 2fa8c63
  - U-Boot 2020.04-5.7.0+git.33bb8e968332

flash target is MMC:2
Net:   eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
Found U-Boot script /boot.scr
5754 bytes read in 8 ms (702.1 KiB/s)
## Executing script at 47000000
Loading DeviceTree: imx8mp-verdin-nonwifi-dev.dtb

Reference image (minimal):

root@verdin-imx8mp-07251034:~# fw_printenv | grep "fdtfile="
fdtfile=imx8mp-verdin-wifi-dahlia.dtb

root@verdin-imx8mp-07251034:~# fw_printenv
arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=Image
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 usb0 dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mfg=fastboot 0
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
carrier_serial#=10985475
console=ttymxc2
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=00:14:2d:7e:a4:5a
ethact=ethernet@30bf0000
ethaddr=00:14:2d:6e:a4:5a
ethprime=eth0
fastboot_dev=mmc2
fdt_addr_r=0x44000000
fdt_board=dev
fdtcontroladdr=fdbf7400
fdtfile=imx8mp-verdin-wifi-dahlia.dtb
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x40000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x44500000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x47400000
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x47000000
serial#=07251034
serverip=192.168.10.1
setup=setenv setupargs console=tty1 console=${console},${baudrate} consoleblank=0 earlycon
soc=imx8m
soc_type=imx8mp
update_uboot=askenv confirm Did you load imx-boot (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
variant=nonwifi
vendor=toradex

root@verdin-imx8mp-07251034:~# reboot

Third boot

U-boot:

Verdin iMX8MP # printenv fdtfile
fdtfile=imx8mp-verdin-nonwifi-dev.dtb

Verdin iMX8MP # printenv
arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=Image
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 usb0 dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mfg=fastboot 0
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
carrier_serial#=10985475
console=ttymxc2
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=00:14:2d:7e:a4:5a
ethact=ethernet@30bf0000
ethaddr=00:14:2d:6e:a4:5a
ethprime=eth0
fastboot_dev=mmc2
fdt_addr_r=0x44000000
fdt_board=dev
fdtcontroladdr=fdbf7400
fdtfile=imx8mp-verdin-nonwifi-dev.dtb
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x40000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x44500000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x47400000
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x47000000
serial#=07251034
serverip=192.168.10.1
setup=setenv setupargs console=tty1 console=${console},${baudrate} consoleblank=0 earlycon
soc=imx8m
soc_type=imx8mp
update_uboot=askenv confirm Did you load imx-boot (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
variant=nonwifi
vendor=toradex

Environment size: 4261/8188 bytes

Verdin iMX8MP # boot

Boot sequence:

MMC: no card present
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
Found U-Boot script /boot.scr
5754 bytes read in 8 ms (702.1 KiB/s)
## Executing script at 47000000
Loading DeviceTree: imx8mp-verdin-nonwifi-dev.dtb

Reference image (minimal):

root@verdin-imx8mp-07251034:~# fw_printenv | grep "fdtfile="
fdtfile=imx8mp-verdin-wifi-dahlia.dtb

root@verdin-imx8mp-07251034:~# fw_printenv
arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=Image
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 usb0 dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mfg=fastboot 0
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
carrier_serial#=10985475
console=ttymxc2
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=00:14:2d:7e:a4:5a
ethact=ethernet@30bf0000
ethaddr=00:14:2d:6e:a4:5a
ethprime=eth0
fastboot_dev=mmc2
fdt_addr_r=0x44000000
fdt_board=dev
fdtcontroladdr=fdbf7400
fdtfile=imx8mp-verdin-wifi-dahlia.dtb
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x40000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x44500000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x47400000
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x47000000
serial#=07251034
serverip=192.168.10.1
setup=setenv setupargs console=tty1 console=${console},${baudrate} consoleblank=0 earlycon
soc=imx8m
soc_type=imx8mp
update_uboot=askenv confirm Did you load imx-boot (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
variant=nonwifi
vendor=toradex

root@verdin-imx8mp-07251034:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:14:2d:6e:a4:5a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.117/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fd2d:261d:f1fa:4f46:214:2dff:fe6e:a45a/64 scope global dynamic mngtmpaddr
       valid_lft 1776sec preferred_lft 281sec
    inet6 2404:4402:17dc:bc00:214:2dff:fe6e:a45a/64 scope global dynamic mngtmpaddr
       valid_lft 599sec preferred_lft 599sec
    inet6 fe80::214:2dff:fe6e:a45a/64 scope link
       valid_lft forever preferred_lft forever
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can
4: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can

root@verdin-imx8mp-07251034:~# ifconfig -a
can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:31

can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:32

eth0      Link encap:Ethernet  HWaddr 00:14:2D:6E:A4:5A
          inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd2d:261d:f1fa:4f46:214:2dff:fe6e:a45a/64 Scope:Global
          inet6 addr: 2404:4402:17dc:bc00:214:2dff:fe6e:a45a/64 Scope:Global
          inet6 addr: fe80::214:2dff:fe6e:a45a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:652 errors:0 dropped:0 overruns:0 frame:0
          TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:189920 (185.4 KiB)  TX bytes:14609 (14.2 KiB)
          Interrupt:47

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:84 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6452 (6.3 KiB)  TX bytes:6452 (6.3 KiB)

root@verdin-imx8mp-07251034:~# connmanctl
connmanctl> enable wifi
Error wifi: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist

As you can see, there appears to be a disconnect between what is reported in u-boot (imx8mp-verdin-nonwifi-dev.dtb) and during the boot sequence, and what is being reported inside the OS (imx8mp-verdin-wifi-dahlia.dtb).

I’ll have a look at it again, there are some variables that could be in use for selecting the correct device tree to load.
Could you try this and see if it makes a difference?

setenv fdt_board dahlia
setenv variant wifi
saveenv

Ah yes, I see that you are trying to get me to set the requisite variables that are used in the preboot command, which is:

preboot=setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb

Unfortunately setting fdt_board, fdtfile, and variant did not work. The value for variant does not seem to persist across restarts (it always gets reset to nonwifi) and value for fdtfile is built off the variant (in the preboot command).

Reading the u-boot documentation U-Boot | Toradex Developer Center about the internal variant variable reveals that “Note: This variable is set every boot.” But doesn’t provide any further information and searching the output of printenv doesn’t yield any insight into what is going on.

More information on what I tried is below, initially I experimented with setting 2/3 variables to see what would happen, then I moved on to setting all three. Between each run, the same u-boot session was used, i.e. after checking for persistence in u-boot at the end of run one, the same u-boot session was used to configure the input variables for run two etc.

Run one

Input (u-boot)

setenv fdt_board dahlia
setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
saveenv
Saving Environment to MMC... Writing to MMC(2)... OK

Setting of variant was intentionally omitted, the default value is nonwifi. Proceed to boot.

boot

Inside the OS

Check that the values carried through.

fw_printenv

Result

Variable Expected Actual Notes
fdt_board dahlia dahlia As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-wifi-dahlia.dtb As expected
variant nonwifi nonwifi As expected

Everything looks as expected, reboot to see if changes persist.

reboot

Checking persistence (u-boot)

Variable Expected Actual Notes
fdt_board dahlia dahlia As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-nonwifi-dahlia.dtb This was updated due to the preboot command
variant nonwifi nonwifi As expected

Run two

Input (u-boot)

setenv fdt_board dev
setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
setenv variant wifi
saveenv
Saving Environment to MMC... Writing to MMC(2)... OK

The value for fdt_board was intentionally reset to the default value. Proceed to boot.

boot

Inside the OS

Check that the values carried through.

fw_printenv

Result

Variable Expected Actual Notes
fdt_board dev dev As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-wifi-dahlia.dtb As expected
variant wifi wifi As expected

Everything looks as expected, reboot to see if changes persist.

reboot

Checking persistence (u-boot)

Variable Expected Actual Notes
fdt_board dev dev As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-nonwifi-dahlia.dtb This was updated due to the preboot command
variant wifi nonwifi Not expected, something is resetting this value.

Run three

Input (u-boot)

setenv fdt_board dahlia
setenv fdtfile imx8mp-verdin-wifi-dahlia.dtb
setenv variant wifi
saveenv
Saving Environment to MMC... Writing to MMC(2)... OK

All variables were set to their correct value. Proceed to boot.

boot

Inside the OS

Check that the values carried through.

fw_printenv

Result

Variable Expected Actual Notes
fdt_board dahlia dahlia As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-wifi-dahlia.dtb As expected
variant wifi wifi As expected

Everything looks as expected, reboot to see if changes persist.

reboot

Checking persistence (u-boot)

Variable Expected Actual Notes
fdt_board dahlia dahlia As expected
fdtfile imx8mp-verdin-wifi-dahlia.dtb imx8mp-verdin-nonwifi-dahlia.dtb This was updated due to the preboot command
variant wifi nonwifi Not expected, something is resetting this value.

This is all very strange. In the end I expected that the fdt_board setup would work. I just tested again with my Verdin IMX8MP and saw that Tezi already sets up the image properly so that I get the wifi working by default after installing a new image. Here it works every time.
However, I have an older version of the Verdin. I’ll try to execute a quick test on a new version and report back.

Ok, thanks @rafael.tx.

Is there any update on this one @rafael.tx ?

No, nothing new. We’re still investigating.

Just checking to see if there has been any progress on this one.

Hi @mastan-aware,

Interestingly cat-ing /proc/device-tree/name and /proc/device-tree/toradex,product-id results in thinking the board is a Verdin Development board (instead of a Dahlia one, but maybe this is a generic name) and a product id of 0063 which is the same SoM but without the built-in WiFi module (the device does have a WiFi module on the SoM though), so the device-tree is lying.

Problem origin

Did I correctly understood that the SoM you are using is iMX8MP with WiFi/BT and product ID is read out as 0063? If yes, that is incorrect. For this particular module the product ID I believe should be 0058. This might happen due to incorrect product ID was entered in config block during initial fusing.

Problem explanation

For this particular module, however, having product ID set to 0063 instead of 0058 is not critical. What you need to know is that U-Boot will always set variant variable on every boot, ignoring what was set there before, basically resetting its value to either wifi or nonwifi on every boot, depending on product ID, and you cannot do anything about it unless you patch U-Boot by yourself.

Solution

  1. Quick

    Hardcode variant to wifi:

    setenv preboot "setenv fdtfile imx8mp-verdin-wifi-${fdt_board}.dtb"
    
  2. Proper

    Overwrite factory configuration block. @rafael.tx should be able to help if you want to go this route.

Best regards,
Andrejs Cainikovs.