Commit graph

14477 commits

Author SHA1 Message Date
Yann Gautier
ae770fedf4 feat(console): introduce EARLY_CONSOLE
This is a generic porting of what was done on ST platforms with flag
STM32MP_EARLY_CONSOLE. It creates the flag and the prototype for
plat_setup_early_console(). This function depends on platform
implementation. This function call is added at the beginning of each BL
image early setup function.
The patch also introduce an extra log macro: EARLY_ERROR. This can
replace ERROR macro in code that will only be executed before the
default console is enabled, and will do nothing when the EARLY_CONSOLE
is not enabled. This can then save some space in memory.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I77bf0a0c4289b4c7df94e4bfb783a938e05bf023
2024-04-24 15:44:28 +02:00
Yann Gautier
a1255c7585 feat(bl32): create an sp_min_setup function
This new C function will call sp_min_early_platform_setup2() and
sp_min_plat_arch_setup(). At this step the C environment is already
enabled, and it allows adding function like the one for early console
for which r9-r12 registers could be clobbered.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4cbf2f6acea769d595ff40b2e2b4ca5d29672878
2024-04-24 15:44:28 +02:00
Manish V Badarkhe
4b0570c3c3 Merge "docs(fconf): add TB_FW config bindings" into integration 2024-04-24 13:16:00 +02:00
Manish V Badarkhe
e88ce98812 Merge "fix(cert-create): add guardrails around brainpool usage" into integration 2024-04-24 10:37:20 +02:00
Manish V Badarkhe
4d2372e914 Merge "fix(cert-create): use a salt length equal to digest length for RSA-PSS" into integration 2024-04-24 10:24:39 +02:00
Bipin Ravi
b67b02c3aa Merge "fix(cpus): workaround for Cortex-X4 erratum 2763018" into integration 2024-04-24 03:57:18 +02:00
Sona Mathew
47312115de fix(cpus): workaround for Cortex-X4 erratum 2763018
Cortex-X4 erratum 2763018 is a Cat B erratum that is present
in revisions r0p0, r0p1 and is fixed in r0p2.

The workaround is to set bit[47] of CPUACTLR3_EL1 register.
Setting this chicken bit might have a small impact on power
and negligible impact on performance.

SDEN documentation:
https://developer.arm.com/documentation/SDEN2432808/latest

Change-Id: Ia188e08c2eb2952923ec72e2a56efdeea836fe1e
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-04-23 15:14:15 -05:00
Madhukar Pappireddy
fb7aa37560 Merge "refactor(fvp_r): remove duplicated macro definitions" into integration 2024-04-23 16:45:25 +02:00
Lauren Wehrmeister
6a4afebb0f Merge "fix(cpus): workaround for Cortex-X4 erratum 2740089" into integration 2024-04-23 16:14:02 +02:00
Lauren Wehrmeister
8acdb13a9a Merge "fix(cpus): workaround for Cortex-A715 erratum 2728106" into integration 2024-04-23 16:13:55 +02:00
Soby Mathew
dcf7a8aee7 Merge "feat(qemu): update to manifest v0.3" into integration 2024-04-23 13:35:38 +02:00
Jean-Philippe Brucker
762a1c44b9 feat(qemu): update to manifest v0.3
Update the RMM manifest to v0.3: pass the console information to RMM.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Change-Id: I55093cd0c12f9c6a7569d7e524f7d301acbb2a45
2024-04-23 10:20:11 +01:00
Yann Gautier
56b263cb2a Merge "feat(qemu): allow ARM_ARCH_MAJOR/MINOR override" into integration 2024-04-23 10:42:01 +02:00
Yann Gautier
09d3fd1418 Merge "feat(qemu): enable FEAT_ECV when present" into integration 2024-04-23 09:58:54 +02:00
Yann Gautier
4c77fac98d Merge "refactor(qemu): do not hardcode counter frequency" into integration 2024-04-23 09:18:16 +02:00
Madhukar Pappireddy
c4d80e7482 Merge "fix(cm): add more feature registers to EL1 context mgmt" into integration 2024-04-23 00:25:44 +02:00
Manish Pandey
9196add7fd Merge "docs(mte2): update docs" into integration 2024-04-22 17:40:43 +02:00
Marcin Juszkiewicz
5436047a0e refactor(qemu): do not hardcode counter frequency
From QEMU change:

> In previous versions of the Arm architecture, the frequency of the
> generic timers as reported in CNTFRQ_EL0 could be any IMPDEF value,
> and for QEMU we picked 62.5MHz, giving a timer tick period of 16ns.
> In Armv8.6, the architecture standardized this frequency to 1GHz.

This change stops TF-A from hardcoding 62.5MHz frequency. Instead value
stored in CNTFRQ_EL0 would be used. As a result we get 62.5MHz on older
cores and 1GHz on newer ones.

