Commit graph

13678 commits

Author SHA1 Message Date
Govindraj Raja
3547270f59 refactor(build): reorder platform Makefile evaluation
Commit(f5211420b refactor(cpufeat): refactor arch feature build
options) ensures mandatory arch features are enabled based on
ARM_ARCH_MAJOR and ARM_ARCH_MINOR, which would be expected to be
provided from platform makefile. However it missed ensuring platform
makefile is included before parsing and enabling any mandatory arch
features.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: Ia0ccb7d73b2d24c87d3d235babed4704230bec28
2023-10-30 10:34:44 -05:00
Lauren Wehrmeister
48b92c604f Merge changes from topic "mb/psa-crypto-ecdsa" into integration
* changes:
  docs: mark PSA_CRYPTO as an experimental feature
  feat(fvp): increase BL1 RW area for PSA_CRYPTO implementation
  feat(mbedtls-psa): mbedTLS PSA Crypto with ECDSA
2023-10-30 16:20:24 +01:00
Prasad Kummari
bfe82cff6f fix(versal): type cast addresses to fix integer overflow
Typecast the base and size arguments for build time as unsigned
integers and the limit derived from these two as an unsigned long
to prevent size integer overflow issues during the build.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Change-Id: Iefc148e0091e8c8a4ca505691036c79528a558a4
2023-10-30 16:24:03 +05:30
Harrison Mutai
568d406ce7 refactor(fvp): move image handling into generic procedure
Post image handling of the HW_CONFIG is out-of-scope for
`plat_get_next_bl_params`. Move parts of the code responsible for post
processing of loaded images into `bl2_plat_handle_post_image_load` for code
reusability and maintainability.

Change-Id: I476b3d306ebcd4529f5e542ba1063e144920bb5f
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-10-30 10:36:39 +00:00
Harrison Mutai
ed5672070d refactor(bl2): make post image handling platform-specific
In certain instances a platform may need to make modifications to an
image after it has been loaded by BL2. The existing common
implementation is a thin wrapper for a more generic arm post image
handler. To enable platforms to make changes to images when
they're loaded, move this into platform code.

Change-Id: I44025391056adb2d8a8eb4ea5984257b02027181
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-10-30 10:29:03 +00:00
Manish V Badarkhe
58f00553d6 Merge "fix(ast2700): add device mapping for coherent memory" into integration 2023-10-30 10:41:12 +01:00
Chia-Wei Wang
cef2e92568 fix(ast2700): add device mapping for coherent memory
The coherent memory should be mapped as Device nGnRnE.
This fix adds the missing MMU attributes for coherent memory
if enabled.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Change-Id: I90b8de167c48f03392c9740f88f4b1e7b073a82d
2023-10-30 11:30:03 +02:00
Lauren Wehrmeister
ed2d256a68 Merge changes from topic "mb/cov-fix" into integration
* changes:
  fix(tbbr): guard defines under MBEDTLS_CONFIG_FILE
  refactor(tbbr): enforce compile-time error for invalid algorithm selection
2023-10-27 22:05:35 +02:00
Andrew Davis
ce1008fef1 feat(ti): query firmware for suspend capability
Instead of hardcoding this at build time we can ask the firmware if
suspend is supported and if not disable accordingly. Then remove compile-
time ifdefs.

Signed-off-by: Andrew Davis <afd@ti.com>
Change-Id: Ib966c04c0bdb79a82e8d890cec5e65d883acd6e3
2023-10-27 10:26:50 -05:00
Andrew Davis
7ab782801f feat(ti): add TI-SCI query firmware capabilities command support
This TISCI API is used to retrieve the firmware capabilities of the
currently running system-firmware.

Signed-off-by: Andrew Davis <afd@ti.com>
Change-Id: I55402dcf876e997eb21bb1f31c725e167c507c47
2023-10-27 10:26:50 -05:00
Andrew Davis
e9868458e6 feat(ti): remove extra core counts in cluster 2 and 3
No K3 SoC supported by this TARGET_BOARD has any cluster
2 or 3 cores. Remove these to save some memory.

Signed-off-by: Andrew Davis <afd@ti.com>
Change-Id: I27868a2f3aac25fa0fdec56847e273d88f0d9a87
2023-10-27 10:26:50 -05:00
Sandrine Bailleux (on vacation)
a089646711 Merge changes from topic "gpt_updates" into integration
* changes:
  refactor(arm): use gpt_partition_init
  feat(partition): add interface to init gpt
  refactor(partition): convert warn to verbose
  feat(partition): add support to use backup GPT header
  refactor(partition): get GPT header location from MBR
  feat(arm): add IO policy to use backup gpt header
  feat(tbbr): add image id for backup GPT
