Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

Since Trizeps VIII Mini and Myon II are software compatible, the same bootloader may be used for both modules.

http://gitlab.keith-koep.com/imx/uboot-imx
http://gitlab.keith-koep.com/imx/imx-mkimage

U-Boot based on NXP 4.14.98_2.0.0_ga

ssh://git@git.seco.com:seco-ne/3rd-party/kuk/uboot-imx-kuk.git
https://git.seco.com/seco-ne/3rd-party/kuk/uboot-imx-kuk.git

kuk_imx_v2018.03_4.14.98_2.0.0_ga

imx_mkimage based on NXP imx_4.14.98_2.0.0_ga

ssh://git@git.seco.com:seco-ne/3rd-party/kuk/imx-mkimage-kuk.git
https://git.seco.com/seco-ne/3rd-party/kuk/imx-mkimage-kuk.git

kuk_imx_4.14.98_2.0.0_ga

Previous Versions:

U-Boot

imx_mkimage

Notes

kuk_imx_v2020.04

kuk_imx_4.14.98_2.0.0_ga

Use for Android 11. (Development Status)

kuk_imx_v2019.04_5.4.3_2.0.0

kuk_imx_4.14.98_2.0.0_ga

Use for all current OS, except Android 11

kuk_imx_v2018.03_4.14.98_2.0.0_ga

kuk_imx_4.14.98_2.0.0_ga

Not compatible with Linux 5.4 and later

U-Boot Binaries

Trizeps VIII Mini

Date

Changelog

Download

18.03.2022

U-Boot 2019.04-00179-g9d842fe992

tr8mm_uboot_20220318.bin

21.01.2021

U-Boot 2019.04-00133-gaf324b156b

flash.tr8m.bin

14.01.2020

U-Boot 2018.03-00071-ga93ecbbefe

tr8mm_uboot_20200114.bin

14.01.2020

U-Boot 2018.03 Limit RAM to 3GB (old GPU)

tr8mm_uboot_3gb_20200114.bin

How to Make U-Boot for Trizeps VIII Mini

This is only a quick-reference on how to build the U-Boot bootloader including Seco specific changes.
For details please view the NXP i.MX8M Mini documentation.

Get the source code of U-Boot and imx_mkimage tool from git repository:

$ mkdir uboot
$ cd uboot
~/uboot$ git clone https://git.seco.com/seco-ne/3rd-party/kuk/imx-mkimage-kuk.git -b kuk_imx_4.14.98_2.0.0_ga
~/uboot$ mv imx-mkimage-kuk/ imx-mkimage/
~/uboot$ git clone https://git.seco.com/seco-ne/3rd-party/kuk/uboot-imx-kuk.git -b kuk_imx_v2019.04_5.4.3_2.0.0

Setup Cross-Build environment (View Software-Development-Kit on how to install.):

$ . /opt/fsl-imx-fb/4.14-sumo/environment-setup-aarch64-poky-linux

Build U-Boot from source Code:

~/uboot/uboot-imx$ make clean
~/uboot/uboot-imx$ make trizeps8mini_defconfig
~/uboot/uboot-imx$ make all

This will generate the SPL, U-Boot and device-tree binary.
Note that this minimal device-tree binary will only be used by U-Boot and is not intended for use by the Linux kernel!
After these binaries have been created, they must be packed together with other components to form the bootloader:
SCU-Firmware: This NXP firmware is loaded into the Cortex-M4 (SCU: System Controller Unit).
ATF-Firmware: The SCU will load the ARM trusted firmware.
SPL / U-Boot: The ATF will load the primary loader, which will initialize the LPDDR4 and load U-Boot.

~/uboot/uboot-imx$ make miniflash.bin

Which will create

~/uboot/uboot-imx/miniflash.bin

If you run

~/uboot/uboot-imx$ make flash_mini

this will build the bootloader and run uuu to download the bootloader to the module.

How to Make U-Boot for Trizeps VIII Mini using imx_firmware

