Commit graph

15310 commits

Author SHA1 Message Date
Tamas Ban
5c8b5f9f8b refactor(docs): update RSE docs to match the example CCA token
The RSE documentation includes binary and JSON dumps of the CCA platform
token. This change updates those to match the example CCA platform
token from [1] and [2], which is also the one returned by the FVP and
QEMU platforms.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Icf91035c5a56c8fa34a7055a969a6ebd8242d460
2024-09-13 13:04:53 +02:00
Tamas Ban
3ba9fca7ed refactor(qemu): use the example CCA platform token from iat-verifier
In [1] and [2], the example CCA platform token has been updated to be
aligned with the new profile(s) defined in draft-ffm-rats-cca-token-00.

This change replaces the static CCA platform token in QEMU.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I9153df1e6c1be81e669d5495dbe8d1a52e86cdff
2024-09-12 15:56:33 +02:00
Tamas Ban
4f3e0cdc45 refactor(fvp): use the example CCA platform token from iat-verifier
In [1] and [2], the example CCA platform token has been updated to be
aligned with the new profile(s) defined in draft-ffm-rats-cca-token-00.

This change replaces the static CCA platform token in the FVP platform.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ia23f0dffe618dca04f9f3c46c953a6f021101b09
2024-09-12 15:56:33 +02:00
Manish V Badarkhe
da5984db53 Merge "fix(fvp): enable FEAT_MTE2" into integration 2024-09-12 15:46:43 +02:00
Olivier Deprez
fb42d7f6c1 Merge "fix(mte): improve ENABLE_FEAT_MTE deprecation warning" into integration 2024-09-12 14:38:41 +02:00
Andre Przywara
d081c6116e fix(fvp): enable FEAT_MTE2
ENABLE_FEAT_MTE2 controls the trapping of some MTE related system
registers. If the memory_tagging_support_level parameter on the FVP
command line is set to higher values, non-secure world will see the
feature bits in the CPU ID registers and will use those registers,
triggering a panic in BL31.

Enable the feature in the optional form for the FVP build, to avoid any
panics.

Change-Id: I26ba444d784adf165db81048f93e11361c7f11ac
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-09-12 11:51:13 +01:00
Manish V Badarkhe
97a9c7ab9e Merge "fix(checkpatch): detect issues in commit message" into integration 2024-09-12 10:54:45 +02:00
Yann Gautier
078ea6657c Merge "feat(mediatek): change log level from INFO to VERBOSE" into integration 2024-09-12 10:48:59 +02:00
Gavin Liu
5f2f384890 feat(mediatek): change log level from INFO to VERBOSE
This change aims to reduce unnecessary information in the default log
output, so change to use VERBOSE.

Change-Id: I80ea57cd4164bdcef915db5392a63ae8982a634f
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2024-09-12 07:30:30 +02:00
Soby Mathew
416616567a Merge changes If374b491,I6b63b9c6 into integration
* changes:
  fix(qemu): exclude GPT reserve from BL32_MEM_SIZE
  fix(qemu): fix L0 GPT page table mapping
2024-09-11 12:27:22 +02:00
Olivier Deprez
0631d68d85 Merge "fix(arm): add extra hash config to validate ROTPK" into integration 2024-09-09 17:32:38 +02:00
Manish V Badarkhe
014975cea4 fix(arm): add extra hash config to validate ROTPK
The default mbedTLS configuration enables hash algorithms based on
the HASH_ALG or MBOOT_EL_HASH_ALG selected. However, the Arm ROTPK
is always embedded as a SHA256 hash in BL1 and BL2. In the future,
we may need to adjust this to use the HASH_ALG algorithm for
embedding the ROTPK hash.

As a temporary workaround, a separate mbedTLS configuration has
been created for Arm platforms to explicitly set SHA256 defines,
rather than relying on the default configuration. This adjustment
is reflected in the mbedTLS configuration file for the TC platform
as well as in the PSA Crypto configuration file.

Change-Id: Ib3128ce7b0fb5c0858624ecbc998d456968beddf
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-09-09 11:22:28 +01:00
Joanna Farley
75fdb32f09 Merge "feat(versal2): implement USB_SET_STATE dummy IOCTL" into integration 2024-09-09 09:54:25 +02:00
Madhukar Pappireddy
829d0a88b9 Merge "fix(gicv3): fix GITS_CTLR.Quiescent bit definition" into integration 2024-09-08 15:36:20 +02:00
magicse7en
2da29d2d07 fix(gicv3): fix GITS_CTLR.Quiescent bit definition
GITS_CTLR.Quiescent is bit31, not bit1.
So fix GITS_CTLR_QUIESCENT_BIT to BIT32(31).

