xref: /rk3399_ARM-atf/docs/plat/synquacer.rst (revision 24dba2b39f880e156965237dc49a253aa196585a)
1*24dba2b3SPaul BeesleySocionext Synquacer
2*24dba2b3SPaul Beesley===================
3150c38e8SSumit Garg
4150c38e8SSumit GargSocionext's Synquacer SC2A11 is a multi-core processor with 24 cores of Arm
5150c38e8SSumit GargCortex-A53. The Developerbox, of 96boards, is a platform that contains this
6150c38e8SSumit Gargprocessor. This port of the Trusted Firmware only supports this platform at
7150c38e8SSumit Gargthe moment.
8150c38e8SSumit Garg
9150c38e8SSumit GargMore information are listed in `link`_.
10150c38e8SSumit Garg
11150c38e8SSumit GargHow to build
12*24dba2b3SPaul Beesley------------
13150c38e8SSumit Garg
14150c38e8SSumit GargCode Locations
15*24dba2b3SPaul Beesley~~~~~~~~~~~~~~
16150c38e8SSumit Garg
17150c38e8SSumit Garg-  Trusted Firmware-A:
18150c38e8SSumit Garg   `link <https://github.com/ARM-software/arm-trusted-firmware>`__
19150c38e8SSumit Garg
20150c38e8SSumit Garg-  edk2:
21150c38e8SSumit Garg   `link <https://github.com/tianocore/edk2>`__
22150c38e8SSumit Garg
23150c38e8SSumit Garg-  edk2-platforms:
24150c38e8SSumit Garg   `link <https://github.com/tianocore/edk2-platforms>`__
25150c38e8SSumit Garg
26150c38e8SSumit Garg-  edk2-non-osi:
27150c38e8SSumit Garg   `link <https://github.com/tianocore/edk2-non-osi>`__
28150c38e8SSumit Garg
29150c38e8SSumit GargBoot Flow
30*24dba2b3SPaul Beesley~~~~~~~~~
31150c38e8SSumit Garg
32150c38e8SSumit GargSCP firmware --> TF-A BL31 --> UEFI(edk2)
33150c38e8SSumit Garg
34150c38e8SSumit GargBuild Procedure
35*24dba2b3SPaul Beesley~~~~~~~~~~~~~~~
36150c38e8SSumit Garg
37150c38e8SSumit Garg-  Firstly, in addition to the “normal” build tools you will also need a
38150c38e8SSumit Garg   few specialist tools. On a Debian or Ubuntu operating system try:
39150c38e8SSumit Garg
40150c38e8SSumit Garg   .. code:: shell
41150c38e8SSumit Garg
42150c38e8SSumit Garg       sudo apt install acpica-tools device-tree-compiler uuid-dev
43150c38e8SSumit Garg
44150c38e8SSumit Garg-  Secondly, create a new working directory and store the absolute path to this
45150c38e8SSumit Garg   directory in an environment variable, WORKSPACE. It does not matter where
46150c38e8SSumit Garg   this directory is created but as an example:
47150c38e8SSumit Garg
48150c38e8SSumit Garg   .. code:: shell
49150c38e8SSumit Garg
50150c38e8SSumit Garg       export WORKSPACE=$HOME/build/developerbox-firmware
51150c38e8SSumit Garg       mkdir -p $WORKSPACE
52150c38e8SSumit Garg
53150c38e8SSumit Garg-  Run the following commands to clone the source code:
54150c38e8SSumit Garg
55150c38e8SSumit Garg   .. code:: shell
56150c38e8SSumit Garg
57150c38e8SSumit Garg       cd $WORKSPACE
58150c38e8SSumit Garg       git clone https://github.com/ARM-software/arm-trusted-firmware -b master
59150c38e8SSumit Garg       git clone https://github.com/tianocore/edk2.git -b master
60150c38e8SSumit Garg       git clone https://github.com/tianocore/edk2-platforms.git -b master
61150c38e8SSumit Garg       git clone https://github.com/tianocore/edk2-non-osi.git -b master
62150c38e8SSumit Garg
63150c38e8SSumit Garg-  Build ATF:
64150c38e8SSumit Garg
65150c38e8SSumit Garg   .. code:: shell
66150c38e8SSumit Garg
67150c38e8SSumit Garg       cd $WORKSPACE/arm-trusted-firmware
68150c38e8SSumit Garg       make -j`nproc` PLAT=synquacer PRELOADED_BL33_BASE=0x8200000 bl31 fiptool
69150c38e8SSumit Garg       tools/fiptool/fiptool create \
70150c38e8SSumit Garg             --tb-fw ./build/synquacer/release/bl31.bin \
71150c38e8SSumit Garg             --soc-fw ./build/synquacer/release/bl31.bin \
72150c38e8SSumit Garg             --scp-fw ./build/synquacer/release/bl31.bin \
73150c38e8SSumit Garg             ../edk2-non-osi/Platform/Socionext/DeveloperBox/fip_all_arm_tf.bin
74150c38e8SSumit Garg
75150c38e8SSumit Garg-  Build EDK2:
76150c38e8SSumit Garg
77150c38e8SSumit Garg   .. code:: shell
78150c38e8SSumit Garg
79150c38e8SSumit Garg       cd $WORKSPACE
80150c38e8SSumit Garg       export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi
81150c38e8SSumit Garg       export ACTIVE_PLATFORM="Platform/Socionext/DeveloperBox/DeveloperBox.dsc"
82150c38e8SSumit Garg       export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
83150c38e8SSumit Garg       unset ARCH
84150c38e8SSumit Garg
85150c38e8SSumit Garg       . edk2/edksetup.sh
86150c38e8SSumit Garg       make -C edk2/BaseTools
87150c38e8SSumit Garg
88150c38e8SSumit Garg       build -p $ACTIVE_PLATFORM -b RELEASE -a AARCH64 -t GCC5 -n `nproc` -D DO_X86EMU=TRUE
89150c38e8SSumit Garg
90150c38e8SSumit Garg-  The firmware image, which comprises the option ROM, ARM trusted firmware and
91150c38e8SSumit Garg   EDK2 itself, can be found $WORKSPACE/../Build/DeveloperBox/RELEASE_GCC5/FV/.
92150c38e8SSumit Garg   Use SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap for UEFI capsule update and
93150c38e8SSumit Garg   SPI_NOR_IMAGE.fd for the serial flasher.
94150c38e8SSumit Garg
95150c38e8SSumit Garg   Note #1: -t GCC5 can be loosely translated as “enable link-time-optimization”;
96150c38e8SSumit Garg   any version of gcc >= 5 will support this feature and may be used to build EDK2.
97150c38e8SSumit Garg
98150c38e8SSumit Garg   Note #2: Replace -b RELEASE with -b DEBUG to build a debug.
99150c38e8SSumit Garg
100150c38e8SSumit GargInstall the System Firmware
101*24dba2b3SPaul Beesley~~~~~~~~~~~~~~~~~~~~~~~~~~~
102150c38e8SSumit Garg
103150c38e8SSumit Garg-  Providing your Developerbox is fully working and has on operating system
104150c38e8SSumit Garg   installed then you can adopt your the newly compiled system firmware using
105150c38e8SSumit Garg   the capsule update method:.
106150c38e8SSumit Garg
107150c38e8SSumit Garg   .. code:: shell
108150c38e8SSumit Garg
109150c38e8SSumit Garg       sudo apt install fwupdate
110150c38e8SSumit Garg       sudo fwupdate --apply {50b94ce5-8b63-4849-8af4-ea479356f0e3} \
111150c38e8SSumit Garg                     SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap
112150c38e8SSumit Garg       sudo reboot
113150c38e8SSumit Garg
114150c38e8SSumit Garg-  Alternatively you can install SPI_NOR_IMAGE.fd using the `board recovery method`_.
115150c38e8SSumit Garg
116150c38e8SSumit Garg.. _link: https://www.96boards.org/product/developerbox/
117150c38e8SSumit Garg.. _board recovery method: https://www.96boards.org/documentation/enterprise/developerbox/installation/board-recovery.md.html
118