Commit graph

25 commits

Author SHA1 Message Date
Boyan Karatotev
b62673c645 refactor(cpus): register DSU errata with the errata framework's wrappers
The existing DSU errata workarounds hijack the errata framework's inner
workings to register with it. However, that is undesirable as any change
to the framework may end up missing these workarounds. So convert the
checks and workarounds to macros and have them included with the
standard wrappers.

The only problem with this is the is_scu_present_in_dsu weak function.
Fortunately, it is only needed for 2 of the errata and only on 3 cores.
So drop it, assuming the default behaviour and have the callers handle
the exception.

Change-Id: Iefa36325804ea093e938f867b9a6f49a6984b8ae
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 17:28:17 +00:00
Kun Qin
648d2d8e2d feat(qemu): add hob support for qemu platforms
This change introduces the hob support for both qemu platforms (virt and
sbsa).

As the hob list feature relies on transfer list, the transfer list
support is promoted to common qemu build configuration. The platforms
specific definitions are updated accordingly.

Change-Id: I473d83388fe95408d34515bf7bcbdd64ce4e777d
Signed-off-by: Kun Qin <kuqin@microsoft.com>
2025-01-31 01:07:06 -08:00
Olivier Deprez
696ed16877 fix(build): include platform mk earlier
Move platform.mk inclusion in top level Makefile to permit a platform
specifying BRANCH_PROTECTION option.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I1f662f82cd949eedfdbb61b9f66de15c46fb3106
2025-01-07 17:14:18 +01:00
Mathieu Poirier
17af9597e2 feat(qemu-sbsa): relocate DT after the RMM when RME is enabled
When RME is enabled, (1) the RMM is installed at the base of system RAM,
(2) the base of the system RAM is shifted upward, after the RMM and (3)
the device tree is relocated to the new system RAM base.

This patch relocates the device tree to the new system RAM base before
the RMM is installed in RAM.  From there, other accesses to the device
tree are using the new location.

Change-Id: I0cb4e060ca33a11becd78fe48fab4dc76f0b484b
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2024-12-06 11:20:43 -07:00
Mathieu Poirier
33ac6f99ab fix(qemu-sbsa): fix compilation error when accessing DT functions
When building SBSA, using DT functions from fdt_wrappers.c produces a
linker error.  Adding:

BL2_SOURCES += ${FDT_WRAPPERS_SOURCES}

fixes the problem.  Since the same inclusion would be present in both
qemu/platform.mk and qemu_sbsa/platform.mk, do the changes in
qemu/common/common.mk.

Change-Id: I775b06c1741f6618813c5e1d2c64cdc1888d8519
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2024-12-06 11:20:43 -07:00
Yann Gautier
56b263cb2a Merge "feat(qemu): allow ARM_ARCH_MAJOR/MINOR override" into integration 2024-04-23 10:42:01 +02:00
Jean-Philippe Brucker
e769f830d3 feat(qemu): allow ARM_ARCH_MAJOR/MINOR override
An upcoming change to the RME support code will use atomic instructions
introduced in Armv8.1 in order to implement bitlocks. In order to do
this, the code needs to be built with appropriate -march compiler flag
(otherwise the assembler complains about invalid instructions). One way
to do this is specifying ARM_ARCH_MAJOR/MINOR version greater than 8.0,
which is what the main Makefile does when ENABLE_RME is set.

Allow the main Makefile to override the ARM_ARCH_MAJOR/MINOR variables
on the QEMU platform, so that it can also build the bitlock functions.

This only affects firmware built with ENABLE_RME, which is an
experimental feature both in TF-A and QEMU. The QEMU platform code
doesn't support booting an ENABLE_RME firmware on non-RME CPUs at the
moment.

As a result of this change, when ENABLE_RME is set,
make_helpers/arch_features.mk sets ENABLE_TRF_FOR_NS to 1, which needs
to be overridden by the QEMU Makefile.