Change-Id: I7d414ce6d3708e598bbb5a6f79eb2d4ec8e15ac4
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2024-04-22 17:33:36 +02:00
Govindraj Raja
c643188f18 docs(mte2): update docs
Add a section under release for capturing and populating
build options that are deprecated and removed.

Various fixes and refactor[1] led to removal of certain MTE
build options so capture this part in build-options docs.

[1]: https://review.trustedfirmware.org/q/topic:%22mte_fixes%22

Change-Id: I74a82f6f73f7f1dceea65a295ad2df60301ad838
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-04-22 17:04:26 +02:00
Leo Yan
07b576a445 refactor(fvp_r): remove duplicated macro definitions
The system counter macros are defined duplicatedly in the header file.
As the macros must be defined before arm_def.h, this patch removes the
redundant definitions afterwards.

Change-Id: Id74a8ef1b9cec4a978366b6db69981cfc30dffb6
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-04-22 15:35:48 +01:00
Harrison Mutai
75093b726d docs(fconf): add TB_FW config bindings
Document bindings for TB_FW_CONFIG that are common between platforms.
Since the information this device tree type contains pertains to
firmware specific properties, we do not expect that the document will
cover all uses, nor do we promise backward compatiblity.

Change-Id: I0e850c13b77cc62940ab5020a15bf8e503568ed8
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-04-22 08:30:24 +00:00
Lauren Wehrmeister
9728f9915d Merge "docs(plat): remove TC1 entry from the deprecation table" into integration 2024-04-19 17:49:06 +02:00
Madhukar Pappireddy
d6c76e6c65 fix(cm): add more feature registers to EL1 context mgmt
The following system registers are made part of save and restore
operations for EL1 context:

TRFCR_EL1
SCXTNUM_EL0
SCXTNUM_EL1
GCSCR_EL1
GCSCRE0_EL1
GCSPR_EL1
GCSPR_EL0

Change-Id: I1077112bdc29a6c9cd39b9707d6cf10b95fa15e3
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-04-19 09:57:36 -05:00
Madhukar Pappireddy
eb69206f00 Merge "fix(spm): add device-regions used in tf-a-tests" into integration 2024-04-19 15:29:06 +02:00
Yann Gautier
85658c5695 Merge "fix(pmu): fix breakage on ARMv7 CPUs with SP_min as BL32" into integration 2024-04-19 14:04:52 +02:00
Soby Mathew
3c36d34e21 Merge "fix(gpt): declare gpt_tlbi_by_pa_ll()" into integration 2024-04-19 13:23:01 +02:00
Daniel Boulby
45716e377e fix(spm): add device-regions used in tf-a-tests
Device memory region specified in an SP manifest are now validated
against the device memory defined in the SPMC manifest. Therefore
we need to add the device memory used in the tf-a-tests to the SPMC
manifests.

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I47376e67c700705d12338d7078292618a15d5546
2024-04-19 11:56:12 +01:00
Soby Mathew
832e4ed520 fix(gpt): declare gpt_tlbi_by_pa_ll()
The patch 8754cc5 accidentally removes the declaration of
gpt_tlbi_by_pa_ll() and hence breaks RME builds. This patch
fixes the same.

signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: I2523982fc48bca2a1f1a36fd9bd3803b01c6916a
2024-04-19 12:27:36 +02:00
Manish V Badarkhe
4a20d5cb88 docs(plat): remove TC1 entry from the deprecation table
Since the TC1 platform has been eliminated from the TF-A source code
and CI script repository, updated the deprecation table to remove its
entry.

Change-Id: I93ae03e1f810666e9a6d0c6172a322ff1e960c71
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-04-19 11:18:44 +01:00
Soby Mathew
98f7b60ec6 Merge changes Ic40e1b7a,I0398b550,Ife594ed6,I3eb0f29b into integration
* changes:
  fix(gpt): unify logging messages
  chore(gpt): remove gpt_ prefix
  feat(aarch64): add functions for TLBI RPALOS
  feat(locks): add bitlock
2024-04-19 11:24:01 +02:00
Bipin Ravi
c833ca66a6 fix(cpus): workaround for Cortex-X4 erratum 2740089
Cortex-X4 erratum 2740089 is a Cat B erratum that applies to
all revisions <=r0p1 and is fixed in r0p2. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN2432808/latest

Change-Id: I1d0fa4dd383437044a4467591f65a4a8514cabdc
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-04-18 13:39:25 -05:00
Lauren Wehrmeister
c8be7c08c3 Merge "fix(docs): typo in the romlib design" into integration 2024-04-18 16:16:30 +02:00
Manish V Badarkhe
4e06355a7b Merge "docs: decrease the minimum supported OpenSSL" into integration 2024-04-18 11:34:50 +02:00
Manish V Badarkhe
3b57ae23e0 fix(docs): typo in the romlib design
There's a typo in the romlib design document when referring to
the generator script. It should be romlib_generator.py instead
of romlib_generate.py so fixed this typo.

