imx6ul - how to select the right dts for sdcard image?

1

I'm building my first yocto release.

All packages build well and I can build my dts. In fact I have a lot of dtb in my images folder.

This is my build configuration.

Build Configuration:
BB_VERSION           = "1.36.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "pico-imx6ul-itl"
DISTRO               = "fsl-imx-fb"
DISTRO_VERSION       = "4.9.88-2.0.0"
TUNE_FEATURES        = "arm armv7ve vfp neon callconvention-hard cortexa7"
TARGET_FPU           = "hard"
meta
meta-poky            = "HEAD:0ec241873367e18f5371a3ad9aca1e2801dcd4ee"
meta-oe
meta-multimedia      = "HEAD:dacfa2b1920e285531bec55cd2f08743390aaf57"
meta-freescale       = "HEAD:49ac225a38f6d84519798e3264f2e4d19b84f70a"
meta-freescale-3rdparty = "HEAD:1d6d5961dbf82624b28bb318b4950a64abc31d12"
meta-freescale-distro = "HEAD:0ec6d7e206705702b5b534611754de0787f92b72"
meta-bsp
meta-sdk             = "HEAD:d65692ecb3a4136fc1cc137152634e8633ddb3c6"
meta-browser         = "HEAD:d6f9aed41c73b75a97d71bff060b03a66ee087b1"
meta-gnome
meta-networking
meta-python
meta-filesystems     = "HEAD:dacfa2b1920e285531bec55cd2f08743390aaf57"
meta-qt5             = "HEAD:32bb7d18a08d1c48873d7ab6332d4cc3815a4dff"
meta-edm-bsp-release = "added-wifi-drivers:10f5373fedd09c19ffb1a393272e3f3ed83b643a"

This is my machine configuration

#@TYPE: Machine
#@NAME: pico-imx6ul-itl
#@SOC: i.MX6UL
#@DESCRIPTION: Machine configuration for PICO-IMX6UL/ULL with  QCA(Qualcomm)/BRCM(Broadcom) WLAN module

include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa7.inc
include conf/machine/include/imx6ul-common.inc    

MACHINEOVERRIDES = "mx6:mx6ul:"
SOC_FAMILY = "mx6ul"

PREFERRED_PROVIDER_u-boot = "u-boot-edm"
PREFERRED_PROVIDER_u-boot_mx6ul = "u-boot-edm"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-edm"
PREFERRED_PROVIDER_virtual/bootloader_mx6ul = "u-boot-edm"
UBOOT_MAKE_TARGET = ""
UBOOT_SUFFIX = "img"
SPL_BINARY = "SPL"
UBOOT_MACHINE = "pico-imx6ul_spl_defconfig"
#UBOOT_MACHINE = "./pico-imx6ul_defconfig"

# Ensure uEnv.txt will be available at rootfs time
do_rootfs[depends] += "u-boot-uenv:do_deploy"

UENV_FILENAME = "uEnv.txt"
BOOT_SCRIPTS = "${UENV_FILENAME}:uEnv.txt"

PREFERRED_PROVIDER_virtual/kernel ?= "linux-tn-imx"
PREFERRED_PROVIDER_virtual/kernel_mx6ul = "linux-tn-imx"

# Add kernel modules
MACHINE_EXTRA_RRECOMMENDS += "\
    kernel-module-qcacld-tn \
"

KERNEL_DEVICETREE = "imx6ul-pico-qca_dwarf.dtb imx6ul-pico-qca_hobbit.dtb \
                     imx6ul-pico-qca_nymph.dtb imx6ul-pico-qca_pi.dtb \
                     imx6ul-pico_dwarf.dtb imx6ul-pico_hobbit.dtb \
                     imx6ul-pico_nymph.dtb imx6ul-pico_pi.dtb \
                     imx6ull-pico-qca_dwarf.dtb imx6ull-pico-qca_hobbit.dtb \
                     imx6ull-pico-qca_nymph.dtb imx6ull-pico-qca_pi.dtb \
                     imx6ull-pico_dwarf.dtb imx6ull-pico_hobbit.dtb \
                     imx6ull-pico_nymph.dtb imx6ull-pico_pi.dtb"

KERNEL_IMAGETYPE = "zImage"

MACHINE_FEATURES += "bluetooth pci wifi touchscreen"

MACHINE_EXTRA_RRECOMMENDS += " \
  broadcom-bluetooth \
  openssh-sftp-server \
  libsocketcan \
  bash hostapd dnsmasq haveged create-ap iptables \
"
MACHINE_FIRMWARE_remove = "firmware-imx-brcm"

SERIAL_CONSOLE = "115200 ttymxc5"

MACHINE_FEATURES += " usbgadget usbhost "