This will generate the uboot with all needed components atf, optee, spl and uboot. Also you can create an uefi image.

Update and install build tools:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install attr build-essential python python-dev python-crypto python-wand device-tree-compiler bison flex swig iasl uuid-dev wget git bc libssl-dev zlib1g-dev python3-pip gcc g++ make python3 mono-devel

Clone the imx-firmware repo:

git clone --recursive ssh://git@gitlab.keith-koep.com:30001/imx/imx_firmware.git

Build uboot and uefi:

./buildme64.sh -b Tr8m -t all

Update uboot and uefi on mounted sd card:

sudo ./WriteUboot.sh /dev/sde ./flash.bin 
sudo ./WriteUefi.sh /dev/sde ./uefi.fit

Update uboot and uefi using fastboot:

sudo fastboot flash bootloader flash.bin
sudo fastboot flash BOOTFIRMWARE uefi.fit

Update Bootloader using UUU

To deploy software to Trizeps VIII Mini, you may use the NXP Universal Update Utility (UUU).
Steps needed:

Update Bootloader on uSD-card

If you have a module with uSD-card-slot, you can deploy software directly using your PC.
Steps needed:

  • Identify the uSD-Slot (/dev/sd<x>) by using 'lsblk' command.

  • Run:

    ~/uboot-imx/iMX8M$ sudo dd if=flash.bin of=/dev/sd<x> bs=1k seek=33 conv=fsync

Update Bootloader on Trizeps VIII Mini running Linux

Copy bootloader (flash.bin) to a filesystem accessible by Linux.

$ dd if=/dev/zero of=/dev/mmcblk0 bs=1k seek=4096 conv=fsync count=8
$ echo 0 > /sys/block/mmcblk0boot0/force_ro
$ dd if=flash.bin of=/dev/mmcblk0boot0 bs=1k seek=33
$ echo 1 > /sys/block/mmcblk0boot0/force_ro

This will:

  • clear U-Boot environment-area,

  • disable read-only access to the boot partition,

  • write flash.bin to offset 33k and

  • reenable read-only access.

How to enter Bootloader Command Console

To enter the bootloader command console attach a serial cable to the first COM-port ( SODIMM-pins: 33, 35) with 115k2 Baud, 8N1.
Press any key while the device is powering up.
The output should look something like this:

U-Boot SPL 2017.03-00886-gb76bb1b-dirty (Apr 10 2019 - 14:18:59)
PMIC:  PFUZE100 ID=0x10
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
Training PASS
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
Normal Boot
Trying to boot from MMC1


U-Boot 2017.03-00886-gb76bb1b-dirty (Apr 10 2019 - 14:18:59 +0200)