Change-Id: Ic16a52e0c4e557d68a8128ccc7e7a0f1a316a23b
Signed-off-by: Joe Yang <magicse7en@outlook.com>
2024-09-06 23:26:40 +02:00
Olivier Deprez
eb366ee769 Merge "build: use ar over gcc-ar" into integration 2024-09-06 09:02:56 +02:00
Manish V Badarkhe
7dd66eec5a Merge changes from topic "jc/tcr2_asymmetric_support" into integration
* changes:
  feat(cm): handle asymmetry for FEAT_TCR2
  feat(tc): make TCR2 feature asymmetric
2024-09-05 18:30:22 +02:00
Jayanth Dodderi Chidanand
f4303d05ea feat(cm): handle asymmetry for FEAT_TCR2
With introduction of FEAT_STATE_CHECK_ASYMMETRIC, the asymmetry of cores
can be handled. FEAT_TCR2 is one of the features which can be
asymmetric across cores and the respective support is added here.

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

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I73a70891d52268ddfa4effe40edf04115f5821ca
2024-09-05 16:28:23 +01:00
Jayanth Dodderi Chidanand
3e8a82a030 feat(tc): make TCR2 feature asymmetric
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I6209dc46ddecaa09cc1220fe9488b3771ea6dc38
2024-09-05 14:11:11 +01:00
Maheedhar Bollapalli
282bce19bb feat(versal2): implement USB_SET_STATE dummy IOCTL
USB DWC3 driver calls firmware API to set USB D0/D3 power states.
In absence of firmware driver probe these PM APIs return -ENODEV
and DWC3 driver probe fails. Till PLM implement these PM APIs as
a temporary workaround add dummy PM implementation in TFA.

Change-Id: I8768301524ffdc2f275221296feaa2a3ad0ad4f6
Signed-off-by: Maheedhar Bollapalli <MaheedharSai.Bollapalli@amd.com>
2024-09-05 17:02:15 +05:30
Madhukar Pappireddy
b76929825b Merge "fix(spmd): remove spmd_handle_spmc_message" into integration 2024-09-04 18:46:19 +02:00
Chris Kay
732c6bbe28 build: use ar over gcc-ar
It has been a sufficiently long time since the last release of binutils
did not automatically enable the LTO plugin. Migrate to `ar` rather than
using the `gcc-ar` build wrapper, which saves us some pain trying to
locate the proper archiver.

Change-Id: I6f8b895d6a470d2b7cd5b98ccb23c54b35d7ad12
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-04 14:08:00 +00:00
Joanna Farley
19bcffad58 Merge "fix(xilinx): optimize logic to read IPI response" into integration 2024-09-04 13:39:09 +02:00
Manish V Badarkhe
0c755a2c66 Merge changes from topic "mbedtls-config-cleanup" into integration
* changes:
  chore(qemu): remove duplicate define
  chore(imx): remove duplicate define
  chore(arm): remove duplicate defines
  chore(mbedtls): remove hash configs
2024-09-04 12:18:36 +02:00
Jens Wiklander
1f3ca0ef5b chore(qemu): remove duplicate define
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: Id18abe80ab56fd51a9c2c1206b22d87f1e3871eb
2024-09-04 10:57:20 +02:00
Jimmy Brisson
d744e0f720 chore(imx): remove duplicate define
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
Change-Id: If55d4e2777ca2cdcf55da3b2a60d99f694a2c94d
2024-09-04 10:55:54 +02:00
Jimmy Brisson
f8e31baa9c chore(arm): remove duplicate defines
Change-Id: I9eea1610660bfa92f7781deab60e29eae11c4ba6
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-09-04 10:55:41 +02:00
Jimmy Brisson
48ee4995c5 chore(mbedtls): remove hash configs
After the upgrade to mbedtls 3.6.0, some of these configuation limitations
are no longer present.

Size chages:
build config | executable | Delta
-------------|------------|-------
tbb ecdsa    | bl1        |  -176
-------------|------------|-------
tbb rsa      | bl1        |  -192
             | bl2        | -4096
-------------|------------|-------
drtm         | romlib     |  -576
-------------|------------|-------
spm          | romlib     |  -576
-------------|------------|-------
mb384        | romlib     | -1016

Change-Id: I019bc59adc93cf95f6f28ace9579e7bf1e785b62
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-09-04 10:55:15 +02:00
Kathleen Capella
6c378c2fef fix(spmd): remove spmd_handle_spmc_message
The function `spmd_handle_spmc_message` was added into SPMD for
potential cases of SPMC sending a message (through SMC conduit)
to the SPMD. There is no longer a use case for this scenario.

