post-image.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # By default U-Boot loads DTB from a file named "system.dtb", so
  3. # let's use a symlink with that name that points to the *first*
  4. # devicetree listed in the config.
  5. FIRST_DT=$(sed -nr \
  6. -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \
  7. "${BR2_CONFIG}")
  8. [ -z "${FIRST_DT}" ] || ln -fs "${FIRST_DT}.dtb" "${BINARIES_DIR}/system.dtb"
  9. BOARD_DIR="$(dirname "$0")"
  10. mkdir -p "${BINARIES_DIR}"
  11. cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
  12. the_ROM_image:
  13. {
  14. image {
  15. { type=bootimage, file=${BINARIES_DIR}/boot.pdi }
  16. { type=bootloader, file=${BINARIES_DIR}/plm.elf }
  17. { core=psm, file=${BINARIES_DIR}/psmfw.elf }
  18. }
  19. image {
  20. id = 0x1c000000, name=apu_subsystem
  21. { type=raw, load=0x00001000, file=${BINARIES_DIR}/u-boot.dtb }
  22. { core=a72-0, exception_level=el-3, trustzone, file=${BINARIES_DIR}/bl31.elf }
  23. { core=a72-0, exception_level=el-2, file=${BINARIES_DIR}/u-boot.elf }
  24. }
  25. }
  26. __HEADER_EOF
  27. "${HOST_DIR}/bin/bootgen" -arch versal -image "${BINARIES_DIR}/bootgen.bif" -o "${BINARIES_DIR}/boot.bin" -w on
  28. support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"