Commit graph

7453 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Jackson Cooper-Driver
e8e1b60820 feat(tc): allow TARGET_VERSION=4
Add basic support for TARGET_VERSION=4. It extends the existing 'if'
statements in the Makefile and the header to allow them to take the
value of 4 and also specifies the SCMI platform info to use for TC4.

Change-Id: I8d8257671314277a133e88ef65fae8fada93d00e
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
36ffe3e1be feat(tc): add MHUv3 register addresses for TC4
Change-Id: I06351fc048d792943f338291f8f64827339e8e1c
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-29 14:39:21 +01:00
Olivier Deprez
241ec3a5af Merge changes from topic "mb/cot-fixes" into integration
* changes:
  fix(cot-dt2c): fix various breakages
  fix(cot-dt2c): use processed Device Tree source file as input
2024-08-29 12:06:50 +02:00
Chris Kay
73f7b7ddbe fix(cot-dt2c): fix various breakages
This change fixes several breakages that were introduced in some build
configurations by the introduction of the cot-dt2c tool.

Some Python environments cannot be managed directly via `pip`, and
invocations of `make`, including `make distclean`, would cause errors
along the lines of:

    error: externally-managed-environment

    × This environment is externally managed
    ╰─> To install Python packages system-wide, try apt install
        python3-xyz, where xyz is the package you are trying to
        install.

This change has been resolved by ensuring that calls to the cot-dt2c
tool from the build system happen exclusively through Poetry, which
automatically sets up a virtual environment that *can* be modified.

Some environments saw the following error when building platforms where
the cot-dt2c tool was used:

    make: *** No rule to make target '<..>/debug/bl2_cot.c', needed
    by '<..>/debug/bl2/bl2_cot.o'.  Stop.

Additionally, environments with a more recent version of Python saw the
following error:

      File "<...>/lib/python3.12/site-packages/cot_dt2c/cot_parser.py",
      line 637, in img_to_c
        if ifdef:
           ^^^^^
    NameError: name 'ifdef' is not defined

Both of these errors have now been resolved by modifications to the
build system and the cot-dt2c tool to enable preprocessing of the device
tree source file before it is processed by the tool.

As a consequence of this change, the `pydevicetree` library is no longer
vendored into the repository tree, and we instead pull it in via a
dependency in Poetry.

This change also resolves several MyPy warnings and errors related to
missing type hints.

Change-Id: I72b2d01caca3fcb789d3fe2549f318a9c92d77d1
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-08-28 09:56:59 +00:00
Olivier Deprez
6b206d1dd8 Merge "fix(zynqmp): handle secure SGI at EL1 for OP-TEE" into integration 2024-08-28 09:14:38 +02:00
Olivier Deprez
8f20266a79 Merge "fix(intel): software workaround for bridge timeout" into integration 2024-08-28 08:37:23 +02:00
Yang Xiwen
c961e68e79 fix(poplar): use sysctrl module to reset
Use sysctrl module rather than watchdog0 to reset the entire system.
Sysctrl is more reliable and requires less resources such as clocks and
resets. Doing this also allows non-secure OS to use the watchdog.

Change-Id: I30ac2780cc70055d81b35e55e35c9cb7f58b40cc
Signed-off-by: Yang Xiwen <forbidden405@foxmail.com>
2024-08-28 08:34:48 +02:00
Olivier Deprez
6a398523b9 Merge "fix(poplar): shutdown wdt0 before powering off" into integration 2024-08-28 08:34:36 +02:00
Olivier Deprez
95b228fe47 Merge "feat(mt8188): update SVP region ID protection flow" into integration 2024-08-28 06:38:29 +02:00
Manish V Badarkhe
cc4f383863 Merge changes from topic "clean-up-errata-compatibility" into integration
* changes:
  refactor(cpus): remove cpu specific errata funcs
  refactor(cpus): directly invoke errata reporter
2024-08-27 16:23:58 +02:00
Andre Przywara
09bf366bef fix(corstone-1000): fix Makefile error reporting
When trying to build for the Corstone-1000 platform without specifying a
valid TARGET_PLATFORM value, the "make" call reports a Makefile error
instead of the expected error messages pointing to the variable
omission:
====================
platform.mk: *** recipe commences before first target. Stop.
====================
This is due to the make's infamous special handling of the tab
character.

Fix the error report by replacing the tab with spaces.

Change-Id: I38264b6731793e5d5b929c189bb963e55bd5ce2d
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-08-27 10:39:41 +01:00
Sieu Mun Tang
e264b55739 fix(intel): update memcpy to memcpy_s
memcpy does not check the dst_size which may
create vulnerable issue as it can overflow the buffer.
Using memcpy_s which check the dst_size will help to
reduce the risk. Also, this memcpy is always 4 bytes
each time.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: I413e6ae2ee9330501703c4cd63b7943c6f55b4c7
2024-08-26 07:59:10 +08:00
Jit Loon Lim
4683946015 fix(intel): add in missing ECC register
This patch is to add in missing ECC register (INITSTAT)