At the moment I use dd to flash the content of this archive:

core-image-base-pico-imx6ul-itl.sdcard.bz2

u-boot is using this device tree:

imx6ul-pico-qca_pi.dts

But I want this one:

imx6ul-pico_pi.dtb

Can you help me to fix the dts? I can't find a tutorial/documentation for this scenario.

UPDATE

printenv from uboot shell on the board

U-Boot SPL 2017.03-tn-imx_v2017.03_4.9.88_2.0.0_ga-test+g2fb0ee6322 (Apr 09 2019 - 20:13:49)
Boot Device: MMC
Trying to boot from MMC1
Boot Device: MMC
reading u-boot.img
reading u-boot.img


U-Boot 2017.03-tn-imx_v2017.03_4.9.88_2.0.0_ga-test+g2fb0ee6322 (Apr 09 2019 - 20:13:49 +0200)

CPU:   Freescale i.MX6UL rev1.0 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 24C
Reset cause: POR
Board: PICO-IMX6UL
Compatible baseboard: dwarf, hobbit, nymph, pi
I2C:   ready
DRAM:  512 MiB
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

No panel detected: default to AT070TN94
Display: AT070TN94 (800x480)
Video: 800x480x24
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc0(part 0) is current device
Net:   , FEC1
Normal Boot
Hit any key to stop autoboot:  0 
=> printenv
baseboard=pi
baudrate=115200
boot_fdt=try
bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscript; then run bootscript; fi;if run loadfit; then run fitboot; fi; if run loadimage; then run mmcboot; else echo WARN: Cannot load kernel from boot media; fi; else run netboot; fi
bootdelay=1
bootenv=uEnv.txt
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc5
default_baseboard=pi
detectmem=if test ${memdet} = 512MB; then setenv memsize cma=128M; else setenv memsize cma=96M; fi
eth1addr=00:1f:7b:11:07:27
ethact=FEC1
fdt_addr=0x83000000
fdt_high=0xffffffff
fdtfile=undefined
fit_args=setenv bootargs console=${console},${baudrate} root=/dev/ram0 rootwait rw
fitboot=run fit_args; echo ${bootargs}; bootm 87880000#config@${som}-${form}_${baseboard};
form=pico
image=zImage
importbootenv=echo Importing environment from mmc ...; env import -t -r $loadaddr $filesize
initrd_high=0xffffffff
ip_dyn=no
loadaddr=0x80800000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdtfile}
loadfit=fatload mmc ${mmcdev}:${mmcpart} 0x87880000 tnrescue.itb
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mmcargs=setenv bootargs console=${console},${baudrate} ${memsize} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run detectmem; run mmcargs; echo baseboard is ${baseboard}; run setfdt; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then echo WARN: Cannot load the DT; echo fall back to load the default DT; setenv baseboard ${default_baseboard}; run setfdt; run loadfdt; bootz ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=0
mmcpart=1
mmcroot=/dev/mmcblk0p2 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; run loadbootenv; run importbootenv; run setfdt; run netargs; ${get_cmd} ${loadaddr} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdtfile}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
script=boot.scr
setfdt=if test ${wifi_module} = qca; then setenv fdtfile ${som}-${form}-${wifi_module}_${baseboard}.dtb; else setenv fdtfile ${som}-${form}_${baseboard}.dtb;fi
som=imx6ul
splashpos=m,m
wifi_module=qca

Environment size: 2920/8188 bytes
embedded-linux
yocto
u-boot
imx6
asked on Stack Overflow Apr 9, 2019 by Admdebian • edited Apr 10, 2019 by Admdebian

2 Answers

1

You need to modify the wifi_module field of your uboot.

At this time, when you boot, the command setfdtsets the device tree to ${som}-${form}-${wifi_module}_${baseboard}.dtb if ${wifi_module} = qca.

To remove this line type:

setenv wifi_module

After that type

run bootcmd

This will allow you to test the modification. After a reboot it will come back to wifi_module = qca so you can save the environment to make it persistent:

setenv wifi_module
saveenv
answered on Stack Overflow Apr 10, 2019 by PierreOlivier
0

See Section 4.12.4 of the Yocto Reference Manual.

To reiterate here, "Functionality is automatically enabled for any recipe that inherits the kernel class and sets the KERNEL_DEVICETREE variable".

For example, in my machine config for ZynqMP which is ARM64 based, I set

KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-ged.dtb"

For your example, I believe specifying the below should suffice in your machine configuration.

KERNEL_DEVICETREE = "imx6ul-pico_pi.dtb"
answered on Stack Overflow Apr 10, 2019 by Sanchayan Maity

User contributions licensed under CC BY-SA 3.0