aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-07-12 08:58:38 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-07-13 15:27:01 +0100
commit64fe343c03dd1b86c342efde97c3cd94f56d84f6 (patch)
tree5c99ac3a51ca86ae73d2ac11212b6c00ceb43926
parentb19269a63c176f118750f59a89b6ac598b4469ef (diff)
downloadplatform_external_arm-trusted-firmware-64fe343c03dd1b86c342efde97c3cd94f56d84f6.tar.gz
platform_external_arm-trusted-firmware-64fe343c03dd1b86c342efde97c3cd94f56d84f6.tar.bz2
platform_external_arm-trusted-firmware-64fe343c03dd1b86c342efde97c3cd94f56d84f6.zip
rpi3: Concatenate BL1 and FIP automatically
Add a new default makefile target to concatenate BL1 and the FIP and generate armstub8.bin. This way it isn't needed to do it manually. Documentation updated to reflect the changes. Change-Id: Id5b5b1b7b9f87767db63fd01180ddfea855a7207 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r--docs/plat/rpi3.rst22
-rw-r--r--plat/rpi3/platform.mk20
2 files changed, 26 insertions, 16 deletions
diff --git a/docs/plat/rpi3.rst b/docs/plat/rpi3.rst
index 5ac908539..0ba564d81 100644
--- a/docs/plat/rpi3.rst
+++ b/docs/plat/rpi3.rst
@@ -196,29 +196,19 @@ Then compile TF-A. For a AArch32 kernel, use the following command line:
CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
RPI3_BL33_IN_AARCH32=1 \
- BL33=../rpi3-arm-tf-bootstrap/aarch32/el2-bootstrap.bin \
- all fip
+ BL33=../rpi3-arm-tf-bootstrap/aarch32/el2-bootstrap.bin
For a AArch64 kernel, use this other command line:
.. code:: shell
CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
- BL33=../rpi3-arm-tf-bootstrap/aarch64/el2-bootstrap.bin \
- all fip
+ BL33=../rpi3-arm-tf-bootstrap/aarch64/el2-bootstrap.bin
-Then, join BL1 and the FIP with the following instructions (replace ``release``
-by ``debug`` if you set the build option ``DEBUG=1``):
-
-.. code:: shell
-
- cp build/rpi3/release/bl1.bin bl1.pad.bin
- truncate --size=131072 bl1.pad.bin
- cat bl1.pad.bin build/rpi3/release/fip.bin > armstub8.bin
-
-The resulting file, ``armstub8.bin``, contains BL1 and the FIP in the place they
-need to be for TF-A to boot correctly. Now, follow the instructions in
-`Setup SD card`_.
+The build system concatenates BL1 and the FIP so that the addresses match the
+ones in the memory map. The resulting file is ``armstub8.bin``, located in the
+build folder (e.g. ``build/rpi3/debug/armstub8.bin``). Now, follow the
+instructions in `Setup SD card`_.
The following build options are supported:
diff --git a/plat/rpi3/platform.mk b/plat/rpi3/platform.mk
index df19705e6..fa7e5eb7f 100644
--- a/plat/rpi3/platform.mk
+++ b/plat/rpi3/platform.mk
@@ -54,6 +54,26 @@ else
TF_CFLAGS_aarch64 += -mtune=cortex-a53
endif
+# Platform Makefile target
+# ------------------------
+
+RPI3_BL1_PAD_BIN := ${BUILD_PLAT}/bl1_pad.bin
+RPI3_ARMSTUB8_BIN := ${BUILD_PLAT}/armstub8.bin
+
+# Add new default target when compiling this platform
+all: armstub
+
+# This target concatenates BL1 and the FIP so that the base addresses match the
+# ones defined in the memory map
+armstub: bl1 fip
+ @echo " CAT $@"
+ ${Q}cp ${BUILD_PLAT}/bl1.bin ${RPI3_BL1_PAD_BIN}
+ ${Q}truncate --size=131072 ${RPI3_BL1_PAD_BIN}
+ ${Q}cat ${RPI3_BL1_PAD_BIN} ${BUILD_PLAT}/fip.bin > ${RPI3_ARMSTUB8_BIN}
+ @${ECHO_BLANK_LINE}
+ @echo "Built $@ successfully"
+ @${ECHO_BLANK_LINE}
+
# Build config flags
# ------------------