From 58b6fccffe7147e7eca6b6738d1732c6c3cc9f42 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 19 Dec 2017 22:30:24 +0900 Subject: [PATCH 1/3] doc: uniphier: reformat reStructuredText manually Commit 6f6257476754 ("Convert documentation to reStructuredText") automatically converted all documents by a tool. I see some parts were converted in an ugly way (or, at least, it is not my intention). Also, the footnote is apparently broken. I checked this document by my eyes, and reformated it so that it looks nicer both in plain text and reST form. Signed-off-by: Masahiro Yamada --- docs/plat/socionext-uniphier.rst | 84 +++++++++++++++----------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/docs/plat/socionext-uniphier.rst b/docs/plat/socionext-uniphier.rst index fb6ebe5ef..2c652ac9e 100644 --- a/docs/plat/socionext-uniphier.rst +++ b/docs/plat/socionext-uniphier.rst @@ -1,11 +1,12 @@ ARM Trusted Firmware for Socionext UniPhier SoCs ================================================ + Socionext UniPhier ARMv8-A SoCs use ARM Trusted Firmware as the secure world firmware, supporting BL1, BL2, and BL31. UniPhier SoC family implements its internal boot ROM, so BL1 is used as pseudo -ROM (i.e. runs in RAM). The internal boot ROM loads 64KB `1`_ image from a +ROM (i.e. runs in RAM). The internal boot ROM loads 64KB [1]_ image from a non-volatile storage to the on-chip SRAM. Unfortunately, BL1 does not fit in the 64KB limit if `Trusted Board Boot`_ (TBB) is enabled. To solve this problem, Socionext provides a first stage loader called `UniPhier BL`_. This loader runs @@ -23,35 +24,33 @@ the UniPhier BL. The concatenation of the UniPhier BL and the compressed BL1 fits in the 64KB limit. The concatenated image is loaded by the boot ROM (and verified if the chip fuses are blown). -:: - - to the lowest common denominator. Boot Flow --------- -#. The Boot ROM +1. The Boot ROM -This is hard-wired ROM, so never corrupted. It loads the UniPhier BL (with -compressed-BL1 appended) into the on-chip SRAM. If the SoC fuses are blown, -the image is verified by the SoC's own method. + This is hard-wired ROM, so never corrupted. It loads the UniPhier BL (with + compressed-BL1 appended) into the on-chip SRAM. If the SoC fuses are blown, + the image is verified by the SoC's own method. -#. UniPhier BL +2. UniPhier BL -This runs in the on-chip SRAM. After the minimum SoC initialization and DRAM -setup, it decompresses the appended BL1 image into the DRAM, then jumps to -the BL1 entry. + This runs in the on-chip SRAM. After the minimum SoC initialization and DRAM + setup, it decompresses the appended BL1 image into the DRAM, then jumps to + the BL1 entry. -#. BL1 +3. BL1 -This runs in the DRAM. It extracts BL2 from FIP (Firmware Image Package). -If TBB is enabled, the BL2 is authenticated by the standard mechanism of ARM -Trusted Firmware. + This runs in the DRAM. It extracts BL2 from FIP (Firmware Image Package). + If TBB is enabled, the BL2 is authenticated by the standard mechanism of ARM + Trusted Firmware. -#. BL2, BL31, and more +4. BL2, BL31, and more + + They all run in the DRAM, and are authenticated by the standard mechanism if + TBB is enabled. See `Firmware Design`_ for details. -They all run in the DRAM, and are authenticated by the standard mechanism if -TBB is enabled. See `Firmware Design`_ for details. Basic Build ----------- @@ -63,59 +62,52 @@ For a non-secure boot loader (aka BL33), U-Boot is well supported for UniPhier SoCs. The U-Boot image (``u-boot.bin``) must be built in advance. For the build procedure of U-Boot, refer to the document in the `U-Boot`_ project. -To build minimum functionality for UniPhier (without TBB): - -:: +To build minimum functionality for UniPhier (without TBB):: make CROSS_COMPILE= PLAT=uniphier BL33= bl1_gzip fip Output images: -- ``bl1.bin.gzip`` -- ``fip.bin`` +- ``bl1.bin.gzip`` +- ``fip.bin`` + Optional features ----------------- -- Trusted Board Boot +- Trusted Board Boot -`mbed TLS`_ is needed as the cryptographic and image parser modules. -Refer to the `User Guide`_ for the appropriate version of mbed TLS. + `mbed TLS`_ is needed as the cryptographic and image parser modules. + Refer to the `User Guide`_ for the appropriate version of mbed TLS. -To enable TBB, add the following options to the build command: - -:: + To enable TBB, add the following options to the build command:: TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 MBEDTLS_DIR= -- System Control Processor (SCP) +- System Control Processor (SCP) -If desired, FIP can include an SCP BL2 image. If BL2 finds an SCP BL2 image -in FIP, BL2 loads it into DRAM and kicks the SCP. Most of UniPhier boards -still work without SCP, but SCP provides better power management support. + If desired, FIP can include an SCP BL2 image. If BL2 finds an SCP BL2 image + in FIP, BL2 loads it into DRAM and kicks the SCP. Most of UniPhier boards + still work without SCP, but SCP provides better power management support. -To include SCP\_BL2, add the following option to the build command: - -:: + To include SCP BL2, add the following option to the build command:: SCP_BL2= -- BL32 (Secure Payload) +- BL32 (Secure Payload) -To enable BL32, add the following option to the build command: - -:: + To enable BL32, add the following options to the build command:: SPD= BL32= -If you use TSP for BL32, ``BL32=`` is not required. Just add the -following: - -:: + If you use TSP for BL32, ``BL32=`` is not required. Just add the + following:: SPD=tspd -.. _1: Some%20SoCs%20can%20load%2080KB,%20but%20the%20software%20implementation%20must%20be%20aligned + +.. [1] Some SoCs can load 80KB, but the software implementation must be aligned + to the lowest common denominator. .. _Trusted Board Boot: ../trusted-board-boot.rst .. _UniPhier BL: https://github.com/uniphier/uniphier-bl .. _Firmware Design: ../firmware-design.rst From fe458325d04709035f1f5fca2b5946a0fd11c4a7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 20 Dec 2017 01:30:08 +0900 Subject: [PATCH 2/3] uniphier: fix base address of IO block buffer The current IO block buffer overlaps with BL2 image location. So, BL2 may corrupt itself. Signed-off-by: Masahiro Yamada --- plat/socionext/uniphier/include/platform_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/socionext/uniphier/include/platform_def.h b/plat/socionext/uniphier/include/platform_def.h index b5dc16aa9..cc046eb40 100644 --- a/plat/socionext/uniphier/include/platform_def.h +++ b/plat/socionext/uniphier/include/platform_def.h @@ -47,7 +47,7 @@ #define BL32_LIMIT (UNIPHIER_SEC_DRAM_LIMIT) #define UNIPHIER_BLOCK_BUF_SIZE 0x00400000 -#define UNIPHIER_BLOCK_BUF_BASE ((BL2_LIMIT) - \ +#define UNIPHIER_BLOCK_BUF_BASE ((BL2_BASE) - \ (UNIPHIER_BLOCK_BUF_SIZE)) #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32) From 9d32b55ccba029d43d5ca7ebc727a210b4eb53c7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 20 Dec 2017 01:37:15 +0900 Subject: [PATCH 3/3] uniphier: fix alignment of build log The build log should be indented with two spaces for correct alignment. Signed-off-by: Masahiro Yamada --- plat/socionext/uniphier/platform.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/socionext/uniphier/platform.mk b/plat/socionext/uniphier/platform.mk index 3c78054b1..41d044487 100644 --- a/plat/socionext/uniphier/platform.mk +++ b/plat/socionext/uniphier/platform.mk @@ -116,5 +116,5 @@ endif .PHONY: bl1_gzip bl1_gzip: $(BUILD_PLAT)/bl1.bin.gzip %.gzip: % - @echo " GZIP $@" + @echo " GZIP $@" $(Q)(cat $< | gzip -n -f -9 > $@) || (rm -f $@ || false)