aboutsummaryrefslogtreecommitdiff
path: root/docs/components/rme/rme-userguide.rst
blob: ba03bba9f792ebd2e9b7523909c8e3e52d83513e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
RME Enabled TF-A userguide
=================================

Prerequisites
--------------

To evaluate |RME|, first follow the instructions as described in the |TF-A|
:ref:`Getting Started` section to clone the repository and setup the build
environment. This should setup the required software libraries and toolchain
for the build. Specifically, ensure that the environment variable
``CROSS_COMPILE`` is setup correctly.

Next, similar to the |TF-A| approach, follow the instructions as described
in the `TF-A Tests Getting Started`_ for the pre-requisites.

At this point, we should be left with two directories, |TF-A| and |TF-A-Tests|.

.. code:: shell

    ls
    tf-a-tests  trusted-firmware-a

Getting the sources
--------------------------

The source code for |RME| is currently maintained as a branch in the |TF-A| git
repository hosted on `trustedfirmware.org`_. To checkout this branch, execute the
following commands:

.. code:: shell

    cd trusted-firmware-a
    git checkout topics/rme_prototype

Similarly, checkout the appropriate branch for |TF-A-Tests|:

.. code:: shell

    cd tf-a-tests
    git checkout topics/rme_prototype


Building the sources
---------------------

To build the |TF-A-Tests| source, follow the instructions to build for the
FVP as described in `Building TF-A Tests`_. An example command is shown below:

.. code:: shell

    cd tf-a-tests
    make PLAT=fvp DEBUG=1 USE_NVM=0 SHELL_COLOR=1 tftf

This should generate the tftf.bin binary which can be passed as BL33 while building |TF-A|.

Finally, to build |TF-A| execute the following commands:

.. code:: shell

    cd trusted-firmware-a
    make ARCH=aarch64 PLAT=fvp ARM_DISABLE_TRUSTED_WDOG=1 ENABLE_RME=1 DEBUG=1 BL33=../tf-a-tests/build/fvp/debug/tftf.bin FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts all fip

This builds |TF-A| with |TF-A-Tests| as Normal world payload (BL33) and adds the
Test Realm payload (TRP) as BL32 image.


Executing on ARM |FVP|
-----------------------

In order to run on the FVP, please download an RME enabled FVP model through
`Arm FVP website`_ (expected availability by end of July 2021). Refer
:ref:`Arm Fixed Virtual Platforms (FVP)` for details about running the model.

To launch the Armv-A Base RevC AEM FVP, execute the following command:

.. code:: shell

    ./FVP_Base_RevC-2xAEMvA \
    -C bp.dram_size=2 \
    -C bp.pl011_uart0.uart_enable=1 \
    -C bp.pl011_uart1.uart_enable=1 \
    -C bp.pl011_uart2.uart_enable=1 \
    -C bp.refcounter.non_arch_start_at_default=1 \
    -C bp.refcounter.use_real_time=0 \
    -C bp.secure_memory=1 \
    -C cache_state_modelled=1 \
    -C cluster0.ecv_support_level=2 \
    -C cluster1.ecv_support_level=2 \
    -C cluster0.gicv3.cpuintf-mmap-access-level=2 \
    -C cluster1.gicv3.cpuintf-mmap-access-level=2 \
    -C cluster0.gicv4.mask-virtual-interrupt=1 \
    -C cluster1.gicv4.mask-virtual-interrupt=1 \
    -C cluster0.gicv3.without-DS-support=1 \
    -C cluster1.gicv3.without-DS-support=1 \
    -C cluster0.has_arm_v8-4=1 \
    -C cluster1.has_arm_v8-4=1 \
    -C cluster0.has_rme=1 \
    -C cluster1.has_rme=1 \
    -C cluster0.has_rndr=1 \
    -C cluster1.has_rndr=1 \
    -C cluster0.has_v8_7_pmu_extension=2 \
    -C cluster1.has_v8_7_pmu_extension=2 \
    -C cluster0.max_32bit_el=-1 \
    -C cluster1.max_32bit_el=-1 \
    -C cluster0.NUM_CORES=4 \
    -C cluster1.NUM_CORES=4 \
    -C cluster0.PA_SIZE=48 \
    -C cluster1.PA_SIZE=48 \
    -C bp.flashloader0.fname=<path to fip.bin> \
    -C bp.secureflashloader.fname=<path to bl1.bin>

Details of the |TF-A-Tests| for Realm world
---------------------------------------------

The |TF-A-Tests| adds a new testsuite "Realm payload tests". This implements
a simple test payload which just initializes the memory and UART. The payload
also implements a handler which can respond to few RMI calls initiated
by the testsuite.

The log for the testsuite should appear as part of the results summary:

.. code-block:: shell

    ******************************* Summary *******************************

    > Test suite 'Realm payload tests'			   	     Passed


Known limitations of the prototype
-----------------------------------

This is a prototype to bootstrap TF-A on an RME enabled FVP. It replaces the
secure world payload with Realm world binary. Currently, due to prototype nature
of the code changes, all the appropriate cache maintenance operations are not done
and hence the cache state modelling is disabled when running on the FVP. Further,
the Granule protection table (GPT) initialization sequence is a work in progress
(although functional).

--------------

*Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.*

.. _Arm FVP website: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
.. _trustedfirmware.org: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io
.. _TF-A Tests Getting Started: https://trustedfirmware-a-tests.readthedocs.io/en/latest/getting_started/index.html
.. _Building TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io/en/latest/getting_started/build.html