synquacer: Add platform makefile and documentation
authorSumit Garg <sumit.garg@linaro.org>
Thu, 21 Jun 2018 05:58:18 +0000 (11:28 +0530)
committerSumit Garg <sumit.garg@linaro.org>
Thu, 21 Jun 2018 08:48:37 +0000 (14:18 +0530)
Add Makefile and plaform definations file.
My thanks to Daniel Thompson and Ard Biesheuvel for the bits and pieces
I've taken from their earlier work regarding build and deploy steps for
Developerbox based on Synquacer SoCs. They deserve much of the credit
for this work although, since I assembled and tested things, any blame
is probably mine.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
docs/plat/synquacer.rst [new file with mode: 0644]
maintainers.rst
plat/socionext/synquacer/platform.mk [new file with mode: 0644]
readme.rst

diff --git a/docs/plat/synquacer.rst b/docs/plat/synquacer.rst
new file mode 100644 (file)
index 0000000..ca53deb
--- /dev/null
@@ -0,0 +1,117 @@
+Trusted Firmware-A for Socionext Synquacer SoCs
+===============================================
+
+Socionext's Synquacer SC2A11 is a multi-core processor with 24 cores of Arm
+Cortex-A53. The Developerbox, of 96boards, is a platform that contains this
+processor. This port of the Trusted Firmware only supports this platform at
+the moment.
+
+More information are listed in `link`_.
+
+How to build
+============
+
+Code Locations
+--------------
+
+-  Trusted Firmware-A:
+   `link <https://github.com/ARM-software/arm-trusted-firmware>`__
+
+-  edk2:
+   `link <https://github.com/tianocore/edk2>`__
+
+-  edk2-platforms:
+   `link <https://github.com/tianocore/edk2-platforms>`__
+
+-  edk2-non-osi:
+   `link <https://github.com/tianocore/edk2-non-osi>`__
+
+Boot Flow
+---------
+
+SCP firmware --> TF-A BL31 --> UEFI(edk2)
+
+Build Procedure
+---------------
+
+-  Firstly, in addition to the “normal” build tools you will also need a
+   few specialist tools. On a Debian or Ubuntu operating system try:
+
+   .. code:: shell
+
+       sudo apt install acpica-tools device-tree-compiler uuid-dev
+
+-  Secondly, create a new working directory and store the absolute path to this
+   directory in an environment variable, WORKSPACE. It does not matter where
+   this directory is created but as an example:
+
+   .. code:: shell
+
+       export WORKSPACE=$HOME/build/developerbox-firmware
+       mkdir -p $WORKSPACE
+
+-  Run the following commands to clone the source code:
+
+   .. code:: shell
+
+       cd $WORKSPACE
+       git clone https://github.com/ARM-software/arm-trusted-firmware -b master
+       git clone https://github.com/tianocore/edk2.git -b master
+       git clone https://github.com/tianocore/edk2-platforms.git -b master
+       git clone https://github.com/tianocore/edk2-non-osi.git -b master
+
+-  Build ATF:
+
+   .. code:: shell
+
+       cd $WORKSPACE/arm-trusted-firmware
+       make -j`nproc` PLAT=synquacer PRELOADED_BL33_BASE=0x8200000 bl31 fiptool
+       tools/fiptool/fiptool create \
+             --tb-fw ./build/synquacer/release/bl31.bin \
+             --soc-fw ./build/synquacer/release/bl31.bin \
+             --scp-fw ./build/synquacer/release/bl31.bin \
+             ../edk2-non-osi/Platform/Socionext/DeveloperBox/fip_all_arm_tf.bin
+
+-  Build EDK2:
+
+   .. code:: shell
+
+       cd $WORKSPACE
+       export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi
+       export ACTIVE_PLATFORM="Platform/Socionext/DeveloperBox/DeveloperBox.dsc"
+       export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
+       unset ARCH
+
+       . edk2/edksetup.sh
+       make -C edk2/BaseTools
+
+       build -p $ACTIVE_PLATFORM -b RELEASE -a AARCH64 -t GCC5 -n `nproc` -D DO_X86EMU=TRUE
+
+-  The firmware image, which comprises the option ROM, ARM trusted firmware and
+   EDK2 itself, can be found $WORKSPACE/../Build/DeveloperBox/RELEASE_GCC5/FV/.
+   Use SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap for UEFI capsule update and
+   SPI_NOR_IMAGE.fd for the serial flasher.
+
+   Note #1: -t GCC5 can be loosely translated as “enable link-time-optimization”;
+   any version of gcc >= 5 will support this feature and may be used to build EDK2.
+
+   Note #2: Replace -b RELEASE with -b DEBUG to build a debug.
+
+Install the System Firmware
+---------------------------
+
+-  Providing your Developerbox is fully working and has on operating system
+   installed then you can adopt your the newly compiled system firmware using
+   the capsule update method:.
+
+   .. code:: shell
+
+       sudo apt install fwupdate
+       sudo fwupdate --apply {50b94ce5-8b63-4849-8af4-ea479356f0e3} \
+                     SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap
+       sudo reboot
+
+-  Alternatively you can install SPI_NOR_IMAGE.fd using the `board recovery method`_.
+
+.. _link: https://www.96boards.org/product/developerbox/
+.. _board recovery method: https://www.96boards.org/documentation/enterprise/developerbox/installation/board-recovery.md.html
index 96ff0e06d85f07b34bae066ce7dce83bb7b33651..4466a56e544237b341e7638f866785f1d70d952b 100644 (file)
@@ -132,6 +132,16 @@ Files:
 
 -  plat/rockchip/\*
 