Instead, if such a message is received by SPMD, return FFA_ERROR.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: I74eda4cc0edf99c83a96d10981cf6d9e727207f8
2024-09-03 20:58:04 +02:00
Manish V Badarkhe
fb3314d9e3 Merge "fix(stm32mp2): remove mapping of BL2 DT area" into integration 2024-09-03 16:52:16 +02:00
Yann Gautier
60d0758411 fix(stm32mp2): remove mapping of BL2 DT area
To prevent from coding issues that could overwrite DT area, we were
mapping this area as read-only on STM32MP1. But on STM32MP2, we need
this area to put BL31 binary. We were then using dynamic mapping. But
the area is included in the whole SYSRAM memory mapping. This is not
allowed with dynamic mapping. As no other code is running at this step,
and we know what code is running in BL2, just remove this extra
read-only protection for STM32MP2. A message is added after the post
load process of FW-CONFIG file, as BL2 DT area will be overwritten
after that.
And remove the now useless macros DTB_BASE & DTB_LIMIT.
This corrects Coverity issue: CID 443168.

Change-Id: Ic01d6a443ecf7721380ef39dc570e2d1627008d0
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-09-03 15:25:53 +02:00
Manish V Badarkhe
f280406368 Merge "fix(fdt): reserved memory: detect existing region" into integration 2024-09-03 13:12:32 +02:00
Olivier Deprez
e2c3611cf1 Merge changes from topic "mb/misc-fixes" into integration
* changes:
  docs: fix typos in cot binding
  fix(drtm): return proper values for DRTM get and set error SMCs
  fix(tools): update the fiptool and certtool to fix POSIX build
2024-09-02 17:12:01 +02:00
Yann Gautier
d2539074b6 Merge "feat(build): add ctags recipes for indexing assembly files" into integration 2024-09-02 14:44:11 +02:00
Jay Buddhabhatti
02943d0d8d fix(xilinx): optimize logic to read IPI response
Optimize logic to read IPI response from firmware and avoid using
temporary buffer. Also, use pointer instead of array as per standard
format to pass by reference in function.

Change-Id: I45ebaeacc932a11bbfd4b7d9b9c43b4ee8ee7df2
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
2024-09-02 02:37:00 -07:00
Mark Dykes
97d48be016 Merge "fix(intel): update memcpy to memcpy_s" into integration 2024-08-30 20:09:24 +02:00
Madhukar Pappireddy
7e014f4710 Merge "feat(rdv3): set CTX_INCLUDE_SVE_REGS build flag for RD-V3 variants" into integration 2024-08-30 19:26:20 +02:00
Andre Przywara
42488064e1 fix(fdt): reserved memory: detect existing region
When fdt_add_reserved_memory() is called to add a memory region, we
unconditionally add a node for that region. However there might be an
existing region node in the DT already, or there might be an overlapping
region. The Linux kernel will complain in those cases.

Cover the simple case of the region already existing in the DT, as this
is what we actually see on the Allwinner H616: The mainline DT contains
a node reserving the memory for TF-A, in case the DT changed by TF-A
itself is not given to the kernel. Our code always adds a region, making
the kernel complain - albeit without further consequences.

Covering all cases of overlapping regions would blow up the generic DT
code too much, so just add a simple check for an existing region
completely containing the to-be-added region, simply bailing out in this
case.

This prevents the kernel warning for the Allwinner H616.

This code requires a function from fdt_wrappers.c, so we have to include
that file for platforms that use the fdt_add_reserved_memory() function
(rpi4 and versal2).

Change-Id: I98404889163316addbb42130d7177f1a21c8be06
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-08-30 11:14:55 +02:00
gaurav02
155183432a feat(rdv3): set CTX_INCLUDE_SVE_REGS build flag for RD-V3 variants
Commit 4242262(feat(simd):add sve state to simd ctxt struct)
introduced the CTX_INCLUDE_SVE_REGS build flag that needs to be set
if SVE is enabled for more than one world, which is the case for
RD-V3. This build flag enables SVE registers to be included when
saving and restoring the CPU context.

Change-Id: Ic491939061e42e8c87a805ded99e271308f90352
Signed-off-by: Gautham Ravichandran <gautham.ravichandran@arm.com>
2024-08-29 19:18:30 +01:00
Manish V Badarkhe
afcb696e20 docs: fix typos in cot binding
Fixed a few typos in the cot binding document.

Change-Id: I043187b3f4b516db944e82569307834df2c3c72a
Signed-off-by: sah01 <sahil@arm.com>
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-08-29 17:31:35 +01:00
Manish V Badarkhe
5e1fa57459 fix(drtm): return proper values for DRTM get and set error SMCs
The DRTM get and set error previously returned SMC_UNK when these
SMCs were issued. This has been corrected to return an appropriate
error code on failure, and success otherwise.
Also,align the error code values with the specification.

