README.pico-imx7d_BL33 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. This document describes the instruction to build and flash ATF/OPTEE/U-Boot on
  2. pico-imx7d board. U-Boot is loaded as part of FIP image by ATF in this setup.
  3. The boot sequence is ATF -> OPTEE -> U-Boot -> Linux. U-Boot is in non-secure
  4. world in this case.
  5. - Build u-boot
  6. Set environment variable of CROSS_COMPILE for your toolchain
  7. $ make pico-imx7d_bl33_defconfig
  8. $ make all
  9. - Download and build OPTEE
  10. $ git clone git@github.com:OP-TEE/optee_os.git
  11. $ make PLATFORM=imx PLATFORM_FLAVOR=mx7dpico_mbl CFG_BOOT_SECONDARY_REQUEST=y ARCH=arm
  12. - Download and build ATF
  13. $ git clone https://git.linaro.org/landing-teams/working/mbl/arm-trusted-firmware.git -b linaro-imx7
  14. $ make DEBUG=1 PLAT=picopi ARCH=aarch32 ARM_ARCH_MAJOR=7 \
  15. CROSS_COMPILE=arm-linux-gnueabihf- LOG_LEVEL=50 V=1 \
  16. CRASH_REPORTING=1 AARCH32_SP=optee all
  17. Save file content in this link to file pico-imx7d.cfg:
  18. http://git.linaro.org/landing-teams/working/mbl/u-boot.git/tree/board/technexion/pico-imx7d/pico-imx7d.cfg?h=linaro-imx
  19. $ u-boot/tools/mkimage -n pico-imx7d.cfg -T imximage -e 0x9df00000 -d \
  20. build/picopi/debug/bl2.bin bl2.imx
  21. - Create FIP image
  22. Create a fiptool_images/ folder in ATF folder, copy u-boot.bin in u-boot
  23. folder and tee*.bin in optee out/arm-plat-imx/core/tee/ folder to
  24. fiptool_images. Run below command in ATF folder to generate FIP image.
  25. $ make -C tools/fiptool/
  26. $ tools/fiptool/fiptool create --tos-fw fiptool_images/tee-header_v2.bin \
  27. --tos-fw-extra1 fiptool_images/tee-pager_v2.bin \
  28. --tos-fw-extra2 fiptool_images/tee-pageable_v2.bin \
  29. --nt-fw fiptool_images/u-boot.bin \
  30. fip.bin
  31. - Burn the images to eMMC for test.
  32. Run below command in atf folder:
  33. $ dd if=build/picopi/debug/bl2.bin.imx of=/dev/disk/by-id/usb-<your device> bs=1024 seek=1;sync
  34. $ dd if=fip.bin of=/dev/disk/by-id/usb-<your device> bs=1024 seek=1;sync
  35. - Test
  36. Just boot up your board and wait for u-boot start up after ATF's log.
  37. For booting Linux in FIT image, please reference the FIT files in
  38. u-boot doc/uImage.FIT/ folder.