Commit graph

14443 commits

Author SHA1 Message Date
Harrison Mutai
33c665ae95 fix(cpus): workaround for Cortex-A715 erratum 2344187
Cortex-A715 erratum 2344187 is a Cat B erratum that applies to r0p0,
r1p0 and is fixed in r1p1. The workaround is to set GCR_EL1.RRND to
0b1, and apply an implementation specific patch sequence.

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

Change-Id: I78ea39a91254765c964bff89f771af33b23f29c1
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-03-07 10:19:56 +00:00
Sona Mathew
cc41b56f41 fix(cpus): workaround for Cortex-X4 erratum 2701112
Cortex-X4 erratum 2701112 is cat B erratum that applies to
revision r0p0 and is fixed in r0p1. This erratum affects
system configurations that do not use an Arm interconnect IP.

The workaround for this erratum is not implemented in EL3.
The erratum can be enabled/disabled on a platform level.
The flag is used when the errata ABI feature is enabled and can
assist the Kernel in the process of mitigation of the erratum.

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

Change-Id: I8ede1ee75b0ea1658369a0646d8af91d44a8759b
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-06 16:40:59 -06:00
Mark Dykes
10eb851f92 Merge changes from topic "errata" into integration
* changes:
  fix(cpus): workaround for Cortex-A715 erratum 2331818
  fix(cpus): workaround for Cortex-A715 erratum 2420947
2024-03-06 22:12:41 +01:00
Bipin Ravi
7b02a57213 Merge "fix(gic600): workaround for Part 1 of GIC600 erratum 2384374" into integration 2024-03-06 21:24:20 +01:00
Arvind Ram Prakash
24a4a0a5ec fix(gic600): workaround for Part 1 of GIC600 erratum 2384374
GIC600 erratum 2384374 is a Category B erratum. Part 1 is fixed
in this patch, and the Part 1 failure mode is described as
'If the packet to be sent is a SET packet, then a higher priority SET
may not be sent when it should be until an unblocking event occurs.'

This is handled by calling gicv3_apply_errata_wa_2384374() in the
ehf_deactivate_priority() path, so that when EHF restores the priority
to the original priority, the interrupt packet buffered
in the GIC can be sent.

gicv3_apply_errata_wa_2384374() is the workaround for
the Part 2 of erratum 2384374 which flush packets from the GIC buffer
and is being used in this patch.

SDEN can be found here:
https://developer.arm.com/documentation/sden892601/latest/

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I4bb6dcf86c94125cbc574e0dc5119abe43e84731
2024-03-06 14:16:35 -06:00
Bipin Ravi
53b3cd2532 fix(cpus): workaround for Cortex-A715 erratum 2331818
Cortex-A715 erratum 2331818 is a cat B erratum that applies to
revisions r0p0 and r1p0 and is fixed in r1p1. The workaround is to
set bit[20] of CPUACTLR2_EL1. Setting this bit is expected to have
a negligible performance impact.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN2148827/latest

Change-Id: If3b1ed78b145ab6515cdd41135314350ed556381
Signed-off-by: Bipin Ravi <biprav01@u203721.austin.arm.com>
2024-03-06 13:57:02 -06:00
Bipin Ravi
6e2e9747c4 Merge "fix(arm): move console flush/switch in common function" into integration 2024-03-06 20:22:50 +01:00
Manish Pandey
6bdc856bc9 fix(arm): move console flush/switch in common function
There are some CI configs which apply patch on the fly to test some
unusual test scenarios. After commit c864af989 there is one patch which
does not apply cleanly into arm_bl31_plat_runtime_setup().

To fix this issue move console flush/switch into the caller of this
function.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I4116044d53bef349a707c977cf26d1df65200045
2024-03-06 19:20:58 +00:00
Bipin Ravi
1f73247132 fix(cpus): workaround for Cortex-A715 erratum 2420947
Cortex-A715 erratum 2420947 is a cat B erratum that applies only
to revision r1p0 and is fixed in r1p1. The workaround is to set
bit[33] of CPUACTLR2_EL1. This will prevent store and store-release
to merge inside the write buffer, and it is not expected to have
much performance impacts.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN2148827/latest

Change-Id: I01a71b878cd958e742ff8357f8cdfbfc5625de47
Signed-off-by: Bipin Ravi <biprav01@u203721.austin.arm.com>
2024-03-06 13:10:31 -06:00
Manish V Badarkhe
9502a88b4f Merge changes from topic "drtm1.0-updates" into integration
* changes:
  feat(drtm): update DRTM version to 1.0
  feat(drtm): update references to DRTM beta0
  feat(drtm): for TPM features fw hash algorithm should be 16-bits
  feat(drtm): add ACPI table region size to the DLME header
  feat(drtm): update return code if secondary PE is not off
  feat(drtm): add additional return codes
2024-03-06 19:07:03 +01:00
Tamas Ban
6df8d7647d feat(tc): group components into certificates
Set the cert_id argument to group the components
into certificates. The grouping reflects the likely units
of updateability.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ie7a1f10c84af727d0cd39e3a78b0cb59cbc2e457
2024-03-06 17:11:11 +01:00
Tamas Ban
6a415bd1e7 feat(dice): add cert_id argument to dpe_derive_context()
This custom argument is meant to simplify to group
components into certificates. Components with
the same cert_id contribute to the same certificate
regardless of the load order or the structure of the
derivation tree. This argument aims to flatten the tree
structure and make it easy to include branches or
subtrees in the main derivation line.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I83c4abc399616063a5eb04792d603899f7513627
2024-03-06 17:11:11 +01:00
David Vincze
33f29b8ae4 refactor(sds): modify log level for region validity
Modify the log level from WARNING to VERBOSE for the SDS region
validity check. An invalid region causes the initialization step
to fail, but normally it's only a temporary condition as the
actual initialization of the region (such as adding a valid region
descriptor structure) can happen asynchronously in another system
component. The goal of this tiny modification is to avoid flooding
the log with this message when we're waiting in a loop for the
region initialization to happen.

Change-Id: I180e35e25df3f31bbc816e6421ded17ba6ae1d85
Signed-off-by: David Vincze <david.vincze@arm.com>
2024-03-06 17:11:11 +01:00
David Vincze
7be391d1ce feat(tc): add dummy TRNG support to be able to boot pVMs
pVMs on Android 14 has a platform requirement to support
SMCCC TRNG discovery. This implementation add a
dummy TRNG support to TC2.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Iae0ca546cadf48a6a404ae578c7ccf5a84d057c4
2024-03-06 17:11:10 +01:00
Tamas Ban
467bdf26b6 feat(tc): get the parent component provided DPE context_handle
Each client who wants to communicate with the DPE service
must own a valid context handle issued by the DPE service.
A context handle can be used for a single time then it will
be invalidated by the DPE service. In case of calls from
the same component, the next valid context handle is
returned in the response to a DPE command. When a component
finishes their job then the next component in the boot flow
inherits its first context handle from its parent.
How the inheritance is done can be client or
platform-dependent. It can be shared through shared
memory or be part of a DTB object passed to the next
bootloader stage.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: Ic82f074f1c5b15953e78f9fa5404ed7f48674cbb
2024-03-06 17:10:21 +01:00
Tamas Ban
03d388d8e3 feat(tc): share DPE context handle with child component
To be allowed to communicate with DPE service all
components must own a valid context handle. The first
valid context handle is inherited from the parent
component via a DTB object.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Id357fab3586398b1933444e1d10d1ab6d8243ab9
2024-03-06 17:10:14 +01:00
Tamas Ban
1f47a7133f feat(tc): add DPE context handle node to device tree
Child software components are inheriting their first valid
DPE context handle from their parent components (who loaded
and measured them). The context handle is shared through
the device tree object the following way:
 - BL1 -> BL2  via TB_FW_CONFIG
 - BL2 -> BL33 via NT_FW_CONFIG

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I9bf7808fb13a310ad7ca1895674a0c7e6725e08b
2024-03-06 16:55:23 +01:00
Tamas Ban
e7f1181f8a feat(tc): add DPE backend to the measured boot framework
The client platform relies on the DICE attestation
scheme. RSS provides the DICE Protection Environment
(DPE) service. TF-A measured boot framework supports
multiple backends. A given platform always enables
the corresponding backend which is required by the
attestation scheme.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Idc3360d0d7216e4859e99b5db3d377407e0aeee5
2024-03-06 16:55:08 +01:00
Yann Gautier
4a8357fb4b Merge "docs(maintainers): add myself as SynQuacer platform co-maintainer" into integration 2024-03-06 16:52:16 +01:00
Tamas Ban
2b53106a0e feat(auth): add explicit entries for key OIDs
Key-OIDs that authenticate SCP_BL2, BL32, BL33,
Trusted FW config and Non-trusted FW config images
have been explicitly entered.
Implementations of signer-ID consume these entries.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Icfb4a4920792c475a92d190837fb24090a57ef89
2024-03-06 15:44:55 +01:00
Tamas Ban
0ae9c631ea feat(dice): add DPE driver to measured boot
Implement a DPE specific backend within the
generic measured boot framework.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ia3a0eac0ee6f7b4b337a93d08286613e7c8186b4
2024-03-06 15:44:55 +01:00
Tamas Ban
b03fe8c025 feat(dice): add client API for DICE Protection Environment
RSS provides the DICE Protection Environment
service (DPE). It partially implements the
DPE specification from TCG.

As a DPE profile, it supports the
Open Profile for DICE specification.
https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md

In order to communicate with the service, commands
must be CBOR encoded.
The API implementation:
 - Expose a C API to the upper layer,
 - Do the CBOR encoding, decoding of the DPE
   commands,
 - Rely on the PSA framework to communicate
   with the RSS through an MHU.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I26a08f0c7cbffe07e725a7defbb6c60fd7735efe
2024-03-06 15:44:55 +01:00
Tamas Ban
c19977be0c feat(dice): add QCBOR library as a dependency of DPE
DPE commands are CBOR encoded. QCBOR library is used
in TF-A for CBOR encoding.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ifd01e1e6e1477cf991e765b97c446684fc6ef9b9
2024-03-06 15:44:55 +01:00
Tamas Ban
584052c7f8 feat(dice): add typedefs from the Open DICE repo
The DPE implementation in RSS is aligned with the
Open Profile for DICE specification:
https://pigweed.googlesource.com/open-dice/

Type definitions are needed to specify the input
values for the DPE service. Instead of mandating to
clone the entire open-dice repo, the following file
is copied from the repository:
https://pigweed.googlesource.com/open-dice/+/refs/heads/main/include/dice/dice.h
Git SHA of the source version: cf549422e3

This is external code, with Apache 2.0 license, therefore
the license.rst is updated accordingly and a copy of this
license is also added.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: Ie84b8483034819d1143fe0ec812e66514ac7d4cb
2024-03-06 15:44:55 +01:00
Tamas Ban
cb249050e7 docs(changelog): add 'dice' scope
To cover the DICE related works such as
DICE Protection Environment (DPE) integration
with the measurd boot framework.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I9769b7bddbd1d269705ebff1d15870ab928fd8ef
2024-03-06 15:44:55 +01:00
Tamas Ban
24844d8b71 refactor(tc): align image identifier string macros
Macros were renamed, align with new names.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Id7a556da34381618577fed4039d9ca957754cd7c
2024-03-06 15:44:55 +01:00
Tamas Ban
09bb42dbd4 refactor(fvp): align image identifier string macros
Macros were renamed, align with new names.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I85d03164f580d9c41b7955482914d20188e559e5
2024-03-06 15:44:55 +01:00
Tamas Ban
c6b204cca5 refactor(imx8m): align image identifier string macros
Macros were renamed, align with new names.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I26be3bc52e176898700568fab5f6c19678978797
2024-03-06 15:44:55 +01:00
Tamas Ban
069eca6692 refactor(qemu): align image identifier string macros
Macros were renamed, align with new names.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Iefcbf4aac9ce4b21f49a633749703f93d4e34250
2024-03-06 15:44:55 +01:00
Tamas Ban
a8a09e3141 fix(measured-boot): add missing image identifier string
The case for SPD=spmd was not handled.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I6c6f268aeb0db15d41662bea81f4a9255e1fabe9
2024-03-06 15:44:55 +01:00
Tamas Ban
d95060288b refactor(measured-boot): move metadata size macros to a common header
The max size macros of metadata elements are shared across
multiple measured boot backends: rss-measured-boot, dpe.

Increase the SW_TYPE_MAX_SIZE to be able to accomodate
all macro.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ic9004a36ef1df96c70a4f7adf7bb86dc27dd307c
2024-03-06 15:44:55 +01:00
Tamas Ban
a77a7444e5 refactor(measured-boot): move image identifier strings to a common header
The image identifier strings are used across different measured boot
backends. Move them to a common location to avoid the redefiniton
of these per backend and to avoid code duplication.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I58897b9a19396be932ca5d230ee00858c09ef03f
2024-03-06 15:44:55 +01:00
Yann Gautier
d5b4d5d2e6 feat(st-sdmmc2): set FIFO size to 1024 on STM32MP25
On STM32MP25, a new version of the SDMMC2 IP is embedded (v3.0).
The size of the FIFO is 1024 in this new IP version.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ie6b1fb215fc77b24b7c342d4cd69248a96039a4d
2024-03-06 11:54:00 +01:00
Lauren Wehrmeister
0cda4adae7 Merge changes from topic "sm/framework_optimize" into integration
* changes:
  chore: rearrange the fvp_cpu_errata.mk file
  fix(cpus): add erratum 2701951 to Cortex-X3's list
  refactor(errata-abi): workaround platforms non-arm interconnect
  refactor(errata-abi): optimize errata ABI using errata framework
2024-03-05 23:38:17 +01:00
Stuart Yoder
9c36b900f9 feat(drtm): update DRTM version to 1.0
Update DRTM version from 0.1 to 1.0.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Ic37fd29e4c2de1a29c2808870addba049d488773
2024-03-05 14:24:13 -06:00
Stuart Yoder
b94d59099f feat(drtm): update references to DRTM beta0
Update all references to DRTM beta0 to be 1.0 instead.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Ieda70f26f3be42f4705e9b267706674c94f120f2
2024-03-05 14:17:15 -06:00
Stuart Yoder
c86cfa3597 feat(drtm): for TPM features fw hash algorithm should be 16-bits
The DRTM 1.0 spec changed the Firmware hash algorithm field
size from 32-bits to 16-bits.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: I713e32e01b1983bf21d97c93bbb28c77dc94a541
2024-03-05 14:17:04 -06:00
Stuart Yoder
5dde96b024 feat(drtm): add ACPI table region size to the DLME header
The DRTM 1.0 spec defines an additional field in the DLME
header for an optional region in the DLME to hold ACPI tables.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Idba7fa6bd0fb4ef2bdffc24f4588720e1661e58c
2024-03-05 14:13:08 -06:00
Stuart Yoder
bc9064ae5c feat(drtm): update return code if secondary PE is not off
DRTM 1.0 specifies that if any secondary PEs are not off
during a dynamic launch the return code must be
SECONDARY_PE_NOT_OFF.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Idcb1f3c60daa63a5bc994bdeacca8aab7066f628
2024-03-05 14:10:32 -06:00
Stuart Yoder
89f5c753af feat(drtm): add additional return codes
Add additional return codes defined in the DRTM 1.0 spec.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: I1620e098edf4f070ac759a26ce3c7272faf2d8b2
2024-03-05 14:09:48 -06:00
Madhukar Pappireddy
e8eb44182d Merge "fix(el3-spmc): add datastore linker script markers" into integration 2024-03-05 19:41:02 +01:00
Sona Mathew
1ba369a5e0 chore: rearrange the fvp_cpu_errata.mk file
Change-Id: I3959bdf5852c5714f2238f61493a931b3c857a20
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
106c4283a5 fix(cpus): add erratum 2701951 to Cortex-X3's list
Erratum ID 2701951 is an erratum that could affect platforms that
do not use an Arm interconnect IP. This was originally added to the list
of Cortex-A715 in the errata ABI files.
Fixed this by adding it to the Cortex-X3 list.

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

Change-Id: I6ffaf4360a4a2d0a23c253a2326c178e010c8e45
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
aceb9c9e54 refactor(errata-abi): workaround platforms non-arm interconnect
The workarounds for these below mentioned errata are not implemented
in EL3, but the flags can be enabled/disabled at a platform level
based on arm/non-arm interconnect IP flag. The ABI helps assist the
Kernel in the process of mitigation for the following errata:

Cortex-A715:   erratum 2701951
Neoverse V2:   erratum 2719103
Cortex-A710:   erratum 2701952
Cortex-X2:     erratum 2701952
Neoverse N2:   erratum 2728475
Neoverse V1:   erratum 2701953
Cortex-A78:    erratum 2712571
Cortex-A78AE:  erratum 2712574
Cortex-A78C:   erratum 2712575

Change-Id: Ie86b7212d731a79e2a0c07649e69234e733cd78d
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
c9f2634387 refactor(errata-abi): optimize errata ABI using errata framework
Errata ABI feature introduced per CPU based errata structures
in the errata_abi_main.c, these can be removed by re-using
the structures created by the errata framework.

Change-Id: I1a60d3e4f116b6254fb45426f43ff1b21771af89
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:08:58 -06:00
Lauren Wehrmeister
aee3757f17 Merge "fix(cpus): workaround for Cortex-A715 erratum 2429384" into integration 2024-03-05 16:31:54 +01:00
Bipin Ravi
58843f25d3 Merge "build: allow platform makefiles to configure ENABLE_LTO" into integration 2024-03-05 16:31:28 +01:00
Chris Kay
fa402f38b2 build: allow platform makefiles to configure ENABLE_LTO
This change introduces a lazily-evaluated condition on `ENABLE_LTO` to
the `LTO_CFLAGS` variable as opposed to evaluating the condition
eagerly.

This concludes a recent request on the mailing list:

    https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/EU3XR4VB3RP2NQB372QPZ4VRP57ANNLC/

Change-Id: Ie1f73352eb51fb2ceb2385232336312216ef87fc
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-03-05 16:30:02 +01:00
Masahisa Kojima
f9f1b4d989 docs(maintainers): add myself as SynQuacer platform co-maintainer
Add myself as co-maintainer for SynQuacer platform,
as I'm currently working on it.

Change-Id: I149830bf7f635f72df808214e8fd23730fde7212
Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
2024-03-05 10:38:17 +01:00
Stefan Kerkmann
81de50372c feat(imx8m): add defines for csu_sa access security
This enables the usage of speaking defines instead of magic numbers:

  CSU_SA(CSU_SA_SDMA1, 1, LOCKED)

becomes:

  CSU_SA(CSU_SA_SDMA1, NON_SEC_ACCESS, LOCKED)

Change-Id: Idcabcda677bf7840084a2ea66d321b50aa0b2b20
Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
2024-03-05 10:05:47 +01:00