2023-10-27 16:37:18 +02:00
Madhukar Pappireddy
efd812c3ee Merge "feat(cpus): add support for Travis CPU" into integration 2023-10-27 15:49:40 +02:00
Madhukar Pappireddy
047b328d26 Merge "fix(ti): align static device region addresses to reduce MMU table count" into integration 2023-10-27 15:47:17 +02:00
Manish Pandey
cb70aed442 Merge "feat(handoff): port BL31-BL33 interface to fw handoff framework" into integration 2023-10-27 15:46:01 +02:00
Govindraj Raja
08ec77c7fe refactor(arm): use gpt_partition_init
Current interface partition_init accepts GPT image id and parses the
GPT image but doesn't return any error on failure.

So use gpt_partition_init which implicitly initialises with GPT image
ID and returns a value.

Change-Id: I63280aa672388f1f8d9dc377ae13002c9f861f03
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:55 -05:00
Govindraj Raja
f08460dc08 feat(partition): add interface to init gpt
Current interface 'partition_init' accepts parameter image_id
and returns no value. But the entire partition driver is build
only to parse and handle GPT partitions, so add new interface
gpt_partition_init which would return failure to platform code
if it fails to parse the image.

Change-Id: Iaf574d2ad01a15d0723c1475290c31dc4a078835
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Govindraj Raja
0f23e7eb1e refactor(partition): convert warn to verbose
Convert all warn messages to verbose messages. As most warning are
needed during debug only and and won't increase the binary size by
default.

Change-Id: Icc5d5157f13507ccbc34675c20357117cad98255
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Govindraj Raja
ad2dd65871 feat(partition): add support to use backup GPT header
Currently we just use primary GPT header which is located in second
entry after MBR header, but if this block is corrupted or CRC
mismatch occurs we could try to use the backup GPT header located at
LBAn and GPT entries following this from LBA-33.

Add suitable warning messages before returning any errors to identify
the cause of issue.

Change-Id: I0018ae9eafbacb683a18784d2c8bd917c70f50e1
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Govindraj Raja
fce8a70edd refactor(partition): get GPT header location from MBR
GPT header is located in first LBA after MBR entry and mbr header has
details of beginning of first entry, so use mbr header entry first_lba
data to locate GPT header rather than GPT_HEADER_OFFSET.

GPT header size is available in gpt_header, so use that
rather than using DEFAULT_GPT_HEADER_SIZE.

The location of GPT entries is available once we parse gpt_header
and is available as partitiona_lba use that to load gpt_entries rather
than GPT_ENTRY_OFFSET.

Change-Id: I3c11f8cc9d4b0b1778a37fe342fb845ea4a4eff1
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Govindraj Raja
3e6d245772 feat(arm): add IO policy to use backup gpt header
Add a IO block spec to use GPT backup header if primary fails.
Currently we use only the primary gpt header which is in the second
block(LBA-1) after the MBR block(LBA-0) so we restrict IO access to
primary gpt header and its entries.

But we plan to use backup GPT which is the last block of the
partition (LBA-n) in case our primary GPT header fails verification
or is corrupted.

Offset and length of the block spec will be updated runtime from
partition driver after parsing MBR data.

Change-Id: Id1d49841d6f4cbcc3248af19faf2fbd8e24a8ba1
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Govindraj Raja
1051606c3d feat(tbbr): add image id for backup GPT
Add image identifier to access backup-GPT header and entry,
when we fail to get primary GPT header.

Currently we use only the primary gpt header, But we plan to
use backup GPT header in case our primary GPT header fails
verification or is corrupted.

Change-Id: I12eedd5d2a5cda21c64254d461d09d400d4edb30
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-10-27 08:31:54 -05:00
Harrison Mutai
94c90ac816 feat(handoff): port BL31-BL33 interface to fw handoff framework
The firmware handoff framework is a light weight mechanism for sharing
information between bootloader stages. Add support for this framework at
the handoff boundary between runtime firmware BL31 and NS software on FVP.

Change-Id: Ib02e0e4c20a39e32e06da667caf2ce5a28de1e28
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-10-27 10:49:46 +01:00
Lauren Wehrmeister
113273aac4 Merge changes from topic "sm/err_errata" into integration
* changes:
  fix(cpus): fix the rev-var of Neoverse-V1
  fix(errata-abi): update the Neoverse-N2 errata ABI struct
  fix(errata-abi): update the neoverse-N1 errata ABI struct
  fix(cpus): fix the rev-var of Cortex-X2
  fix(errata-abi): update the Cortex-A78C errata ABI struct
  fix(cpus): update the rev-var for Cortex-A78AE
  fix(errata-abi): update the Cortex-A76 errata ABI struct
  fix(cpus): fix the rev-var for Cortex-A710
