Commit graph

8091 commits

Author SHA1 Message Date
Soby Mathew
ca3f2eee11 Merge "feat(rmmd): verify FEAT_MEC present before calling plat hoook" into integration 2025-03-26 17:39:57 +01:00
Juan Pablo Conde
609ada9691 feat(rmmd): verify FEAT_MEC present before calling plat hoook
Some platforms do not support FEAT_MEC. Hence, they do not provide
an interface to update the update of the key corresponding to a
MECID.

This patch adds a condition in order to verify FEAT_MEC is present
before calling the corresponding platform hook, thus preventing it
from being called when the platform does not support the feature.

Change-Id: Ib1eb9e42f475e27ec31529569e888b93b207148c
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
2025-03-26 15:46:38 +01:00
Maheedhar Bollapalli
435bc14a94 fix(versal): handle invalid entry point in cpu hotplug scenario
Invalid addresses are from 2G-4G and also address where TF-A is.

Change-Id: I3d07808821da3bdd46be819ad829cb284f9d53d3
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-26 06:33:21 +00:00
Maheedhar Bollapalli
e5e417ddec fix(versal-net): handle invalid entry point in cpu hotplug scenario
Invalid addresses are from 2G-4G and also address where TF-A is.

Change-Id: I153d26bd92ea26efcd7f236e2f1d89c3e5442ba4
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-26 06:33:21 +00:00
Maheedhar Bollapalli
df44616a12 fix(zynqmp): handle invalid entry point in cpu hotplug scenario
Invalid addresses are from 2G-4G and also address where TF-A is.

Change-Id: Iedb817a2f9667b7d0b9a3ac03891a5b93295bf87
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-26 06:33:09 +00:00
Govindraj Raja
8fb8b93984 Merge "refactor(mediatek): fix mcusys off issue for MTK GIC v3 driver" into integration 2025-03-25 16:33:40 +01:00
Soby Mathew
90f9c9bef5 Merge "feat(rme): add SMMU and PCIe information to Boot manifest" into integration 2025-03-25 12:35:47 +01:00
AlexeiFedorov
90552c612e feat(rme): add SMMU and PCIe information to Boot manifest
- Define information structures for SMMU, root complex,
  root port and BDF mappings.
- Add entries for SMMU and PCIe root complexes to Boot manifest.
- Update RMMD_MANIFEST_VERSION_MINOR from 4 to 5.

Change-Id: I0a76dc18edbaaff40116f376aeb56c750d57c7c1
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2025-03-25 10:26:18 +00:00
Manish Pandey
518b278bed Merge changes from topic "hm/handoff-aarch32" into integration
* changes:
  refactor(arm): simplify early platform setup functions
  feat(bl32): enable r3 usage for boot args
  feat(handoff): add lib to sp-min sources
  feat(handoff): add 32-bit variant of SRAM layout
  feat(handoff): add 32-bit variant of ep info
  fix(aarch32): avoid using r12 to store boot params
  fix(arm): reinit secure and non-secure tls
  refactor(handoff): downgrade error messages
2025-03-24 17:29:57 +01:00
Manish V Badarkhe
2f4bcc08bb Merge "feat(zynqmp): add pin group for lower qspi interface" into integration 2025-03-21 12:30:41 +01:00
Manish V Badarkhe
3c198a97ad Merge "fix(rdv3): correctly handle FP regs context saving" into integration 2025-03-21 10:13:57 +01:00
Runyang Chen
2be3014f6b refactor(mediatek): fix mcusys off issue for MTK GIC v3 driver
When mcusys is off, rdist_ctx will save the rdist data of the last core.
In the case of the last core plug off, the data of other cores will be
inconsistent with the data in rdist_ctx.

Therefore, each core needs to use a dedicated context.

Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>
Change-Id: Ic9501f4da219cf906c0e348982be3f550c3ba30b
2025-03-21 06:38:05 +01:00
Harrison Mutai
8921349894 refactor(arm): simplify early platform setup functions
Refactor `arm_sp_min_early_platform_setup` to accept generic
`u_register_r` values to support receiving firmware handoff boot
arguments in common code. This has the added benefit of simplifying the
interface into common early platform setup.

