Breadcrumbs

Bootloader imx8mm

The KED bootloader is used, which is derived via bbappend and its own config.

The bootloader is divided into a SPL and u-boot.

bootloader.vsdx


KED Info: https://docs.kontron-electronics.de/yocto-ktn/yocto-ktn/

Version: Mainline u-boot 2020.01

Folder:  ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01 

Features:

  • PMIC BD71837

  • MMC

  • eMMC

  • NET

  • I2C

  • GPIO

  • NOR

  • CONSOLE

  • RUN Text Script (UNIX Format)

  • ENV (saved on boot device, mmc, nor flash)


Console: UART3

ATF: nxp-atf


bootloader_process.png

SPL

Files:

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/board/kontron/11555/spl.c

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/arch/arm/dts/imx8mm-11555-u-boot.dtsi

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/configs/11555_defconfig

Special:

  • sdcard clock reduced to 20MHz

SPL_process.png

u-boot

Files:

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/board/kontron/11555/kontron_mx8mm.c

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/board/kontron/11555/cmd_*

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/include/*

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/drivers/*

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/arch/arm/dts/imx8mm-11555.dts

  • ~/yocto-ktn/layers/meta-webpanel/recipes-bsp/u-boot/u-boot-ktn_2020.01/patches_2020.01/configs/11555_defconfig

Special:

  • sdcard clock reduced to 20MHz

  • nor flash driver expanded with additional flash types

  • fec driver workrround: read and set always mac from fuses

uboot_process.png

Environment Variables:

Name

Default Value

Description

macaddr

empty

read from fuses, else random

ipaddr

192.168.1.100

ip address for eth0

serverip

192.168.1.254

server ip address for loading kernel and fdt file from tftp server

gatewayip

192.168.1.10

gatewayip for eth0

netmask

255.255.255.0

netmask for eth0

hostname

11555

hostname for eth0

console

ttymxc2

Kernel Commandline console device 

baudrate

115200

Kernel Commandline console baudrate

nfsroot

/nfsroot

nfs root if loading via net

kernel_addr_r

0x43000000

ram destination address of kernel

fdt_addr_r

0x42000000

ram destination address of dts file

fdt_file

imx8mm-11555.dts

fdt file to load

auto_fdt_detect

1

use autodetect function if implemented and overwrite fdt_file

UseEepromDisplaySettings

1

use reading display params from i2c eeprom and update dts

tuxbootlogo

empty

additional kernel commandline for the tuxbootlogo

fbconargs

empty

additional kernel commandline for the fbconargs

crashkernel

empty

additional kernel commandline for the crashkernel

boot_targets

mmc1 mmc0 net

each entry whill be checked to load kernel and dts.

if entry success: skip all others

if entry failed: go to next entry

if all failed go to console

EnvVar: boot_cmd_[entry] will automatically called (ex. bootcmd_mmc1)

boot_script

startup.sh

filename of script to try to execute as first on each boot_targets entry

bootargs

empty

kernel command line

mmc_boot

if mmc dev ${devnum}; then devtype=mmc; run mmc_boot2

  • try mmc dev

mmc_boot2

run mmcargs; if run mmcloadimage; then if run mmcloadfdt; then booti ${kernel_addr_r} - ${fdt_addr_r}; else echo WARN: Cannot load the DT; fi; else echo WARN: Cannot load the kernel image; fi;

  • call mmcargs

  • try to load fdt and kernel

mmcargs

setenv bootargs console=${console},${baudrate} consoleblank=0 root=${root} rootwait rw ${tuxbootlogo} ${fbconargs}

generates bootargs for mmc devices

mmcloadimage

${mode} mmc ${devnum}:${devpart} ${kernel_addr_r} ${bootdir}${image}

command mmc load image file

mmcloadfdt

${mode} mmc ${devnum}:${devpart} ${fdt_addr_r} ${bootdir}${fdt_file}

command mmc load fdt file

bootcmd_mmc1

run microsd_runscript; echo Booting from microSD ...; devnum=1; devpart=1; bootdir=/; root=/dev/mmcblk1p2 mode=load; run mmc_boot

bootcmd for microSD

bootcmd_mmc0

echo Booting from eMMC ...; devnum=0; devpart=1; bootdir=/boot/; root=/dev/mmcblk0p1 mode=ext4load; run mmc_boot

bootcmd for eMMC

bootcmd_net

setenv bootargs console=${console},${baudrate} consoleblank=0 root=/dev/nfs ip=${ipaddr}:${gatewayip}:${netmask} nfsroot=${serverip}:${nfsroot},v3,tcp rw ${tuxbootlogo} ${fbconargs}

bootcmd for tftp loading and nfs

env_size

static from env settings

each boot overwritten and updated in dts (bootloader/env/size)

env_offset

static from env settings

each boot overwritten and updated in dts (bootloader/env/offset)

version

static from u-boot

each boot overwritten and updated in dts (bootloader/env/version)

Yocto Build Variables

Name

Default Value

Description

DEFAULT_KERNEL_DEVICETREE

undefined

default device tree file set in env var fdt_file

CONFIG_AUTO_FDT_DETECT

0

if 1 the used device tree file is autmatically detected and the  env var fdt_file will be updated while booting.

Supported for imx6 (11368) and imx8mm (11555) boards with the default dts files for WP/CP-70, WP/CP-101, WP/CP-156

ASSIGN_UART4_TO_M4

0

if 1 the uart4 is used for the M4 else for the A53