@@ -10,35 +7,9 @@ Total Compute is an approach to moving beyond optimizing individual IP to take a
Total Compute focuses on optimizing Performance, Security, and Developer Access across Arm’s IP, software, and tools. This means higher-performing, more immersive, and more secure experiences on devices coupled with an easier app and software development process.
Instructions: Obtaining Total Compute software deliverables
* To build the TC0 software stack please refer to :ref:`user-guide <docs/totalcompute/tc0/user-guide>`
* For the list of changes and features added please refer to :ref:`change-log <docs/totalcompute/tc0/change-log>`
* For further details on the latest release and features please refer to :ref:`release_notes <docs/totalcompute/tc0/release_notes>`
TC Software Stack Overview
--------------------------
The TC0 software consists of firmware, kernel and file system components that can run on the associated FVP.
Following are the Software components:
#. SCP firmware – System initialization, Clock and Power control
#. AP firmware – Arm Trusted firmware
#. Secure Partition Manager
#. Secure Partitions
* OP-TEE Trusted OS
* Trusted Services with Shim layer
#. U-Boot – loads and verifies the fitImage for poky boot, containing kernel and filesystem or boot Image for Android Verified Boot, containing kernel and ramdisk.
#. Kernel – supports the following hardware features
* To build the TC0 software stack please refer to :ref:`user-guide <docs/totalcompute/tc0/user-guide>`
* For the list of changes and features added please refer to :ref:`change-log <docs/totalcompute/tc0/change-log>`
* For further details on the latest release and features please refer to :ref:`release_notes <docs/totalcompute/tc0/release_notes>`
TC Software Stack Overview
--------------------------
The TC0 software consists of firmware, kernel and file system components that can run on the associated FVP.
Following are the Software components:
#. SCP firmware – System initialization, Clock and Power control
#. AP firmware – Trusted Firmware-A (TF-A)
#. Secure Partition Manager
#. Secure Partitions
* OP-TEE Trusted OS
* Trusted Services with Shim layer
#. U-Boot – loads and verifies the fitImage for poky boot, containing kernel and filesystem or boot Image for Android Verified Boot, containing kernel and ramdisk.
#. Kernel – supports the following hardware features
The System Control Processor (SCP) is a compute unit of Total Compute and is responsible for low-level system management. The SCP is a Cortex-M3 processor with a set of dedicated peripherals and interfaces that you can extend.
SCP firmware supports:
#. Powerup sequence and system start-up
#. Initial hardware configuration
#. Clock management
...
...
@@ -19,6 +23,7 @@ SCP Boot ROM
............
SCP Boot ROM code is the first software that executes right after a cold reset or Power-on.
It performs the following functions:
#. Sets up generic timer, UART console and clocks
#. Initializes the Coherent Interconnect
#. Powers ON primary AP CPU
...
...
@@ -28,6 +33,7 @@ SCP Runtime Firmware
....................
SCP runtime code starts execution after TF-A BL2 has authenticated and copied it from flash.
It performs the following functions:
#. Responds to SCMI messages via MHUv2 for CPU power control and DVFS
#. Power Domain management
#. Clock management
...
...
@@ -40,12 +46,12 @@ AP firmware
...........
The AP firmware consists of the code that is required to boot Total Compute platform up the point where the OS execution starts. This firmware performs architecture and platform initialization. It also loads and initializes secure world images like Secure partition manager and Trusted OS.
Arm Trusted firmware BL1
++++++++++++++++++++++++
Trusted Firmware-A (TF-A) BL1
+++++++++++++++++++++++++++++
AP Trusted ROM contains an on-chip trusted ROM that runs the boot code on Total Compute platform. BL1 performs minimal architectural initialization (like exception vectors, CPU initialization) and Platform initialization. It loads the BL2 image and passes control to it.
Arm Trusted firmware BL2
++++++++++++++++++++++++
Trusted Firmware-A (TF-A) BL2
+++++++++++++++++++++++++++++
BL2 runs at S-EL1 and performs architectural initialization required for subsequent stages of TF-A and normal world software. It configures the TrustZone Controller and carves out memory region in DRAM for secure and non-secure use. BL2 loads below images:
#. SCP BL2 image
...
...
@@ -54,8 +60,8 @@ BL2 runs at S-EL1 and performs architectural initialization required for subsequ
#. Non-Trusted firmware - U-boot (BL33 image)
#. Secure Partitions images (OP-TEE and Trusted Services)
Arm Trusted firmware BL31
+++++++++++++++++++++++++
Trusted Firmware-A (TF-A) BL31
++++++++++++++++++++++++++++++
BL2 loads EL3 Runtime Software (BL31) and BL1 passes control to BL31 at EL3. In Total Compute BL31 runs at trusted SRAM. It provides below mentioned runtime services:
#. Power State Coordination Interface (PSCI)
...
...
@@ -98,6 +104,7 @@ Android
-------
Total Compute has support for Android Open-Source Project (AOSP), which contains the Android framework, Native Libraries, Android Runtime and the Hardware Abstraction Layers (HALs) for Android Operating system.
The Total Compute device profile defines the required variables for Android such as partition size and product packages and has support for 2 different configurations of Android:
#. Nano: This is a stripped-down version to provide the bare minimum for Android Runtime and boot Android to console. It does not have Android UI support.
#. Software rendering: This profile has support for Android UI and boots Android to home screen. It uses SwiftShader to achieve this. Swiftshader is a CPU base implementation of the Vulkan graphics API by Google.
* To build the TC1 software stack please refer to :ref:`user-guide <docs/totalcompute/tc1/user-guide>`
* For the list of changes and features added please refer to :ref:`change-log <docs/totalcompute/tc1/change-log>`
* For further details on the latest release and features please refer to :ref:`release_notes <docs/totalcompute/tc1/release_notes>`
TC Software Stack Overview
--------------------------
The TC1 software consists of firmware, kernel and file system components that can run on the associated FVP.
Following are the Software components:
#. SCP firmware – System initialization, Clock and Power control
#. AP firmware – Trusted Firmware-A (TF-A)
#. Secure Partition Manager
#. Secure Partitions
* OP-TEE Trusted OS
* Trusted Services with Shim layer
#. U-Boot – loads and verifies the fitImage for poky boot, containing kernel and filesystem or boot Image for Android Verified Boot, containing kernel and ramdisk.
#. Kernel – supports the following hardware features
The System Control Processor (SCP) is a compute unit of Total Compute and is responsible for low-level system management. The SCP is a Cortex-M3 processor with a set of dedicated peripherals and interfaces that you can extend.
SCP firmware supports:
#. Powerup sequence and system start-up
#. Initial hardware configuration
#. Clock management
#. Servicing power state requests from the OS Power Management (OSPM) software
SCP Boot ROM
............
SCP Boot ROM code is the first software that executes right after a cold reset or Power-on.
It performs the following functions:
#. Sets up generic timer, UART console and clocks
#. Initializes the Coherent Interconnect
#. Powers ON primary AP CPU
#. Loads SCP Runtime Firmware
SCP Runtime Firmware
....................
SCP runtime code starts execution after TF-A BL2 has authenticated and copied it from flash.
It performs the following functions:
#. Responds to SCMI messages via MHUv2 for CPU power control and DVFS
#. Power Domain management
#. Clock management
Secure Software
---------------
Secure software/firmware is a trusted software component that runs in the AP secure world. It mainly consists of AP firmware, Secure Partition Manager and Secure Partitions (OP-TEE, Trusted Services).
AP firmware
...........
The AP firmware consists of the code that is required to boot Total Compute platform up the point where the OS execution starts. This firmware performs architecture and platform initialization. It also loads and initializes secure world images like Secure partition manager and Trusted OS.
Trusted Firmware-A (TF-A) BL1
+++++++++++++++++++++++++++++
AP Trusted ROM contains an on-chip trusted ROM that runs the boot code on Total Compute platform. BL1 performs minimal architectural initialization (like exception vectors, CPU initialization) and Platform initialization. It loads the BL2 image and passes control to it.
Trusted Firmware-A (TF-A) BL2
+++++++++++++++++++++++++++++
BL2 runs at S-EL1 and performs architectural initialization required for subsequent stages of TF-A and normal world software. It configures the TrustZone Controller and carves out memory region in DRAM for secure and non-secure use. BL2 loads below images:
#. SCP BL2 image
#. EL3 Runtime Software (BL31 image)
#. Secure Partition Manager (BL32 image)
#. Non-Trusted firmware - U-boot (BL33 image)
#. Secure Partitions images (OP-TEE and Trusted Services)
Trusted Firmware-A (TF-A) BL31
++++++++++++++++++++++++++++++
BL2 loads EL3 Runtime Software (BL31) and BL1 passes control to BL31 at EL3. In Total Compute BL31 runs at trusted SRAM. It provides below mentioned runtime services:
#. Power State Coordination Interface (PSCI)
#. Secure Monitor framework
#. Secure Partition Manager Dispatcher
Secure Partition Manager
........................
Total Compute enables FEAT S-EL2 architectural extension, and it uses Hafnium as Secure Partition Manager Core (SPMC). BL32 option in TF-A is re-purposed to specify the SPMC image. The SPMC component runs at S-EL2 exception level.
Secure Partitions
.................
Software image isolated using SPM is Secure Partition. Total Compute enables OP-TEE and Trusted Services (crypto, secure storage) as Secure Partitions.
OP-TEE
++++++
OP-TEE Trusted OS is virtualized using Hafnium at S-EL2. OP-TEE OS for Total Compute is built with FFA and SEL2 SPMC support. This enables OP-TEE as a Secure Partition running in an isolated address space managed by Hafnium. The OP-TEE kernel runs at S-EL1 with Trusted applications running at S-EL0.
Trusted Services
++++++++++++++++
Trusted Services like Crypto Service and Secure Storage runs as S-EL0 Secure Partitions using a Shim layer at S-EL1. Crypto Service along with S-EL1 Shim layer is built as a single image. The Shim layer forwards FF-A calls from S-EL0 to S-EL2.
U-Boot
------
TF-A BL31 passes execution control to U-boot bootloader (BL33). U-boot in Total Compute has support for multiple image formats:
#. FitImage format: this contains the Linux kernel and poky ramdisk which are authenticated and loaded in their respective positions in DRAM and execution is handed off to the kernel.
#. Android boot image: This contains the Linux kernel and Android ramdisk. If using Android Verified Boot (AVB) boot.img is loaded from MMC to DRAM, authenticated and then execution is handed off to the kernel.
Kernel
------
Linux Kernel in Total Compute contains the subsystem-specific features that demonstrate the capabilities of Total Compute. Apart from default configuration, it enables:
#. Arm MHUv2 controller driver
#. Arm FF-A driver
#. OP-TEE driver with FF-A Transport Support
#. Arm FF-A user space interface driver
Android
-------
Total Compute has support for Android Open-Source Project (AOSP), which contains the Android framework, Native Libraries, Android Runtime and the Hardware Abstraction Layers (HALs) for Android Operating system.
The Total Compute device profile defines the required variables for Android such as partition size and product packages and has support for 2 different configurations of Android:
#. Nano: This is a stripped-down version to provide the bare minimum for Android Runtime and boot Android to console. It does not have Android UI support.
#. Software rendering: This profile has support for Android UI and boots Android to home screen. It uses SwiftShader to achieve this. Swiftshader is a CPU base implementation of the Vulkan graphics API by Google.
If syncing and building android, the minimum requirements for the host machine can be found at https://source.android.com/setup/build/requirements, These include:
* At least 250GB of free disk space to check out the code and an extra 150 GB to build it. If you conduct multiple builds, you need additional space.
* At least 16 GB of available RAM/swap.
* Git configured properly using "git config" otherwise it may throw error while fetching the code.
Syncing and building the source code
------------------------------------
There are two distros supported in the TC1 software stack: poky (a minimal distro containing busybox) and android.
To sync code for poky, please follow the steps in "Syncing code" section for BSP only. To sync code for android, please follow the steps for syncing both BSP and Android.
To build the required binaries for poky, please follow the steps in "Board Support Package build" section only. To build the binaries for Android, please follow the steps in both "Board Support Package build" and "Android OS build" sections.
Syncing code
#####################
Create a new folder that will be your workspace, which will henceforth be referred to as ``<tc1_workspace>``
in these instructions.
::
mkdir <tc1_workspace>
cd <tc1_workspace>
export TC1_RELEASE=refs/tags/TC1-2021.08.17
To sync BSP only without Android, run the repo command.
The initial clean build will be lengthy, given that all host utilities are to be built as well as
the target images. This includes host programs (python, cmake, etc.) and the required toolchain(s).
Once the build is successful, all images will be placed in the ``<tc1_workspace>/bsp/build-poky/tmp-poky/deploy/images/tc1``
directory.
Note that the BSP includes the Poky Linux distribution, which offers BusyBox-like utilities.
Android OS build
#################
Two profiles are supported:
#. tc1_swr : This supports Android display with swiftshader (software rendering).
#. tc1_nano : This supports headless Android and provides a good runtime environment for testing shell-based applications.
The android images can be built with or without authentication enabled using Android Verified Boot(AVB).
AVB build is done in userdebug mode and takes a longer time to boot as the images are verified.
The ``build-scripts/tc1/build_android.sh`` script in ``<tc1_workspace>/android`` will patch and build android. This can be passed 2 parameters, ``-d`` for deciding which profile to build and ``-a`` for enabling AVB. The following command shows the help menu for the script:
Android based stack takes considerable time to build, so start the build and go grab a cup of coffee!
Provided components
-------------------
Within the Yocto project, each component included in the TC1 software stack is specified as
a `Bitbake recipe <https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#recipes>`__.
The TC1 recipes are located at ``<tc1_workspace>/bsp/layers/meta-arm/``.
Yocto allows modifying the fetched source code of each recipe component in the
workspace, by applying patches. This is however not a convenient approach for
developers, since creating patches and updating recipes is time-consuming.
To make that easier, Yocto provides the `devtool <https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe>`__ utility. Devtool creates a
new workspace, in which you can edit the fetched source code and bake images