blob: 413f1356c3d3ba83cac8a7db8fb9b8065e6c708e [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
20This platform port currently supports all TF-M regression tests (Secure and
21Non-secure) using the IPC model with Isolation Level 1 and 2.
22
23Building TF-M
24-------------
25
Anton Komlev0dbe8f12022-06-17 16:48:12 +010026Follow the instructions in :doc:`Build instructions </building/tfm_build_instruction>`.
Jamie Fox519cc4b2022-06-07 12:07:28 +010027Build TF-M with platform name: `arm/rss`
28
29``-DTFM_PLATFORM=arm/rss``
30
31Signing host images
32-------------------
33
34RSS BL2 can load boot images into other subsystems within the host system. It
35expects images to be signed, with the signatures attached to the images in the
36MCUBoot metadata format.
37
38The `imgtool Python package <https://pypi.org/project/imgtool/>`_ can be used to
39sign images in the required format. To sign a host image using the development
40key distributed with TF-M, use the following command::
41
42 imgtool sign \
43 -k <TF-M base directory>/bl2/ext/mcuboot/root-RSA-3072.pem \
44 --public-key-format full \
45 --max-align 8 \
46 --align 1 \
47 -v "0.0.1" \
48 -s 1 \
49 -H 0x1000 \
50 --pad-header \
51 -S 0x80000 \
52 --pad \
53 --boot-record "HOST" \
54 -L <load address> \
55 <binary infile> \
56 <signed binary outfile>
57
58The ``load address`` is the address to which BL2 will load the image. The RSS
59ATU should be configured to map this logical address to the physical address in
60the host system that the image needs to be loaded to.
61
62For more information on the ``imgtool`` parameters, see the MCUBoot
63`imgtool documentation <https://docs.mcuboot.com/imgtool.html>`_.
64
65.. warning::
66
67 The TF-M development key must never be used in production. To generate a
68 production key, follow the imgtool documentation.
69
70Running the code
71----------------
72
73To run the built images, they need to be concatenated into binaries that can be
74placed in ROM and flash. To do this, navigate to the TF-M build directory and
75run the following ``srec_cat`` commands::
76
77 srec_cat \
78 bl1_1.bin -Binary -offset 0x0 \
79 bl1_provisioning_bundle.bin -Binary -offset 0xE000 \
80 -o rom.bin -Binary
81
82 srec_cat \
83 bl2_signed.bin -Binary -offset 0x0 \
84 bl2_signed.bin -Binary -offset 0x20000 \
85 tfm_s_ns_signed.bin -Binary -offset 0x40000 \
86 tfm_s_ns_signed.bin -Binary -offset 0x140000 \
87 <Host AP BL1 image> -Binary -offset 0x240000 \
88 <SCP BL1 image> -Binary -offset 0x2C0000 \
89 <Host AP BL1 image> -Binary -offset 0x340000 \
90 <SCP BL1 image> -Binary -offset 0x3C0000 \
91 -o flash.bin -Binary
92
93For development purposes, the OTP image is included as a provisioning bundle in
94the ROM image and provisioned into OTP by BL1_1. The flash image should include
95the signed host images from the previous section. For each boot image, there is
96a primary and secondary image; if these are different then BL2 will load the one
97with the higher version number.
98
99The ROM binary should be placed in RSS ROM at ``0x11000000`` and the flash
100binary should be placed at ``0x31000000``.
101
102--------------
103
104*Copyright (c) 2022, Arm Limited. All rights reserved.*