CPU:   Freescale i.MX8MQ rev2.0 1500 MHz (running at 1000 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 63C
Reset cause: POR
Model: Freescale i.MX8MQ EVK
DRAM:  2 GiB
[TR8] RAM-size is 0x80000000
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
No panel detected: default to HDMI
Display: HDMI (1280x720)
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - ATF 9d25029
  - U-Boot 2017.03-00886-gb76bb1b-dirty

switch to partitions #0, OK
mmc0(part 0) is current device
Net:
Warning: ethernet@30be0000 (eth0) using random MAC address - fe:77:14:3e:cc:f0
eth0: ethernet@30be0000
Normal Boot
Hit any key to stop autoboot:  0
u-boot=>

Device-Tree

The Linux-kernel will use a Device-Tree-Binary file (.dtb) to determine how the Trizeps module is used in a system (i.e. which drivers to load).
How the device-tree is generated might depend on the used kernel-version and it is recommended to view the articles to the respective OS in this wiki.
For Linux 4.14 the device-tree files can be found at:

~/linux_imx/arch/arm64/boot/dts/keithkoep

When building the Linux-kernel .dts source-files are converted to .dtb binary files.

kuk-trizeps8mini

Basic Device-Tree for the Trizeps VIII Mini module itself, which is included by all other Device-Tree baseboard files

kuk-trizeps8mini-pconxs-edt7

Trizeps VIII Mini in pConXS with capacitive touch EDT 7inch display

kuk-trizeps8mini-pconxs-edt7-pcie

Trizeps VIII Mini in pConXS with capacitive touch EDT 7inch display and PCIE-slot

kuk-trizeps8mini-pconxs-edt7res

Trizeps VIII Mini in pConXS with resistive touch EDT 7inch display

kuk-trizeps8mini-pconxs-edt7res-pcie

Trizeps VIII Mini in pConXS with resistive touch EDT 7inch display and PCIE-slot

kuk-trizeps8mini-ipant7

Trizeps VIII Mini in i-PAN T7 panel

kuk-trizeps8mini-ipant10

Trizeps VIII Mini in i-PAN T10 panel

When you open the u-boot command prompt and output the environment, you can determine which device-tree is used:

u-boot=> env print -a
...
fdt_file=kuk-trizeps8mini.dtb
...

To change this you can i.e. call:

u-boot=> env set fdt_file kuk-trizeps8mini-pconxs-edt7.dtb
u-boot=> env save

'env save' will store this setting for subsequent boots.

Hints on using U-Boot

Enter USB Serial Download Mode

The USB Serial Download Mode (manufacturing mode) is a mode by which the i.MX8M Mini processor loads its internal ROM-firmware instead of the bootloader stored in eMMC or SD-card.
It will use the USB-OTG port to enumerate as HID-device on a connected PC.
In this mode the NXP Universal Update Utility (UUU) can be used to deploy software.

Using Hardware RESET_IN

The default Kinetis MCU firmware will enter Serial Download Mode after RESET_IN (SODIMM-pin 26) has been asserted for more than 10s.

Using Bootloader

To enter the USB Serial Download Mode of the NXP boot-ROM issue following commands:

u-boot=> i2c dev 2
u-boot=> i2c mw 0x10 2.1 2

This will write to REG_CONTROL of the Trizeps VIII MCU, which will than reset the i.MX8M processor into this mode.

Using Linux

To enter the USB Serial Download Mode of the NXP boot-ROM issue the following command:

$ i2cset -f -y 2 0x10 2 2

This will write to REG_CONTROL of the Trizeps VIII MCU, which will than reset the i.MX8M processor into this mode.

Notes on eMMC Boot Partition

Whereas SD-cards got memory organized in one user-space, eMMC have two additional boot-spaces.
The spaces are often referred to as partitions. But this might be confusing, since they are not the typical partition, one would create through a partition-table/master-boot-record.
A boot-space can overlay the first megabytes of normal user-space. After the bootloader got booted, it will fade-out the boot-space and so prevent any subsequent operating-system to be able to mess with the bootloader.
When using eMMC it needs to be decided, wether to use the boot-space or the user-space for the bootloader.
Following commands may be used to switch between the different modes (this is kept after power-cycle):

//display configuration
mmc partconf 0

//boot0
mmc partconf 0 1 1 0

//boot1
mmc partconf 0 1 2 0

//no boot partition, the the emmc will be used like an sd card
mmc partconf 0 0 0 0

When using different tools for updating the flash-content, a situation may arise, where the bootloader is written into the „wrong“ partition – the flash-space, which is not used for booting.

If you use

sudo ./uuu -bshow emmc

to view the default-script used by uuu, you should note the line

FB: ucmd emmc partconf ${emmc_dev} ${emmc_ack} 1 0

, which will configure the eMMC to use the boot-space after it has completed the update. If you want to use the user-space simply call

mmc partconf 0 0 0 0

after running uuu or run uuu with a custom-script.

Errors

sh: 1: dtc: not found
./mkimage_uboot: Can't open u-boot.itb.tmp: No such file or directory
soc.mak:137: recipe for target 'u-boot.itb' failed

To remove this error you Need the device-tree-compiler

apt-get install device-tree-compiler

  • No labels