Change-Id: I695fc98b21d07f6c84003d9e36a57cad2a3c806e
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2024-04-18 10:05:25 +01:00
Jean-Philippe Brucker
1b694c77c4 feat(qemu): enable FEAT_ECV when present
QEMU supports FEAT_ECV since commit 2808d3b38a52 ("target/arm: Implement
FEAT_ECV CNTPOFF_EL2 handling"), in the v9.0.0 release. Enable
auto-detecting the feature on the QEMU platforms, in order to set
SCR.ECVEN. Without this, EL2 gets undefined instruction exceptions when
trying to access the new CNTPOFF register.

Change-Id: I555a5f9a9a84fd23e64ca85219ed1599204c6bb2
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2024-04-15 17:53:02 +01:00
Marcin Juszkiewicz
59bdb426d3 fix(qemu): disable FEAT_SB
qemu/qemu_sbsa platforms support wide selection of cpu cores. From
Cortex-A57 (v8.0) to Neoverse-N2 (v9.0) one. Only the last one (and
'max' which supports everything possible) supports FEAT_SB.

Runtime check for ENABLE_FEAT_SB does not work in our case and we want
to have working platform.

Change-Id: Ic27d5af20ad76ae44c4211d28694e91ec62bddc1
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2024-02-08 16:14:51 +01:00
Jean-Philippe Brucker
c69e95eed0 feat(qemu): use mock attestation functions for RME
Since QEMU doesn't yet emulate hardware attestation, provide hardcoded
key and token to demonstrate attestation for RME. They are copied from
the mock values for the FVP platform.

Change-Id: I9ce686955345854e9409af5c3aad2a648adea226
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2024-01-08 12:29:07 +00:00
Marcin Juszkiewicz
a97f4665d1 refactor(qemu): change way how we enable cpu features
We have to handle wide selection of cpu cores in one TF-A binary:
- v8.0: a53, a57, a72
- v8.2: a55, a76, n1
- v8.4: v1
- v9.0: a710, n2

And then we have QEMU's hybrid: 'max' which has everything QEMU can
emulate.

TF-A for QEMU platforms was built for v8.5 architecture. But turned out
that 'max' has v8.7 flag now (HCX) which we need to have. And this
enabled set of mandatory features which made TF-A not-bootable on
v8.0/8.2 cpus.

So I decided to follow Arm FVP way and do build for v8.0 with set of
feature flags enabled. This way we have bare minimum to make v8.0 cpus
boot. And then all features from newer cores are enabled with runtime
check which makes them boot.

Tested with BSA/SBSA ACS and Debian Linux 6.5 kernel.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: Ib87bdab992536c65ce0747ce1520682eafc18d39
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-11-14 17:59:22 +02:00
Marcin Juszkiewicz
c41b16eadb docs(qemu): mention a55 in list of v8.2 cores
Change-Id: Ib3a1711be323023cf111373111f39038fa23fb6f
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-11-08 11:54:42 +01:00
Marcin Juszkiewicz
408f9cb485 feat(qemu): add "neoverse-n2" cpu support
Add support to qemu "neoverse-n2" cpu for "qemu" platform.
This one has 2^48 address space so will be used by both systems.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: I9f0fa23a4934d9464379495225e08adc121325b4
2023-09-15 22:44:04 +02:00
Sandrine Bailleux
d4635e9998 Merge "feat(qemu): add A55 cpu support for virt" into integration 2023-09-15 08:20:15 +02:00
Mark-PK Tsai
409c20c84d feat(qemu): add A55 cpu support for virt
Add support to "cortex-a55" cpu for "qemu" ('virt') platform.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Change-Id: I2693892be735eda91494b767322935ddb63c9f48
2023-09-13 20:08:32 +08:00
Marcin Juszkiewicz
4734a62d2c feat(qemu): add "cortex-a710" cpu support
Add support to qemu "cortex-a710" cpu for "qemu" platform.

CPU is supported by qemu/virt only as qemu/sbsa-ref memory starts at
2^40 which is limit for Cortex-A710.

Switched 'qemu' platform to be built as armv8.5 to cover features of
new cpu core.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: I035790eac41b2caf7f13167e53f48c16f0827754
2023-09-13 10:18:15 +01:00
Marcin Juszkiewicz
51ce1f3469 refactor(qemu): handle pointer authentication
Pointer authentication requires CTX_INCLUDE_PAUTH_REGS to be defined.

Change-Id: I4ca95d6d9e619e7a7296a2c3ecb799683bf70575
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-23 12:48:26 +02:00
Marcin Juszkiewicz
035c6da4af refactor(qemu): keep AArch64 cpu flags in one section
There is no need to have two "if" checks for same thing one after
another.

FGT, RNG, SVE, SME are aarch64 only flags.

Change-Id: I6e5850211c859dc7a4ccf6bc8dc6a8d600ffe692
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 22:06:41 +02:00
Marcin Juszkiewicz
941fc3834d refactor(qemu): handle SPM_MM builds
SPM_MM is not compatible with ENABLE_SVE_FOR_NS and breaks build early:

> Including SPM Management Mode (MM) makefile
> services/std_svc/spm/spm_mm/spm_mm.mk:14: *** "Error: SPM_MM is not compatible with ENABLE_SVE_FOR_NS". Stop.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: Iabe181647fce00a432ae11dc4599b71619364c24
2023-08-21 22:06:29 +02:00
Marcin Juszkiewicz
3b61457b4e refactor(qemu): handle AArch64 flags
Handle coherency in one place for AArch64 mode.

Change-Id: Id3678a8f478e5ef731c81c0df30059000e380758
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 21:41:26 +02:00
Marcin Juszkiewicz
c1baf17821 refactor(qemu): common cpu features enablement
Enable SVE, SME, RNG, FGT in one place.

qemu gains FGT (needed for 'max' cpu to boot Linux)
qemu_sbsa gains RNG

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: I2e8f971ef3e42d9ebe9f20641b288cc8c40f806a
2023-08-21 21:41:26 +02:00
Marcin Juszkiewicz
1888475005 refactor(qemu): common BL31 sources
Move BL31 source list into common file.

Change-Id: Iaa27cfd8f87b691728379c87a6ff6331e87951e1
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 21:30:39 +02:00
Marcin Juszkiewicz
71f5359b11 refactor(qemu): common BL1/2 sources
Move BL1 and BL2 source list into common file.

Change-Id: I8f9a835f6cd1c5d67728a071860173f80f03c84e
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 21:30:39 +02:00
Marcin Juszkiewicz
886688d136 refactor(qemu): move CPU definitions into one place
Keep list of supported cpu cores in one place for both platforms.
qemu_sbsa does not handle some of them but with 256MB firmware space it
does not matter.

Change-Id: I5b8f7d18dc903e86e0cc7babbc2fb3f26a1bfdfa
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 21:30:34 +02:00
Marcin Juszkiewicz
a63cdc74ce refactor(qemu): move FDT stuff into one place
Move libfdt includes into common file and use definitions from them.

Change-Id: Ic4fe784fdbedcf5e9e3804a633fcac68464f38a6
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-08-21 21:19:14 +02:00