Commit graph

14016 commits

Author SHA1 Message Date
Sandrine Bailleux
e3f9ed852b docs(auth): add missing AUTH_PARAM_NV_CTR value
Section "Describing the authentication method(s)" of the Authentication
Framework documentation shows the authentication parameters types
(auth_param_type_t enum type) but is missing the AUTH_PARAM_NV_CTR
value. Add it.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I7c9022badfb039bfa9f999ecee40f18b49e6764c
2024-02-02 15:32:34 +01:00
Sandrine Bailleux
4290d34393 docs: fix link to TBBR specification
The former link pointed to a page which displayed the following warning
message:

  We could not find that page in the latest version, so we have taken
  you to the first page instead

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: Icf9277770e38bc5e602b75052c2386301984238d
2024-02-02 15:31:12 +01:00
Manish Pandey
89b9d96573 Merge "fix(ehf): restrict secure world FIQ routing model to SPM_MM" into integration 2024-02-01 15:49:00 +01:00
Manish Pandey
7671008fcf fix(ehf): restrict secure world FIQ routing model to SPM_MM
Exception handling framework (EHF) changes the semantics of interrupts,
sync and async external aborts. As far as interrupts are concerned it
changes the routing model of foreign interrupts (FIQs) by changing
SCR_EL3.FIQ to 1 for both non-secure and secure except when SPMD is
used along with Hafnium/SPM at S-EL2 [1].
For NS world it means : G1S and G0 interrupts are routed to EL3
For Secure world it means : G1NS and G0 are routed to EL3

There is no upstream use case utilizing EHF and re-routing EL3
interrupts to the Secure world except when SPM_MM is present.

Modify the FIQ routing model during EHF init just for known use cases,
Always for NS world and for secure world only if SPM_MM is present.

[1]:https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16047

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic292bbe8dd02d560aece5802d79569d868d8500f
2024-02-01 13:15:43 +00:00
Manish Pandey
00f97e4d1c Merge "fix(build): mute sp_mk_generator from build log" into integration 2024-01-31 10:19:18 +01:00
Olivier Deprez
fbd32ac081 fix(build): mute sp_mk_generator from build log
Add a silent token to sp_mk_generator python script invocation.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I51d9bd6965504d8869e946db0a74691bbaa1dcd2
2024-01-31 10:08:01 +01:00
Lauren Wehrmeister
c6db6d0361 Merge "fix(cpus): workaround for Cortex X3 erratum 2641945" into integration 2024-01-30 23:27:01 +01:00
Olivier Deprez
7a277aa83d Merge changes I509b7bc5,Ibd36ea5c into integration
* changes:
  fix(fconf): boot fails using ARM_ARCH_MINOR=8
  fix(libc): add memcpy_s source file to libc_asm mk
2024-01-30 17:29:35 +01:00
Sandrine Bailleux
0bf0d92867 Merge "docs: import MISRA compliance spreadsheet" into integration 2024-01-30 17:12:55 +01:00
Madhukar Pappireddy
84f9abecca Merge "feat(stm32mp1): only fuse monotonic counter on closed devices" into integration 2024-01-30 15:40:49 +01:00
Olivier Deprez
0c86a846d9 fix(fconf): boot fails using ARM_ARCH_MINOR=8
When building TF-A (with SPMD support) with ARM_ARCH_MAJOR=8/
ARCH_ARCH_MINOR=8 options, this forces the -march=armv8.8-a compiler
option. In this condition, the compiler optimises statement [1] into
a store pair to an unaligned address resulting to a supposedly alignment
fault. With -march=armv8.7-a and earlier the compiler resolves with a
memcpy. Replacing this line by an explicit memcpy masks out the issue.
Prefer using the plain struct uuid in place of the uuid_helper union
for further clarity.