Change-Id: Idfc3d41f94f2bf3a3a0c7ca39f6b9b0013836e3a
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-03-20 13:57:14 +00:00
Rakshit Goyal
ac05182df0 fix(rdv3): correctly handle FP regs context saving
Commit fe488c3796 added an override to
force `CTX_INCLUDE_SVE_REGS` to 0 when `SPD == spmd` and
`SPMD_SPM_AT_SEL2 == 1`.
Since there is an architectural dependency between FP and SVE registers,
`CTX_INCLUDE_FPREGS` must also be overridden to 0 when
CTX_INCLUDE_SVE_REGS is 0.

Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I1cd834241a2d5a5368ac532a348d8729a701bbcd
2025-03-20 13:04:53 +00:00
Manish V Badarkhe
7e84854015 Merge changes from topic "dtpm_poc" into integration
* changes:
  feat(docs): update mboot threat model with dTPM
  docs(tpm): add design documentation for dTPM
  fix(rpi3):  expose BL1_RW to BL2 map for mboot
  feat(rpi3): add dTPM backed measured boot
  feat(tpm): add Infineon SLB9670 GPIO SPI config
  feat(tpm): add tpm drivers and framework
  feat(io): add generic gpio spi bit-bang driver
  feat(rpi3): implement eventlog handoff to BL33
  feat(rpi3): implement mboot for rpi3
2025-03-20 12:57:14 +01:00
Soby Mathew
4848824548 Merge changes from topic "mec" into integration
* changes:
  feat(qemu): add plat_rmmd_mecid_key_update()
  feat(rmmd): add RMM_MECID_KEY_UPDATE call
2025-03-20 10:26:23 +01:00
Jean-Philippe Brucker
9c9a31eb9a feat(qemu): add plat_rmmd_mecid_key_update()
Add an implementation of the plat_rmmd_mecid_key_update() callback, that
updates the MEC keys associated with a MECID. Leave it empty for now,
since QEMU doesn't yet implement an MPE (Memory Protection Engine).

Change-Id: I2746f6024f28e4fd487726de9e43e14d8cad57a0
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2025-03-18 19:43:16 -05:00
Tushar Khandelwal
f801fdc22e feat(rmmd): add RMM_MECID_KEY_UPDATE call
With this addition, TF-A now has an SMC call to handle the
update of MEC keys associated to MECIDs.

The behavior of this newly added call is empty for now until an
implementation for the MPE (Memory Protection Engine) driver is
available. Only parameter sanitization has been implemented.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I2a969310b47e8c6da1817a79be0cd56158c6efc3
2025-03-18 17:17:06 -05:00
Abhi Singh
9acaaded3c fix(rpi3): expose BL1_RW to BL2 map for mboot
BL2 requires the ability to access the TCG Event Log during
Measured Boot. Currently the Platform hangs since the Event Log
is not exposed to BL2's mmap. Define a RPI3_BL1_RW region to be
added to the BL2 Image, if Measured Boot is enabled.

Change-Id: Ic236a80e73ea342b4590cfb65bafbb8ffac17085
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 20:53:27 +01:00
Abhi Singh
4f9894db35 feat(rpi3): add dTPM backed measured boot
In BL1 and BL2 add support for the use of an Infineon Optiga SLB 9670
TPM2.0.
The platform utilizes the gpio_spi.c driver to bit-bang gpio pins in
order to send commands and receive responses to/from the TPM.
In BL1 & BL2:
-utilize TPM commands to initialize the gpio pins for "spi"
 communication, and extend image hashes to the TPM's PCR 0,
 at the end of the measured boot phase for the bootloader,
 the TPM locality is released.
-Bl1 executes a tpm_startup command in order to flush the TPM.

Change-Id: I2f2fa28f60a262a0aa25a674c72a9904b3cf4d8a
Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:59:03 +01:00
Abhi Singh
6dfcf4e1df feat(rpi3): implement eventlog handoff to BL33
At the end of BL2 measured boot, write the address
and size of the TCG Event Log to NT_FW_CONFIG so
that the log can be consumed later by BL33.
-add dynamic configuration helpers for the fdt
-write the eventlog address and size to the fdt

Change-Id: I099dd9cc96d740ae13cb8b8e8c6b9f2e6c02accc
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:54:35 +01:00
Abhi Singh
c4c9e2bc43 feat(rpi3): implement mboot for rpi3
Add Measured Boot support using the Event Log backend for the rpi3
platform.
-Implement measured boot infrastructure in BL1 & BL2, including
 the init, measure image, and finish phases.
