First I followed this article: https://solidrun.atlassian.net/wiki/spaces/developer/pages/287179471/i.MX8M+ATF+U-Boot+and+Linux+Ker...
Here is the summary of the commands:
git clone https://github.com/nxp-imx/imx-atf -b imx_4.19.35_1.0.0 arm-trusted-firmware
git clone https://github.com/SolidRun/u-boot.git -b v2018.11-solidrun
wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.9.bin
export ARCH=arm64
export CROSS_COMPILE=$(pwd)/gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export PATH=${PATH}:$(pwd)/gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/bin
cd arm-trusted-firmware/
make PLAT=imx8mq bl31
cp build/imx8mq/release/bl31.bin ../u-boot/
cd ..
chmod +x firmware-imx-7.9.bin
./firmware-imx-7.9.bin
cp firmware-imx-7.9/firmware/hdmi/cadence/signed_hdmi_imx8m.bin u-boot/
cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin u-boot/
make imx8mq_hb_defconfig
cd u-boot/
make imx8mq_hb_defconfig
make flash.bin
export SD=/dev/mmcblk0
sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16
sudo gparted
sudo dd if=./flash.bin of=/dev/mmcblk0 bs=1024 seek=33
Everything went okay, no errors compiled and image generated just fine.
I dd it on a micro sd card but the board does not move a bit. It wont boot
Then I enabled a the atf and u-boot on buildroot, and I followed this link:
I ended up with a flash.bin in buildroot:
buildroot-2022.11.2/output/build/uboot-2022.04/flash.bin
sudo dd if=uildroot-2022.11.2/output/build/uboot-2022.04/flash.bin of=/dev/mmcblk0 bs=1024 seek=33
That did not boot either.
Then I downloaded the imx-boot-tools and https://github.com/nxp-imx/imx-mkimage
and I used the files from buildroot and used a guide from https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Manually-build-Boot-binary-for-i-MX8M-Mi...
I ended up with the script
for F in "./buildroot-2022.11.2/output/images/bl31.bin"\
"./buildroot-2022.11.2/output/images/imx8mm-spectra.dtb"\
"./buildroot-2022.11.2/output/images/u-boot.bin"\
"./buildroot-2022.11.2/output/build/uboot-2022.04/u-boot-nodtb.bin"\
"./buildroot-2022.11.2/output/images/u-boot-spl.bin"\
"./buildroot-2022.11.2/output/build/uboot-2022.04/lpddr4_pmu_train_2d_imem.bin"\
"./buildroot-2022.11.2/output/build/uboot-2022.04/lpddr4_pmu_train_1d_dmem.bin"\
"./buildroot-2022.11.2/output/build/uboot-2022.04/lpddr4_pmu_train_1d_imem.bin"\
"./buildroot-2022.11.2/output/build/uboot-2022.04/lpddr4_pmu_train_2d_dmem.bin";do
BN=$(basename ${F})
echo "checking ${MK_FILES}${BN}"
[[ -f ${MK_FILES}/${BN} ]] && rm ${MK_FILES}/${BN}
cp ${F} ${MK_FILES}/
ls -la ${MK_FILES}
done
pushd uboot-tools/imx-mkimage
ln -s ../uboot-tools/imx-boot-tools/mkimage_uboot ./mkimage_uboot
make clean
make SOC=iMX8MM flash_evk
popd
Which compiled as:
include misc.mak
include m4.mak
include android.mak
include test.mak
include autobuild.mak
include alias.mak
imx8qm clean done
include misc.mak
include m4.mak
include android.mak
include test.mak
include autobuild.mak
include alias.mak
imx8qx clean done
include misc.mak
include m4.mak
include android.mak
include test.mak
include autobuild.mak
imx8dxl clean done
imx8ulp clean done
Compiling mkimage_imx8
PLAT=imx8mm HDMI=no
Compiling mkimage_imx8
cc -O2 -Wall -std=c99 -static mkimage_imx8.c -o mkimage_imx8 -lz
30427+0 records in
30427+0 records out
121708 bytes (122 kB, 119 KiB) copied, 0.0746166 s, 1.6 MB/s
./../scripts/dtb_check.sh imx8mm-evk.dtb evk.dtb
Use u-boot DTB: fsl-imx8mm-evk.dtb
./../scripts/pad_image.sh tee.bin
Pad file tee.bin NOT found
./../scripts/pad_image.sh bl31.bin
bl31.bin is padded to 28800
./../scripts/pad_image.sh u-boot-nodtb.bin evk.dtb
u-boot-nodtb.bin + evk.dtb are padded to 631264
BL32=tee.bin DEK_BLOB_LOAD_ADDR=0x40400000 TEE_LOAD_ADDR=0xbe000000 ATF_LOAD_ADDR=0x00920000 ./mkimage_fit_atf.sh evk.dtb > u-boot.its
bl31.bin size:
28800
u-boot-nodtb.bin size:
592712
evk.dtb size:
38552
./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb
FIT description: Configuration to load ATF before U-Boot
Created: Fri Jun 9 17:51:24 2023
Image 0 (uboot-1)
Description: U-Boot (64-bit)
Created: Fri Jun 9 17:51:24 2023
Type: Standalone Program
Compression: uncompressed
Data Size: 592712 Bytes = 578.82 KiB = 0.57 MiB
Architecture: AArch64
Load Address: 0x40200000
Entry Point: unavailable
Image 1 (fdt-1)
Description: evk
Created: Fri Jun 9 17:51:24 2023
Type: Flat Device Tree
Compression: uncompressed
Data Size: 38552 Bytes = 37.65 KiB = 0.04 MiB
Architecture: Unknown Architecture
Image 2 (atf-1)
Description: ARM Trusted Firmware
Created: Fri Jun 9 17:51:24 2023
Type: Firmware
Compression: uncompressed
Data Size: 28800 Bytes = 28.12 KiB = 0.03 MiB
Architecture: AArch64
OS: Unknown OS
Load Address: 0x00920000
Default Configuration: 'config-1'
Configuration 0 (config-1)
Description: evk
Kernel: unavailable
Firmware: uboot-1
FDT: fdt-1
Loadables: atf-1
./mkimage_imx8 -version v1 -fit -loader u-boot-spl-ddr.bin 0x7E1000 -second_loader u-boot.itb 0x40200000 0x60000 -out flash.bin
Platform: i.MX8M (mScale)
ROM VERSION: v1
Using FIT image
LOADER IMAGE: u-boot-spl-ddr.bin start addr: 0x007e1000
SECOND LOADER IMAGE: u-boot.itb start addr: 0x40200000 offset: 0x00060000
Output: flash.bin
========= IVT HEADER [HDMI FW] =========
header.tag: 0x0
header.length: 0x0
header.version: 0x0
entry: 0x0
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x0
self: 0x0
csf: 0x0
reserved2: 0x0
boot_data.start: 0x0
boot_data.size: 0x0
boot_data.plugin: 0x0
========= IVT HEADER [PLUGIN] =========
header.tag: 0x0
header.length: 0x0
header.version: 0x0
entry: 0x0
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x0
self: 0x0
csf: 0x0
reserved2: 0x0
boot_data.start: 0x0
boot_data.size: 0x0
boot_data.plugin: 0x0
========= IVT HEADER [LOADER IMAGE] =========
header.tag: 0xd1
header.length: 0x2000
header.version: 0x41
entry: 0x7e1000
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x7e0fe0
self: 0x7e0fc0
csf: 0x812fc0
reserved2: 0x0
boot_data.start: 0x7e0bc0
boot_data.size: 0x34460
boot_data.plugin: 0x0
========= OFFSET dump =========
Loader IMAGE:
header_image_off 0x0
dcd_off 0x0
image_off 0x40
csf_off 0x32000
spl hab block: 0x7e0fc0 0x0 0x32000
Second Loader IMAGE:
sld_header_off 0x57c00
sld_csf_off 0x58c20
sld hab block: 0x401fcdc0 0x57c00 0x1020
/sdaone/PEG_PROJ/Kohler_wc/ICP_buildroot_uboot/ICP_buildroot
sudo dd if=./uboot-tools/imx-mkimage/iMX8M/flash.bin of=/dev/mmcblk0 bs=1024 seek=33
That did not work either
Any help would be appreciated. I just want to go classic not with Yocto.
Thank you.
Solved! Go to Solution.
After more reading I found out that my board is a iMX8M-dart from varisicte
and the assumption that is a evk compatible was wrong.
It works with these repos and checkout tags:
https://github.com/varigit/imx-atf.git
7575633e03ff952a18c0a2c0aa543dee793fda5f
https://github.com/nxp-imx/imx-mkimage.git
6745ccdcf15384891639b7ced3aa6ce938682365
https://github.com/varigit/uboot-imx.git
9458fd59dd6d69230438350c3aeb8ac803ff1b1c
After more reading I found out that my board is a iMX8M-dart from varisicte
and the assumption that is a evk compatible was wrong.
It works with these repos and checkout tags:
https://github.com/varigit/imx-atf.git
7575633e03ff952a18c0a2c0aa543dee793fda5f
https://github.com/nxp-imx/imx-mkimage.git
6745ccdcf15384891639b7ced3aa6ce938682365
https://github.com/varigit/uboot-imx.git
9458fd59dd6d69230438350c3aeb8ac803ff1b1c