1*150c38e8SSumit GargTrusted Firmware-A for Socionext Synquacer SoCs 2*150c38e8SSumit Garg=============================================== 3*150c38e8SSumit Garg 4*150c38e8SSumit GargSocionext's Synquacer SC2A11 is a multi-core processor with 24 cores of Arm 5*150c38e8SSumit GargCortex-A53. The Developerbox, of 96boards, is a platform that contains this 6*150c38e8SSumit Gargprocessor. This port of the Trusted Firmware only supports this platform at 7*150c38e8SSumit Gargthe moment. 8*150c38e8SSumit Garg 9*150c38e8SSumit GargMore information are listed in `link`_. 10*150c38e8SSumit Garg 11*150c38e8SSumit GargHow to build 12*150c38e8SSumit Garg============ 13*150c38e8SSumit Garg 14*150c38e8SSumit GargCode Locations 15*150c38e8SSumit Garg-------------- 16*150c38e8SSumit Garg 17*150c38e8SSumit Garg- Trusted Firmware-A: 18*150c38e8SSumit Garg `link <https://github.com/ARM-software/arm-trusted-firmware>`__ 19*150c38e8SSumit Garg 20*150c38e8SSumit Garg- edk2: 21*150c38e8SSumit Garg `link <https://github.com/tianocore/edk2>`__ 22*150c38e8SSumit Garg 23*150c38e8SSumit Garg- edk2-platforms: 24*150c38e8SSumit Garg `link <https://github.com/tianocore/edk2-platforms>`__ 25*150c38e8SSumit Garg 26*150c38e8SSumit Garg- edk2-non-osi: 27*150c38e8SSumit Garg `link <https://github.com/tianocore/edk2-non-osi>`__ 28*150c38e8SSumit Garg 29*150c38e8SSumit GargBoot Flow 30*150c38e8SSumit Garg--------- 31*150c38e8SSumit Garg 32*150c38e8SSumit GargSCP firmware --> TF-A BL31 --> UEFI(edk2) 33*150c38e8SSumit Garg 34*150c38e8SSumit GargBuild Procedure 35*150c38e8SSumit Garg--------------- 36*150c38e8SSumit Garg 37*150c38e8SSumit Garg- Firstly, in addition to the “normal” build tools you will also need a 38*150c38e8SSumit Garg few specialist tools. On a Debian or Ubuntu operating system try: 39*150c38e8SSumit Garg 40*150c38e8SSumit Garg .. code:: shell 41*150c38e8SSumit Garg 42*150c38e8SSumit Garg sudo apt install acpica-tools device-tree-compiler uuid-dev 43*150c38e8SSumit Garg 44*150c38e8SSumit Garg- Secondly, create a new working directory and store the absolute path to this 45*150c38e8SSumit Garg directory in an environment variable, WORKSPACE. It does not matter where 46*150c38e8SSumit Garg this directory is created but as an example: 47*150c38e8SSumit Garg 48*150c38e8SSumit Garg .. code:: shell 49*150c38e8SSumit Garg 50*150c38e8SSumit Garg export WORKSPACE=$HOME/build/developerbox-firmware 51*150c38e8SSumit Garg mkdir -p $WORKSPACE 52*150c38e8SSumit Garg 53*150c38e8SSumit Garg- Run the following commands to clone the source code: 54*150c38e8SSumit Garg 55*150c38e8SSumit Garg .. code:: shell 56*150c38e8SSumit Garg 57*150c38e8SSumit Garg cd $WORKSPACE 58*150c38e8SSumit Garg git clone https://github.com/ARM-software/arm-trusted-firmware -b master 59*150c38e8SSumit Garg git clone https://github.com/tianocore/edk2.git -b master 60*150c38e8SSumit Garg git clone https://github.com/tianocore/edk2-platforms.git -b master 61*150c38e8SSumit Garg git clone https://github.com/tianocore/edk2-non-osi.git -b master 62*150c38e8SSumit Garg 63*150c38e8SSumit Garg- Build ATF: 64*150c38e8SSumit Garg 65*150c38e8SSumit Garg .. code:: shell 66*150c38e8SSumit Garg 67*150c38e8SSumit Garg cd $WORKSPACE/arm-trusted-firmware 68*150c38e8SSumit Garg make -j`nproc` PLAT=synquacer PRELOADED_BL33_BASE=0x8200000 bl31 fiptool 69*150c38e8SSumit Garg tools/fiptool/fiptool create \ 70*150c38e8SSumit Garg --tb-fw ./build/synquacer/release/bl31.bin \ 71*150c38e8SSumit Garg --soc-fw ./build/synquacer/release/bl31.bin \ 72*150c38e8SSumit Garg --scp-fw ./build/synquacer/release/bl31.bin \ 73*150c38e8SSumit Garg ../edk2-non-osi/Platform/Socionext/DeveloperBox/fip_all_arm_tf.bin 74*150c38e8SSumit Garg 75*150c38e8SSumit Garg- Build EDK2: 76*150c38e8SSumit Garg 77*150c38e8SSumit Garg .. code:: shell 78*150c38e8SSumit Garg 79*150c38e8SSumit Garg cd $WORKSPACE 80*150c38e8SSumit Garg export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi 81*150c38e8SSumit Garg export ACTIVE_PLATFORM="Platform/Socionext/DeveloperBox/DeveloperBox.dsc" 82*150c38e8SSumit Garg export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- 83*150c38e8SSumit Garg unset ARCH 84*150c38e8SSumit Garg 85*150c38e8SSumit Garg . edk2/edksetup.sh 86*150c38e8SSumit Garg make -C edk2/BaseTools 87*150c38e8SSumit Garg 88*150c38e8SSumit Garg build -p $ACTIVE_PLATFORM -b RELEASE -a AARCH64 -t GCC5 -n `nproc` -D DO_X86EMU=TRUE 89*150c38e8SSumit Garg 90*150c38e8SSumit Garg- The firmware image, which comprises the option ROM, ARM trusted firmware and 91*150c38e8SSumit Garg EDK2 itself, can be found $WORKSPACE/../Build/DeveloperBox/RELEASE_GCC5/FV/. 92*150c38e8SSumit Garg Use SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap for UEFI capsule update and 93*150c38e8SSumit Garg SPI_NOR_IMAGE.fd for the serial flasher. 94*150c38e8SSumit Garg 95*150c38e8SSumit Garg Note #1: -t GCC5 can be loosely translated as “enable link-time-optimization”; 96*150c38e8SSumit Garg any version of gcc >= 5 will support this feature and may be used to build EDK2. 97*150c38e8SSumit Garg 98*150c38e8SSumit Garg Note #2: Replace -b RELEASE with -b DEBUG to build a debug. 99*150c38e8SSumit Garg 100*150c38e8SSumit GargInstall the System Firmware 101*150c38e8SSumit Garg--------------------------- 102*150c38e8SSumit Garg 103*150c38e8SSumit Garg- Providing your Developerbox is fully working and has on operating system 104*150c38e8SSumit Garg installed then you can adopt your the newly compiled system firmware using 105*150c38e8SSumit Garg the capsule update method:. 106*150c38e8SSumit Garg 107*150c38e8SSumit Garg .. code:: shell 108*150c38e8SSumit Garg 109*150c38e8SSumit Garg sudo apt install fwupdate 110*150c38e8SSumit Garg sudo fwupdate --apply {50b94ce5-8b63-4849-8af4-ea479356f0e3} \ 111*150c38e8SSumit Garg SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap 112*150c38e8SSumit Garg sudo reboot 113*150c38e8SSumit Garg 114*150c38e8SSumit Garg- Alternatively you can install SPI_NOR_IMAGE.fd using the `board recovery method`_. 115*150c38e8SSumit Garg 116*150c38e8SSumit Garg.. _link: https://www.96boards.org/product/developerbox/ 117*150c38e8SSumit Garg.. _board recovery method: https://www.96boards.org/documentation/enterprise/developerbox/installation/board-recovery.md.html 118