Commit graph

1984 commits

Author SHA1 Message Date
Patrick Delaunay
412d92fdfd fix(psci): fix parent_idx in psci_validate_state_coordination
Update parent_idx support in psci_validate_state_coordination() as
it is done in psci_do_state_coordination(). The modified loop verifies
the targeted state for all the branch up to end_pwrlvl in the topology
for the current cpu.

Fixes: 606b743007 ("feat(psci): add support for OS-initiated mode")
Change-Id: I14420f64a18b543eb4e10a1279f51cc17558c13c
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2024-05-08 10:09:07 +01:00
Govindraj Raja
ba6b69494b chore: rename hermes to neoverse-n3
Rename hermes cpu to Neoverse-N3

Change-Id: I912d4c824c5004a8c1909c68fef77f1f5e202b8a
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-05-07 08:51:27 -05:00
Manish Pandey
2a0ca84f47 Merge changes from topic "sm/feat_detect" into integration
* changes:
  refactor(cpufeat): restore functions in detect_arch_features
  refactor(cpufeat): add macro to simplify is_feat_xx_present
  chore: simplify the macro names in ENABLE_FEAT mechanism
2024-05-07 11:17:02 +02:00
Younghyun Park
6aa5d1b3ab feat(cpus): support to update External LLC presence in Neoverse V2
The CPUECTLR_EL1.EXTLLC bit indicates that an external last level
cache(LLC) is present in the system. The default value is internal LLC.
Some systems which may have External LLC can enable the External LLC
presece with new build option 'NEOVERSE_Vx_EXTERNAL_LLC'.

Change-Id: I740947f1ef78e31626dc5b96f6d6dc6658d0120f
Signed-off-by: Younghyun Park <younghyunpark@google.com>
2024-05-07 07:46:36 +02:00
Govindraj Raja
42cbefc727 feat((smccc): add version FID for PMF
Introduce a version FID for PMF.

Change-Id: I6b0a7f54aefc2839704e03c5da2243d7c85f8a49
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-05-06 09:42:11 -05:00
Govindraj Raja
f7679d437d refactor(smccc): move pmf to vendor el3 calls
Move pmf support to vendor-specific EL3 Monitor Service Calls. Remove
pmf call count as it's not supported in vendor-specific el3 as per
SMCCC Documentation 1.5:
https://developer.arm.com/documentation/den0028/latest

Add a deprecation notice to inform PMF is moved from arm-sip range to
vendor-specific EL3 range. PMF support from arm-sip range will be
removed and will not available after TF-A 2.12 release.

Change-Id: Ie1e14aa601d4fc3db352cd5621d842017a18e9ec
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-05-06 09:42:11 -05:00
Hsin-Hsiung Wang
a5c4212f05 refactor(cpus): replace adr with adr_l
Replace "adr" with "adr_l" to handle symbols or labels that exceeds 1MB
access range. This modification resolves the link error.

Change-Id: I9eba2e34c0a303b40e4c7b3ea7c5b113f4c6d989
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
2024-05-03 14:08:13 +02:00
Sona Mathew
aaaf2cc313 refactor(cpufeat): add macro to simplify is_feat_xx_present
In this patch, we are trying to introduce the wrapper macro
CREATE_FEATURE_PRESENT to get the following capability and
align it for all the features:

-> is_feat_xx_present(): Does Hardware implement the feature.
-> uniformity in naming the function across multiple features.
-> improved readability

The is_feat_xx_present() is implemented to check if the hardware
implements the feature and does not take into account the
ENABLE_FEAT_XXX flag enabled/disabled in software.

- CREATE_FEATURE_PRESENT(name, idreg, shift, mask, idval)
The wrapper macro reduces the function to a single line and
creates the is_feat_xx_present function that checks the
id register based on the shift and mask values and compares
this against a determined idvalue.

Change-Id: I7b91d2c9c6fbe55f94c693aa1b2c50be54fb9ecc
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-05-02 12:16:16 -05:00
Sona Mathew
9e51f15ed1 chore: simplify the macro names in ENABLE_FEAT mechanism
Currently, the macros used to denote feature implementation
in hardware follow a random pattern with a few macros having
suffix as SUPPORTED and a few using the suffix IMPLEMENTED.
This patch aligns the macro names uniformly using the suffix
IMPLEMENTED across all the features and removes unused macros
pertaining to the Enable feat mechanism.

FEAT_SUPPORTED --> FEAT_IMPLEMENTED
FEAT_NOT_SUPPORTED --> FEAT_NOT_IMPLEMENTED

Change-Id: I61bb7d154b23f677b80756a4b6a81f74b10cd24f
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-05-02 08:53:01 -05:00
Manish V Badarkhe
a1901c7d0d Merge changes from topic "rss_rse_rename" into integration
* changes:
  refactor(changelog): change all occurrences of RSS to RSE
  refactor(qemu): change all occurrences of RSS to RSE
  refactor(fvp): change all occurrences of RSS to RSE
  refactor(fiptool): change all occurrences of RSS to RSE
  refactor(psa): change all occurrences of RSS to RSE
  refactor(fvp): remove leftovers from rss measured boot support
  refactor(tc): change all occurrences of RSS to RSE
  docs: change all occurrences of RSS to RSE
  refactor(measured-boot): change all occurrences of RSS to RSE
  refactor(rse): change all occurrences of RSS to RSE
  refactor(psa): rename all 'rss' files to 'rse'
  refactor(tc): rename all 'rss' files to 'rse'
  docs: rename all 'rss' files to 'rse'
  refactor(measured-boot): rename all 'rss' files to 'rse'
  refactor(rss): rename all 'rss' files to 'rse'
2024-04-26 16:55:04 +02:00
Manish Pandey
f9d40b5c4b Merge changes from topic "hm/handoff" into integration
* changes:
  feat(handoff): add support for RESET_TO_BL2
  feat(arm): support FW handoff b/w BL1 & BL2
  feat(handoff): add TL source files to BL1
  feat(handoff): add TE's for BL1 handoff interface
  refactor(bl1): clean up bl2 layout calculation
  feat(arm): support FW handoff b/w BL2 & BL31
2024-04-26 16:22:38 +02:00
Harrison Mutai
469b1d8412 feat(handoff): add TL source files to BL1
Change-Id: Id9843ba0ccfb448cf17e09e0659b743741ae01ac
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-04-26 09:00:12 +00: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
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
Tamas Ban
d797665cce refactor(psa): change all occurrences of RSS to RSE
Changes all occurrences of "RSS" and "rss" in the code and build files
to "RSE" and "rse".

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I606e2663fb3719edf6372d6ffa4f1982eef45994
2024-04-22 15:44:38 +02:00
Tamas Ban
3857898f66 refactor(psa): rename all 'rss' files to 'rse'
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I379c471c541dda25d8ee9087fcf67e05b4204474
2024-04-22 15:44:38 +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
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
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
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
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
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
Mark Dykes
0cf4fda900 Merge "fix(handoff): correct representation of tag_id" into integration 2024-04-12 17:49:46 +02:00
Jayanth Dodderi Chidanand
a796d5aa11 fix(cm): remove ENABLE_FEAT_MTE usage
commit@c282384dbb45b6185b4aba14efebbad110d18e49
removed ENABLE_FEAT_MTE but missed its usage in
context structure declaration path.

All mte regs that are currently context saved/restored
are needed only when FEAT_MTE2 is enabled, so move to
usage of FEAT_MTE2 and remove FEAT_MTE usage

Change-Id: I6b4417485fa6b7f52a31045562600945e48e81b7
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-04-12 06:42:42 +01:00
Chris Kay
a6b3643c2a fix(cm): hide cm_init_context_by_index from BL1
BL1 requires the context management library but does not use or
implement `cm_init_context_by_index`. This change ensures that is not
compiled into BL1, as linking with LTO enabled causes an undefined
reference for this function.

Change-Id: I4a4602843bd75bc4f47b3e0c4c5a6efce1514ef6
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-04-11 11:20:32 +00:00
Bipin Ravi
10134e3556 fix(cpus): workaround for Cortex-A715 erratum 2728106
Cortex-A715 erratum 2728106 is a Cat B(rare) erratum that is present
in revision r0p0, r1p0 and r1p1. It is fixed in r1p2.

The workaround is to execute an implementation specific sequence in
the CPU.

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

Change-Id: Ic825f9942e7eb13893fdbb44a2090b897758cbc4
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-04-10 15:12:13 -05:00
Mark Dykes
a6cb061b62 Merge "fix(cc): code coverage optimization fix" into integration 2024-04-10 20:15:00 +02:00
Mark Dykes
4b50d7582f Merge "fix(cm): add more system registers to EL1 context mgmt" into integration 2024-04-08 23:14:03 +02:00
Mark Dykes
152ad112d7
fix(cc): code coverage optimization fix
Resolve issue where optimization is enabled for TF-A using
-Og and compile fail is seen in PSCI module.

Change-Id: Id9afb5c56a6937e7040b20cd01080c190c8276d5
Signed-off-by: Mark Dykes <mark.dykes@arm.com>
2024-04-08 13:38:01 -05:00
Bipin Ravi
c97831eb09 Merge "build: use GCC to link by default" into integration 2024-04-05 22:21:15 +02:00
Madhukar Pappireddy
ed9bb824e4 fix(cm): add more system registers to EL1 context mgmt
The following system registers are made part of save and restore
operations for EL1 context:
  MDCCINT_EL1
  MDSCR_EL1
  DISR_EL1
  PIRE0_EL1
  PIR_EL1
  POR_EL1
  S2POR_EL1
  TCR2_EL1

Some of these registers are available as part of core Armv8-A
architecture while others are made available through various
architectural extensions.

Change-Id: I507dccb9053ba177e1b98100fceccd1f32bdfc5c
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-04-03 11:08:35 -05:00
Harrison Mutai
d594ace68d fix(handoff): correct representation of tag_id
The tag ID is a 3-byte field used to identify the contents of a TE. In
our library, the internal representation of the tag is a 2 byte field.
We currently ignore the top byte of this field, marking it res0. This
causes problems when dealing with non-standard TE types, whose range
starts at 0xff_f000.  This commit fixes this by using a bit-field with a
24-bit width, and packing `transfer_list_entry`.

Change-Id: Ib3c212f964b64f528ad6f3dd6ab8b4597b877cd9
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-04-03 13:16:24 +00:00
Ahmad Fatoum
e6f8fc7437 fix(pmu): fix breakage on ARMv7 CPUs with SP_min as BL32
While comments introduced with the original commit claim that
pmuv3_disable_el3()/pmuv3_init_el3() are compatible with PMUv2 and
PMUv1, this is not true in practice: The function accesses the Secure
Debug Control Register (SDCR), which only available to ARMv8 CPUs.

ARMv8 CPUs executing in AArch32 mode would thus be able to disable
their PMUv3, while ARMv7 CPUs would hang trying to access the SDCR.

Fix this by only doing PMUv3 handling when we know a PMUv3 to be
available. This resolves boot hanging on all STM32MP15 platforms
that use SP_min as BL32 instead of OP-TEE.

Change-Id: I40f7611cf46b89a30243cc55bf55a8d9c9de93c8
Fixes: c73686a11c ("feat(pmu): introduce pmuv3 lib/extensions folder")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
2024-04-02 16:17:03 +02:00
Chris Kay
2f1c5e7eb1 build: use GCC to link by default
When configuring GNU GCC as the C compiler, we usually use the GNU BFD
linker directly to link by default. However, this complicates things
because we also need to support LTO, which can only be done when linking
is done via the C compiler, and we cannot change the linker later on if
some other part of the build system wants to enable LTO.

This change migrates the default choice of linker to GCC if the C
compiler is GCC, in order to enable this use-case. This should have no
impact on anything outside of the build system, as by default GCC merely
acts as a wrapper around BFD.

Change-Id: I40771be2b0571def67bbfde9e877e7629ec8cdaa
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-04-02 09:52:17 +00:00
Madhukar Pappireddy
6aae3acfd0 fix(cm): save guarded control stack registers
This patch fixes a typo which led to incorrect context save
operations for two FEAT_GCS registers.

Change-Id: I3d3202a6721714bbc8f84c2d775d1b28afffa5df
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-04-01 16:13:59 -05:00
Madhukar Pappireddy
eee0ec48b5 Merge changes from topic "mte_fixes" into integration
* changes:
  build(changelog): move mte to mte2
  refactor(mte): remove mte, mte_perm
2024-03-26 23:01:05 +01:00
Govindraj Raja
c282384dbb refactor(mte): remove mte, mte_perm
Currently both FEAT_MTE and FEAT_MTE_PERM aren't used for enabling
of any feature bits in EL3. So remove both FEAT handling.

All mte regs that are currently context saved/restored are needed
only when FEAT_MTE2 is enabled, so move to usage of FEAT_MTE2 and
remove FEAT_MTE usage.

BREAKING CHANGE: Any platform or downstream code trying to use
SCR_EL3.ATA bit(26) will see failures as this is now moved to be
used only with FEAT_MTE2 with
commit@ef0d0e5478a3f19cbe70a378b9b184036db38fe2

Change-Id: Id01e154156571f7792135639e17dc5c8d0e17cf8
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-03-26 14:30:58 -05:00
Sona Mathew
328d304d27 chore: rename Poseidon to Neoverse V3
Rename Neoverse Poseidon to Neoverse V3, make changes
to related build flags, macros, file names etc.

Change-Id: I9e40ba8f80b7390703d543787e6cd2ab6301e891
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-26 11:27:31 -05:00
Bipin Ravi
e7419780f7 Merge "fix(cpus): workaround for Cortex-A715 erratum 2413290" into integration 2024-03-26 01:12:57 +01:00
Sona Mathew
bd2f7d3258 fix(cpus): workaround for Cortex-A715 erratum 2413290
Erratum 2413290 is a Cat B erratum that is present only
in revision r0p1 and is fixed in r1p1.

The initial implementation did not consider that this
fix is to be applied only when SPE (Statistical Profiling
Extension) is implemented and enabled. This patch applies
the fix by adding a check for ENABLE_SPE_FOR_NS.

Change-Id: I87b2175b89d6fb168c77e6ab233c90ca056791a1
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-24 22:45:31 -05:00
Bipin Ravi
152f4cfa16 fix(cpus): workaround for Cortex-A720 erratum 2926083
Cortex-A720 erratum 2926083 is a Cat B erratum that is present
in revisions r0p0, r0p1 and is fixed in r0p2. The errata is only
present when SPE (Statistical Profiling Extension) is implemented
and enabled.

The workaround is to set bits[58:57] of the CPUACTLR_EL1 to 'b11
when SPE is "implemented and enabled".

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

Change-Id: I30182c3893416af65b55fca9a913cb4512430434
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-03-22 16:10:07 -05:00
Manish Pandey
869ee08638 Merge "fix(mte): use ATA bit with FEAT_MTE2" into integration 2024-03-22 18:24:29 +01:00
Manish Pandey
ceedd1dc02 Merge "refactor(cm): minor update on conditions used in prepare_el3_exit" into integration 2024-03-22 14:24:05 +01:00
Bipin Ravi
063d99b3ec Merge "chore: update status of Cortex-X3 erratum 2615812" into integration 2024-03-22 00:41:20 +01:00
Madhukar Pappireddy
fe6c65749d Merge "fix(cpus): workaround for Cortex-A720 erratum 2940794" into integration 2024-03-22 00:09:19 +01:00
Sona Mathew
f589a2a5f1 chore: update status of Cortex-X3 erratum 2615812
SDEN documentation:
https://developer.arm.com/documentation/2055130/latest

Change-Id: Ied7150bab505a743401cf4afa9a0a5f81d5fdff1
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-20 11:41:29 -05:00
Jayanth Dodderi Chidanand
d39b123690 refactor(cm): minor update on conditions used in prepare_el3_exit
This patch covers the following:

* Conditions set for verifying the EL2 presence and its usage
  for various scenarios while exiting to Non secure world
  "cm_prepare_el3_exit" has been improved.

* It thereby also fixes the issue(misra_c_2012_rule_15_7_violation)
  for not terminating "if..else if" construct with an else statement
  and keeps code in accordance with MISRA standards.

Change-Id: Ie5284447f5ac91412552629b76dbf2e636a09fd9
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-03-20 09:59:42 +00:00