Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagannadh.teki@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 02/11] support/scripts: Add sunxi64-post-build.sh
Date: Thu, 19 Oct 2017 11:45:24 +0200	[thread overview]
Message-ID: <1508406333-27138-3-git-send-email-jagan@amarulasolutions.com> (raw)
In-Reply-To: <1508406333-27138-1-git-send-email-jagan@amarulasolutions.com>

For building U-Boot proper in allwinner A64/H5 ATF need to build
first and ATF binary need to be exported, since buildroot not taking
care of this process this script will do the same build during
post-build.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 support/scripts/sunxi64-post-build.sh | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100755 support/scripts/sunxi64-post-build.sh

diff --git a/support/scripts/sunxi64-post-build.sh b/support/scripts/sunxi64-post-build.sh
new file mode 100755
index 0000000..359bd1d
--- /dev/null
+++ b/support/scripts/sunxi64-post-build.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+#
+# sunxi64-post-build script
+#
+# Allwinner A64/H5 firmware consists of three parts:
+# 1) U-Boot's SPL
+# 2) ARM Trusted Firmware (ATF)
+# 3) U-Boot proper.
+#
+# The SPL will load both ATF and U-Boot proper along with the right device
+# tree blob (.dtb) and will pass execution to ATF (in EL3), which in turn will
+# drop into the U-Boot proper (in EL2).
+#
+# As the ATF binary will become part of the U-Boot image file, you will need
+# to build it first and export ATF variable to built U-Boot proper. Since
+# buildroot not take of building ATF first and export the binary, this post-build
+# script build the u-boot.itb
+
+# source .config
+source ${BR2_CONFIG}
+
+ATF_BUILD_DIR=arm-trusted-firmware-${BR2_TARGET_ARM_TRUSTED_FIRMWARE_VERSION}/build
+ATF_PLAT_DIR=${ATF_BUILD_DIR}/${BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM}/release
+ATF_BIN_PATH=${ATF_PLAT_DIR}/${BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES}.bin
+UBOOT_BUILD_DIR=${BUILD_DIR}/uboot-${BR2_TARGET_UBOOT_VERSION}
+MKIMAGE=${UBOOT_BUILD_DIR}/tools/mkimage
+DTB_NAME=${BR2_LINUX_KERNEL_INTREE_DTS_NAME#*/}.dtb
+
+cd ${UBOOT_BUILD_DIR}
+export BL31=${BUILD_DIR}/${ATF_BIN_PATH}
+${UBOOT_BUILD_DIR}/board/sunxi/mksunxi_fit_atf.sh ${UBOOT_BUILD_DIR}/arch/arm/dts/${DTB_NAME} > u-boot.its
+${MKIMAGE} -f u-boot.its -E $BINARIES_DIR/u-boot.itb
-- 
1.9.1

  parent reply	other threads:[~2017-10-19  9:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19  9:45 [Buildroot] [PATCH v3 00/11] board: Add Allwinner A64/H5 boards Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 01/11] board: Add Bananapi M1 support Jagan Teki
2017-10-19 10:38   ` Baruch Siach
2017-10-19 10:56     ` Jagan Teki
2017-10-21 20:37   ` Thomas Petazzoni
2017-10-19  9:45 ` Jagan Teki [this message]
2017-10-21 21:06   ` [Buildroot] [PATCH v3 02/11] support/scripts: Add sunxi64-post-build.sh Thomas Petazzoni
2017-10-22 10:15     ` Jagan Teki
     [not found]       ` <4cb45577-1f4a-ce9c-7204-74934272b789@arm.com>
2017-10-22 12:29         ` Thomas Petazzoni
2017-10-26 11:20           ` Jagan Teki
2017-10-26 18:13             ` Jagan Teki
     [not found]               ` <e73be7ab-6435-5d11-41b5-37f3bf4053ee@arm.com>
2017-10-27 11:46                 ` Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 03/11] board: Add Bananapi M64 support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 04/11] board: Add Pine64 support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 05/11] board: Add SoPine support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 06/11] board: Add FriendlyARM Nanopi A64 support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 07/11] board: Add FriendlyARM Nanopi NEO2 support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 08/11] board: Add Olimex A64-OLinuXino support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 09/11] board: Add Orangepi Win/Win Plus support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 10/11] board: Add Orangepi Prime support Jagan Teki
2017-10-19  9:45 ` [Buildroot] [PATCH v3 11/11] board: Add Orangepi Zero Plus2 support Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508406333-27138-3-git-send-email-jagan@amarulasolutions.com \
    --to=jagannadh.teki@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox