Commit graph

1848 commits

Author SHA1 Message Date
Manish V Badarkhe
4b6e4e618e Merge changes from topic "mp/simd_ctxt_mgmt" into integration
* changes:
  feat(fvp): allow SIMD context to be put in TZC DRAM
  docs(simd): introduce CTX_INCLUDE_SVE_REGS build flag
  feat(fvp): add Cactus partition manifest for EL3 SPMC
  chore(simd): remove unused macros and utilities for FP
  feat(el3-spmc): support simd context management upon world switch
  feat(trusty): switch to simd_ctx_save/restore apis
  feat(pncd): switch to simd_ctx_save/restore apis
  feat(spm-mm): switch to simd_ctx_save/restore APIs
  feat(simd): add rules to rationalize simd ctxt mgmt
  feat(simd): introduce simd context helper APIs
  feat(simd): add routines to save, restore sve state
  feat(simd): add sve state to simd ctxt struct
  feat(simd): add data struct for simd ctxt management
2024-08-20 22:30:06 +02:00
Madhukar Pappireddy
308ebfa188 feat(simd): introduce simd context helper APIs
This patch adds the common API to save and restore FP and SVE. When SVE
is enabled we save and restore SVE which automatically covers FP. If FP
is enabled while SVE is not, then we save and restore FP only.

The patch uses simd_ctx_t to save and restore both FP and SVE which
means developers need not use fp or sve routines directly. Once all the
calls to fpregs_context_* are replaced with simd_ctx_*, we can remove
fp_regs_t data structure and macros (taken care in a following patch).

simd_ctx_t is currently allocated in section of its own. This will go
into  BSS section by default but platform will have option of relocating
it to a different section by overriding in plat.ld.S.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Signed-off-by: Okash Khawaja <okash@google.com>
Change-Id: I090f8b8fa3862e527b6c40385249adc69256bf24
2024-08-19 11:10:10 -05:00
Madhukar Pappireddy
6d5319afec feat(simd): add routines to save, restore sve state
This adds assembly routines to save and restore SVE registers. In order
to share between FPU and SVE the code to save and restore FPCR and
FPSR, the patch converts code for those registers into macro.
Since we will be using simd_ctx_t to save and restore FPU also, we use
offsets in simd_ctx_t for FPSR and FPCR. Since simd_ctx_t has the same
structure at the beginning as fp_regs_t, those offsets should be the
same as CTX_FP_* offsets, when SVE is not enabled. Note that the code
also saves and restores FPEXC32 reg along with FPSR and FPCR.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Signed-off-by: Okash Khawaja <okash@google.com>
Change-Id: I120c02359794aa6bb6376a464a9afe98bd84ae60
2024-08-19 11:10:10 -05:00
Manish V Badarkhe
553b70c3ef Merge changes from topic "ar/asymmetricSupport" into integration
* changes:
  feat(tc): enable trbe errata flags for Cortex-A520 and X4
  feat(cm): asymmetric feature support for trbe
  refactor(errata-abi): move EXTRACT_PARTNUM to arch.h
  feat(cpus): workaround for Cortex-A520(2938996) and Cortex-X4(2726228)
  feat(tc): make SPE feature asymmetric
  feat(cm): handle asymmetry for SPE feature
  feat(cm): support for asymmetric feature among cores
  feat(cpufeat): add new feature state for asymmetric features
2024-08-19 11:56:49 +02:00
Arvind Ram Prakash
721249b0c0 feat(cm): asymmetric feature support for trbe
This patch checks if the Errata 2938996(Cortex-A520) , 2726228(Cortex-X4)
applies to cores and if affected applies the errata workaround which
disables TRBE.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I53b037839820c8b3a869f393588302a365d5b97c
2024-08-17 09:38:44 +01:00
Arvind Ram Prakash
4a97ff5111 feat(cpus): workaround for Cortex-A520(2938996) and Cortex-X4(2726228)
This patch implements errata functions for two errata, both of them
disable TRBE as a workaround. This patch doesn't have functions
that disable TRBE but only implemented helper functions that are
used to detect cores affected by Errata 2938996(Cortex-A520) & 2726228(Cortex-X4)

Cortex-X4 SDEN documentation:
    https://developer.arm.com/documentation/SDEN2432808/latest

Cortex-A520 SDEN Documentation:
    https://developer.arm.com/documentation/SDEN-2444153/latest

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I8f886a1c21698f546a0996c719cc27dc0a23633a
2024-08-17 09:37:55 +01:00
Manish Pandey
188f8c4b60 feat(cm): handle asymmetry for SPE feature
With introduction of FEAT_STATE_CHECK_ASYMMETRIC, the asymmetry of cores
can be handled. SPE is one of the features which can be asymmetric
across cores.

Add a function to handle this asymmetry by re-visting the feature
presence on running core.
There are two possible cases:
 - If the primary has the feature and secondary does not have it then,
   the feature needs to be disabled.
 - If the primary does not have the feature and secondary has it then,
   the feature need to be enabled

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ibb2b88b5ef63b3efcb80801898ae8d8967e5c271
2024-08-17 09:36:10 +01:00
Manish Pandey
2f41c9a7be feat(cm): support for asymmetric feature among cores
TF-A assumes that all the cores in a platform has architecture feature
parity, this is evident by the fact that primary sets up the
Non-secure context of secondary cores.

With changing landscape of platforms (e.g. big/little/mid cores), we are
seeing more and more platforms which has feature asymmetry among cores.
There is also a scenario where certain CPU erratum only applies to one
type of cores and requires a feature to be disabled even it supports
the feature.

To handle these scenarios, introduce a hook in warmboot path which would
be called on the running CPU to override any feature disparity in the
NS context stashed up by primary. Note that, re-checking of feature for
Secure/Realm context is not required as the context is created on
running core itself.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I5a01dbda528fa8481a00fdd098b58a7463ed0e22
2024-08-17 09:35:53 +01:00
Manish Pandey
43d1d951dd feat(cpufeat): add new feature state for asymmetric features
Introduce a new feature state CHECK_ASYMMETRIC to cater for the features
which are asymmetric across cores. This state is useful for platforms
which has architectural asymmetric cores (A feature is only present in
one type of core e.g. big).
This state is similar to FEAT_STATE_CHECK (dynamic detection) except
that feature state is also checked on each core during warmboot path and
override the context (just for asymmetric features) which was setup by
core executing CPU_ON call.

Only Non-secure context will be re-checked as secure and realm context
is created on same core.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic78a0b6ca996e0d7881c43da1a6a0c422f528ef3
2024-08-17 09:35:13 +01:00
Manish V Badarkhe
2d4f264ba5 Merge changes from topic "romlib-fixes" into integration
* changes:
  fix(romlib): wrap indirectly included functions
  fix(arm): remove duplicate jumptable entry
2024-08-17 10:09:06 +02:00
Mark Dykes
abeb8ad6c1 Merge "fix(cpus): workaround for Cortex-A720 erratum 2844092" into integration 2024-08-17 00:18:54 +02:00
Mark Dykes
28e4ec1b39 Merge "fix(cpus): workaround for Cortex-X4 erratum 2816013" into integration 2024-08-17 00:18:02 +02:00
Jimmy Brisson
d95d56bd2b fix(romlib): wrap indirectly included functions
The problem that this resolves is a bit involved; the following
must be met at the same time for some function <to_be_wrapped>:

 * to_be_wrapped must be specified as part of the romlib
 * to_be_wrapped must _not_ be referenced by any translation unit
   in TF-A
 * to_be_wrapped must be referenced by a translation unit in a
   dependent library, mbedtls for example.

Under these circumstances, to_be_wrapped will not be wrapped, and
will instead reference its original definition while simultaneously
residing in romlib.

This is a side effect of two issues with romlib prior to this patch:

 1 to_be_wrapped is expected to wrap by duplicating its definition.
    This causes any condition that links against both the base and
    wrapper functions to be a link error (duplicate symbol definition).
 2 to_be_wrapped is in its own translation unit
    This causes the wrappers to be used by TF-A in an as needed.

The duplicate function definitions can be worked around using the
linker's `--wrap` flag, which redirects all references to a symbol
to resolve to `__wrap_<symbol>` and the original symbol to be
available as `__real_<symbol>`. Most of the changes handle creating
this arguments and passing them to the linker.

Further, once you use the linker's wrap, you will encounter another
issue: if TF-A does not use a function, its wrapper is not present.
This causes link issues when a library and not TF-A uses the wrapper.
Note that this issue would have been resolved previously by ignoring
the wrapper and using the base definition.

This further issue is worked around by concatenating the assembly for
all of the wrappers into a single translation unit. It's possible to
work around this issue in a few other ways, including reordering the
libraries passed to the linker to place libwrapper.a last or grouping
the libraries so that symbols from later libraries may be resolved
with prior libraries.

I chose the translation unit concatenation approach as it revealed
that a jumptable has duplicate symbols within it.

Change-Id: Ie57b5ae69bde2fc8705bdc7a93fae3ddb5341ed9
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-08-15 10:49:07 -05:00
Charlie Bareham
01959a1656 fix(psci): fix parent parsing in psci_is_last_cpu_to_idle_at_pwrlvl
The function always checks the first parent of the current core
instead parse the tree topology to find the parent at parent level
of the CPU. It is because the current loop has no effect as it uses
a fixed parameter 'my_idx' and returns the FIRST parent of CPU.
Also, it looks for the parent nodes in the array of CPU nodes, but
actually they are in a separate array.

This update allows to parse the PSCI topology tree to find
the parent at parent level of the CPU identified by my_idx.

Fixes: 606b743007 ("feat(psci): add support for OS-initiated mode")
Change-Id: I96fb5ecc154a76b16adca5b5055217b8626c9e66
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
2024-08-06 09:20:29 +01:00
Manish V Badarkhe
1baf62469e Merge changes from topic "ar/asymmetricSupport" into integration
* changes:
  feat(trbe): introduce trbe_disable() function
  feat(spe): introduce spe_disable() function
  chore(spe): rename spe_disable() to spe_stop()
2024-08-05 17:16:52 +02:00
Sona Mathew
12140908a5 fix(cpus): workaround for Cortex-A720 erratum 2844092
Cortex-A720 erratum 2844092 is a Cat B erratum that is present
in revisions r0p0, r0p1 and is fixed in r0p2.

The workaround is to set bit[11] of CPUACTLR4_EL1 register.

SDEN documentation:
https://developer.arm.com/documentation/SDEN-2439421/latest

Change-Id: I3d8eacb26cba42774f1f31c3aae2a0e6fecec614
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-08-01 13:40:32 -05:00
Sona Mathew
1e4480bb54 fix(cpus): workaround for Cortex-X4 erratum 2816013
Cortex-X4 erratum 2816013 is a Cat B erratum that applies
to all revisions <= r0p1 and is fixed in r0p2. This erratum
is only present when memory tagging is enabled.

The workaround is to set CPUACTLR5_EL1[14] to 1.

SDEN documentation:
https://developer.arm.com/documentation/SDEN-2432808/latest

Change-Id: I546044bde6e5eedd0abf61643d25e2dd2036df5c
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-08-01 13:40:32 -05:00
Arvind Ram Prakash
b36e975ea3 feat(trbe): introduce trbe_disable() function
This patch adds trbe_disable() which disables Trace buffer access
from lower ELs in all security state. This function makes Secure
state the owner of Trace buffer and access from EL2/EL1 generate
trap exceptions to EL3.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: If3e3bd621684b3c28f44c3ed2fe3df30b143f8cd
2024-07-29 20:35:14 +01:00
Manish Pandey
651fe5073c feat(spe): introduce spe_disable() function
Introduce a function to disable SPE feature for Non-secure state and do
the default setting of making Secure state the owner of profiling
buffers and trap access of profiling and profiling buffer control
registers from lower ELs to EL3.

This functionality is required to handle asymmetric cores where SPE has
to disabled at runtime.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I2f99e922e8df06bfc900c153137aef7c9dcfd759
2024-07-29 20:34:18 +01:00
Manish Pandey
4de07b4be7 chore(spe): rename spe_disable() to spe_stop()
During CPU power down, we stop the profiling by calling spe_disable()
function. From TF-A point of view, enable/disable means the avaibility
of the feature for lower EL. In this case we are not actully disabling
the feautre but stoping it before power down.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I6e3b39c5c35d330c51e7ac715446a8b36bf9531f
2024-07-29 20:34:04 +01:00
Manish V Badarkhe
4bcf5b847c Merge changes from topic "jc/refact_el1_ctx" into integration
* changes:
  refactor(cm): convert el1-ctx assembly offset entries to c structure
  feat(cm): add explicit context entries for ERRATA_SPECULATIVE_AT
2024-07-29 19:21:30 +02:00
Manish Pandey
0195bac19b Merge "build: consolidate directory creation rules" into integration 2024-07-29 15:54:46 +02:00
Jayanth Dodderi Chidanand
42e35d2f8c refactor(cm): convert el1-ctx assembly offset entries to c structure
Currently the EL1 part of the context structure (el1_sysregs_t),
is coupled with feature flags reducing the context memory allocation
for platforms, that don't enable/support all the architectural
features at once.

Similar to the el2 context optimization commit-"d6af234" this patch
further improves this section by converting the assembly context-offset
entries into a c structure. It relies on garbage collection of the
linker removing unreferenced structures from memory, as well as aiding
in readability and future maintenance. Additionally, it eliminates
the #ifs usage in 'context_mgmt.c' source file.

Change-Id: If6075931cec994bc89231241337eccc7042c5ede
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-07-26 17:08:12 +01:00
Jayanth Dodderi Chidanand
59b7c0a03f feat(cm): add explicit context entries for ERRATA_SPECULATIVE_AT
* Currently, "ERRATA_SPECUALTIVE_AT" errata is enabled by default
  for few cores and they need context entries for saving and
  restoring EL1 regs "SCTLR_EL1 and TCR_EL1" registers at all times.

* This prevents the mechanism of decoupling EL1 and EL2 registers,
  as EL3 firmware shouldn't be handling both simultaneously.

* Depending on the build configuration either EL1 or EL2 context
  structures need to included, which would result in saving a good
  amount of context memory.

* In order to achieve this it's essential to have explicit context
  entries for registers supporting "ERRATA_SPECULATIVE_AT".

* This patch adds two context entries under "errata_speculative_at"
  structure to assist this errata and thereby allows decoupling
  EL1 and EL2 context structures.

Change-Id: Ia50626eea8fb64899a2e2d81622adbe07fe77d65
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-07-26 15:36:31 +01:00
Manish Pandey
a3939b1bda Merge "feat(handoff): fix register convention r1/x1 value on transfer list" into integration 2024-07-24 20:04:53 +02:00
Olivier Deprez
07354cfbde Merge "fix(xlat): correct attribute retrieval in a RME enabled system" into integration 2024-07-24 18:20:37 +02:00
Manish Pandey
e7c060d559 Merge "feat(fgt2): add support for FEAT_FGT2" into integration 2024-07-24 17:26:21 +02:00
Jagdish Gediya
0aa3284a45 fix(context-mgmt): keep actlr_el2 value in the init context
The system register actlr_el2 can be set during CPU or platform reset
handler. E.g. on Arm Total Compute platform, the CLUSTERPMUEN bit of
actlr_el2 is set in the platform reset handler to enable the write
access to DSU PMU registers from EL1. However, as EL2 context gets
restored without saving it beforehand during jump to SPM and next NS
image, therefore, the initialized value of actlr_el2 is not retained.

To fix this issue, keep track of actlr_el2 value during the EL2 context
initialization. This applies for both secure and non-secure security
state.

Change-Id: I1bd7b984216c042c056ad20c6724bedce5a6a3e2
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-07-23 15:34:25 +01:00
Manish Pandey
c5b8de86c8 Merge "feat(debugv8p9): add support for FEAT_Debugv8p9" into integration 2024-07-22 18:07:11 +02:00
levi.yun
7475815f4b feat(handoff): fix register convention r1/x1 value on transfer list
According to recently firmware handsoff spec [1]'s "Register usage at handoff
boundary", Transfer List's signature value was changed from 0x40_b10b
(3 bytes) to 4a0f_b10b (4 bytes).

As updating of TL's signature, register value of x1/r1 should be:

In aarch32's r1 value should be
    R1[23:0]: set to the TL signature (4a0f_b10b -> masked range value: 0f_b10b)
    R1[31:24]: version of the register convention ==  1
and
In aarch64's x1 value should be
    X1[31:0]: set to the TL signature (4a0f_b10b)
    X1[39:32]: version of the register convention ==  1
    X1[63:40]: MBZ
(See the [2] and [3]).

Therefore, it requires to separate mask and shift value for register
convention version field when sets each r1/x1.

This patch fix two problems:
   1. breaking X1 value with updated specification in aarch64
        - change of length of signature field.

   2. previous error value set in R1 in arm32.
        - length of signature should be 24, but it uses 32bit signature.

This change is breaking change. It requires some patch for other
softwares (u-boot[4], optee[5]).

Link: https://github.com/FirmwareHandoff/firmware_handoff [1]
Link: https://github.com/FirmwareHandoff/firmware_handoff/issues/32 [2]
Link: 5aa7aa1d3a [3]
Link: https://lists.denx.de/pipermail/u-boot/2024-July/558628.html [4]
Link: https://github.com/OP-TEE/optee_os/pull/6933 [5]
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
Change-Id: Ie417e054a7a4c192024a2679419e99efeded1705
2024-07-22 15:54:44 +01:00
Manish V Badarkhe
e3c0869f6f fix(xlat): correct attribute retrieval in a RME enabled system
In a system enabled with RME, the function
'xlat_get_mem_attributes_internal' fails to accurately provide
'output PA space' for Realm and Root memory because it does not
consider the 'nse' bit in page table descriptor.
This patch resolves the issue by extracting the 'nse' bit value.
As a result, it ensures correct retrieval of attributes
in RME-enabled systems while maintaining unaffected attribute
retrieval for non-RME systems.

Change-Id: If2d01545b921c9074f48c52a98027ff331e14237
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-07-22 14:14:33 +02:00
Chris Kay
f4dd18c270 build: consolidate directory creation rules
This commit streamlines directory creation by introducing a single
pattern rule to automatically make directories for which there is a
dependency.

We currently use several macros to generate rules to create directories
upon dependence, which is a significant amount of code and a lot of
redundancy. The rule introduced by this change represents a catch-all:
any rule dependency on a path ending in a forward slash is automatically
created.

Now, rules can rely on an unordered dependency (`|`) on `$$(@D)/` which,
when secondary expansion is enabled, expands to the directory of the
target being built, e.g.:

    build/main.o: main.c | $$(@D)/ # automatically creates `build/`

Change-Id: I7e554efa2ac850e779bb302fd9c7fbb239886c9f
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-07-22 09:41:30 +00:00
Sona Mathew
becc97efc4 refactor(cpus): modify log for "ERRATA_NOT_APPLIES"
modify the print logs when an erratum workaround does not
need to be applied to a certain revision/variant of the CPU.

Change-Id: I8f60636320f617ecd4ed88ee1fbf7a3e3e4517ee
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-07-19 08:39:28 -05:00
Arvind Ram Prakash
33e6aaacf1 feat(fgt2): add support for FEAT_FGT2
This patch disables trapping to EL3 when the FEAT_FGT2
specific trap registers are accessed by setting the
SCR_EL3.FGTEn2 bit

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I6d2b614affb9067b2bc3d7bf0ae7d169d031592a
2024-07-18 13:49:43 -05:00
Arvind Ram Prakash
83271d5a5a feat(debugv8p9): add support for FEAT_Debugv8p9
This patch enables FEAT_Debugv8p9 and prevents EL1/0 from
trapping to EL3 when accessing MDSELR_EL1 register by
setting the MDCR_EL3.EBWE bit.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I3613af1dd8cb8c0d3c33dc959f170846c0b9695a
2024-07-18 13:49:43 -05:00
Manish Pandey
a822a22865 chore(cm): fix some typos in comments
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I592439f1686c333c855de98a8e7d377ba1e6c498
2024-07-16 21:51:31 +01:00
Manish Pandey
2e0efb3f40 Merge "feat(cm): context switch MDCR_EL3 register" into integration 2024-06-27 23:18:27 +02:00
Manish V Badarkhe
eb408432e5 Merge "refactor(cm): update SCTLR_EL2 initialisation" into integration 2024-06-27 16:24:23 +02:00
Jayanth Dodderi Chidanand
123002f917 feat(cm): context switch MDCR_EL3 register
Currently MDCR_EL3 register value is same for all the
worlds(Non-secure, Secure, Realm and Root).