Change-Id: I8f11f94f1ab097245003dbde97365fa54e0097ba
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-08-29 17:31:35 +01:00
Manish V Badarkhe
ccbfd01d95 fix(tools): update the fiptool and certtool to fix POSIX build
This patch fixes below issue raised:

https://github.com/TrustedFirmware-A/trusted-firmware-a/issues/8
https://github.com/TrustedFirmware-A/trusted-firmware-a/issues/9
https://github.com/TrustedFirmware-A/trusted-firmware-a/issues/10

Change-Id: I521bf7410535ffe49198789ba183cc401b3b88a0
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-08-29 17:31:25 +01:00
Andre Przywara
54b773e183 feat(build): add ctags recipes for indexing assembly files
The "ctags" code referencing tool creates an index for all identifiers
used in a project. The builtin recipes handle our C files just fine, but
due to a lack of a standard for marking functions and variables in assembly
files, will fail including the assembly code.

Provide the regular expressions that match the function tags used in our
assembly files, alongside the syntax we use for macros and "equ"
defines.

This will include assembly code in a ctags cross reference session.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I47d531bfc6fafe9aeef9f4b66b7fdc4490b2e161
2024-08-29 15:58:24 +01:00
Manish V Badarkhe
8e9bdc5b1d Merge changes from topic "us_tc4_rebase_v2" into integration
* changes:
  feat(tc): bind DPU SMMU on TC4
  feat(tc): bind GPU SMMU on TC4
  feat(tc): update DT for Drage GPU
  feat(tc): enable SME and SME2 options for TC4
  feat(tc): add new TC4 RoS definitions
  feat(tc): add system generic timer register definition for TC4
  feat(tc): allow TARGET_VERSION=4
  feat(tc): add MHUv3 register addresses for TC4
  feat(tc): add device tree binding for TC4
2024-08-29 16:58:07 +02:00
Jackson Cooper-Driver
e365479d0d feat(tc): bind DPU SMMU on TC4
TC4 adds a new SMMU-700 specifically for the DPU (in the RoS). This is
used as the DPU SMMU instead of the existing SMMU used for both the GPU
and DPU. Update the devicetree to reflect this.

Note that the streamID values have also changes for this new SMMU. This
is because TC4 also updates the new SMMU to use a different streamID for
each DPU port - these must all be added to the device tree.

Change-Id: If2ce9749e40937fd1291346d071b691cfb662f2e
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Leo Yan
11ec5de695 feat(tc): bind GPU SMMU on TC4
A SMMU-700 is used on TC4 for only GPU, on both FVP and FPGA. Add DT
binding for it.

Change-Id: I1b840676fd02c3961d4efdd769f12a4b01d459fb
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Leo Yan
b3a4f8cfcf feat(tc): update DT for Drage GPU
This patch incorporates the changes for Drage GPU to uses new access
window interface "IRQ_AW". As the interrupt properties are different
between TC4 and other TC platforms, this patch appends the interrupt
properties in platform specific DT binding file.

Change-Id: I2ca505846f03ce64b8e5f02fd202962dbfe39f25
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Jackson Cooper-Driver
9face2123a feat(tc): enable SME and SME2 options for TC4
Set the Make flags for TF-A to be able to enable SME and SME2 features.
Note that we enable these architectural features for both the secure and
non-secure worlds, which is required on TC4.

In the case of the non-secure world, we specify a value of 2 for the
flag which specifies that TF-A should check the feature register to
ensure that the feature is present before enabling it. This allows these
flags to be compatible with all platforms and stops TF-A doing anything
different if it does not detect that the feature is present.

Change-Id: I51f8c7e3eb1cf06767f4b155c93269e1f129f730
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Jackson Cooper-Driver
e9e83e96bb feat(tc): add new TC4 RoS definitions
The TC4 uses a new RoS (Virtual Peripherals) and places them at
different address to that in TC3. Add these addresses to the DTS.

Change-Id: Ia62a670e47cdc98b3c113a670a21edc65905cafe
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Jackson Cooper-Driver
d6b6a8b7cc feat(tc): add system generic timer register definition for TC4
Add new include (specific to TC4) to the TC platform file which
specifies the system generic timer base address and is used by the TF-a
for use as system counters.

Note that this include must come before arm_def.h. This is required
as it checks if ARM_SYS_CNTCTL macros are defined before defining
its own macros.

Change-Id: I56861e5737271b29f09c75d962533be620766b52
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00