Yocto Build U-Boot MX95: Difference between revisions
No edit summary |
(Download and build OEI: Add SOC revision parameter) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 9: | Line 9: | ||
--> [[category:{{#var:HARDWARE_NAME}}]] __toc__ | --> [[category:{{#var:HARDWARE_NAME}}]] __toc__ | ||
= Toolchain installation for out of | = Toolchain installation for out of {{#var:PLATFORM_OS}} builds = | ||
To install the toolchain, follow the {{Varlink2|Yocto Toolchain installation|{{#var:RELEASE_LINK}}}} guide. | To install the toolchain, follow the {{Varlink2|{{#ifeq: {{#var:BUILD_PLAFTORM}} | flexbuild | Debian Flexbuild Toolchain installation | Yocto Toolchain installation}}|{{#var:RELEASE_LINK}}}} guide. | ||
= Build U-Boot out of | = Build U-Boot out of {{#var:BUILD_SYSTEM}} tree = | ||
Obtain sources: | Obtain sources: | ||
Line 20: | Line 20: | ||
Configure compilation environment: | Configure compilation environment: | ||
{{#ifeq: {{#var:PLATFORM_OS}} | Yocto | | |||
{{#tag: pre | $ source {{#var:TOOLCHAIN_LOCATION}}}} | |||
</pre> | |||
| | |||
{{#tag: pre |$ export ARCH=arm64 | |||
$ export CROSS_COMPILE=aarch64-linux-gnu- | |||
}}}} | |||
Cleanup everything: | Cleanup everything: | ||
Line 59: | Line 65: | ||
$ ./{{#var:NXP_ELE_FIRMWARE}}.bin | $ ./{{#var:NXP_ELE_FIRMWARE}}.bin | ||
$ rm {{#var:NXP_ELE_FIRMWARE}}.bin | $ rm {{#var:NXP_ELE_FIRMWARE}}.bin | ||
$ cp {{#var:NXP_ELE_FIRMWARE}}/mx95a0-ahab-container.img imx-mkimage/iMX95 | $ cp {{#var:NXP_ELE_FIRMWARE}}/{{#var:NXP_ELE_AHAB_CONTAINER_IMAGE|mx95a0-ahab-container.img}} imx-mkimage/iMX95 | ||
Download and build ATF:<!-- | Download and build ATF:<!-- | ||
Line 67: | Line 73: | ||
$ cd imx-atf | $ cd imx-atf | ||
$ source {{#var:TOOLCHAIN_LOCATION}} | $ source {{#var:TOOLCHAIN_LOCATION}} | ||
$ unset CFLAGS | |||
$ unset LDFLAGS | $ unset LDFLAGS | ||
$ unset AS | |||
$ unset LD | |||
$ make PLAT={{#var:IMX_ATF_PLAT}} bl31 | $ make PLAT={{#var:IMX_ATF_PLAT}} bl31 | ||
$ cp build/{{#var:IMX_ATF_PLAT}}/release/bl31.bin ../imx-mkimage/iMX95 | $ cp build/{{#var:IMX_ATF_PLAT}}/release/bl31.bin ../imx-mkimage/iMX95 | ||
Line 79: | Line 88: | ||
$ export OEI_CROSS_COMPILE=/opt/{{#var:TOOLCHAIN_ARM-NONE-EABI_NAME}}/bin/arm-none-eabi- | $ export OEI_CROSS_COMPILE=/opt/{{#var:TOOLCHAIN_ARM-NONE-EABI_NAME}}/bin/arm-none-eabi- | ||
$ make really-clean | $ make really-clean | ||
$ make board={{#var:OEI_CFG_BOARD}} DEBUG=0 oei=ddr | $ make board={{#var:OEI_CFG_BOARD}} DEBUG=1 {{#ifeq:{{#sub:{{#var:SOC_REV}}|0|1}}|B| r={{#var:SOC_REV}} }} oei=ddr | ||
$ cp build/ | $ cp build/{{#var:OEI_CFG_BOARD}}/ddr/oei-m33-ddr.bin ../imx-mkimage/iMX95 | ||
$ make board={{#var:OEI_CFG_BOARD}} DEBUG=0 oei=tcm | $ make board={{#var:OEI_CFG_BOARD}} DEBUG=0 {{#ifeq:{{#sub:{{#var:SOC_REV}}|0|1}}|B| r={{#var:SOC_REV}} }} oei=tcm | ||
$ cp build/ | $ cp build/{{#var:OEI_CFG_BOARD}}/tcm/oei-m33-tcm.bin ../imx-mkimage/iMX95 | ||
$ cd .. | $ cd .. | ||
Line 104: | Line 113: | ||
$ cd imx-mkimage | $ cd imx-mkimage | ||
$ make clean | $ make clean | ||
$ make SOC={{#var:IMX_MKIMAGE_SOC}} | $ make SOC={{#var:IMX_MKIMAGE_SOC}} flash_a55 REV={{#var:SOC_REV|A0}} OEI=YES LPDDR_TYPE=lpddr5 LPDDR_FUNC=train | ||
$ | $ mv iMX95/flash.bin iMX95/{{#var:U-BOOT_IMAGE_NAME}} | ||
= Install the built U-Boot on an SD card = | = Install the built U-Boot on an SD card = | ||
Line 116: | Line 124: | ||
And eject the SD card gracefully from host machine. | And eject the SD card gracefully from host machine. | ||
{{Note|Note: If you manually upgrade an existing U-Boot, and you have an old environment saved, it is a good idea to reset your environment to the new default (see | {{Note|Note: If you manually upgrade an existing U-Boot, and you have an old environment saved, it is a good idea to reset your environment to the new default (see {{Varlink|Yocto U-Boot 4.1.15 features#Environment handling commands |{{#var:RELEASE_LINK}}|Environment handling commands}})}} | ||
= Update your U-Boot out of Yocto tree = | = Update your U-Boot out of Yocto tree = |
Latest revision as of 14:08, 11 August 2025
This page is using the default release mx95-yocto-scarthgap-6.6.23_2.0.0-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:
- Visit variwiki.com
- Select your SoM
- Select the software release
Toolchain installation for out of Yocto builds
To install the toolchain, follow the Yocto Toolchain installation guide.
Build U-Boot out of Yocto tree
Obtain sources:
$ git clone https://github.com/varigit/uboot-imx.git -b lf_v2024.04_6.6.23-2.0.0_var01 $ cd uboot-imx
Configure compilation environment:
$ source /opt/fsl-imx-xwayland/6.6-scarthgap/environment-setup-armv8a-poky-linux
Cleanup everything:
$ make mrproper
Select configuration:
$ make imx95_var_dart_defconfig
Build U-Boot:
$ make -j$(nproc)
Download and install Arm-none-eabi cross-compiler required to build OEI and SM
$ wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi.tar.xz $ sudo tar -xf arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi.tar.xz -C /opt
Build boot image
The final boot image contains multiple firmware files, as explained by NXP in IMX_LINUX_USERS_GUIDE.pdf (Search for "How to build imx-boot image by using imx-mkimage").
The following procedure builds the final image:
Create imx-boot-tools directory:
$ mkdir imx-boot-tools $ cd imx-boot-tools
Download imx_mkimage:
$ git clone https://github.com/nxp-imx/imx-mkimage -b lf-6.6.23-2.0.0
Download DDR firmware:
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.24-fbe0a4c.bin $ chmod +x firmware-imx-8.24-fbe0a4c.bin $ ./firmware-imx-8.24-fbe0a4c.bin $ rm firmware-imx-8.24-fbe0a4c.bin $ cp firmware-imx-8.24-fbe0a4c/firmware/ddr/synopsys/* imx-mkimage/iMX95
Download ELE firmware:
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-ele-imx-0.1.2-4ed450a.bin $ chmod +x firmware-ele-imx-0.1.2-4ed450a.bin $ ./firmware-ele-imx-0.1.2-4ed450a.bin $ rm firmware-ele-imx-0.1.2-4ed450a.bin $ cp firmware-ele-imx-0.1.2-4ed450a/mx95a0-ahab-container.img imx-mkimage/iMX95
Download and build ATF:
$ git clone https://github.com/varigit/imx-atf -b lf_v2.10_6.6.23-2.0.0_var01 $ cd imx-atf $ source /opt/fsl-imx-xwayland/6.6-scarthgap/environment-setup-armv8a-poky-linux $ unset CFLAGS $ unset LDFLAGS $ unset AS $ unset LD $ make PLAT=imx95 bl31 $ cp build/imx95/release/bl31.bin ../imx-mkimage/iMX95 $ cd ..
Download and build OEI DDR Image and OEI TCM Image:
$ git clone https://github.com/varigit/imx-oei -b lf-6.6.23-2.0.0_var01 $ cd imx-oei $ export OEI_CROSS_COMPILE=/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi- $ make really-clean $ make board=mx95lp5 DEBUG=1 oei=ddr $ cp build/mx95lp5/ddr/oei-m33-ddr.bin ../imx-mkimage/iMX95 $ make board=mx95lp5 DEBUG=0 oei=tcm $ cp build/mx95lp5/tcm/oei-m33-tcm.bin ../imx-mkimage/iMX95 $ cd ..
Download and build SM:
$ git clone https://github.com/varigit/imx-sm -b lf-6.6.23-2.0.0_var01 $ cd imx-sm $ export SM_CROSS_COMPILE=/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi- $ make really-clean $ make -j $(nproc --all) config=mx95evk cfg $ make -j $(nproc --all) config=mx95evk img $ cp build/mx95evk/m33_image.bin ../imx-mkimage/iMX95 $ cd ..
Copy U-Boot binaries:
$ cp ../u-boot.bin imx-mkimage/iMX95 $ cp ../spl/u-boot-spl.bin imx-mkimage/iMX95
Build boot image:
$ cd imx-mkimage $ make clean $ make SOC=iMX95 flash_a55 REV=A0 OEI=YES LPDDR_TYPE=lpddr5 LPDDR_FUNC=train $ mv iMX95/flash.bin iMX95/imx-boot-sd.bin
Install the built U-Boot on an SD card
$ sudo dd if=iMX95/imx-boot-sd.bin of=/dev/sdX bs=1K seek=32 conv=fsync (Replace /dev/sdX with the correct device)
If you want to use our recovery SD card to flash the built U-Boot to NAND flash/eMMC, then copy it to the appropriate location in the SD card:
$ sudo cp iMX95/imx-boot-sd.bin /media/rootfs/opt/images/…
And eject the SD card gracefully from host machine.
Update your U-Boot out of Yocto tree
$ git pull