+Synquacer platform sub-maintainer
+---------------------------------
+
+Sumit Garg (sumit.garg@linaro.org, `b49020`_)
+
+Files:
+
+- docs/plat/synquacer.rst
+- plat/socionext/synquacer/\*
+
 Texas Instruments platform sub-maintainer
 -----------------------------------------
 
@@ -183,3 +193,4 @@ Etienne Carriere (etienne.carriere@linaro.org, `etienne-lms`_)
 .. _etienne-lms: https://github.com/etienne-lms
 .. _qoriq-open-source: https://github.com/qoriq-open-source
 .. _Andre-ARM: https://github.com/Andre-ARM
+.. _b49020: https://github.com/b49020
diff --git a/plat/socionext/synquacer/platform.mk b/plat/socionext/synquacer/platform.mk
new file mode 100644 (file)
index 0000000..546f84a
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+override RESET_TO_BL31                 := 1
+override ENABLE_PLAT_COMPAT            := 0
+override MULTI_CONSOLE_API             := 1
+override PROGRAMMABLE_RESET_ADDRESS    := 1
+override USE_COHERENT_MEM              := 1
+override SEPARATE_CODE_AND_RODATA      := 1
+override ENABLE_SVE_FOR_NS             := 0
+
+# Enable workarounds for selected Cortex-A53 erratas.
+ERRATA_A53_855873              := 1
+
+# Libraries
+include lib/xlat_tables_v2/xlat_tables.mk
+
+PLAT_PATH              :=      plat/socionext/synquacer
+PLAT_INCLUDES          :=      -I$(PLAT_PATH)/include          \
+                               -I$(PLAT_PATH)/drivers/scpi     \
+                               -I$(PLAT_PATH)/drivers/mhu
+
+PLAT_BL_COMMON_SOURCES +=      $(PLAT_PATH)/sq_helpers.S               \
+                               drivers/arm/pl011/pl011_console.S       \
+                               drivers/delay_timer/delay_timer.c       \
+                               drivers/delay_timer/generic_delay_timer.c \
+                               ${XLAT_TABLES_LIB_SRCS}
+
+BL31_SOURCES           +=      drivers/arm/ccn/ccn.c                   \
+                               drivers/arm/gic/common/gic_common.c     \
+                               drivers/arm/gic/v3/gicv3_helpers.c      \
+                               drivers/arm/gic/v3/gicv3_main.c         \
+                               lib/cpus/aarch64/cortex_a53.S           \
+                               plat/common/plat_gicv3.c                \
+                               plat/common/plat_psci_common.c          \
+                               $(PLAT_PATH)/sq_bl31_setup.c            \
+                               $(PLAT_PATH)/sq_ccn.c                   \
+                               $(PLAT_PATH)/sq_topology.c              \
+                               $(PLAT_PATH)/sq_psci.c                  \
+                               $(PLAT_PATH)/sq_gicv3.c                 \
+                               $(PLAT_PATH)/sq_xlat_setup.c            \
+                               $(PLAT_PATH)/drivers/scpi/sq_scpi.c     \
+                               $(PLAT_PATH)/drivers/mhu/sq_mhu.c
index 3738c97dd0569b27e93e634f96b8f63bd6e6f639..c87936ceddf19c468eefc14697c69b876fb58103 100644 (file)
@@ -182,7 +182,7 @@ This release also contains the following platform support:
 -  QEMU emulator
 -  Raspberry Pi 3 board
 -  RockChip RK3328, RK3368 and RK3399 SoCs
--  Socionext UniPhier SoC family
+-  Socionext UniPhier SoC family and SynQuacer SC2A11 SoCs
 -  Texas Instruments K3 SoCs
 -  Xilinx Zynq UltraScale + MPSoC