With this approach, features enable/disable settings
remain same across all the worlds. This is not ideal as
there must be flexibility in controlling feature as per
the requirements for individual world.

The patch addresses this by providing MDCR_EL3 a per world
value. Features with identical values for all the worlds are
grouped under ``manage_extensions_common`` API.

Change-Id: Ibc068d985fe165d8cb6d0ffb84119bffd743b3d1
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-06-25 13:50:32 +01:00
AlexeiFedorov
d024cce376 fix(gpt): fix GPT library fill_l1_tbl() function
GPT library function fill_l1_tbl() gets 'first' and
'last' parameters which are the start addresses of
the 1st and the last granules in the range to fill
L1 GPT table. When RME_GPT_MAX_BLOCK build option
is not 0, condition for 'while' loop should be
changed from 'first < last' to 'first <= last' in
the case of 'first' = 'last' when a single granule
is passed.

Change-Id: I9b49a78b5a2f7a01f51dbce43bd3f3cfbb458fa2
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-06-20 10:29:58 +01:00
Jayanth Dodderi Chidanand
da1a459132 refactor(cm): update SCTLR_EL2 initialisation
Currently, during the initial bootup phase SCTLR_EL2 register
has been initialised with the endianness bit based on header
attribute evaluation at EL3.

This is not mandatorily required as TF-A by default, expects
the software at EL2 to execute in little endian format ( EE = 0).

Henceforth, this patch removes the endianness bit evaluation for
SCTLR_EL2 register and initialises with a predefined RESET value,
setting SCTLR_EL2.EE=0.

Change-Id: I53fdd5bf907cbe35c551fc03cc893821229ff807
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-06-14 18:30:28 +01:00
Chris Kay
7c4e1eea61 build: unify verbosity handling
This change introduces a few helper variables for dealing with verbose
and silent build modes: `silent`, `verbose`, `q` and `s`.

The `silent` and `verbose` variables are boolean values determining
whether the build system has been configured to run silently or
verbosely respectively (i.e. with `--silent` or `V=1`).

These two modes cannot be used together - if `silent` is truthy then
`verbose` is always falsy. As such:

    make --silent V=1

... results in a silent build.

In addition to these boolean variables, we also introduce two new
variables - `s` and `q` - for use in rule recipes to conditionally
suppress the output of commands.

When building silently, `s` expands to a value which disables the
command that follows, and `q` expands to a value which supppresses
echoing of the command:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed but not echoed'

When building verbosely, `s` expands to a value which disables the
command that follows, and `q` expands to nothing:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed and echoed'

In all other cases, both `s` and `q` expand to a value which suppresses
echoing of the command that follows:

    $(s)echo 'This command is executed but not echoed'
    $(q)echo 'This command is executed but not echoed'

The `s` variable is predominantly useful for `echo` commands, where you
always want to suppress echoing of the command itself, whilst `q` is
more useful for all other commands.