-Pass the eventlog addr and size from BL1 to BL2 using the
 image entry point args.
-dump the eventlog after measuring BL2, and after all images are
 measured in BL2.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: I7c040c4a2d001a933fefb0b16f0fdf2a43a11be9
2025-03-18 19:52:57 +01:00
Maheedhar Bollapalli
2333ab4cd2 fix(versal2): rename console build arg to generic
Rename VERSAL2_CONSOLE build argument to CONSOLE to
keep it aligned with generic build arguments.

Change-Id: I0f4967aa262f0300d8f76f6638030a1839901234
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-18 16:52:16 +00:00
Harrison Mutai
2948d1f819 fix(arm): reinit secure and non-secure tls
Initializing the transfer list using `transfer_list_ensure` allows reuse
of an already initialized transfer list. While this is beneficial when
receiving a transfer list and ensuring one exists, it causes issues
during a system RESET if the old content of SRAM is not cleared.

To prevent this, at least one step in the reset path must zero intialise
the transfer list memory. Unless a previous stage explicitly provides a
transfer list via boot arguments, a fresh transfer list should be
created.

This change ensures that BL1 and BL31 properly reinitialize the transfer
lists, preserving correctness for secure and non-secure handoffs in
TF-A.

Change-Id: I3bfaa9e76df932a637031d645e4a22d857a094a5
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-03-17 16:56:48 +00:00
Mark Dykes
5a16264208 Merge "feat(intel): provide atf build version via smc call" into integration 2025-03-14 16:35:07 +01:00
Mark Dykes
af74739f2a Merge "fix(intel): this patch is used to solve DDR and VAB" into integration 2025-03-14 16:34:14 +01:00
Soby Mathew
c5ea3faca1 Merge "feat(rmmd): add FEAT_MEC support" into integration 2025-03-12 11:19:04 +01:00
Yann Gautier
a69468cee1 Merge "fix(xilinx): avoid unexpected variable update" into integration 2025-03-12 09:14:24 +01:00
Tushar Khandelwal
7e84f3cf90 feat(rmmd): add FEAT_MEC support
This patch provides architectural support for further use of
Memory Encryption Contexts (MEC) by declaring the necessary
registers, bits, masks, helpers and values and modifying the
necessary registers to enable FEAT_MEC.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I670dbfcef46e131dcbf3a0b927467ebf6f438fa4
2025-03-11 14:46:00 -05:00
Manish Pandey
5488b945d6 Merge "build(poetry): install dependencies with --no-root" into integration 2025-03-10 11:54:25 +01:00
Chris Kay
c25405d613 build(poetry): install dependencies with --no-root
More recent versions of Poetry introduced the `package-mode` key to
configure whether the project should be used for dependency management
only, but this is incompatible with the earlier versions of Poetry that
we still support.

Instead, we rely on installing with the `--no-root` flag, which behaves
similarly. Installing without passing the `--no-root` flag is
deprecated, and in recent versions of Poetry has become a hard error.

This change ensures that the build system always installs dependencies
with the required flag.

Change-Id: Ic1543511314dcd20c00b73fd9e8cfae3dd034a41
Signed-off-by: Chris Kay <chris.kay@arm.com>
2025-03-10 09:27:38 +00:00
Jit Loon Lim
458b40df58 fix(intel): this patch is used to solve DDR and VAB
The patch provide solutions for:
1. Enable BL31 console logs during run-time.
2. Update VAB initialization.
3. Update DDR size accordin to Linux DTS configuration.
4. Solve VAB CCERT address issue.

Change-Id: I41eb0fab747de5010d369e845c33a45decb41e21
Signed-off-by: Jit Loon Lim <jit.loon.lim@altera.com>
2025-03-08 13:11:25 +08:00
Girisha Dengi
d1c58d8649 feat(intel): provide atf build version via smc call
This patch provides ATF build version via SMC call
on Agilex7, Agilex5, Stratix10 and N5X platforms.

Change-Id: I61af83433fe61f85987f38ffc86380a41cdb5289
Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@altera.com>
2025-03-08 12:58:08 +08:00
Maheedhar Bollapalli
50029b9ac3 fix(platforms): modify function to have single return
This corrects the MISRA violation C2012-15.5:
A function should have a single point of exit at the end.
Introduced a temporary variable to store the return value to
ensure single return for the function.

