Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sunil at amarulasolutions.com <sunil@amarulasolutions.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399
Date: Thu, 19 Mar 2020 16:16:49 +0530	[thread overview]
Message-ID: <1584614812-20061-2-git-send-email-sunil@amarulasolutions.com> (raw)
In-Reply-To: <1584614812-20061-1-git-send-email-sunil@amarulasolutions.com>

From: Jagan Teki <jagan@amarulasolutions.com>

Unlike other SoC platforms, rockchip platforms doesn't require a binary
generation on TF-A project.

This is due to rockchip platforms have non-continuous memory areas in
the linker script with a huge gap between them, so generating the binary
would require addition padding which indeed increases the size of the binary.

Interestingly this binary generation is disabled in v2.2 of TF-A on below
commit:
 commit <33218d2a8143> "rockchip: Disable binary generation for all SoCs."

Buildroot generally looks for a *.bin in the TF-A build directory but v2.2 is
not creating any bin since rk3399 (or rockchip) doesn't need bins, because of
which build fails.

This changeset checks for a *.bin in the respective TF-A build directory, if
available it copies to the output directory, otherwise skips copy.

This fixes the atf build on rk3399 with v2.2 and above.

Note: the same can be applied to rest of rockchip platforms if
they use v2.2 TF-A and above.

Cc: linux-amarula at amarulasolutions.com
Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- no changes

Changes for v3:
- Based on suggestions from sergey and thomas, instead of encoding
  platform-specific stuff in config files, made changes in .mk files
  based on the build flow.
- Tested on roc-rk3399-pc, a rk3399 based target. Compile tested for orangepi 

Changes for v2:
- added Cc tag.

 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3473701..7722954 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -150,9 +150,11 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 endef
 
 define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
+if [ -e $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin ]; then \
 	$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
-		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
-	)
+		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \
+	) ; \
+fi
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF)
 endef
-- 
2.7.4

  reply	other threads:[~2020-03-19 10:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 2/5] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 3/5] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 4/5] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets sunil at amarulasolutions.com
2020-03-18 14:51       ` Heiko Thiery
2020-03-18 17:07         ` Jagan Teki
2020-03-18 18:05           ` Heiko Thiery
2020-03-18 20:52           ` Thomas Petazzoni
2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-03-19 10:46               ` sunil at amarulasolutions.com [this message]
2020-03-20 22:13                 ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 Thomas Petazzoni
2020-03-19 10:46               ` [Buildroot] [PATCH v4 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-03-19 10:46               ` [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-03-20 22:14                 ` Thomas Petazzoni
2020-03-19 10:46               ` [Buildroot] [PATCH v4 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-02-14 12:32   ` Michael Walle
2020-02-16 23:28     ` Thomas Petazzoni
2020-02-13 10:44 ` [Buildroot] [PATCH v2 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-02-24  9:22   ` 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=1584614812-20061-2-git-send-email-sunil@amarulasolutions.com \
    --to=sunil@amarulasolutions.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