2023-10-26 21:03:06 +02:00
Manish V Badarkhe
eb8700a938 refactor(fvp): do not use RSS platform token and attestation key APIs
Since FVP does not support RSS, RSS APIs used to provide the hardcoded
platform token and attestation key. However, that seems to be causing
un-necessary mandating of some PSA crypto definitions, that doesn't
seem appropriate.
Hence to retrieve platform token and realm attestation key, these
RSS APIs calls have been replaced with hardcoded information.

Change-Id: I5fd091025e3444a698b9d387763ce20db6b13ae1
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 21:01:00 +02:00
Juan Pablo Conde
a0594add2e feat(cpus): add support for Travis CPU
Adding basic CPU library code to support Travis CPU

Change-Id: I3c85e9fab409325d213978888a8f6d6949291258
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
2023-10-26 11:25:28 -05:00
Manish V Badarkhe
4c02c99bd1 docs: deletion of a few deprecated platforms not yet confirmed
Updated the 'Deprecated Platforms' table to reflect that the
deletion of sgi575 and rdn1Edge is still unconfirmed.

Change-Id: Ie8e8af55a735f624f5ee604d75bb497d870620cd
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 16:37:29 +02:00
Manish V Badarkhe
81c2e1566d fix(tbbr): guard defines under MBEDTLS_CONFIG_FILE
Several platforms, such as NXP platforms, employ Trusted Boot support
without relying on MBEDTLS_CONFIG. This patch addresses the build
issues that arose on such platforms as a result of recent change
c1ec23dd60 [1].

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

Change-Id: Idfbeeafb8a30dc15bb0060beb5b17819a8807084
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 11:30:39 +01:00
Manish V Badarkhe
2ea42fec35 refactor(tbbr): enforce compile-time error for invalid algorithm selection
Enforced compile-time error on invalid algorithm selection.

Change-Id: I517aa11c9fa9fda49483f95587f43529085c9d5d
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 11:29:51 +01:00
Manish Pandey
41095bd3f9 Merge "fix(arm): fix GIC macros for GICv4.1 support" into integration 2023-10-26 12:00:33 +02:00
Manish Pandey
2c1cbfdddd Merge "fix(spmd): fix FFA_VERSION forwarding" into integration 2023-10-26 11:27:26 +02:00
Manish V Badarkhe
98ea2d814c docs: mark PSA_CRYPTO as an experimental feature
Updated the documentation to mark PSA_CRYPTO as an experimental
feature.

Change-Id: I894b687d6727fe7f80df54e6b08937e171f459b6
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 09:34:51 +01:00
Manish V Badarkhe
ce189383dc feat(fvp): increase BL1 RW area for PSA_CRYPTO implementation
When using PSA Crypto API, few algorithms like ECDSA require a
larger BL1 RW area. Hence added an additional BL1 RW page when
PSA_CRYPTO is selected.

Change-Id: Id6994667641a0b1e36b6a356d7c39a125d62ac01
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 08:53:20 +01:00
Manish V Badarkhe
255ce97d60 feat(mbedtls-psa): mbedTLS PSA Crypto with ECDSA
The ECDSA algorithm signature verification in the PSA differs
from the RSA algorithm in its handling of data formats. In the
case of RSA, an encoded ASN1.0 buffer is passed to the PSA API,
which then decodes the buffer. However, for ECDSA, the PSA API
expects a raw format.

To accomodate this requirement, introduce several static APIs
that allows to retrieve -

1. ECDSA public key data pointer along with its size, and also,
   the ECC family in PSA format from the public key.
2. R and S pair of the ECDSA signature along with its size

Change-Id: Icc7d5659aeb3d5c1ab63c3a12c001e68b11a3a86
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-10-26 08:52:33 +01:00
Andrew Davis
53a868f676 fix(ti): align static device region addresses to reduce MMU table count
Align our device memory regions to the next highest MMU table level (LV2).
This allows the xlat_tables library code to use a single entry in the
higher order table, vs having to create a new table for LV3 entries.

This reduces our tables to just 4: 2 LV2 and 1 LV3 plus 1 spare in case
alignment changes ever cause one to be split. This saves 24KB of our
128KB total TF-A SRAM (~18%!).

While here, as USE_COHERENT_MEM does not change MAX_XLAT_TABLES but
does change our total MAX_MMAP_REGIONS, move that check accordingly.

Signed-off-by: Andrew Davis <afd@ti.com>
Change-Id: I4cb8e3b2cc3d05c6c9a84d887dd6ec56bde7a786
2023-10-25 17:01:03 -05:00
Manish Pandey
0e1dc0f2bc Merge "fix(mpam): refine MPAM initialization and enablement process" into integration 2023-10-25 19:14:06 +02:00
Moritz Fischer
f1df8f10c6 fix(arm): fix GIC macros for GICv4.1 support
Newer platforms such as Neoverse V2 with GICv4.1 will report
0x3 instead of 0x1 in ID_AA64PFR0_EL1.