Change-Id: I6db7ee66b13c2b0b9d8511da7e0d1b058366281b
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-04-18 10:14:21 +01: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
Mark Dykes
46d53216e7 Merge "fix: static checks on spmc dts" into integration 2024-04-17 20:12:44 +02:00
J-Alves
c35299d6b4 fix: static checks on spmc dts
Change the header of the license to have 2024, and
replace spaces for a tab.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: If98161ad35e1ead30e1e0d3ddb4cc6348e83d6ee
2024-04-17 14:59:36 +01:00
AlexeiFedorov
b99926ef7b fix(gpt): unify logging messages
This patch modifies GPT library comments and makes
logging messages consistent with PRIx64 usage and
TF-A format used in other modules.
Minor changes are made to make the code compliant
with MISRA C requirements.

Change-Id: Ic40e1b7ac43cd9602819698d00e1ce3a8c7183ce
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-04-17 14:00:16 +02:00
AlexeiFedorov
20e2683daf chore(gpt): remove gpt_ prefix
This patch removes 'gpt_' prefix from the
names of static functions for better code
readability.

Change-Id: I0398b55047a73209da598b708240fcba47c779f7
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-04-17 13:59:59 +02:00
AlexeiFedorov
8754cc5d1c feat(aarch64): add functions for TLBI RPALOS
This patch adds tlbirpalos_XYZ() functions to support
TLBI RPALOS instructions for the 4KB-512MB invalidation
range.

Change-Id: Ife594ed6c746d356b4b1fdf97001a0fe2b5e8cd0
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-04-17 12:59:04 +01:00
Donald Chan
c0c280dfda fix(cert-create): add guardrails around brainpool usage
OpenSSL has brainpool support only since version 1.1.0, make sure we
put a proper guardrail around it.

Change-Id: Ia2ee686904ed80699f77b1da953546ab7538ec37
Signed-off-by: Donald Chan <donachan@tesla.com>
2024-04-16 17:26:26 +02:00
Manish Pandey
e9398e46bc Merge "fix(gicv2): fix SGIR_NSATT bitshift" into integration 2024-04-16 15:57:03 +02:00
Manish Pandey
d3604b353e Merge changes from topic "lto-fixes" into integration
* changes:
  fix(bl1): add missing `__RW_{START,END}__` symbols
  fix(fvp): don't check MPIDRs with the power controller in BL1
  fix(arm): only expose `arm_bl2_dyn_cfg_init` to BL2
  fix(cm): hide `cm_init_context_by_index` from BL1
  fix(bl1): add missing spinlock dependency
2024-04-16 15:51:44 +02:00
Manish Pandey
145572914b Merge changes from topic "hm/handoff" into integration
* changes:
  refactor(fvp): reduce max size of HW_CONFIG to 16KB
  refactor(arm): replace hard-coded HW_CONFIG DT size
2024-04-16 15:51:13 +02:00
Harrison Mutai
1b86ec5b5d docs: decrease the minimum supported OpenSSL
Our code does not preclude the use of versions 1.0.x of OpenSSL.
Instead, we discourage it's use due to security concerns. Update the
documentation to reflect this.

Change-Id: I5c60907337f10b05d5c43b0384247c5d4135db50
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-04-16 13:46:57 +00:00
Olivier Deprez
e75e593593 Merge "docs(build): update GCC to 13.2.Rel1 version" into integration 2024-04-16 13:58:02 +02: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
Madhukar Pappireddy
eabcde257f Merge "fix(ff-a): add NS memory node to fvp_spmc_optee_sp manifest" into integration 2024-04-15 15:57:02 +02:00
Harrison Mutai
b9ecf6458b refactor(fvp): reduce max size of HW_CONFIG to 16KB
HW_CONFIG is the hardware description consumed primarly by the Linux
kernel, and for the FVP platform, TF-A runtime firmware (BL31). Due to
both needing it, two copies of this file are made in Trusted DRAM and
SRAM. The copy in Trusted DRAM is a workaround stemming from memory
constraints in SRAM. We temporarily map the range of memory in Trusted
DRAM into BL31 to allow it to consume the configuration.  In principle,
however, BL31 execution should be limited to SRAM, hence reduce the
maximum size of the HW_CONFIG to 16KB in order to accommodate it in
SRAM. This is possible since in practice, the HW_CONFIG on FVP is only
about 11KB.

Change-Id: Idb5dc0637b402562b7177a2b4e2464c4f3f67da7
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-04-15 13:03:41 +00:00
AlexeiFedorov
222f885df3 feat(locks): add bitlock
This patch adds 'bitlock_t' type and bit_lock() and
bit_unlock() to support locking/release functionality
based on individual bit position. These functions use
atomic bit set and clear instructions which require
FEAT_LSE mandatory from Armv8.1.

Change-Id: I3eb0f29bbccefe6c0f69061aa701187a6364df0c
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-04-15 12:14:16 +01:00