Commit Graph

10401 Commits

Author SHA1 Message Date
Jorge Ramirez-Ortiz 25844ff728
feat(bl31): aarch64: RESET_TO_BL31_WITH_PARAMS
It is not always the case that RESET_TO_BL31 enabled platforms don't
execute a bootloader before BL31.

For those use cases, being able to receive arguments from that first
loader (i.e: a DTB with TPM logs) might be necessary feature.

This code has been validated on iMX8mm.

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Change-Id: Ibf00c3867cb1d1012b8b376e64ccaeca1c9d2bff
2022-04-29 22:54:23 +02:00
Joanna Farley e96ffdc8b4 Merge "fix(errata): workaround for Cortex-X2 erratum 2147715" into integration 2022-04-19 17:07:49 +02:00
Manish Pandey dfc59a7b82 Merge changes from topic "st_nvmem_layout" into integration
* changes:
  refactor(stm32mp1-fdts): remove nvmem_layout node
  refactor(stm32mp1): drop the "st,stm32-nvmem-layout" node
  refactor(st): remove useless includes
2022-04-19 16:11:24 +02:00
Manish Pandey 38b7828e1a Merge "refactor(ufs): delete unused variables" into integration 2022-04-19 11:51:12 +02:00
Jorge Troncoso a8904e94f0 refactor(ufs): delete unused variables
The result variable is not being used so it's better to delete it.

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: Icae614076ce1ba7cdc86267473d59a8bec682f6c
2022-04-14 14:35:12 -07:00
Joanna Farley 863296898a Merge "refactor(context mgmt): add cm_prepare_el3_exit_ns function" into integration 2022-04-12 17:44:52 +02:00
Joanna Farley 9c2e925964 Merge "refactor(mpam): remove initialization of EL2 registers when EL2 is used" into integration 2022-04-12 17:44:41 +02:00
Joanna Farley d2b68f498f Merge "refactor(context mgmt): refactor the cm_setup_context function" into integration 2022-04-12 17:44:31 +02:00
Joanna Farley 6cd0a2cbb3 Merge "refactor(context mgmt): remove registers accessible only from secure state from EL2 context" into integration 2022-04-12 17:44:00 +02:00
Zelalem Aweke 8b95e84870 refactor(context mgmt): add cm_prepare_el3_exit_ns function
As part of the RFC:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/13651,
this patch adds the 'cm_prepare_el3_exit_ns' function. The function is
a wrapper to 'cm_prepare_el3_exit' function for Non-secure state.

When EL2 sysregs context exists (CTX_INCLUDE_EL2_REGS is
enabled) EL1 and EL2 sysreg values are restored from the context
instead of directly updating the registers.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I9b071030576bb05500d54090e2a03b3f125d1653
2022-04-12 17:42:11 +02:00
Zelalem Aweke fd5da7a847 refactor(mpam): remove initialization of EL2 registers when EL2 is used
The patch removes initialization of MPAM EL2 registers when an EL2
software exists. The patch assumes the EL2 software will perform
the necessary initializations of the registers.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I5bed81bc22f417bc3e3cbbcd860a8553cd4307cd
2022-04-12 17:41:51 +02:00
Zelalem Aweke 2bbad1d126 refactor(context mgmt): refactor the cm_setup_context function
This patch splits the function 'cm_setup_context' into four
functions to make it more readable and easier to maintain.

The function is split into the following functions based on
the security state of the context.

 - setup_context_common - performs common initializations
 - setup_secure_context - performs Secure state specific
			  initializations
 - setup_realm_context - performs Realm state specific
			 initializations
 - setup_ns_context - performs Non-secure state specific
		      initializations

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: Ie14a1c2fc6586087e7aa36537cf9064c80802f8f
2022-04-12 17:41:41 +02:00
Zelalem Aweke 7f41bcc76d refactor(context mgmt): remove registers accessible only from secure state from EL2 context
The following registers are only accessible from secure state,
therefore don't need to be saved/restored during world switch.
 - SDER32_EL2
 - VSTCR_EL2
 - VSTTBR_EL2