Update the logic to not accidentially take the GICv2 path
when printing the GIC registers.

Change-Id: Ia0d546cc5dcaa0dcad49a75b5921b0df5e176d34
Signed-off-by: Moritz Fischer <moritzf@google.com>
2023-10-25 16:14:31 +00:00
Manish Pandey
a093d394a7 Merge "fix(build): convert tabs to spaces" into integration 2023-10-25 16:49:51 +02:00
Arvind Ram Prakash
edebefbcbc fix(mpam): refine MPAM initialization and enablement process
Restricts MPAM to only NS world and enables trap to EL3 for access of
MPAM registers from lower ELs of Secure and Realm world.

This patch removes MPAM enablement from global context and adds it to
EL3 State context which enables/disables MPAM during world switches.
Renamed ENABLE_MPAM_FOR_LOWER_ELS to ENABLE_FEAT_MPAM and
removed mpam_init_el3() as RESET behaviour is trapping.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I131f9dba5df236a71959b2d425ee11af7f3c38c4
2023-10-25 09:04:29 -05:00
Olivier Deprez
76d53ee1aa fix(spmd): fix FFA_VERSION forwarding
When FFA_VERSION is forwarded from SPMD to SPMC, ensure that the full
NS GP regs context incl. x8-x17 is carried when building the SPMD to
SPMC direct message.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I3467c0e04de95ab80f7c86a0763021a5fa961e4d
2023-10-25 11:27:10 +02:00
Olivier Deprez
4a2ff22fd4 Merge "feat(mt8195): increase TZRAM" into integration 2023-10-25 09:55:08 +02:00
Manish Pandey
c20b0c58c2 Merge "feat(st): update STM32MP DT files" into integration 2023-10-25 09:53:23 +02:00
Manish Pandey
17e0a8c5db Merge changes from topic "st_remove_shm" into integration
* changes:
  docs(stm32mp15): mark STM32MP15_OPTEE_RSV_SHM deprecated
  feat(stm32mp15): disable OP-TEE shared memory
2023-10-25 09:44:27 +02:00
Manish Pandey
13f54450c9 Merge "fix(st): properly check LOADADDR" into integration 2023-10-25 09:38:41 +02:00
Manish Pandey
0efa651234 Merge "fix(cpus): workaround for Cortex-A510 erratum 2080326" into integration 2023-10-25 09:28:23 +02:00
Sona Mathew
6e86475d55 fix(cpus): workaround for Cortex-A510 erratum 2080326
Cortex-A510 erratum 2080326 is a Cat B erratum that applies
to all revisions <= r0p2 and is fixed in r0p3.
The workaround sequence helps perform a DSB after each TLBI
instruction and can be applied only for version r0p2 and has
minimal performance impact.
The workaround is not applicable for versions < r0p2.

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

Change-Id: Ib9bce8b711c25a79f7b2f891ae6f8b366fc80ddd
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-10-24 14:35:21 -05:00
Sona Mathew
ab2b56df26 fix(cpus): fix the rev-var of Neoverse-V1
Update the revision and variant information in the
errata ABI file, neoverse_v1.S file for erratum ID - 2294912
to match the revision and variant in the latest SDEN.

SDEN documentation:
https://developer.arm.com/documentation/SDEN-1401781/latest

Change-Id: I38a0f53c3515860ba442b5c0872c8ab051fdda6f
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-10-24 14:15:17 -05:00
Sona Mathew
80af87e476 fix(errata-abi): update the Neoverse-N2 errata ABI struct
Updated the structure for Neoverse_N2 in the errata ABI file
for the missing entries from the neoverse_n2.S file.

Change-Id: I635c39014a7b3e842a978a59e122d508d4bcf3c1
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-10-24 14:15:17 -05:00
Sona Mathew
56747a5caa fix(errata-abi): update the neoverse-N1 errata ABI struct
Updated the structure for Neoverse_N1 in the errata ABI file
for the missing entries from the neoverse_n1.S file.

Change-Id: I79a1a72b807781d65a6afc9e0367e77b21eecf41
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-10-24 14:15:17 -05:00
Sona Mathew
8ae66d624e fix(cpus): fix the rev-var of Cortex-X2
Update the revision and variant information in the
errata ABI file, cortex_X2.S file for erratum ID - 2058056
to match the revision and variant in the latest SDEN.

SDEN documentation:
https://developer.arm.com/documentation/SDEN-1775100/latest

Change-Id: I28ee39949d977c53d6f5243100f0c29bc3c0428c
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-10-24 14:15:17 -05:00