Change-Id: I8d8ff6ed714d3cb401946c52955887ed7dca602b
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-14 15:54:48 +00:00
Manish V Badarkhe
378025e20c Merge changes from topic "nrd3_support" into integration
* changes:
  feat(rdfremont): add support for measured boot at BL1 and BL2
  feat(arm): mock support for CCA NV ctr
  feat(rdfremont): fetch attestation key and token from RSE
  feat(psa): introduce generic library for CCA attestation
  feat(rdfremont): initialize the rse comms driver
  feat(rdfremont): helper to initialize rse-comms with AP-RSE MHUv3
  fix(rse): include lib-psa to resolve build
  feat(neoverse-rd): add MHUv3 channels on third gen multichip platforms
  feat(neoverse-rd): add MHUv3 doorbell channels on third gen platforms
  feat(rdfremont): initialize GPT on GPC SMMU block
  feat(rdfremont): update Root registers page offset for SMMUv3
  feat(rdfremont): enable MTE2 if present on the platform
  feat(rdfremont): enable SVE for SWD and NS
  feat(rdfremont): enable AMU if present on the platform
  feat(rdfremont): enable MPAM if present on the platform
  feat(rdfremont): add DRAM pas entries in pas table for multichip
  feat(rdfremont): add implementation for GPT setup
  feat(rdfremont): integrate DTS files for RD-Fremont variants
  feat(rdfremont): add support for RD-Fremont-Cfg2
  feat(rdfremont): add support for RD-Fremont-Cfg1
  feat(rdfremont): add support for RD-Fremont
  feat(neoverse-rd): add scope for RD-Fremont variants
  feat(neoverse-rd): add multichip pas entries
  feat(neoverse-rd): add pas definitions for third gen platforms
  feat(neoverse-rd): add DRAM layout for third gen platforms
  feat(neoverse-rd): add SRAM layout for third gen platforms
  feat(neoverse-rd): add firmware definitions for third gen platforms
  feat(neoverse-rd): add RoS definitions for third gen platforms
  feat(neoverse-rd): add CSS definitions for third gen platforms
2024-06-14 10:09:02 +02:00
Vivek Gautam
98d36e5b02 feat(psa): introduce generic library for CCA attestation
Add a generic Arm CCA attestation library driver to interface with the
PSA delegated attestation partition APIs that use RSE to fetch the
platform attestation token and Realm attestation key.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Signed-off-by: Vivek Gautam <vivek.gautam@arm.com>
Change-Id: I882273e97567cc068f90d2ef089410f3a93c6b00
2024-06-07 11:40:08 +01:00
shengfei Xu
9fd9f1d024 feat(rockchip): add RK3566/RK3568 Socs support
RK3566/RK3568 is a Quad-core soc and Cortex-a55 inside.
This patch supports the following functions:
1. basic platform setup
2. power up/off cpus
3. suspend/resume cpus
4. suspend/resume system
5. reset system

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I8b98a4d07664de26bd6078f63664cbc3d9c1c68c
2024-06-07 11:59:46 +02:00
Soby Mathew
85b9401bc0 Merge "fix(gpt): fix RME GPT library bug" into integration 2024-06-07 11:39:27 +02:00
AlexeiFedorov
6350aea2f1 fix(gpt): fix RME GPT library bug
This patch fixes fill_l1_tbl() function bug
for RME_GPT_MAX_BLOCK build option set to 0
disabling filling L1 tables with Contiguous
descriptors.

Change-Id: I3eedd6c1bb55b7c207bb3630d1ab2fda8f72eb17
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-06-06 13:03:33 +01:00
Chris Kay
ae4795261a build(romlib): don't timestamp generated wrappers
The Makefile rule for the libwrappers object files places a dependency
on a timestamp file. This timestamp file is created by the recipe that
generates the libwrappers sources, and was presumably introduced to
indicate to Make that all of the source files are generated
simultaneously by that rule.

Instead, we can use a grouped target rule, which uses `&:` instead of
`:`. This communicates to Make that all of the targets listed are
generated at once.

To demonstrate, the following two Makefile rules differ in their
behaviour:

    a.x b.x c.x: # targets may be updated independently
        ... # generate a.x, b.x and c.x

    a.x b.x c.x &: # all targets are updated at once
        ... # generate a.x, b.x and c.x

While both recipes do generate all three files, only the second rule
communicates this fact to Make. As such, Make can reason that if one of
the files is up to date then all of them are, and avoid re-running the
rule for any generated file that it has not already run it for.

Change-Id: I10b49eb72b5276c7f9bd933900833b03a61cff2f
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-04 11:09:02 +00:00
Chris Kay
d9db846766 build(romlib): de-duplicate ROMLib wrapper sources
The `romlib_generator.py` script may generate duplicate wrapper sources,
which is undesirable when using them to generate Makefile rules as Make
will warn about duplicated targets.

This change sorts the wrapper sources returned from this script, which
has the effect of also de-duplicating them.

Change-Id: I109607ef94f77113a48cc0d6e07877efd1971dbc
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-04 11:08:53 +00:00
Manish Pandey
55c7efc494 Merge "refactor(cm): move mpam registers into el2 context" into integration 2024-05-30 13:48:04 +02:00