This patch removes these registers from EL2 context.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I24d08aacb1b6def261c7b37d3e1265bb76adafdc
2022-04-12 17:41:23 +02:00
Lauren Wehrmeister 807d6d6217 Merge "chore(measured boot): remove unused DTC flags" into integration 2022-04-12 17:19:01 +02:00
Sandrine Bailleux 2d1ba79cde Merge "style(plat/arm/corstone1000): resolve checkpatch warnings" into integration 2022-04-12 17:17:14 +02:00
Bipin Ravi 63446c27d1 fix(errata): workaround for Cortex-X2 erratum 2147715
Cortex-X2 erratum 2147715 is a Cat B erratum that applies to revision
r2p0 and is fixed in r2p1. The workaround is to set CPUACTLR_EL1[22]=1,
which will cause the CFP instruction to invalidate all branch predictor
resources regardless of context.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I2d81867486d9130f2c36cd4554ca9a8f37254b57
2022-04-11 17:00:19 -05:00
Sandrine Bailleux 71e2ea8323 Merge "refactor(arm): use MBEDTLS_CONFIG_FILE macro" into integration 2022-04-11 14:33:04 +02:00
Manish V Badarkhe def5571db2 refactor(arm): use MBEDTLS_CONFIG_FILE macro
Used MBEDTLS_CONFIG_FILE macro for including mbedTLS
configuration.

Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Change-Id: I374b59a31df3ab1e69481b2c37a6f7455a106b6e
2022-04-11 14:32:59 +02:00
Sandrine Bailleux a934332d98 Merge "refactor(corstone700): namespace MHU driver filenames" into integration 2022-04-11 12:47:08 +02:00
Manish Pandey 9bd3cb5c96 Merge changes I573e6478,I52dc3bee,I7e543664 into integration
* changes:
  feat(gic600ae_fmu): enable all GICD, PPI, ITS SMs
  feat(gic600ae_fmu): disable SMID for unavailable blocks
  feat(gic600ae_fmu): introduce support for RAS error handling
2022-04-08 14:42:45 +02:00
Sandrine Bailleux 92c356e2ed chore(measured boot): remove unused DTC flags
We no longer need to pass special flags to the device tree compiler
for measured boot. These are a left over from the days where we used
to pass BL2 measurement to BL2 image via TB_FW configuration file.

