blob: abc2d2f91171dcf44daf8bbbc621302229402da9 [file] [log] [blame]
Jamie Fox519cc4b2022-06-07 12:07:28 +01001Runtime Security Subsystem (RSS)
2================================
3
4Introduction
5------------
6
7Runtime Security Subsystem (RSS) is an Arm subsystem that provides a reference
8implementation of the HES Host in the
9`Arm Confidential Compute Architecture (CCA) <https://www.arm.com/architecture/security-features/arm-confidential-compute-architecture>`_.
10It is designed to be integrated into A-profile compute subsystems that implement
11Arm CCA, where it serves as the Root of Trust.
12
13RSS initially boots from immutable code (BL1_1) in its internal ROM, before
14jumping to BL1_2, which is provisioned and hash-locked in RSS OTP. The updatable
15MCUBoot BL2 boot stage is loaded from host system flash into RSS SRAM, where it
16is authenticated. BL2 loads and authenticates the TF-M runtime into RSS SRAM
17from host flash. BL2 is also responsible for loading initial boot code into
18other subsystems within the host.
19
Jamie Fox06c09dc2022-06-21 16:06:08 +010020The RSS platform port supports the TF-M Crypto, TF-M Initial Attestation and
21TF-M Platform services along with the corresponding regression tests. It
22supports the IPC model in multi-core topology with Isolation Level 1 and 2.
Jamie Fox519cc4b2022-06-07 12:07:28 +010023
24Building TF-M
25-------------
26
Anton Komlev0dbe8f12022-06-17 16:48:12 +010027Follow the instructions in :doc:`Build instructions </building/tfm_build_instruction>`.
Jamie Fox519cc4b2022-06-07 12:07:28 +010028Build TF-M with platform name: `arm/rss`
29
30``-DTFM_PLATFORM=arm/rss``
31
32Signing host images
33-------------------
34
35RSS BL2 can load boot images into other subsystems within the host system. It
36expects images to be signed, with the signatures attached to the images in the
37MCUBoot metadata format.
38
39The `imgtool Python package <https://pypi.org/project/imgtool/>`_ can be used to
40sign images in the required format. To sign a host image using the development
41key distributed with TF-M, use the following command::
42
43 imgtool sign \
44 -k <TF-M base directory>/bl2/ext/mcuboot/root-RSA-3072.pem \
45 --public-key-format full \
46 --max-align 8 \
47 --align 1 \
48 -v "0.0.1" \
49 -s 1 \
50 -H 0x1000 \
51 --pad-header \
52 -S 0x80000 \
53 --pad \
54 --boot-record "HOST" \
55 -L <load address> \
56 <binary infile> \
57 <signed binary outfile>
58
59The ``load address`` is the address to which BL2 will load the image. The RSS
60ATU should be configured to map this logical address to the physical address in
61the host system that the image needs to be loaded to.
62
63For more information on the ``imgtool`` parameters, see the MCUBoot
64`imgtool documentation <https://docs.mcuboot.com/imgtool.html>`_.
65
66.. warning::
67
68 The TF-M development key must never be used in production. To generate a
69 production key, follow the imgtool documentation.
70
71Running the code
72----------------
73
74To run the built images, they need to be concatenated into binaries that can be
75placed in ROM and flash. To do this, navigate to the TF-M build directory and
76run the following ``srec_cat`` commands::
77
78 srec_cat \
79 bl1_1.bin -Binary -offset 0x0 \
80 bl1_provisioning_bundle.bin -Binary -offset 0xE000 \
81 -o rom.bin -Binary
82
83 srec_cat \
84 bl2_signed.bin -Binary -offset 0x0 \
85 bl2_signed.bin -Binary -offset 0x20000 \
86 tfm_s_ns_signed.bin -Binary -offset 0x40000 \
87 tfm_s_ns_signed.bin -Binary -offset 0x140000 \
88 <Host AP BL1 image> -Binary -offset 0x240000 \
89 <SCP BL1 image> -Binary -offset 0x2C0000 \
90 <Host AP BL1 image> -Binary -offset 0x340000 \
91 <SCP BL1 image> -Binary -offset 0x3C0000 \
92 -o flash.bin -Binary
93
94For development purposes, the OTP image is included as a provisioning bundle in
95the ROM image and provisioned into OTP by BL1_1. The flash image should include
96the signed host images from the previous section. For each boot image, there is
97a primary and secondary image; if these are different then BL2 will load the one
98with the higher version number.
99
100The ROM binary should be placed in RSS ROM at ``0x11000000`` and the flash
101binary should be placed at ``0x31000000``.
102
103--------------
104
105*Copyright (c) 2022, Arm Limited. All rights reserved.*