imx6ul-如何为SD卡图像选择正确的DTS?

时间:2019-04-09 22:21:48

标签: embedded-linux yocto u-boot imx6

我正在构建我的第一个yocto版本。

所有软件包都构建良好,我可以构建我的dts。实际上,我的images文件夹中有很多dtb。

这是我的构建配置。

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"

这是我的机器配置

#@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 "

此刻,我使用dd刷新此归档文件的内容:

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

u-boot正在使用此设备树:

imx6ul-pico-qca_pi.dts

但是我想要这个:

imx6ul-pico_pi.dtb

您能帮我修复DTS吗?我找不到这种情况的教程/文档。

更新

板上uboot外壳上的printenv

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

2 个答案:

答案 0 :(得分:1)

您需要修改uboot的wifi_module字段。

这时,在启动时,如果setfdt,命令${som}-${form}-${wifi_module}_${baseboard}.dtb会将设备树设置为${wifi_module} = qca

要删除此行类型:

setenv wifi_module

之后输入

run bootcmd

这将允许您测试修改。重新启动后,它将返回到wifi_module = qca,因此您可以保存环境以使其持久:

setenv wifi_module
saveenv

答案 1 :(得分:0)

请参见Yocto Reference Manual的4.12.4节。

在此重申,“对于继承内核类并设置KERNEL_DEVICETREE变量的任何配方,都会自动启用其功能。”

例如,在基于ARM64的ZynqMP的机器配置中,我设置了

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

以您的示例为例,我相信在您的计算机配置中指定以下内容即可。

KERNEL_DEVICETREE = "imx6ul-pico_pi.dtb"