Change-Id: Iecf03dc9597ec2884901c132fb9cef7e90ab06a0
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
2024-08-23 13:41:25 +02:00
Mark Dykes
44418fce30 Merge changes from topics "rockchip", "rockchip-rk3588" into integration
* changes:
  feat(rk3588): support SCMI for clock/reset domain
  feat(rk3588): support rk3588
2024-08-22 21:53:05 +02:00
Madhukar Pappireddy
d76d27e978 Merge changes from topic "stm32mp2_bl2_updates" into integration
* changes:
  feat(stm32mp2): load fw-config file
  feat(stm32mp2): add fw-config compilation
  feat(stm32mp2-fdts): add fw-config files for STM32MP257F-EV1
  feat(stm32mp2-fdts): add fw-config file
  feat(stm32mp2-fdts): add clock tree for STM32MP257F-EV1
  feat(stm32mp2): enable DDR sub-system clock
  feat(stm32mp2): add fixed regulators support
  feat(stm32mp2): print board info
  feat(stm32mp2): display CPU info
  feat(stm32mp2): get chip ID
  feat(stm32mp2): add BL2 boot first steps
  feat(stm32mp2): add defines for the PWR peripheral
  feat(stm32mp2-fdts): add SD-card and eMMC support on STM32MP257F-EV1
  feat(stm32mp2-fdts): add sdmmc pins definition
  feat(stm32mp2-fdts): add sdmmc nodes in SoC DT file
  feat(stm32mp2-fdts): add io_policies
  feat(stm32mp2-fdts): remove pins-are-numbered
2024-08-22 18:38:03 +02:00
Mark Dykes
44c5f8e582 Merge changes I23bdbbe1,Ic22ab741 into integration
* changes:
  feat(intel): enable VAB support for Intel products
  feat(intel): add in SHA384 authentication
2024-08-22 17:15:53 +02:00
Madhukar Pappireddy
5eac9fea5e Merge changes from topic "nxp-drivers/add-linflex-clk" into integration
* changes:
  feat(nxp-clk): enable UART clock
  feat(nxp-clk): add PERIPH PLL enablement
2024-08-22 15:09:16 +02:00
Joanna Farley
0c499d354f Merge "fix(xilinx): fix OVERRUN coverity violation" into integration 2024-08-22 08:55:02 +02:00
Madhukar Pappireddy
021cdbfbd4 Merge changes from topic "jc/refact_el1_ctx" into integration
* changes:
  feat(cm): enhance the cpu_context memory report
  refactor(cm): remove el1 context when SPMD_SPM_AT_SEL2=1
2024-08-21 21:55:56 +02:00
Mark Dykes
f538a096ca Merge "fix(intel): update sip smc config addr for agilex5" into integration 2024-08-21 18:03:19 +02:00
Jayanth Dodderi Chidanand
a0674ab081 refactor(cm): remove el1 context when SPMD_SPM_AT_SEL2=1
* Currently, EL1 context is included in cpu_context_t by default
  for all the build configurations.
  As part of the cpu context structure, we hold a copy of EL1, EL2
  system registers, per world per PE. This context structure is
  enormous and will continue to grow bigger with the addition of
  new features incorporating  new registers.

* Ideally, EL3 should save and restore the system registers at its next
  lower exception level, which is EL2 in majority of the configurations.

* This patch aims at optimising the memory allocation in cases, when
  the members from the context structure are unused. So el1 system
  register context must be omitted when lower EL is always x-EL2.

* "CTX_INCLUDE_EL2_REGS" is the internal build flag which gets set,
  when SPD=spmd and SPMD_SPM_AT_SEL2=1 or ENABLE_RME=1.
  It indicates, the system registers at EL2 are context switched for
  the respective build configuration. Here, there is no need  to save
  and restore EL1 system registers, while x-EL2 is enabled.

Henceforth, this patch addresses this issue, by taking out the EL1
context at all possible places, while EL2 (CTX_INCLUDE_EL2_REGS) is
enabled, there by saving memory.

Change-Id: Ifddc497d3c810e22a15b1c227a731bcc133c2f4a
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-08-21 16:35:27 +01:00
Jayanth Dodderi Chidanand
a0d9a973a4 chore(cm): reorganise sctlr_el1 and tcr_el1 ctx code
SCTLR_EL1 and TCR_EL1 regs are included either as part of errata
"ERRATA_SPECULATIVE_AT" or under el1_sysregs_t context structure.
The code to write and read into these context entries, looks
repetitive and is invoked at most places.
This section is refactored to bring them under a static procedure,
keeping the code neat and easier to maintain.

Change-Id: Ib0d8c51bee09e1600c5baaa7f9745083dca9fee1
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-08-21 08:45:25 +01:00
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