Skip to content

Commit e089e6e

Browse files
Merge pull request #1918 from khalid-saadi/main
Run and Debug Linux Software Stack on Arm Fixed Virtual Platforms
2 parents feb2429 + 5e87d3d commit e089e6e

17 files changed

Lines changed: 814 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Introduction to Arm Ecosystem Fixed Virtual Platforms
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
Arm Ecosystem Fixed Virtual Platforms (FVPs) model hardware subsystems target different market segments and applications.
10+
11+
FVPs use binary translation technology to deliver fast, functional simulations of Arm-based systems, including processor, memory, and peripherals. They implement a programmer's view suitable for software development and enable execution of full software stacks, providing a widely available platform ahead of silicon.
12+
13+
Arm provides different types of FVPs. There are several freely available, pre-built Armv8‑A FVPs for download from [Arm Ecosystem Models](https://developer.arm.com/Tools%20and%20Software/Fixed%20Virtual%20Platforms) on Arm Developer website. You can use these FVPs without a license. For example, the AEMv8-A Base Platform RevC FVP is freely available, and it supports the latest Armv8‑A architecture versions up to v8.7 and Armv9-A.
14+
15+
The [Arm reference software stack](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) is based on the above RevC model. However, some Armv8 FVPs with a fixed number of cores are replaced by FVPs with a configurable number of cores, for example:
16+
17+
* FVP_Base_Cortex-A55x4
18+
* FVP_Base_Cortex-A78x4
19+
* FVP_Base_Cortex-X1x4
20+
* FVP_Base_Cortex-X2x4
21+
* FVP_Base_Cortex-A78AEx2
22+
* FVP_Base_Cortex-A76x4
23+
* FVP_Base_Neoverse-N2x1
24+
* FVP_Base_Neoverse-N1x4
25+
* FVP_Base_Cortex-A510x4
26+
* FVP_Base_Cortex-A53x4
27+
* FVP_Base_Cortex-A76x4
28+
29+
### Set up the environment
30+
31+
The [Arm reference software](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) stack is the codebase. Follow the [Armv-A Base AEM FVP Platform Software User Guide](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) to set up the environment, download the software stack, and get the toolchain.
32+
33+
he FVP_Base_Cortex-\<xxx> FVP is available for you to build and run Linux host environments. Contact Arm Support [support@arm.com](mailto:support@arm.com) to request access.
34+
35+
This document supports running the software stack on the following FVPs:
36+
37+
* FVP_Base_Cortex-A510x4
38+
* FVP_Base_Cortex-A510x4+Cortex-A710x4
39+
* FVP_Base_Cortex-A53x4
40+
* FVP_Base_Cortex-A55x4
41+
* FVP_Base_Cortex-A55x4+Cortex-A75x4
42+
* FVP_Base_Cortex-A55x4+Cortex-A78x4
43+
* FVP_Base_Cortex-A57x2-A35x4
44+
* FVP_Base_Cortex-A57x2-A53x4
45+
* FVP_Base_Cortex-A57x4
46+
* FVP_Base_Cortex-A57x4-A35x4
47+
* FVP_Base_Cortex-A57x4-A53x4
48+
* FVP_Base_Cortex-A65AEx4
49+
* FVP_Base_Cortex-A65AEx4+Cortex-A76AEx4
50+
* FVP_Base_Cortex-A65x4
51+
* FVP_Base_Cortex-A710x4
52+
* FVP_Base_Cortex-A72x2-A53x4
53+
* FVP_Base_Cortex-A72x4
54+
* FVP_Base_Cortex-A72x4-A53x4
55+
* FVP_Base_Cortex-A73x2-A53x4
56+
* FVP_Base_Cortex-A73x4
57+
* FVP_Base_Cortex-A73x4-A53x4
58+
* FVP_Base_Cortex-A75x4
59+
* FVP_Base_Cortex-A76AEx4
60+
* FVP_Base_Cortex-A76x4
61+
* FVP_Base_Cortex-A77x4
62+
* FVP_Base_Cortex-A78AEx4
63+
* FVP_Base_Cortex-A78Cx4
64+
* FVP_Base_Cortex-A78x4
65+
* FVP_Base_Cortex-X1Cx4
66+
* FVP_Base_Cortex-X1x4
67+
* FVP_Base_Cortex-X2x4
68+
* FVP_Base_Neoverse-E1x4
69+
* FVP_Base_Neoverse-N1x4
70+
71+
However, this is not a full list. This blog might apply to more FVP platforms, but no test is done for these platforms, for example:
72+
73+
* FVP_Base_Cortex-A55x1
74+
* FVP_Base_Cortex-A55x2
75+
* FVP_Base_Cortex-A55x1+Cortex-A75x1
76+
* FVP_Base_Cortex-A55x4+Cortex-A76x2
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Set up the environment
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
The [Arm reference software](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) stack is the codebase. Follow the [Armv-A Base AEM FVP Platform Software User Guide](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) to set up the environment, download the software stack, and get the toolchain.
10+
11+
he FVP_Base_Cortex-\<xxx> FVP is available for you to build and run Linux host environments. Contact Arm Support [support@arm.com](mailto:support@arm.com) to request access.
12+
13+
This document supports running the software stack on the following FVPs:
14+
15+
* FVP_Base_Cortex-A510x4
16+
* FVP_Base_Cortex-A510x4+Cortex-A710x4
17+
* FVP_Base_Cortex-A53x4
18+
* FVP_Base_Cortex-A55x4
19+
* FVP_Base_Cortex-A55x4+Cortex-A75x4
20+
* FVP_Base_Cortex-A55x4+Cortex-A78x4
21+
* FVP_Base_Cortex-A57x2-A35x4
22+
* FVP_Base_Cortex-A57x2-A53x4
23+
* FVP_Base_Cortex-A57x4
24+
* FVP_Base_Cortex-A57x4-A35x4
25+
* FVP_Base_Cortex-A57x4-A53x4
26+
* FVP_Base_Cortex-A65AEx4
27+
* FVP_Base_Cortex-A65AEx4+Cortex-A76AEx4
28+
* FVP_Base_Cortex-A65x4
29+
* FVP_Base_Cortex-A710x4
30+
* FVP_Base_Cortex-A72x2-A53x4
31+
* FVP_Base_Cortex-A72x4
32+
* FVP_Base_Cortex-A72x4-A53x4
33+
* FVP_Base_Cortex-A73x2-A53x4
34+
* FVP_Base_Cortex-A73x4
35+
* FVP_Base_Cortex-A73x4-A53x4
36+
* FVP_Base_Cortex-A75x4
37+
* FVP_Base_Cortex-A76AEx4
38+
* FVP_Base_Cortex-A76x4
39+
* FVP_Base_Cortex-A77x4
40+
* FVP_Base_Cortex-A78AEx4
41+
* FVP_Base_Cortex-A78Cx4
42+
* FVP_Base_Cortex-A78x4
43+
* FVP_Base_Cortex-X1Cx4
44+
* FVP_Base_Cortex-X1x4
45+
* FVP_Base_Cortex-X2x4
46+
* FVP_Base_Neoverse-E1x4
47+
* FVP_Base_Neoverse-N1x4
48+
49+
However, this is not a full list. This blog might apply to more FVP platforms, but no test is done for these platforms, for example:
50+
51+
* FVP_Base_Cortex-A55x1
52+
* FVP_Base_Cortex-A55x2
53+
* FVP_Base_Cortex-A55x1+Cortex-A75x1
54+
* FVP_Base_Cortex-A55x4+Cortex-A76x2
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Use TF-A extra build options to build cpu_ops into images
3+
weight: 4
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
### 1. Why build cpu_ops into images
10+
11+
If you build the software without any modification, you might get the following error message after running the software stack:
12+
13+
```
14+
ASSERT: File lib/cpus/aarch64/cpu_helpers.S Line 00035
15+
```
16+
17+
The previous error message is issued because the TF-A does not build the cpu_ops into the images:
18+
19+
```
20+
31 /* Get the matching cpu_ops pointer */
21+
22+
32 bl get_cpu_ops_ptr
23+
24+
33 #if ENABLE_ASSERTIONS
25+
26+
34 cmp x0, #0
27+
28+
35 ASM_ASSERT(ne)
29+
30+
36 #endif
31+
```
32+
33+
34+
The cpu_ops are defined in the source file as follows:
35+
36+
```
37+
lib/cpus/aarch64/cortex_a510.S
38+
lib/cpus/aarch64/cortex_a53.S
39+
lib/cpus/aarch64/cortex_a55.S
40+
lib/cpus/aarch64/cortex_a57.S
41+
lib/cpus/aarch64/cortex_a65.S
42+
lib/cpus/aarch64/cortex_a65ae.S
43+
lib/cpus/aarch64/cortex_a710.S
44+
lib/cpus/aarch64/cortex_a715.S
45+
lib/cpus/aarch64/cortex_a72.S
46+
lib/cpus/aarch64/cortex_a73.S
47+
```
48+
49+
Check the Makefile (plat/arm/board/fvp/platform.mk) of the FVP platform. You can find the following code:
50+
51+
```
52+
ifeq (${HW_ASSISTED_COHERENCY}, 0)
53+
# Cores used without DSU
54+
FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a35.S \
55+
lib/cpus/aarch64/cortex_a53.S \
56+
lib/cpus/aarch64/cortex_a57.S \
57+
lib/cpus/aarch64/cortex_a72.S \
58+
lib/cpus/aarch64/cortex_a73.S
59+
else
60+
# Cores used with DSU only
61+
ifeq (${CTX_INCLUDE_AARCH32_REGS}, 0)
62+
# AArch64-only cores
63+
FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a76.S \
64+
lib/cpus/aarch64/cortex_a76ae.S \
65+
lib/cpus/aarch64/cortex_a77.S \
66+
lib/cpus/aarch64/cortex_a78.S \
67+
lib/cpus/aarch64/neoverse_n_common.S \
68+
lib/cpus/aarch64/neoverse_n1.S \
69+
lib/cpus/aarch64/neoverse_n2.S \
70+
lib/cpus/aarch64/neoverse_e1.S \
71+
lib/cpus/aarch64/neoverse_v1.S \
72+
lib/cpus/aarch64/neoverse_v2.S \
73+
lib/cpus/aarch64/cortex_a78_ae.S \
74+
lib/cpus/aarch64/cortex_a510.S \
75+
lib/cpus/aarch64/cortex_a710.S \
76+
lib/cpus/aarch64/cortex_a715.S \
77+
lib/cpus/aarch64/cortex_x3.S \
78+
lib/cpus/aarch64/cortex_a65.S \
79+
lib/cpus/aarch64/cortex_a65ae.S \
80+
lib/cpus/aarch64/cortex_a78c.S \
81+
lib/cpus/aarch64/cortex_hayes.S \
82+
lib/cpus/aarch64/cortex_hunter.S \
83+
lib/cpus/aarch64/cortex_x2.S \
84+
lib/cpus/aarch64/neoverse_poseidon.S
85+
endif
86+
# AArch64/AArch32 cores
87+
FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a55.S \
88+
lib/cpus/aarch64/cortex_a75.S
89+
endif
90+
```
91+
92+
HW_ASSISTED_COHERENCY = 0 and CTX_INCLUDE_AARCH32_REGS =1 are default build options.
93+
94+
### 2. Required build options
95+
96+
Building the cpu_ops into the TF-A image requires different build options, depending on the CPU type. For example, different platforms require different build options when building the TF-A:
97+
98+
* For the A55 CPU FVP, add the HW_ASSISTED_COHERENCY=1 and USE_COHERENT_MEM=0 build options.
99+
* For the A78 CPU FVP, add the HW_ASSISTED_COHERENCY=1, USE_COHERENT_MEM=0, and CTX_INCLUDE_AARCH32_REGS=0 build options.
100+
* For the A53 CPU FVP, you do not need extra build options.
101+
102+
Note: The build option USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY=1.
103+
104+
105+
### 3. Steps to build cpu_ops into the TF-A image
106+
107+
Perform the following steps to build cpu_ops into the TF-A image:
108+
109+
3.1 Modify the following build script to add build options. The [Arm reference software stack](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) uses the [build-scripts](https://gitlab.arm.com/arm-reference-solutions/build-scripts) to build the TF-A.
110+
111+
```
112+
build-scripts/ configs/aemfvp-a/aemfvp-a
113+
```
114+
115+
3.2 Add TF-A build options, depending on the CPU type. For example:
116+
117+
* For A55 CPU FVP, add the following line:
118+
119+
```
120+
ARM_TF_BUILD_FLAGS="$ARM_TF_BUILD_FLAGS HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 "
121+
```
122+
123+
* For A78 CPU FVP, add the following line:
124+
125+
```
126+
ARM_TF_BUILD_FLAGS="$ARM_TF_BUILD_FLAGS HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 CTX_INCLUDE_AARCH32_REGS=0"
127+
```
128+
129+
3.3 Rebuild the TF-A by using the following commands:
130+
131+
```
132+
./build-scripts/build-arm-tf.sh -p aemfvp-a -f busybox clean
133+
134+
./build-scripts/build-arm-tf.sh -p aemfvp-a -f busybox build
135+
```
136+
137+
3.4 Package the built TF-A into the BusyBox disk image by using the following command:
138+
139+
```
140+
./build-scripts/aemfvp-a/build-test-busybox.sh -p aemfvp-a package
141+
```
142+

0 commit comments

Comments
 (0)