This should have been removed as part of commit eab78e9ba4
("refactor(measured_boot): remove passing of BL2 hash via device
tree") but was missed at the time.

Change-Id: Iced7e60af7ca660c342c0fc3a33b51865d67f04d
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-04-08 10:33:56 +02:00
Manish Pandey 141791088e Merge "build(changelog): add new scope for TI platform" into integration 2022-04-07 17:44:31 +02:00
Varun Wadekar 6a1c17c770 feat(gic600ae_fmu): enable all GICD, PPI, ITS SMs
The following SMIDs are disabled by default.

* GICD: MBIST REQ error and GICD FMU ClkGate override
* PPI: MBIST REQ error and PPI FMU ClkGate override
* ITS: MBIST REQ error and ITS FMU ClkGate override

This patch explicitly enables them during the FMU init sequence.

Change-Id: I573e64786e3318d4cbcd07d0a1caf25f8e6e9200
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-07 15:21:40 +02:00
Manish Pandey f6ca81ddfb Merge changes from topic "jc/detect_feat" into integration
* changes:
  docs(build): update the feature enablement flags
  refactor(el3-runtime): replace ARM_ARCH_AT_LEAST macro with FEAT flags
  refactor(el3-runtime): add arch-features detection mechanism
2022-04-07 15:19:04 +02:00
Manish Pandey fe029b5829 Merge changes from topic "mapping" into integration
* changes:
  feat(debug): update print_memory_map.py
  feat(bl_common): add XLAT tables symbols in linker script
2022-04-07 14:55:58 +02:00
Yann Gautier d16bfe0fef feat(debug): update print_memory_map.py
Add some entries in blx_symbols, that are used when the flag
SEPARATE_CODE_AND_RODATA is not enabled (__RO_* and __TEXT_RESIDENT_*).
Add all new symbols that were not yet present in the script.
Correct __BSS_END to __BSS_END__, and add __BSS_START__.
Add new *_XLAT_TABLE_* symbols.
As those strings are longer than 22, update display format string to
be dependent on the longest string.
The script also skips lines for which the _START__ and _END__
symbols have the same address (empty sections).

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I6c510ced6116b35d14ee2cb7a6711405604380d6
2022-04-07 13:46:31 +02:00
Varun Wadekar 3f0094c15d feat(gic600ae_fmu): disable SMID for unavailable blocks
This patch updates the gic600_fmu_init function to disable all safety
mechanisms for a block ID that is not present on the platform. All
safety mechanisms for GIC-600AE are enabled by default and should be
disabled for blocks that are not present on the platform to avoid
false positive RAS errors.

Change-Id: I52dc3bee9a8b49fd2e51d7ed851fdc803a48e6e3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-07 10:00:23 +02:00
Yann Gautier bb5b942e6f feat(bl_common): add XLAT tables symbols in linker script
Add __BASE_XLAT_TABLE_START__/_END__ and __XLAT_TABLE_START__/_END__
symbols in the linker script to have them in the .map file.
This allows displaying those areas when running memory map script.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I768a459c5cecc403a9b81b36a71397ecc3179f4f
2022-04-06 18:07:36 +02:00
Varun Wadekar 308dce4067 feat(gic600ae_fmu): introduce support for RAS error handling
The GIC-600AE uses a range of RAS features for all RAMs, which include
SECDED, ECC, and Scrub, software and bus error reporting. The GIC makes
all necessary information available to software through Armv8.2 RAS
architecture compliant register space.

This patch introduces support to probe the FMU_ERRGSR register to find
the right error record. Once the correct record is identified, the
"handler" function queries the FMU_ERR<m>STATUS register to further
identify the block ID, safety mechanism and the architecturally defined
primary error code. The description of the error is displayed on the
console to simplify debug.

Change-Id: I7e543664b74457afee2da250549f4c3d9beb1a03
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-06 08:14:39 +01:00
Jayanth Dodderi Chidanand d9e984cc30 docs(build): update the feature enablement flags
Adding the newly introduced build flags for feature enablement of the
following features:
1.FEAT_AMUv1p1 - ENABLE_FEAT_AMUv1p1
2.FEAT_CSV2_2  - ENABLE_FEAT_CSV2_2
3.FEAT_VHE     - ENABLE_FEAT_VHE
4.FEAT_DIT     - ENABLE_FEAT_DIT
5.FEAT_SB      - ENABLE_FEAT_SB
6.FEAT_SEL2    - ENABLE_FEAT_SEL2

Also as part of feature detection mechanism, we now support three
states for each of these features, allowing the flags to take either
(0 , 1 , 2) values. Henceforth the existing feature build options are
converted from boolean to numeric type and is updated accordingly
in this patch.

The build flags take a default value and will be internally enabled
when they become mandatory from a particular architecture version
and upwards. Platforms have the flexibility to overide this
internal enablement via this feature specific explicit build flags.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I0090c8c780c2e7d1a50ed9676983fe1df7a35e50
2022-04-05 17:34:17 +01:00
Manish Pandey 1bbe2135c3 Merge "fix(st): remove extra chars from dtc version" into integration 2022-04-05 11:31:14 +02:00
Yann Gautier 03d20776ef fix(st): remove extra chars from dtc version
In some implementations of dtc tool (e.g. with yocto), there can be a 'v'
at the beginning of the version, and a '+' at the end. Just keep numbers
then, with a grep -o.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I180e97ab75ba3e5ceacb4b1961a1f22788b428a3
2022-04-05 08:58:16 +02:00
Jayanth Dodderi Chidanand 0ce220afb2 refactor(el3-runtime): replace ARM_ARCH_AT_LEAST macro with FEAT flags
Replacing ARM_ARCH_AT_LEAST macro with feature specific build options
to prevent unconditional accesses to the registers during context save
and restore routines.

Registers are tightly coupled with features more than architecture
versions. Henceforth having a feature-specific build flag guarding the
respective registers, will restrict any undefined actions.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I809774df580530803c8a6e05a62d8d4de0910e02
2022-04-04 10:25:02 +01:00
Jayanth Dodderi Chidanand 6a0da73647 refactor(el3-runtime): add arch-features detection mechanism
This patch adds architectural features detection procedure to ensure
features enabled are present in the given hardware implementation.

It verifies whether the architecture build flags passed during
compilation match the respective features by reading their ID
registers. It reads through all the enabled feature specific ID
registers at once and panics in case of mismatch(feature enabled
but not implemented in PE).

Feature flags are used at sections (context_management,
save and restore routines of registers) during context switch.
If the enabled feature flag is not supported by the PE, it causes an
exception while saving or restoring the registers guarded by them.

With this mechanism, the build flags are validated at an early
phase prior to their usage, thereby preventing any undefined action
under their control.

This implementation is based on tristate approach for each feature and
currently FEAT_STATE=0 and FEAT_STATE=1 are covered as part of this
patch. FEAT_STATE=2 is planned for phase-2 implementation and will be
taken care separately.

The patch has been explicitly tested, by adding a new test_config
with build config enabling majority of the features and detected
all of them under FVP launched with parameters enabling v8.7 features.

Note: This is an experimental procedure and the mechanism itself is
      guarded by a macro "FEATURE_DETECTION", which is currently being
      disabled by default.

The "FEATURE_DETECTION" macro is documented and the platforms are
encouraged to make use of this diagnostic tool by enabling this
"FEATURE_DETECTION" flag explicitly and get used to its behaviour
during booting before the procedure gets mandated.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Ia23d95430fe82d417a938b672bfb5edc401b0f43
2022-04-04 10:24:51 +01:00
Sandrine Bailleux 510dc79c85 refactor(corstone700): namespace MHU driver filenames
There are plans to contribute a generic MHU driver to the TF-A code
base in the short term.

In preparation for this, rename the Corstone-700 MHU driver source
files and prefix them with the name of the platform to avoid any
ambiguity or name clashes with the upcoming generic MHU driver. Also
rename the header guard accordingly.

This renaming is inline with other platform-specific MHU drivers, such
as the ones used on Broadcom [1], Socionext [2] or Amlogic [3] platforms.

[1] plat/brcm/common/brcm_mhu.h
[2] plat/socionext/synquacer/drivers/mhu/sq_mhu.h
[3] plat/amlogic/common/aml_mhu.c

Change-Id: I8a5e5b16e7c19bf931a90422dfca8f6a2a0663b4
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-04-01 10:16:01 +02:00
David Vincze 83b3ed260b style(plat/arm/corstone1000): resolve checkpatch warnings
Change-Id: Ic8cb9b0834806675c792018e809d7ba77fbe856f
Signed-off-by: David Vincze <david.vincze@arm.com>
2022-03-31 10:59:41 +02:00
Joanna Farley f78cb61a11 Merge changes I84e257b3,I1317e482 into integration
* changes:
  fix(layerscape): fix coverity issue
  fix(nxp-ddr): fix coverity issue
2022-03-30 09:38:52 +02:00
Jiafei Pan 5161cfde9b fix(layerscape): fix coverity issue
Check return value of mmap_add_dynamic_region().

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I84e257b3052371e18af158c3254f42a1bae0da10
2022-03-30 10:38:22 +08:00
Joanna Farley e24ce2c1c8 Merge "fix(scmi): use same type for message_id" into integration 2022-03-29 17:01:48 +02:00
Jiafei Pan f713e5954e fix(nxp-ddr): fix coverity issue
Check return value of mmap_add_dynamic_region().

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I1317e4822f3da329185d54005f08047872b5cdce
2022-03-29 14:43:12 +08:00
Joanna Farley 0263c968a7 Merge changes Ic1796898,I93bd392a into integration
* changes:
  fix(errata): workaround for Cortex A78 AE erratum 2395408
  fix(errata): workaround for Cortex A78 AE erratum 2376748
2022-03-29 00:21:37 +02:00
Soby Mathew ad88c37080 Merge changes from topic "rme-attest" into integration
* changes:
  feat(rme): add dummy realm attestation key to RMMD
  feat(rme): add dummy platform token to RMMD
2022-03-28 18:32:27 +02:00
Patrick Delaunay 578a4795ab refactor(stm32mp1-fdts): remove nvmem_layout node
Remove the nvmem_layout node with compatible "st,stm32-nvmem-layout"
no more used in TF-A code to simplify the device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I3748b20b7d3c60ee64ead15541fac1fd12656600
2022-03-28 18:29:59 +02:00
Patrick Delaunay c5bf1b0971 refactor(stm32mp1): drop the "st,stm32-nvmem-layout" node
Simplify the DT parsing by removing the parsing of the nvmem layout node
with "st,stm32-nvmem-layout" compatible.

The expected OTP NAME can directly be found in a sub-node named
NAME@ADDRESS of the BSEC node, the NVMEM provider node.

This patch also removes this specific binding introduced for TF-A.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic703385fad1bec5bef1cee583fbe9fbbf6aea216
2022-03-28 18:29:59 +02:00
Yann Gautier b9a6dbc1ba refactor(st): remove useless includes
The stm32mp_dt.c file does not need anything from DDR header files.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ibfe23204d68ee2e863cd2eda3d725baa830b729a
2022-03-28 18:29:59 +02:00
Joanna Farley 2ea18c7df3 Merge changes from topics "ls1088a", "ls1088a-prepare" into integration
* changes:
  docs(layerscape): add ls1088a soc and board support
  feat(ls1088aqds): add ls1088aqds board support
  feat(ls1088ardb): add ls1088ardb board support
  feat(ls1088a): add new SoC platform ls1088a
  build(changelog): add new scopes for ls1088a
  feat(bl2): add support to separate no-loadable sections
  refactor(layerscape): refine comparison of inerconnection
  feat(layerscape): add soc helper macro definition for chassis 3
  feat(nxp-gic): add some macros definition for gicv3
  feat(layerscape): add CHASSIS 3 support for tbbr
  feat(layerscape): define more chassis 3 hardware address
  feat(nxp-crypto): add chassis 3 support
  feat(nxp-dcfg): add Chassis 3 support
  feat(lx2): enable DDR erratas for lx2 platforms
  feat(layerscape): print DDR errata information
  feat(nxp-ddr): add workaround for errata A050958
  feat(layerscape): add new soc errata a010539 support
  feat(layerscape): add new soc errata a009660 support
  feat(nxp-ddr): add rawcard 1F support
  fix(layerscape): fix build issue of mmap_add_ddr_region_dynamically
  fix(nxp-tools): fix create_pbl print log
  build(changelog): add new scopes for NXP driver
2022-03-28 17:40:59 +02:00
Soby Mathew a0435105f2 feat(rme): add dummy realm attestation key to RMMD
Add a dummy realm attestation key to RMMD, and return it on request.
The realm attestation key is requested with an SMC with the following
parameters:
    * Fid (0xC400001B2).
    * Attestation key buffer PA (the realm attestation key is copied
      at this address by the monitor).
    * Attestation key buffer length as input and size of realm
      attesation key as output.
    * Type of elliptic curve.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: Subhasish Ghosh <subhasish.ghosh@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: I12d8d98fd221f4638ef225c9383374ddf6e65eac
2022-03-28 15:02:01 +02:00
Manish Pandey 62a63491de Merge "fix(fwu): rename is_fwu_initialized" into integration 2022-03-28 13:59:23 +02:00
Manish Pandey 869dd20ff7 Merge "docs(maintainers): add the new maintainer for MediaTek SoCs" into integration 2022-03-28 12:41:46 +02:00
Rex-BC Chen 933bf32c14 docs(maintainers): add the new maintainer for MediaTek SoCs
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ia9409127e91e55726db0856e3f13f009d3c7c866
2022-03-28 17:49:31 +08:00