[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/
plat/arm/common/fconf/arm_fconf_sp.c?h=v2.10#n77

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I509b7bc50c7c4a894885d24dc8279d0fe634e8f2
2024-01-30 12:15:52 +01:00
Olivier Deprez
99db13bfaa fix(libc): add memcpy_s source file to libc_asm mk
Change [1] introduced the memcpy_s function and added the source file to
lib/libc/libc.mk but omitted to update lib/libc/libc_asm.mk
Arm platforms (and platforms from one partner) use OVERRIDE_LIBC=1
option as a platform default hence consume libc_asm.mk
To prevent this confusion to happen again, create libc_common.mk for the
common set of C files to build.
libc_common.mk is included by both libc.mk and libc_asm.mk
The latter adds asm implementations of libc functions.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/21450

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ibd36ea5c561e35f268048ccbefc8f47485f64bdf
2024-01-30 12:15:15 +01:00
Manish V Badarkhe
28c79e1013 Merge changes from topic "plat_gpt_setup" into integration
* changes:
  feat(arm): move GPT setup to common BL source
  feat(arm): retrieve GPT related data from platform
  refactor(arm): rename L0/L1 GPT base macros
2024-01-30 12:13:14 +01:00
Manish Pandey
7516d93d3a Merge "feat(cpufeat): add feature detection for FEAT_CSV2_3" into integration 2024-01-29 22:46:39 +01:00
Manish Pandey
0d136806ed Merge changes from topic "st-bsec3" into integration
* changes:
  feat(stm32mp2): add BSEC and OTP support
  feat(st-bsec): add driver for the new IP version BSEC3
2024-01-29 16:38:43 +01:00
Sona Mathew
30019d8698 feat(cpufeat): add feature detection for FEAT_CSV2_3
This feature provides support to context save the
SCXTNUM_ELx register. FEAT_CSV2_3 implies the implementation
of FEAT_CSV2_2. FEAT_CSV2_3 is supported in AArch64 state only
and is an optional feature in Arm v8.0 implementations.

This patch adds feature detection for v8.9 feature FEAT_CSV2_3,
adds macros for ID_AA64PFR0_EL1.CSV2 bits [59:56] for detecting
FEAT_CSV2_3 and macro for ENABLE_FEAT_CSV2_3.

Change-Id: Ida9f31e832b5f11bd89eebd6cc9f10ddad755c14
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-01-29 14:06:56 +00:00
Sandrine Bailleux
d48425144d Merge "docs: update links to TF-A issues tracker" into integration 2024-01-29 14:15:10 +01:00
Sandrine Bailleux
6c2c8528ac docs: import MISRA compliance spreadsheet
TF-A aims to comply with MISRA C:2012 Guidelines. We maintain a list of
all rules and directives and whether the project aims to comply with
them or not. A rationale is given for each deviation.

This list used to be provided as an '.ods' spreadsheet file hosted on
developer.trustedfirmware.org. This raises the following issues:

 - The list is not version-controlled under the same scheme as TF-A
   source code. This could lead to synchronization issues between the
   two.

 - The file needs to be open in a separate program, which is not as
   straightforward as reading it from TF-A documentation itself.

 - developer.trustedfirmware.org is deprecated, thus the file cannot be
   safely kept there for any longer.

To address these issues, convert the '.ods' file into a CSV (Comma
Separated Values) file, which we import into TF-A source tree itself.
Make use of Sphinx's ability to process and render CSV files as tables
to display that information directly into the Coding Guidelines
document.

Also make the following minor changes along the way:

 - Remove dead link to MISRA C:2012 Guidelines page. Replace it with a
   link to a Wikipedia page to give a bit of context to the reader.

 - We no longer use Coverity for MISRA compliance checks. Instead, we
   use ECLAIR nowadays. Reflect this in the document.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I422fdd8246f4f9c2498c1be18115408a873b86ac
2024-01-29 11:43:51 +01:00
Madhukar Pappireddy
c9f05a326f Merge "feat(imx8m): obtain boot image set for imx8mn/mp" into integration 2024-01-26 17:50:03 +01:00
Manish V Badarkhe
772981cff4 Merge "feat(cpufeat): add cortex-a35 l2 extended control register" into integration 2024-01-26 16:38:39 +01:00
Sandrine Bailleux
77f7a6a8ca docs: update links to TF-A issues tracker
developer.trustedfirmware.org is deprecated so we cannot use its issues
tracker anymore. Instead, the project will now make use of the issues
tracker associated with the project's Github mirror at [1].

Reflect this change in TF-A documentation.

[1] https://github.com/TrustedFirmware-A/trusted-firmware-a/issues

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I912f7dafc74368dba4e61ba4c9f358d5bf8346a9
2024-01-26 14:11:04 +01:00
Igor Opaniuk
6d2c502afb feat(imx8m): obtain boot image set for imx8mn/mp
In i.MX8MM/MQ it is possible to have two copies of bootloader in
SD/eMMC and switch between them. The switch is triggered either
by the BootROM in case the bootloader image is faulty OR can be
enforced by the user, and there is API introduced in
9ce232fe ("feat(plat/imx8m): add SiP call for secondary boot"),
which leverages this SoC feature.

However neither i.MX8MP nor i.MX8MN have a dedicated bit
which indicates what boot image set is currently booted.
According to AN12853 [1] "i.MX ROMs Log Events", it is
possible to determine whether fallback event occurred
by parsing the BootROM event log. In case ROM event ID 0x51 is
present,fallback event did occur and secondary boot image was booted.

Knowing which boot image was booted might be useful for reliable
bootloader A/B updates, detecting fallback event might be used for
making decision if boot firmware rollback is required.

This patche introduces implementation, that replicates the same
imx_src_handler() behaviour as on i.MX8MM/MQ SoCs.

The code is based on original U-Boot implementation [2].

[1]: https://www.nxp.com/webapp/Download?colCode=AN12853
[2]: a5ee05cf71

Change-Id: I9a4c5229aa0e53fa23b5261459da99cb3ce6bdbe
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2024-01-26 08:51:27 +01:00
Jacky Bai
a727d59d9c feat(cpufeat): add cortex-a35 l2 extended control register
Add Cortex-A35 l2 extended control register definition.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: I14c766a88c95fef0f95a6f2e9d8ca87dbeac77c2
2024-01-26 11:00:43 +08:00
Bipin Ravi
c1aa3fa555 fix(cpus): workaround for Cortex X3 erratum 2641945
Cortex X3 erratum 2641945 is a Cat B erratum that applies to all
revisions <= r1p0 and is fixed in r1p1.

The workaround is to disable the affected L1 data cache prefetcher
by setting CPUACTLR6_EL1[41] to 1. Doing so will incur a performance
penalty of ~1%. Contact Arm for an alternate workaround that impacts
power.

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

Change-Id: Ia6d6ac8a66936c63b8aa8d7698b937f42ba8f044
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-01-25 17:14:54 -06:00
Manish V Badarkhe
6c74b55637 Merge "fix(mte): remove CTX_INCLUDE_MTE_REGS usage" into integration 2024-01-25 17:59:33 +01:00
Govindraj Raja
30788a8455 fix(mte): remove CTX_INCLUDE_MTE_REGS usage
commit@0a33adc058080433f73bde73895266068990245c
Deprecated CTX_INCLUDE_MTE_REGS but missed its usage in
context save and restore path.

Change-Id: I30544abdff2cf92ff05d2d4df46ffc6ff10611de
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-01-25 08:39:01 -06:00
Rohit Mathew
341df6af6e feat(arm): move GPT setup to common BL source
As of now, GPT setup is being handled from BL2 for plat/arm platforms.
However, for platforms having a separate entity to load firmware images,
it is possible for BL31 to setup the GPT. In order to address this
concern, move the GPT setup implementation from arm_bl2_setup.c file to
arm_common.c. Additionally, rename the API from arm_bl2_gpt_setup to
arm_gpt_setup to make it boot stage agnostic.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: I35d17a179c8746945c69db37fd23d763a7774ddc
2024-01-25 10:45:22 +00:00
Rohit Mathew
86e4859a05 feat(arm): retrieve GPT related data from platform
For RME-enabled platforms, initializing L0 and L1 tables and enabling
GPC checks is necessary. For systems using BL2 to load firmware images,
the GPT initialization has to be done in BL2 prior to the image load.
The common Arm platform code currently implements this in the
"arm_bl2_plat_gpt_setup" function, relying on the FVP platform's
specifications (PAS definitions, GPCCR_PPS, and GPCCR_PGS).

Different Arm platforms may have distinct PAS definitions, GPCCR_PPS,
GPCCR_PGS, L0/L1 base, and size. To accommodate these variations,
introduce the "plat_arm_get_gpt_info" API. Platforms must implement
this API to provide the necessary data for GPT setup on RME-enabled
platforms. It is essential to note that these additions are relevant to
platforms under the plat/arm hierarchy that will reuse the
"arm_bl2_plat_gpt_setup" function.

As a result of these new additions, migrate data related to the FVP
platform to its source and header files.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: I4f4c8894c1cda0adc1f83e7439eb372e923f6147
2024-01-25 10:45:22 +00:00
Rohit Mathew
1e7545accd refactor(arm): rename L0/L1 GPT base macros
In accordance with common naming conventions, macros specifying the base
address of a region typically use the prefix "BASE" combined with the
region name, rather than "ADDR_BASE."

Currently, the macros defining the base addresses for L0 and L1 GPT
tables within `arm_def.h` are named "ARM_L0_GPT_ADDR_BASE" and
"ARM_L1_GPT_ADDR_BASE" respectively. To adhere to the established naming
convention, rename these macros as "ARM_L1_GPT_BASE" and
"ARM_L0_GPT_BASE" respectively.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: Ibd50a58a1f63ba97d2df141f41a21a89ef97d6fb
2024-01-25 10:45:22 +00:00
Manish Pandey
19220a02c7 Merge "docs(cpufeat): clarify description of FEATURE_DETECTION macro" into integration 2024-01-25 11:15:15 +01:00
Andre Przywara
641571c728 docs(cpufeat): clarify description of FEATURE_DETECTION macro
The current documentation of the FEATURE_DETECTION build option seems
to suggest that this macro enables the dynamic runtime checking of
features, although this is done regardless of this debug feature.
FEATURE_DETECTION just adds the detect_arch_features() function to the
build and calls it early on, plus it enables the CPU errata order
checking.

Simplify the description of the FEATURE_DETECTION macro to make this
clear, and move the dynamic feature detection description into a
separate section, before all the specific ENABLE_FEAT_xxx explanations.

This also renames all mentioning of:
"... to align with the FEATURE_DETECTIION mechanism ..."
with:
"... to align with the ENABLE_FEAT mechanism ..."
in the description of each feature.

Change-Id: I5f4dd2d1e43bd440687b7cee551d02ec853d4e23
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-01-24 20:51:09 +00:00
Lauren Wehrmeister
07da4854e9 Merge changes from topics "rcar-tools-fix", "toolchain-cleanup" into integration
* changes:
  build: remove the `NM` variable
  build: prefer `gcc-ar` over `ar`
  build: add `--no-warn-rwx-segments` when linking with GCC
  build: always use the C compiler to assemble
  build: always use the C compiler to preprocess
  fix(rcar): fix implicit rule invocations in tools
2024-01-24 16:11:22 +01:00
Robin van der Gracht
d6bb94f3a1 feat(stm32mp1): only fuse monotonic counter on closed devices
The fused monotonic counter is checked by the ROM bootloader. The ROM
bootloader won't allow booting images build with a lower
STM32_TF_VERSION value.

On non-closed devices a user can easily circumvent this. But it is
annoying for a developer when open development hardware gets the counter
value fused.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Change-Id: Ie52561368a3178de9d9a44b9d089664241452651
2024-01-24 12:22:55 +01:00
Manish V Badarkhe
61dfdfd4db Merge "refactor(mte): deprecate CTX_INCLUDE_MTE_REGS" into integration 2024-01-24 11:05:32 +01:00
Sandrine Bailleux
fc26a0fcac Merge "feat(qemu-sbsa): handle memory information" into integration 2024-01-24 07:57:49 +01:00
Lauren Wehrmeister
3f02459572 Merge changes from topic "errata" into integration
* changes:
  fix(cpus): workaround for Cortex-A78C erratum 2683027
  fix(cpus): workaround for Cortex-X3 erratum 2266875
  fix(cpus): workaround for Cortex-X3 erratum 2302506
2024-01-23 21:43:06 +01:00
Govindraj Raja
0a33adc058 refactor(mte): deprecate CTX_INCLUDE_MTE_REGS
Currently CTX_INCLUDE_MTE_REGS is used for dual purpose,
to enable allocation tags register and to context save and restore
them and also to check if mte feature is available.

To make it more meaningful, remove CTX_INCLUDE_MTE_REGS
and introduce FEAT_MTE. This would enable allocation tags register
when FEAT_MTE is enabled and also supported from platform.

Also arch features can be conditionally enabled disabled based on
arch version from `make_helpers/arch_features.mk`

Change-Id: Ibdd2d43874634ad7ddff93c7edad6044ae1631ed
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-01-23 11:58:55 -06:00
Sandrine Bailleux
d4a770a99b Merge "fix(intel): update nand driver to match GHRD design" into integration 2024-01-23 16:03:26 +01:00
Sandrine Bailleux
4b8e507822 Merge changes Ib481fade,Id4070b46,I4ac997cd into integration
* changes:
  feat(rcar3): update IPL and Secure Monitor Rev.4.0.0
  feat(rcar3): add cache operations to boot process
  feat(rcar3): change MMU configurations
2024-01-23 15:20:21 +01:00
Yann Gautier
197ac780d7 feat(stm32mp2): add BSEC and OTP support
Add compilation and initialization of BSEC peripheral, to access OTP
fuses. Add the definition of OTP fuses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: If6403838b1e2c04c59effc8545b381aced5f7cda
2024-01-23 14:49:43 +01:00
Nicolas Le Bayon
ae6542f6c7 feat(st-bsec): add driver for the new IP version BSEC3
This driver is used for the new version of the BSEC peripheral used
on STM32MP25.

Change-Id: I38ca0db22d06704769c994c6806ccd80b17dde6e
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-01-23 14:49:34 +01:00
Manish Pandey
e6a0994c02 Merge changes from topic "st-bsec-otp" into integration
* changes:
  feat(stm32mp2-fdts): add board ID OTP in STM32MP257F-EV1
  feat(stm32mp2-fdts): add OTP nodes in STM32MP251 SoC DT file
  fix(stm32mp2): add missing include
  feat(st): do not directly call BSEC functions in common code
  feat(st): use stm32_get_otp_value_from_idx() in BL31
  refactor(st): update test for closed chip
  refactor(st-bsec): improve BSEC driver
  refactor(st): use dashes for BSEC node names
2024-01-23 12:54:09 +01:00
Olivier Deprez
9f9b4814c5 Merge "fix(marvell-tools): include mbedtls/version.h before use" into integration 2024-01-23 10:55:11 +01:00
Girisha Dengi
a773f4121b fix(intel): update nand driver to match GHRD design
Update nand driver to match GHRD design, fix row
address calculation method and other misc updates.

Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: I1cb3dda43e767ba243fbe89bfa18818db321c5c2
2024-01-23 00:05:11 +08:00
Joanna Farley
1064bc6c8c Merge changes from topic "idling-during-subsystem-restart" into integration
* changes:
  fix(xilinx): add console_flush() before shutdown
  fix(xilinx): fix sending sgi to linux
  feat(xilinx): add new state to identify cpu power down
  feat(xilinx): request cpu power down from reset
  feat(xilinx): power down all cores on receiving cpu pwrdwn req
  feat(xilinx): add handler for power down req sgi irq
  feat(xilinx): add wrapper to handle cpu power down req
  fix(versal-net): use arm common GIC handlers
  fix(xilinx): rename macros to align with ARM
2024-01-22 16:12:02 +01:00
Joanna Farley
b7e85c7cee Merge "feat(versal): extend platform address space sizes" into integration 2024-01-22 16:07:46 +01:00
Joanna Farley
c0bf07e077 Merge "fix(xilinx): deprecate SiP service count query" into integration 2024-01-22 16:07:03 +01:00
Manish V Badarkhe
99f9aacd20 Merge "docs(threat-model): supply chain threat model TF-A" into integration 2024-01-22 14:45:17 +01:00
Sandrine Bailleux
2109aadd97 Merge "feat(rcar3): enable the stack protection" into integration 2024-01-22 14:31:45 +01:00
Olivier Deprez
81704f5d30 Merge "docs(security): security advisory for CVE-2023-49100" into integration 2024-01-22 10:41:55 +01:00