Change-Id: I9c2ca05b506a6ac35b24966fc5fdd5e88e65770d
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-07 13:22:18 +01:00
Maheedhar Bollapalli
7e288d11a5 fix(platforms): add missing curly braces
This corrects the MISRA violation C2012-15.6:
The body of an iteration-statement or a selection-statement shall
be a compound-statement.
Enclosed statement body within the curly braces.

Change-Id: I1327a206782ccd341c0c7eaa3f26078150458ed0
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-07 13:22:18 +01:00
Madhav Bhatt
b3d25dca86 fix(xilinx): avoid unexpected variable update
The commit 50ab13577f ("fix(xilinx): typecast expression to match
data type") introduced a change where the isenabler1 variable is
modified within the loop iterating over GICD_ISENABLER registers.
Instead of computing the offset from the base address for each
register, the offset is accumulated incorrectly, leading to an
incorrect register read.

As a result, some GIC enablers, including the RTC device were missed,
so pm_set_wakeup_source was not called for them and the
suspend-resume use case was failed because of that.

Fix the logic to ensure the correct offset calculation for each
iteration, preserving the intended behavior.

Fixes: 50ab13577f fix(xilinx): typecast expression to match data type
Change-Id: Iec5bafcbde21078545a37259b2cf0353585ef1fa
Signed-off-by: Madhav Bhatt <madhav.bhatt@amd.com>
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
2025-03-06 20:20:41 -08:00
Manish Pandey
d153bcf427 Merge "feat(spm_mm): move mm_communication header define to general header" into integration 2025-03-06 23:36:19 +01:00
J-Alves
dcd8d7f13d feat(fvp): increase cactus-tertiary size
Increase the size of cactus-tertiary partition to match update in
manifest. Part of effort to use cactus-tertiary partition in StMM/HOB
testing.

Dependent on
https://review.trustedfirmware.org/c/TF-A/tf-a-tests/+/35383

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I5b91400848e2cf5d04d1c7442874a7a4b9847399
2025-03-04 14:38:13 -06:00
Manish Pandey
183f2ea2fe Merge changes I0396b597,I326f920f,I0437eec8,Ieadf01fc,I4e1d8c24, ... into integration
* changes:
  feat(fvp): set defaults for build commandline
  docs(arm): enable Linux boot from fip as BL33
  feat(arm): enable Linux boot from fip as BL33
  docs(fvp): update fvp build time options
  docs(arm): add initrd props to dtb at build time
  feat(arm): add initrd props to dtb at build time
2025-03-04 17:13:46 +01:00
Carsten Hansen
fe81d9c959 feat(zynqmp): add pin group for lower qspi interface
ZynqMP provides two QSPI interfaces on MIO[0..12],
but the existing pin group definitions only allow
all or none of the pins to be configured for QSPI.

This is an issue on platforms that use only the lower
QSPI interface and require the remaining pins to be
configured for other purposes such as general I/O.

Add pin groups to support QSPI on MIO[0..4] with SS
(slave select) on MIO5, freeing up MIO[7..12] for
other uses.

The new pin groups can be accessed from Linux as
'qspi0_1_grp' and 'qspi_ss_1_grp'.

Change-Id: Ibdb3f13d4ba9194a3be8ce5e63478d9066d087ac
Signed-off-by: Carsten Hansen <Carsten.Hansen@bksv.com>
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
2025-03-04 04:06:37 -08:00
Salman Nabi
bf9a25f075 feat(fvp): set defaults for build commandline
When using ARM_LINUX_KERNEL_AS_BL33, set defaults for the below for
increased build time efficiency:

PRELOADED_BL33_BASE=0x80080000
This address supports older kernels before v5.7

ARM_PRELOADED_DTB_BASE=0x87F00000 (only in RESET_TO_BL31)
1MiB before the address 0x88000000 in FVP. 1MiB seems enough for the
device tree blob (DTB).

Change-Id: I0396b597485e163b43f7c6677c04fcc08db55aa8
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2025-03-03 16:56:57 +00:00
Salman Nabi
eb8cb9534b feat(arm): enable Linux boot from fip as BL33
Disable the reliance of ARM_LINUX_KERNEL_AS_BL33 on PRELOADED_BL33_BASE
so that a Linux Kernel can be loaded and booted from the fip as BL33.

Change-Id: I0437eec852cf17e0ed37a7ff77fcc4e66b1cea7a
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2025-03-03 16:56:56 +00:00
Salman Nabi
1c08ff3277 feat(arm): add initrd props to dtb at build time
Add initrd properties to the device tree blob at build time, giving
users the ability to run a linux kernel and successfully boot it to
the terminal. Users can boot a linux kernel in a normal flow as well
as in RESET_TO_BL31. This function is an extension of the build time
option "ARM_LINUX_KERNEL_AS_BL33=1".

The build time options INITRD_SIZE or INITRD_PATH will trigger the
insertion of initrd properties in to the DTB. If both options are
provided then the INITRD_SIZE will take precedence.

The available options are:
INITRD_SIZE: Provide the initrd size in dec or hex (hex format must
precede with '0x'.
Example: INITRD_SIZE=0x1000000

INITRD_PATH: Provide an initrd path for the build time to find its
exact size.

INITRD_BASE: A required build time option that sets the initrd base
address in hex format. A default value can be set by the platform.
Example: INITRD_BASE=0x90000000

Change-Id: Ief8de5f00c453509bcc6e978e0a95d768f1f509c
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2025-03-03 16:56:54 +00:00
Govindraj Raja
e5a1f4abee Merge "feat(mt8196): fix MT8196 gpio driver" into integration 2025-03-03 16:21:54 +01:00
Manish Pandey
c72200357a fix(el3-runtime): replace CTX_ESR_EL3 with CTX_DOUBLE_FAULT_ESR
ESR_EL3 value is updated when an exception is taken to EL3 and its value
does not change until a new exception is taken to EL3. We need to save
ESR in context memory only when we expect nested exception in EL3.

The scenarios where we would expect nested EL3 execution are related
with FFH_SUPPORT, namely
  1.Handling pending async EAs at EL3 boundry
    - It uses CTX_SAVED_ESR_EL3 to preserve origins esr_el3
  2.Double fault handling
    - Introduce an explicit storage (CTX_DOUBLE_FAULT_ESR) for esr_el3
      to take care of DobuleFault.

As the ESR context has been removed, read the register directly instead
of its context value in RD platform.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I7720c5f03903f894a77413a235e3cc05c86f9c17
2025-02-28 11:48:37 +00:00
Govindraj Raja
70b5967ebc Merge changes from topic "mb/drtm" into integration
* changes:
  feat(drtm): retrieve DLME image authentication features
  feat(drtm): log No-Action Event in Event Log for DRTM measurements
  feat(fvp): add stub function to retrieve DLME image auth features
  feat(drtm): introduce plat API for DLME authentication features
  feat(drtm): ensure event types aligns with DRTM specification v1.1
  fix(drtm): add missing DLME data regions for min size requirement
  feat(fvp): add stub platform function to get ACPI table region size
  feat(drtm): add platform API to retrieve ACPI tables region size
2025-02-27 19:14:11 +01:00
Mark Dykes
1dd6f3ece6 Merge changes from topic "gr/build_fix_spmd" into integration
* changes:
  fix(rdv3): handle invalid build combination
  fix(build): handle invalid spd build options
2025-02-27 17:12:29 +01:00
Madhukar Pappireddy
c8054c8d58 Merge changes I5aabe415,Ief6fb4fc into integration
* changes:
  feat(stm32mp15-fdts): add SP_MIN versions of DT files
  feat(st): use dedicated version of DT for SP_MIN
2025-02-27 16:21:14 +01:00
Govindraj Raja
fe488c3796 fix(rdv3): handle invalid build combination
`CTX_INCLUDE_SVE_REGS` should not be enabled when building with
SPD=spmd and SPMD_SPM_AT_SEL2=1 both been used.

Unfortunately a check at top level makefile ignored this, now its been
fixed at top level makefile. Ensure correct combination are handled,
otherwise it will lead to build failures.

Change-Id: Ib84fc0096c92d9b3d56366c0e1d77b6d83098221
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2025-02-27 09:19:57 -06:00
Govindraj Raja
9da0ba8e83 Merge changes Ie8c83c92,I9cca19fd into integration
* changes:
  feat(stm32mp2): disable PIE by default on STM32MP2 platform
  refactor(stm32mp2): remove useless STM32MP_SEC_SYSRAM_SIZE
2025-02-27 16:10:04 +01:00