Commit Graph

1358 Commits

Author SHA1 Message Date
Bipin Ravi fe82bcc04a Merge "feat(cpu): add support for Hayes CPU" into integration 2021-09-30 23:10:09 +02:00
johpow01 7bd8dfb85a feat(cpu): add support for Hayes CPU
This patch adds the basic CPU library code to support the Hayes CPU
in TF-A. This CPU is based on the Klein core so that library code
has been adapted for use here.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: If0e0070cfa77fee8f6eebfee13d3c4f209ad84fc
2021-09-30 19:30:39 +02:00
laurenw-arm e31fb0fa1b fvp_r: load, auth, and transfer from BL1 to BL33
Adding load, authentication, and transfer functionality from FVP R BL1 to
BL33, which will be the partner runtime code.

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I293cad09739dacac0d20dd57c1d98178dbe84d40
2021-09-30 17:07:11 +01:00
Gary Morrison 5fb061e761 chore: fvp_r: Initial No-EL3 and MPU Implementation
For v8-R64, especially R82, creating code to run BL1 at EL2, using MPU.

Signed-off-by: Gary Morrison <gary.morrison@arm.com>
Change-Id: I439ac3915b982ad1e61d24365bdd1584b3070425
2021-09-30 17:05:59 +01:00
laurenw-arm 03b201c0fb fvp_r: initial platform port for fvp_r
Creating a platform port for FVP_R based on the FVP platform.
Differences including only-BL1, aarch64, Secure only, and EL2 being the
ELmax (No EL3).

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I1283e033fbd4e03c397d0a2c10c4139548b4eee4
2021-09-30 17:00:37 +01:00
shriram.k d932a5831e feat(plat/arm/sgi): add CPU specific handler for Neoverse N2
The 'CORE_PWRDN_EN' bit of 'CPUPWRCTLR_EL1' register requires an
explicit write to clear it for hotplug and idle to function correctly.
So add Neoverse N2 CPU specific handler in platform reset handler to
clear the CORE_PWRDN_EN bit.

Signed-off-by: shriram.k <shriram.k@arm.com>
Change-Id: If3859447410c4b8e704588993941178fa9411f52
2021-09-29 22:47:07 +05:30
shriram.k cbee43ebd6 feat(plat/arm/sgi): add CPU specific handler for Neoverse V1
The 'CORE_PWRDN_EN' bit of 'CPUPWRCTLR_EL1' register requires an
explicit write to clear it for hotplug and idle to function correctly.
So add Neoverse V1 CPU specific handler in platform reset handler to
clear the CORE_PWRDN_EN bit.

Signed-off-by: shriram.k <shriram.k@arm.com>
Change-Id: I56084c42a56c401503a751cb518238c83cfca8ac
2021-09-29 22:47:07 +05:30
Balint Dobszay 46789a7c71 build(bl2): enable SP pkg loading for S-EL1 SPMC
Currently the SP package loading mechanism is only enabled when S-EL2
SPMC is selected. Remove this limitation.

Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: I5bf5a32248e85a26d0345cacff7d539eed824cfc
2021-09-28 16:44:58 +02:00
Olivier Deprez b7bc51a7a7 fix: OP-TEE SP manifest per latest SPMC changes
Update UUID to little endian:
The SPMC expects a little endian representation of the UUID as an array
of four integers in the SP manifest.

Add managed exit field and cosmetic comments updates.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Icad93ca70bc27bc9d83b8cf888fe5f8839cb1288
2021-09-28 12:05:03 +02:00
Manish Pandey b3210f4ddb Merge changes from topic "TrcDbgExt" into integration
* changes:
  feat(plat/fvp): enable trace extension features by default
  feat(trf): enable trace filter control register access from lower NS EL
  feat(trf): initialize trap settings of trace filter control registers access
  feat(sys_reg_trace): enable trace system registers access from lower NS ELs
  feat(sys_reg_trace): initialize trap settings of trace system registers access
  feat(trbe): enable access to trace buffer control registers from lower NS EL
  feat(trbe): initialize trap settings of trace buffer control registers access
2021-09-17 11:36:43 +02:00
Davidson K 38f7904577 refactor(tc): use internal trusted storage
Trusted Services had removed secure storage and added two new
trusted services - Protected Storage and Internal Trusted Storage.
Hence we are removing secure storage and adding support for the
internal trusted storage.

And enable external SP images in BL2 config for TC, so that
we do not have to modify this file whenever the list of SPs
changes. It is already implemented for fvp in the below commit.

commit 33993a3737
Author: Balint Dobszay <balint.dobszay@arm.com>
Date:   Fri Mar 26 15:19:11 2021 +0100

    feat(fvp): enable external SP images in BL2 config

Change-Id: I3e0a0973df3644413ca5c3a32f36d44c8efd49c7
Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
2021-09-15 20:15:14 +05:30
André Przywara 0295079162 Merge changes from topic "gic-700-auto" into integration
* changes:
  feat(arm_fpga): support GICv4 images
  feat(gicv3): detect GICv4 feature at runtime
  feat(gicv3): multichip: detect GIC-700 at runtime
  refactor(gic): move GIC IIDR numbers
  refactor(gicv3): rename GIC Clayton to GIC-700
2021-09-10 17:17:46 +02:00
Olivier Deprez dc8b361c78 Merge changes I0ae8a6ea,I0b4fc83e into integration
* changes:
  feat(tc): Enable SVE for both secure and non-secure world
  feat(tc): populate HW_CONFIG in BL31
2021-09-07 18:00:44 +02:00
Usama Arif 10198eab3a
feat(tc): Enable SVE for both secure and non-secure world
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I0ae8a6ea3245373a17af76c9b7dc3f38f3711091
2021-09-07 14:38:02 +01:00
Usama Arif 34a87d74d9
feat(tc): populate HW_CONFIG in BL31
BL2 passes FW_CONFIG to BL31 which contains information
about different DTBs present. BL31 then uses FW_CONFIG
to get the base address of HW_CONFIG and populate fconf.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I0b4fc83e6e0a0b9401f692516654eb9a3b037616
2021-09-07 14:37:53 +01:00
Olivier Deprez 2b9bfbc2b0 Merge "feat(fvp): enable external SP images in BL2 config" into integration 2021-09-06 18:09:37 +02:00
Madhukar Pappireddy f465cc1659 Merge "feat(board/rdn2): add tzc master source ids for soc dma" into integration 2021-09-04 01:10:55 +02:00
Andre Przywara 13e16fee86 fix(arm_fpga): reserve BL31 memory
Embarrassingly we never told the non-secure world that secure firmware
lives in the first few hundred KBs of DRAM, so any non-secure payload
could happily overwrite TF-A, and we couldn't even blame it.

Advertise the BL31 region in the reserved-memory DT node, so non-secure
world stays out of it.

This fixes Linux booting on FPGAs with less memory than usual.

Change-Id: I7fbe7d42c0b251c0ccc43d7c50ca902013d152ec
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-09-03 17:24:46 +01:00
Andre Przywara d4572303ed fix(arm_fpga): limit BL31 memory usage
At the moment we specified the BL31 memory limits to 1MB; since we
typically have gigabytes of DRAM, we can be quite generous.

However the default parameters expect the devicetree binary at
0x80070000, so we should actually make sure we have no code or data
beyond that point.

Limit the ARM FPGA BL31 memory footprint to this available 7*64K region.
We stay within the limit at the moment, with more than half of it
reserved for stacks, so this could be downsized later should we run
into problems.

The PIE addresses stay as they are, since the default addresses do not
apply there anywhere, and the build is broken anyway.

Change-Id: I7768af1a93ff67096f4359fc5f5feb66464bafaa
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-09-03 14:14:02 +01:00
Balint Dobszay 33993a3737 feat(fvp): enable external SP images in BL2 config
Currently the list of SP UUIDs loaded by BL2 is hardcoded in the DT.
This is a problem when building a system with other SPs (e.g. from
Trusted Services). This commit implements a workaround to enable adding
SP UUIDs to the list at build time.

Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: Iff85d3778596d23d777dec458f131bd7a8647031
2021-09-03 11:12:10 +02:00
Andre Przywara c69f815b09 feat(arm_fpga): support GICv4 images
Up until now we relied on the GICs used in our FPGA images to be GICv3
compliant, without the "direct virtual injection" feature (aka GICv4)
enabled.
To support newer images which have GICv4 compliant GICs, enable the
newly introduced GICv4 detection code, and use that also when we adjust
the redistributor region size in the devicetree.

This allows the same BL31 image to be used with GICv3 or GICv4 FPGA
images.

Change-Id: I9f6435a6d5150983625efe3650a8b7d1ef11b1d1
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-09-01 16:14:03 +01:00
Andre Przywara 858f40e379 feat(gicv3): detect GICv4 feature at runtime
At the moment we have a GIC_ENABLE_V4_EXTN build time variable to
determine whether the GIC interrupt controller is compliant to version
4.0 of the spec or not. This just changes the number of 64K MMIO pages
we expect per redistributor.

To support firmware builds which run on variable systems (emulators,
fast model or FPGAs), let's make this decision at runtime.
The GIC specification provides several architected flags to learn the
size of the MMIO frame per redistributor, we use GICR_TYPER[VLPI] here.

Provide a (static inline) function to return the size of each
redistributor.
We keep the GIC_ENABLE_V4_EXTN build time variable around, but change
its meaning to enable this autodetection code. Systems not defining this
rely on a "pure" GICv3 (as before), but platforms setting it to "1" can
now deal with both configurations.

Change-Id: I9ede4acf058846157a0a9e2ef6103bf07c7655d9
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-09-01 16:14:03 +01:00
Manish V Badarkhe cd3f0ae6f8 feat(plat/fvp): enable trace extension features by default
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I3e344b0abda7ab4e54ee918ec65ff39d40855fcd
2021-08-26 09:32:40 +01:00
Joanna Farley 6657c1e3cc Merge "cpu: add support for Demeter CPU" into integration 2021-08-25 10:30:29 +02:00
Vijayenthiran Subramaniam 3139270693 feat(board/rdn2): add tzc master source ids for soc dma
Add TZC master source id for DMA in the SoC space and for the DMAs
behind the I/O Virtualization block to allow the non-secure transactions
from these DMAs targeting DRAM.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I77a2947b01b4b49a7c1940f09cf62b7b5257657c
2021-08-24 11:07:43 +05:30
Andre Przywara 0c9f91cf69 refactor(gicv3): rename GIC Clayton to GIC-700
The GIC IP formerly known as "GIC Clayton" has been released under the
name of "GIC-700".

Rename occurences of Clayton in comments and macro names to reflect the
official name.

Change-Id: Ie8c55f7da7753127d58c8382b0033c1b486f7909
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-08-20 14:23:35 +01:00
André Przywara 9fcefe38d5 Merge "fix(plat/arm_fpga): enable AMU extension" into integration 2021-08-19 16:43:45 +02:00
johpow01 f4616efafb cpu: add support for Demeter CPU
This patch adds the basic CPU library code to support the Demeter
CPU.  This CPU is based on the Makalu-ELP core so that CPU lib code
was adapted to create this patch.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Ib5740b748008a72788c557f0654d8d5e9ec0bb7f
2021-08-17 13:14:58 -05:00
Tom Cosgrove d810e30dd6 fix(plat/arm_fpga): enable AMU extension
As done recently for plat/tc0 in b5863cab9, enable AMU explicitly.
This is necessary as the recent changes that enable SVE for the secure
world disable AMU by default in the CPTR_EL3 reset value.

Change-Id: Ie3abf1dee8a4e1c8c39f934da8e32d67891f5f09
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2021-08-17 08:50:53 +01:00
Abdellatif El Khlifi c7e4f1cfb8 feat: enabling stack protector for diphda
This commit activates the stack protector feature for the diphda
platform.

Change-Id: Ib16b74871c62b67e593a76ecc12cd3634d212614
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2021-08-12 16:49:52 +01:00
Usama Arif 6ec0c65b09
feat(plat/arm): Introduce TC1 platform
This renames tc0 platform folder and files to tc, and introduces
TARGET_PLATFORM variable to account for the differences between
TC0 and TC1.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I5b4a83f3453afd12542267091b3edab4c139c5cd
2021-08-11 11:36:50 +01:00
Olivier Deprez abde216dc8 Merge "feat(ff-a): update FF-A version to v1.1" into integration 2021-08-10 11:14:44 +02:00
Manish V Badarkhe f34322c1ce fix: avoid redefinition of 'efi_guid' structure
Fixed the build error by removing the local definition of 'efi_guid'
structure in 'sgi_ras.c' file as this structure definition is already
populated in 'sgi_ras.c' file via 'uuid.h' header.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I57687336863f2a0761c09b6c1aa00b4aa82a6a12
2021-08-06 12:54:11 +01:00
J-Alves e1c732d46f feat(ff-a): update FF-A version to v1.1
Bump the required FF-A version in framework and manifests to v1.1 as
upstream feature development goes.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I89b2bd3828a13fc4344ccd53bc3ac9c0c22ab29f
2021-08-06 11:16:39 +02:00
Madhukar Pappireddy 5e4e13e173 Merge changes from topic "fw-update-2" into integration
* changes:
  feat(sw_crc32): add software CRC32 support
  refactor(hw_crc32): renamed hw_crc32 to tf_crc32
  feat(fwu): avoid booting with an alternate boot source
  docs(fwu): add firmware update documentation
  feat(fwu): avoid NV counter upgrade in trial run state
  feat(plat/arm): add FWU support in Arm platforms
  feat(fwu): initialize FWU driver in BL2
  feat(fwu): add FWU driver
  feat(fwu): introduce FWU platform-specific functions declarations
  docs(fwu_metadata): add FWU metadata build options
  feat(fwu_metadata): add FWU metadata header and build options
2021-08-02 22:53:50 +02:00
Manish V Badarkhe c885d5c84d refactor(hw_crc32): renamed hw_crc32 to tf_crc32
Renamed hw_crc32 to tf_crc32 to make the file and function
name more generic so that the same name can be used in upcoming
software CRC32 implementation.

Change-Id: Idff8f70c50ca700a4328a27b49d5e1f14d2095eb
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-08-02 17:15:41 +01:00
Manish V Badarkhe 2f1177b2b9 feat(plat/arm): add FWU support in Arm platforms
Added firmware update support in Arm platforms by using
FWU platform hooks and compiling FWU driver in BL2
component.

Change-Id: I71af06c09d95c2c58e3fd766c4a61c5652637151
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-08-02 17:15:40 +01:00
Olivier Deprez c7e39dcf68 Merge "feat(ff-a): change manifest messaging method" into integration 2021-08-02 18:14:54 +02:00
Stas Sergeev 749d0fa80d fix(plat/fvp): provide boot files via semihosting
These files are needed during boot, but they were missing
for semihosting.
With this patch, the list of files is complete enough to
boot on ATF platform via semihosting.

Change-Id: I2f0ca25983a6e18096f040780776f19f8040ea79
Signed-off-by: stsp@users.sourceforge.net
2021-07-28 14:16:55 +03:00
Madhukar Pappireddy 743e3b4147 Merge "plat/sgi: tag dmc620 MM communicate messages with a guid" into integration 2021-07-27 21:35:11 +02:00
Manish Pandey a52c52477a Merge changes from topic "sve+amu" into integration
* changes:
  fix(plat/tc0): enable AMU extension
  fix(el3_runtime): fix SVE and AMU extension enablement flags
2021-07-26 11:05:39 +02:00
Arunachalam Ganapathy b5863cab9a fix(plat/tc0): enable AMU extension
Recent changes to enable SVE for the secure world have disabled AMU
extension by default in the reset value of CPTR_EL3 register. So the
platform has to enable this extension explicitly.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I7d930d96ec22d7c3db961411370564bece0ce272
2021-07-23 10:33:59 +01:00
Abdellatif El Khlifi 7f70cd2923 feat: disabling non volatile counters in diphda
At this stage of development Non Volatile counters are not implemented
in the Diphda platform.

This commit disables their use during the Trusted Board Boot by
overriding the NV counters get/set functions.

Change-Id: I8dcbebe0281cc4d0837c283ff637e20b850988ef
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2021-07-22 18:01:43 +01:00
Abdellatif El Khlifi bf3ce99371 feat: adding the diphda platform
This commit enables trusted-firmware-a with Trusted Board Boot support
for the Diphda 64-bit platform.

Diphda uses a FIP image located in the flash. The FIP contains the
following components:

- BL2
- BL31
- BL32
- BL32 SPMC manifest
- BL33
- The TBB certificates

The board boot relies on CoT (chain of trust). The trusted-firmware-a
BL2 is extracted from the FIP and verified by the Secure Enclave
processor. BL2 verification relies on the signature area at the
beginning of the BL2 image. This area is needed by the SecureEnclave
bootloader.

Then, the application processor is released from reset and starts by
executing BL2.

BL2 performs the actions described in the trusted-firmware-a TBB design
document.

Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Change-Id: Iddb1cb9c2a0324a9635e23821c210ac81dfc305d
2021-07-22 18:01:39 +01:00
Maksims Svecovs bb320dbc47 feat(ff-a): change manifest messaging method
Align documentation with changes of messaging method for partition
manifest:
      - Bit[0]: support for receiving direct message requests
      - Bit[1]: support for sending direct messages
      - Bit[2]: support for indirect messaging
      - Bit[3]: support for managed exit
Change the optee_sp_manifest to align with the new messaging method
description.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I333e82c546c03698c95f0c77293018f8dca5ba9c
2021-07-22 14:21:41 +01:00
Manish V Badarkhe aa79421c16 refactor(plat/arm): use mmio* functions to read/write NVFLAGS registers
Used mmio* functions to read/write NVFLAGS registers to avoid
possibile reordering of instructions by compiler.

Change-Id: Iae50ac30e5413259cf8554f0fff47512ad83b0fd
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-07-06 16:32:38 +01:00
Manish V Badarkhe 79d8be3c14 refactor(plat/arm): mark the flash region as read-only
In the FVP platform, BL1 uses flash only for read purpose
hence marked this flash region as read-only.

Change-Id: I3b57130fd4f3b4df522ac075f66e9799f237ebb7
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-07-06 16:30:36 +01:00
Manish V Badarkhe 59ea36485a refactor(plat/arm): update NV flags on image load/authentication failure
Erasing the FIP TOC header present in a flash is replaced by updating NV
flags with an error code on image load/authentication failure.
BL1 component uses these NV flags to detect whether a firmware update is
needed or not.
These NV flags get cleared once the firmware update gets completed.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I6232a0db07c89b2373b7b9d28acd37df6203d914
2021-07-06 16:28:56 +01:00
Sandrine Bailleux 9fa5db4da8 Merge changes from topic "sb/measured-boot" into integration
* changes:
  refactor(plat/fvp): tidy up list of images to measure
  docs: explain Measured Boot dependency on Trusted Boot
2021-07-05 10:19:19 +02:00
Olivier Deprez 05f47b77dd Merge "feat(spm): add Ivy partition to tb fw config" into integration 2021-07-02 10:28:01 +02:00
Daniel Boulby 1bc02c2e0f feat(spm): add Ivy partition to tb fw config
The partition layout description JSON file generated by TF-A tests
declares a fourth test partition called Ivy demonstrating the
implementation of a S-EL0 partition supported by a S-EL1 shim.

Change-Id: If8562acfc045d6496dfdb3df0524b3a069357f8e
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
2021-07-02 09:19:59 +01:00
Manish Pandey c1c14b3485 Merge "feat(plat/arm): enable PIE when RESET_TO_SP_MIN=1" into integration 2021-06-30 13:04:45 +02:00
Sandrine Bailleux 64dd1dee2d refactor(plat/fvp): tidy up list of images to measure
We don't ever expect to load a binary with an STM32 header on the Arm
FVP platform so remove this type of image from the list of
measurements.

Also remove the GPT image type from the list, as it does not get
measured. GPT is a container, just like FIP is. We don't measure the FIP
but rather the images inside it. It would seem logical to treat GPT the
same way.

Besides, only images that get loaded through load_auth_image() get
measured right now. GPT processing happens before that and is handled in
a different way (see partition_init()).

Change-Id: Iac4de75380ed625b228e69ee4564cf9e67e19336
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2021-06-29 15:14:44 +02:00
Manish Pandey 7285fd5f9a feat(plat/arm): enable PIE when RESET_TO_SP_MIN=1
For Arm platforms PIE is enabled when RESET_TO_BL31=1 in aarch64 mode on
the similar lines enable PIE when RESET_TO_SP_MIN=1 in aarch32 mode.
The underlying changes for enabling PIE in aarch32 is submitted in
commit 4324a14bf

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ib8bb860198b3f97cdc91005503a3184d63e15469
2021-06-29 11:59:01 +01:00
Arunachalam Ganapathy 05f667f0c6 fix(tc0): set cactus-tertiary vcpu count to 1
Third instance of cactus is a UP SP. Set its vcpu count to 1.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I34b7feb2915e6d335e690e89dea466e75944ed1b
2021-06-28 11:11:55 +01:00
Arunachalam Ganapathy 1c1953653c fix(tc0): change UUID to string format
Change OP-TEE, Cactus SPs UUID to string format

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I32dbf40e4c5aa959bb92d3e853072aea63409ddc
2021-06-28 11:11:47 +01:00
Manish Pandey 2a0087796f Merge changes from topic "soc_id" into integration
* changes:
  refactor(plat/nvidia): use SOC_ID defines
  refactor(plat/mediatek): use SOC_ID defines
  refactor(plat/arm): use SOC_ID defines
  feat(plat/st): implement platform functions for SMCCC_ARCH_SOC_ID
  refactor(plat/st): export functions to get SoC information
  feat(smccc): add bit definition for SMCCC_ARCH_SOC_ID
2021-06-16 12:03:17 +02:00
Olivier Deprez 1a2c0ff927 Merge changes from topic "od/cleanup-changes" into integration
* changes:
  perf(spmd): omit sel1 context save if sel2 present
  fix(fvp): spmc optee manifest remove SMC allowlist
  fix: random typos in tf-a code base
2021-06-04 14:50:20 +02:00
Olivier Deprez 183725b39d fix(fvp): spmc optee manifest remove SMC allowlist
Fix a remainder from early prototyping. OP-TEE as a secure partition
does not need specific SMC function id pass through to EL3.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I2843d1b9a5eb4c966f82790e1655fb569c2de7d4
2021-06-03 09:31:18 +02:00
Yann Gautier 748bdd19aa fix(plat/arm): correct UUID strings in FVP DT
The UUID strings used in FW_CONFIG DT are not aligned with UUIDs defined
in include/tools_share/firmware_image_package.h for BL32_EXTRA1 and
TRUSTED_KEY_CERT.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I517f8f9311585931f2cb931e0588414da449b694
2021-06-02 17:21:06 +02:00
Manoj Kumar 7f2d23d9d7 fix(morello): initialise CNTFRQ in Non Secure CNTBaseN
Morello exhibits the behavior similar to Juno wherein CNTBaseN.CNTFRQ
can be written but does not reflect the value of the CNTFRQ register
in CNTCTLBase frame. This doesn't follow ARM ARM in that the value
updated in CNTCTLBase.CNTFRQ is not reflected in CNTBaseN.CNTFRQ.

Hence enable the workaround (applied to Juno) for Morello that updates
the CNTFRQ register in the Non Secure CNTBaseN frame.

Change-Id: Iabe53bf3c25152052107e08321323e4bde5fbef4
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
2021-06-01 13:11:50 +01:00
Olivier Deprez b35f8f2d1e Merge "feat(tc0): add support for trusted services" into integration 2021-05-31 08:44:33 +02:00
Madhukar Pappireddy 2ea8d41979 Merge "fix: rename Matterhorn, Matterhorn ELP, and Klein CPUs" into integration 2021-05-28 22:08:24 +02:00
johpow01 c6ac4df622 fix: rename Matterhorn, Matterhorn ELP, and Klein CPUs
This patch renames the Matterhorn, Matterhorn ELP, and Klein CPUs to
Cortex A710, Cortex X2, and Cortex A510 respectively.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I056d3114210db71c2840a24562b51caf2546e195
2021-05-28 13:53:23 -05:00
Yann Gautier dfff46862f refactor(plat/arm): use SOC_ID defines
Use the macros that are now defined in include/lib/smccc.h.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I688a76277b729672835d51fafb68d1d6205b6ae4
2021-05-27 09:59:11 +02:00
Pranav Madhu 7bd64c70e9 feat(plat/sgi): enable use of PSCI extended state ID format
The SGI/RD platforms have been using PSCI state ID format as defined in
PSCI version prior to 1.0. This is being changed and the PSCI extended
state ID format as defined in PSCI version 1.1 is being adapted. In
addition to this, the use of Arm recommended PSCI state ID encoding is
enabled as well.

Change-Id: I2be8a9820987a96b23f4281563b6fa22db48fa5f
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-05-27 10:29:17 +05:30
Madhukar Pappireddy 3bb3157ab3 Merge "feat(plat/sgi): enable AMU for RD-V1-MC" into integration 2021-05-26 15:54:28 +02:00
Mark Dykes 09e153a9a8 Merge "feat(hw_crc): add support for HW computed CRC" into integration 2021-05-24 17:47:18 +02:00
Manish V Badarkhe a1cedadf73 feat(hw_crc): add support for HW computed CRC
Added support for HW computed CRC using Arm ACLE intrinsics.
These are built-in intrinsics available for ARMv8.1-A, and
onwards.
These intrinsics are enabled via '-march=armv8-a+crc' compile
switch for ARMv8-A (supports CRC instructions optionally).

HW CRC support is enabled unconditionally in BL2 for all Arm
platforms.

HW CRC calculation is verified offline to ensure a similar
result as its respective ZLib utility function.

HW CRC calculation support will be used in the upcoming
firmware update patches.

Change-Id: Ia2ae801f62d2003e89a9c3e6d77469b5312614b3
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-05-19 19:34:34 +01:00
Zelalem 63ca6bbad8 refactor(juno): disable non-invasive debug of secure state
Disable non-invasive debug of secure state for Juno
in release builds. This makes sure that PMU counts
only Non-secure events.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I0d1c3f96f3b4e48360a7211ae55851d65d291025
2021-05-17 10:19:26 -05:00
Davidson K ca9324819e feat(tc0): add support for trusted services
This patch adds support for the crypto and secure storage secure
partitions for the Total Compute platform.  These secure partitions
have to be managed by Hafnium executing at S-EL2

Change-Id: I2df690e3a99bf6bf50e2710994a905914a07026e
Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
2021-05-10 18:39:37 +05:30
Pranav Madhu e8b119e03a feat(plat/sgi): enable AMU for RD-V1-MC
AMU counters are used for monitoring the CPU performance. RD-V1-MC
platform has architected AMU available for each core. Enable the use of
AMU by non-secure OS for supporting the use of counters for processor
performance control (ACPI CPPC).

Change-Id: I33be594cee669e7f4031e5e5a371eec7c7451030
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-05-03 23:01:03 +05:30
Olivier Deprez 6794378d2e Merge changes from topic "fw-update" into integration
* changes:
  docs: add build options for GPT support enablement
  feat(plat/arm): add GPT parser support
2021-04-29 14:49:10 +02:00
Manish V Badarkhe ef1daa420f feat(plat/arm): add GPT parser support
Added GPT parser support in BL2 for Arm platforms to get the entry
address and length of the FIP in the GPT image.

Also, increased BL2 maximum size for FVP platform to successfully
compile ROM-enabled build with this change.

Verified this change using a patch:
https://review.trustedfirmware.org/c/ci/tf-a-ci-scripts/+/9654

Change-Id: Ie8026db054966653b739a82d9ba106d283f534d0
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-04-29 10:11:06 +01:00
Mark Dykes 800b8849c0 Merge "refactor(plat/arm): replace FIP base and size macro with a generic name" into integration 2021-04-28 21:16:20 +02:00
David Horstmann 7d111d99c6 refactor(plat/arm): store UUID as a string, rather than ints
NOTE: Breaking change to the way UUIDs are stored in the DT

Currently, UUIDs are stored in the device tree as
sequences of 4 integers. There is a mismatch in endianness
between the way UUIDs are represented in memory and the way
they are parsed from the device tree. As a result, we must either
store the UUIDs in little-endian format in the DT (which means
that they do not match up with their string representations)
or perform endianness conversion after parsing them.

Currently, TF-A chooses the second option, with unwieldy
endianness-conversion taking place after reading a UUID.

To fix this problem, and to make it convenient to copy and
paste UUIDs from other tools, change to store UUIDs in string
format, using a new wrapper function to parse them from the
device tree.

Change-Id: I38bd63c907be14e412f03ef0aab9dcabfba0eaa0
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2021-04-28 12:13:58 +01:00
Manish V Badarkhe 49e9ac2811 refactor(plat/arm): replace FIP base and size macro with a generic name
Replaced PLAT_ARM_FIP_BASE and PLAT_ARM_FIP_MAX_SIZE macro with a
generic name PLAT_ARM_FLASH_IMAGE_BASE and PLAT_ARM_FLASH_IMAGE_MAX_SIZE
so that these macros can be reused in the subsequent GPT based support
changes.

Change-Id: I88fdbd53e1966578af4f1e8e9d5fef42c27b1173
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-04-28 11:50:35 +01:00
Aditya Angadi fe5d5bbfe6 feat(board/rdn2): add support for variant 1 of rd-n2 platform
Add board support for RD-N2 Cfg1 variant of RD-N2 platform. It is a
variant of RD-N2 platform with a reduced interconnect mesh size (3x3)
and core count (8-cores). Its platform variant id is 1.

Change-Id: I34ad35c5a5c1e9b69a658fb92ed00e5bc5fe72f3
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2021-04-27 16:29:52 +05:30
Aditya Angadi cfe1506ee8 feat(plat/sgi): introduce platform variant build option
A Neoverse reference design platform can have two or more variants that
differ in core count, cluster count or other peripherals. To allow reuse
of platform code across all the variants of a platform, introduce build
option CSS_SGI_PLATFORM_VARIANT for Arm Neoverse reference design
platforms. The range of allowed values for the build option is platform
specific. The recommended range is an interval of non negative integers.

An example usage of the build option is
make PLAT=rdn2 CSS_SGI_PLATFORM_VARIANT=1

Change-Id: Iaae79c0b4d0dc700521bf6e9b4979339eafe0359
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2021-04-27 16:22:21 +05:30
Manish Pandey 303f543e12 Merge changes from topic "sgm775_deprecation" into integration
* changes:
  build: deprecate Arm sgm775 FVP platform
  docs: introduce process for platform deprecation
2021-04-26 23:46:33 +02:00
Manish Pandey c404794a6f plat/arm: move compile time switch from source to dt file
This will help in keeping source file generic and conditional
compilation can be contained in platform provided dt files.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I3c6e0a429073f0afb412b9ba521ce43f880b57fe
2021-04-26 14:00:13 +02:00
Olivier Deprez 7bcb8ad260 Merge "Arm: Fix error message printing in board makefile" into integration 2021-04-26 09:20:54 +02:00
Manish Pandey 37ee58d134 build: deprecate Arm sgm775 FVP platform
sgm775 is an old platform and is no longer maintained by Arm and its
fast model FVP_CSS_SGM-775 is no longer available for download.
This platform is now superseded by Total Compute(tc) platforms.

This platform is now deprecated but the source will be kept for cooling
off period of 2 release cycle before removing it completely.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I8fe1fc3da0c508dba62ed4fc60cbc1642e0f7f2a
2021-04-23 10:42:58 +01:00
bipin.ravi dfe6466597 Merge "Add "_arm" suffix to Makalu ELP CPU lib" into integration 2021-04-21 18:25:05 +02:00
johpow01 97bc7f0dcc Add "_arm" suffix to Makalu ELP CPU lib
ELP processors can sometimes have different MIDR values or features so
we are adding the "_arm" suffix to differentiate the reference
implementation from other future versions.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Ieea444288587c7c18a397d279ee4b22b7ad79e20
2021-04-20 17:14:31 -05:00
Mikael Olsson 76a21174d2 Add SiP service to configure Arm Ethos-N NPU
By default the Arm Ethos-N NPU will boot up in secure mode. In this mode
the non-secure world cannot access the registers needed to use the NPU.
To still allow the non-secure world to use the NPU, a SiP service has
been added that can delegate non-secure access to the registers needed
to use it.

Only the HW_CONFIG for the Arm Juno platform has been updated to include
the device tree for the NPU and the platform currently only loads the
HW_CONFIG in AArch64 builds.

Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Change-Id: I65dfd864042ed43faae0a259dcf319cbadb5f3d2
2021-04-20 15:42:18 +02:00
Mikael Olsson 5d5fb10f9c plat/arm/juno: Add support to use hw_config in BL31
To make it possible to use the hw_config device tree for dynamic
configuration in BL31 on the Arm Juno platform. A placeholder hw_config
has been added that is included in the FIP and a Juno specific BL31
setup has been added to populate fconf with the hw_config.

Juno's BL2 setup has been updated to align it with the new behavior
implemented in the Arm FVP platform, where fw_config is passed in arg1
to BL31 instead of soc_fw_config. The BL31 setup is expected to use the
fw_config passed in arg1 to find the hw_config.

Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Change-Id: Ib3570faa6714f92ab8451e8f1e59779dcf19c0b6
2021-04-20 15:42:10 +02:00
Sandrine Bailleux 5eea019378 Arm: Fix error message printing in board makefile
Remove an incorrect tabulation in front of an $(error) function call
outside of a recipe, which caused the following text to be displayed:

  plat/arm/board/common/board_common.mk:36: *** recipe commences before first target.  Stop.

instead of:

  plat/arm/board/common/board_common.mk:36: *** "Unsupported ARM_ROTPK_LOCATION value".  Stop.

Change-Id: I8592948e7de8ab0c4abbc56eb65a53eb1875a83c
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2021-04-16 16:09:44 +02:00
Madhukar Pappireddy 866e6721f3 Merge changes from topic "scmi_v2_0" into integration
* changes:
  drivers/arm/css/scmi: Update power domain protocol version to 2.0
  tc0: update GICR base address
2021-04-15 23:39:31 +02:00
Usama Arif 69f2ace106 tc0: update GICR base address
The number of ITS have changed from 4 to 1, resulting
in GICR base address change.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I28101f0d1faf9f3c58591b642033c3fd49a275e7
2021-04-14 12:13:26 +01:00
Olivier Deprez 3b9e06a6dd Merge "plat/arm: don't provide NT_FW_CONFIG when booting hafnium" into integration 2021-04-13 14:16:08 +02:00
Manish Pandey 2b6fc53584 plat/arm: don't provide NT_FW_CONFIG when booting hafnium
NT_FW_CONFIG file is meant to be passed from BL31 to be consumed by
BL33, fvp platforms use this to pass measured boot configuration and
the x0 register is used to pass the base address of it.

In case of hafnium used as hypervisor in normal world, hypervisor
manifest is expected to be passed from BL31 and its base address is
passed in x0 register.

As only one of NT_FW_CONFIG or hypervisor manifest base address can be
passed in x0 register and also measured boot is not required for SPM so
disable passing NT_FW_CONFIG.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ifad9d3658f55ba7d70f468a88997d5272339e53e
2021-04-09 16:40:47 +01:00
Heyi Guo abe6ce1d1b plat/arm/arm_image_load: refine plat_add_sp_images_load_info
Refine the function plat_add_sp_images_load_info() by saving the
previous node and only setting its next link when the current node is
valid. This can reduce the check for the next node and simply the
total logic.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Change-Id: I4061428bf49ef0c3816ac22aaeb2e50315531f88
2021-04-06 17:17:33 +01:00
Heyi Guo 47fe4c4fe2 plat/arm/arm_image_load: fix bug of overriding the last node
The traverse flow in function plat_add_sp_images_load_info() will find
the last node in the main load info list, with its
next_load_info==NULL. However this node is still useful and should not
be overridden with SP node info.

The bug will cause below error on RDN2 for spmd enabled:

ERROR:   Invalid NT_FW_CONFIG DTB passed

Fix the bug by only setting the next_load_info of the last node in the
original main node list.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Change-Id: Icaee5da1f2d53b29fdd6085a8cc507446186fd57
2021-04-06 17:16:43 +01:00
Bipin Ravi 0a144dd4ea Add Cortex_A78C CPU lib
Add basic support for Cortex_A78C CPU.

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Id9e41cbe0580a68c6412d194a5ee67940e8dae56
2021-03-31 16:02:35 -05:00
bipin.ravi e5fa7459ed Merge "Add Makalu ELP CPU lib" into integration 2021-03-29 22:41:29 +02:00
Omkar Anand Kulkarni 59c2a02740 plat/sgi: tag dmc620 MM communicate messages with a guid
Define a GUID that should be used in the header of MM communicate
message originating due to a dmc620 ECC error interrupt. So the use
of SMC ID in 'sgi_ras_ev_map' to represent the interrupt event is
removed.

In addition to this, update the dmc620 error record data structure to
use aux_data to indicate the dmc620 instance number on which the ECC
error interrupt occurred.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: I18c8ef5ba6483bb1bce6464ee9be0c2aabec4baa
2021-03-29 22:00:30 +05:30
Omkar Anand Kulkarni c0d55ef7c0 plat/sgi: allow usage of secure partions on rdn2 platform
Add the secure partition mmap table and the secure partition boot
information to support secure partitions on RD-N2 platform. In addition
to this, add the required memory region mapping for accessing the
SoC peripherals from the secure partition.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: I2c75760d6c8c3da3ff4885599be420e924aeaf3c
2021-03-29 22:00:30 +05:30
Aditya Angadi f97b579502 board/rdv1mc: initialize tzc400 controllers
A TZC400 controller is placed inline on DRAM channels and regulates
the secure and non-secure accesses to both secure and non-secure
regions of the DRAM memory. Configure each of the TZC controllers
across the Chips.

For use by secure software, configure the first chip's trustzone
controller to protect the upper 16MB of the memory of the first DRAM
block for secure accesses only. The other regions are configured for
non-secure read write access. For all the remote chips, all the DRAM
regions are allowed for non-secure read and write access.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I809f27eccadfc23ea0ef64e2fd87f95eb8f195c1
2021-03-29 21:36:48 +05:30
Aditya Angadi 2180349117 plat/sgi: allow access to TZC controller on all chips
On a multi-chip platform, the boot CPU on the first chip programs the
TZC controllers on all the remote chips. Define a memory region map for
the TZC controllers for all the remote chips and include it in the BL2
memory map table.

In addition to this, for SPM_MM enabled multi-chip platforms, increase
the number of mmap entries and xlat table counts for EL3 execution
context as well because the shared RAM regions and GIC address space of
remote chips are accessed.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I6f0b5fd22f9f28046451e382eef7f1f9258d88f7
2021-03-29 21:34:20 +05:30
Aditya Angadi 05b5c4175b plat/sgi: define memory regions for multi-chip platforms
For multi-chip platforms, add a macro to define the memory regions on
chip numbers >1 and its associated access permissions. These memory
regions are marked with non-secure access.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: If3d6180fd8ea61f45147c39d3140d694abf06617
2021-03-29 18:52:34 +05:30
Thomas Abraham 5dae6bc71c plat/sgi: allow access to nor2 flash and system registers from s-el0
Allow the access of system registers and nor2 flash memory region
from s-el0. This allows the secure parititions residing at s-el0
to access these memory regions.

Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I3887a86770de806323fbde0d20fdc96eec6e0c3c
2021-03-29 18:52:34 +05:30
Thomas Abraham b4d548f141 plat/sgi: define default list of memory regions for dmc620 tzc
Define a default DMC-620 TZC memory region configuration and use it to
specify the TZC memory regions on sgi575, rdn1edge and rde1edge
platforms. The default DMC-620 TZC memory regions are defined
considering the support for secure paritition as well.

Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: Iedee3e57d0d3de5b65321444da51ec990d3702db
2021-03-29 18:52:34 +05:30
Thomas Abraham d306eb801e plat/sgi: improve macros defining cper buffer memory region
Remove the 'ARM_' prefix from the macros defining the CPER buffer memory
and replace it with 'CSS_SGI_' prefix. These macros are applicable only
for platforms supported within plat/sgi. In addition to this, ensure
that these macros are defined only if the RAS_EXTENSION build option is
enabled.

Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I44df42cded18d9d3a4cb13e5c990e9ab3194daee
2021-03-29 18:52:34 +05:30
Thomas Abraham 513ba5c973 plat/sgi: refactor DMC-620 error handling SMC function id
The macros defining the SMC function ids for DMC-620 error handling are
listed in the sgi_base_platform_def.h header file. But these macros are
not applicable for all platforms supported under plat/sgi. So move these
macro definitions to sgi_ras.c file in which these are consumed. While
at it, remove the AArch32 and error injection function ids as these are
unused.

Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I249b54bf4c1b1694188a1e3b297345b942f16bc9
2021-03-29 18:52:34 +05:30
Thomas Abraham a883447403 plat/sgi: refactor SDEI specific macros
The macros specific to SDEI defined in the sgi_base_platform_def.h are
not applicable for all the platforms supported by plat/sgi. So refactor
the SDEI specific macros into a new header file and include this file on
only on platforms it is applicable on.

Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I0cb7125334f02a21cae1837cdfd765c16ab50bf5
2021-03-29 18:52:34 +05:30
johpow01 cb090c1924 Add Makalu ELP CPU lib
Add basic support for Makalu ELP processor core.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I7b1ddbb8dd43326ecb8ff188f6f8fcf239826a93
2021-03-24 12:53:18 -05:00
Olivier Deprez ae030052a1 Merge changes from topic "od/ffa_spmc_pwr" into integration
* changes:
  SPM: declare third cactus instance as UP SP
  SPMD: lock the g_spmd_pm structure
  FF-A: implement FFA_SECONDARY_EP_REGISTER
2021-03-16 16:15:03 +01:00
Madhukar Pappireddy 332649da47 Merge changes from topic "matterhorn_elp" into integration
* changes:
  plat: tc0: add matterhorn_elp_arm library to tc0
  cpus: add Matterhorn ELP ARM cpu library
2021-03-15 17:50:08 +01:00
Olivier Deprez e96fc8e7d6 SPM: declare third cactus instance as UP SP
The FF-A v1.0 spec allows two configurations for the number of EC/vCPU
instantiated in a Secure Partition:
-A MultiProcessor (MP) SP instantiates as many ECs as the number of PEs.
An EC is pinned to a corresponding physical CPU.
-An UniProcessor (UP) SP instantiates a single EC. The EC is migrated to
the physical CPU from which the FF-A call is originating.
This change permits exercising the latter case within the TF-A-tests
framework.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I7fae0e7b873f349b34e57de5cea496210123aea0
2021-03-15 12:29:19 +01:00
Sandrine Bailleux 5491208afa Merge changes from topic "linux_as_bl33" into integration
* changes:
  plat/arm: Remove ARM_LINUX_KERNEL_AS_BL33 relying on RESET_TO_BL31
  plat/arm: Always allow ARM_LINUX_KERNEL_AS_BL33
2021-03-12 09:03:54 +01:00
Usama Arif 72bdcb9a25
plat: tc0: add matterhorn_elp_arm library to tc0
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: Ie199c60553477c43d1665548ae78cdfd1aa7ffcf
2021-03-10 16:10:04 +00:00
bipin.ravi 8ef06b6cdd Merge "Add Makalu CPU lib" into integration 2021-03-02 16:21:22 +01:00
johpow01 aaabf9789a Add Makalu CPU lib
Add basic support for Makalu CPU.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I4e85d425eedea499adf585eb8ab548931185043d
2021-03-01 17:11:36 -06:00
Madhukar Pappireddy 174551d598 Merge changes from topic "trng-svc" into integration
* changes:
  plat/arm: juno: Use TRNG entropy source for SMCCC TRNG interface
  plat/arm: juno: Condition Juno entropy source with CRC instructions
2021-03-02 00:05:10 +01:00
Aditya Angadi 0557734dc0 plat/arm/css: rename rd_n1e1_edge_scmi_plat_info array
Rename rd_n1e1_edge_scmi_plat_info array to plat_rd_scmi_info as the
same array is used to provide SCMI platform info across mulitple RD
platforms and is not resitricted to only RD-N1 and RD-E1 platforms.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I42ba33e0afa3003c731ce513c6a5754b602ec01f
2021-02-17 15:32:33 +05:30
Andre Przywara cb5f0faa71 plat/arm: juno: Use TRNG entropy source for SMCCC TRNG interface
Now that we have a framework for the SMCCC TRNG interface, and the
existing Juno entropy code has been prepared, add the few remaining bits
to implement this interface for the Juno Trusted Entropy Source.

We retire the existing Juno specific RNG interface, and use the generic
one for the stack canary generation.

Change-Id: Ib6a6e5568cb8e0059d71740e2d18d6817b07127d
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-16 17:20:23 +00:00
Andre Przywara eb18ce3283 plat/arm: juno: Condition Juno entropy source with CRC instructions
The Juno Trusted Entropy Source has a bias, which makes the generated
raw numbers fail a FIPS 140-2 statistic test.

To improve the quality of the numbers, we can use the CPU's CRC
instructions, which do a decent job on conditioning the bits.

This adds a *very* simple version of arm_acle.h, which is typically
provided by the compiler, and contains the CRC instrinsics definitions
we need. We need the original version by using -nostdinc.

Change-Id: I83d3e6902d6a1164aacd5060ac13a38f0057bd1a
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-15 11:55:52 +00:00
bipin.ravi d3e145b4cd Merge "plat/arm: juno: Refactor juno_getentropy()" into integration 2021-02-11 21:43:09 +00:00
Madhukar Pappireddy b2e5e56f05 Merge "plat/arm/rdn2: update TZC base address" into integration 2021-02-11 17:15:02 +00:00
Madhukar Pappireddy edbe490baa Merge "morello: Modify morello_plat_info structure" into integration 2021-02-11 15:35:33 +00:00
Andre Przywara 543f0d8b08 plat/arm: juno: Refactor juno_getentropy()
Currently we use the Juno's TRNG hardware entropy source to initialise
the stack canary. The current function allows to fill a buffer of any
size, but we will actually only ever request 16 bytes, as this is what
the hardware implements. Out of this, we only need at most 64 bits for
the canary.

In preparation for the introduction of the SMCCC TRNG interface, we
can simplify this Juno specific interface by making it compatible with
the generic one: We just deliver 64 bits of entropy on each call.
This reduces the complexity of the code. As the raw entropy register
readouts seem to be biased, it makes sense to do some conditioning
inside the juno_getentropy() function already.
Also initialise the TRNG hardware, if not already done.

Change-Id: I11b977ddc5417d52ac38709a9a7b61499eee481f
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-11 10:43:25 +00:00
Vijayenthiran Subramaniam 4e8060d2f5 plat/arm/rdn2: update TZC base address
Update TZC base address to align with the recent changes in the platform
memory map.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I0d0ad528a2e236607c744979e1ddc5c6d426687a
2021-02-11 14:02:56 +05:30
Manish V Badarkhe f98630fbbf plat/arm: fvp: Protect GICR frames for fused/unused cores
Currently, BLs are mapping the GIC memory region as read-write
for all cores on boot-up.

This opens up the security hole where the active core can write
the GICR frame of fused/inactive core. To avoid this issue, disable
the GICR frame of all inactive cores as below:

1. After primary CPU boots up, map GICR region of all cores as
   read-only.
2. After primary CPU boots up, map its GICR region as read-write
   and initialize its redistributor interface.
3. After secondary CPU boots up, map its GICR region as read-write
   and initialize its redistributor interface.
4. All unused/fused core's redistributor regions remain read-only and
   write attempt to such protected regions results in an exception.

As mentioned above, this patch offers only the GICR memory-mapped
region protection considering there is no facility at the GIC IP
level to avoid writing the redistributor area.

These changes are currently done in BL31 of Arm FVP and guarded under
the flag 'FVP_GICR_REGION_PROTECTION'.

As of now, this patch is tested manually as below:
1. Disable the FVP cores (core 1, 2, 3) with core 0 as an active core.
2. Verify data abort triggered by manually updating the ‘GICR_CTLR’
   register of core 1’s(fused) redistributor from core 0(active).

Change-Id: I86c99c7b41bae137b2011cf2ac17fad0a26e776d
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-02-09 15:55:26 +00:00
Manish V Badarkhe e0cea7831f plat/arm: fvp: Do not map GIC region in BL1 and BL2
GIC memory region is not getting used in BL1 and BL2.
Hence avoid its mapping in BL1 and BL2 that freed some
page table entries to map other memory regions in the
future.

Retains mapping of CCN interconnect region in BL1 and BL2
overlapped with the GIC memory region.

Change-Id: I880dd0690f94b140e59e4ff0c0d436961b9cb0a7
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-02-09 15:44:33 +00:00
Andre Przywara e27340a74d plat/arm: Remove ARM_LINUX_KERNEL_AS_BL33 relying on RESET_TO_BL31
So far the ARM platform Makefile would require that RESET_TO_BL31 is set
when we ask for the ARM_LINUX_KERNEL_AS_BL33 feature.
There is no real technical reason for that, and the one place in the
code where this was needed has been fixed.

Remove the requirement of those two options to be always enabled
together.
This enables the direct kernel boot feature for the Foundation FVP
(as described in the documentation), which requires a BL1/FIP
combination to boot, so cannot use RESET_TO_BL31.

Change-Id: I6814797b6431b6614d684bab3c5830bfd9481851
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-09 13:47:47 +00:00
Andre Przywara c99b8c8939 plat/arm: Always allow ARM_LINUX_KERNEL_AS_BL33
At the moment we have the somewhat artifical limitation of
ARM_LINUX_KERNEL_AS_BL33 only being used together with RESET_TO_BL31.

However there does not seem to be a good technical reason for that,
it was probably just to differentate between two different boot flows.

Move the initial register setup for ARM_LINUX_KERNEL_AS_BL33 out of the
RESET_TO_BL31 #ifdef, so that we initialise the registers in any case.

This allows to use a preloaded kernel image when using BL1 and FIP.

Change-Id: I832df272d3829f077661f4ee6d3dd9a276a0118f
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-09 13:34:01 +00:00
Manoj Kumar 42ea8d6731 morello: Modify morello_plat_info structure
The structure has been modified to specify the memory
size in bytes instead of Gigabytes.

Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I3384677d79af4f3cf55d3c353b6c20bb827b5ae7
2021-02-08 11:08:02 +05:30
Manoj Kumar 041d7c7ba9 rainier: remove cpu workaround for errata 1542419
This patch removes the Neoverse N1 CPU errata workaround for
bug 1542419 as the bug is not present in Rainier R0P0 core.

Change-Id: Icaca299b13ef830b2ee5129576aae655a6288e69
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
2021-02-05 11:14:58 +00:00
Lauren Wehrmeister d5105d994c Merge changes from topic "RD_INFRA_POWER_MODING" into integration
* changes:
  plat/arm/board: enable AMU for RD-N2
  plat/arm/board: enable AMU for RD-V1
  plat/arm/sgi: allow all PSCI callbacks on RD-V1
2021-02-03 16:09:51 +00:00
Manish Pandey 6d0dcc7d96 Merge "plat/arm:juno: fix parallel build issue for romlib config" into integration 2021-02-03 15:10:50 +00:00
Avinash Mehta e5da15e045 product/tc0: Enable Theodul DSU in TC platform
Increase the core count and add respective entries in DTS.
Add Klein assembly file to cpu sources for core initialization.
Add SCMI entries for cores.

Signed-off-by: Avinash Mehta <avinash.mehta@arm.com>
Change-Id: I14dc1d87df6dcc8d560ade833ce1f92507054747
2021-02-03 10:10:58 +00:00
Zelalem 5e508f06a0 plat/arm:juno: fix parallel build issue for romlib config
When building TF-A with USE_ROMLIB=1 and -j make options, the build fails with the following error:
make[1]: *** No rule to make target '/build/juno/debug/romlib/romlib.bin', needed by 'bl1_romlib.bin'.
This patch fixes that issue.

Signed-off-by: Zelalem <zelalem.aweke@arm.com>
Change-Id: I0cca416f3f50f400759164e0735c2d6b520ebf84
2021-02-02 11:24:56 -06:00
Pranav Madhu f7bab27616 plat/arm/board: enable AMU for RD-N2
AMU counters are used for monitoring the CPU performance. RD-N2 platform
has architected AMU available for each core. Enable the use of AMU by
non-secure OS for supporting the use of counters for processor
performance control (ACPI CPPC).

Change-Id: I5cc749cf63c18fc5c7563dd754c2f42990a97e23
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30
Pranav Madhu c9bf2cf5e3 plat/arm/board: enable AMU for RD-V1
AMU counters are used for monitoring the CPU performance. RD-V1 platform
has architected AMU available for each core. Enable the use of AMU by
non-secure OS for supporting the use of counters for processor
performance control (ACPI CPPC).

Change-Id: I4003d21407953f65b3ce99eaa8f496d6052546e0
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30
Pranav Madhu 92264f86a3 plat/arm/sgi: allow all PSCI callbacks on RD-V1
Some of the PSCI platform callbacks were restricted on RD-V1 platform
because the idle was not functional. Now that it is functional, remove
all the restrictions on the use PSCI platform callbacks.

Change-Id: I4cb97cb54de7ee166c30f28df8fea653b6b425c7
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30
Lauren Wehrmeister 036e9c177f Merge changes I635cf82e,Iee3b4e0d into integration
* changes:
  Makefile: Fix ${FIP_NAME} to be rebuilt only when needed
  Makefile: Do not mark file targets as .PHONY target
2021-01-25 21:41:25 +00:00
Manish Pandey 009553fc13 Merge "plat/arm: css: Turn ON/OFF redistributor in sync with GIC CPU interface ON/OFF" into integration 2021-01-25 15:05:04 +00:00
Ming Huang 0301d09ce6 plat/arm/css/sgi: Fix assert expression issue
Violation of MISRA-C Rule 14.4

Signed-off-by: Ming Huang <huangming@linux.alibaba.com>
Change-Id: I44ef50dadb54fb056a91f3de962b6e63ba6d7ac4
2021-01-20 22:09:43 +00:00
Ming Huang 9feb1e2f4b plat/arm/css/sgi: Fix bl32 receive event - 0xC4000061 issue
The issue is that, when interrupt is triggered and RAS handler
is entered, after interrupt handler finishes, TF-A will re-enter
bl32 and then crash.
sdei_dispatch_event() may return failing result in some cases,
for example kernel may not have registered a handler or RAS event
may happen early during boot. We restore the NS context when
sdei_dispatch_event() returns failing result.

error log :
Received delegated event
X0 :  0xC4000061
X1 :  0x0
X2 :  0x0
X3 :  0x0
Received event - 0xC4000061 on cpu 0
UnRecognized Event - 0xC4000061
Failed delegated event 0xC4000061, Status Invalid Parameter
Unhandled Exception in EL3.
x30            = 0x000000000401f700
x0             = 0xfffffffffffffffe
x1             = 0xfffffffffffffffe
x2             = 0x00000000600003c0

Signed-off-by: Ming Huang <huangming@linux.alibaba.com>
Change-Id: I9802e9a32eee0ac3b5a8bcc0362d0b0e3b71dc9f
2021-01-20 22:09:36 +00:00
Jagadeesh Ujja 4d8c181963 plat/arm: css: Turn ON/OFF redistributor in sync with GIC CPU interface ON/OFF
Turn ON/OFF GIC redistributor in sync with GIC CPU interface ON/OFF.

Issue :
The Linux prompt hangs when all the cores in a cluster are turned OFF
and we try to turn ON a core in that cluster. Previously when TF-A turns
ON a core, TF-A first turns ON the redistributor followed by the core.
This did not match the flow when turning OFF a core, as TF-A did not
turn OFF redistributor when the corresponding core[s] are disabled.
This hang is resolved by disabling redistributor as cores are disabled,
keeping them in sync.

Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Change-Id: Ifd04fdcfd47b45e00f874f15b098471883d023f0
2021-01-20 13:31:16 +00:00
Aditya Angadi 90aecf1e0a plat/arm: rename rddanielxlr to rdv1mc
Reference Design platform RD-Daniel-ConfigXLR has been renamed to
RD-V1-MC. Correspondingly, remove all uses of 'rddanielxlr' and replace
it with 'rdv1mc' where appropriate.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I5d91c69738397b19ced43949b4080c74678e604c
2021-01-11 12:29:51 +05:30
Aditya Angadi edf771a11f plat/arm: rename rddaniel to rdv1
Reference Design platform RD-Daniel has been renamed to RD-V1.
Correspondingly, remove all uses of 'rddaniel' and replace it with
'rdv1' where appropriate.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I1702bab39c501f8c0a09df131cb2394d54c83bcf
2021-01-11 12:28:54 +05:30
Pali Rohár a98122064d Makefile: Do not mark file targets as .PHONY target
Only non-file targets should be set a .PHONY. Otherwise if file target is
set as .PHONY then targets which depends on those file .PHONY targets would
be always rebuilt even when their prerequisites are not changed.

File target which needs to be always rebuilt can be specified in Make
system via having a prerequisite on some .PHONY target, instead of marking
whole target as .PHONY. In Makefile projects it is common to create empty
.PHONY target named FORCE for this purpose.

This patch changes all file targets which are set as .PHONY to depends on
new .PHONY target FORCE, to ensure that these file targets are always
rebuilt (as before). Basically they are those targets which calls external
make subprocess.

After FORCE target is specified in main Makefile, remove it from other
Makefile files to prevent duplicate definitions.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Iee3b4e0de93879b95eb29a1745a041538412e69e
2021-01-07 13:23:15 +00:00
Madhukar Pappireddy 669ee776cc Merge changes from topic "tc0_optee_sp" into integration
* changes:
  fdts: tc0: Add reserved-memory node for OP-TEE
  plat: tc0: OP-TEE as S-EL1 SP with SPMC at S-EL2
  docs: arm: Add OPTEE_SP_FW_CONFIG
  plat: tc0: enable opteed support
  plat: arm: Increase SP max size
2020-12-21 19:42:05 +00:00
Vijayenthiran Subramaniam fb86e5373c plat/arm/rdn2: update gic redistributor base address
RD-N2 platform has been updated to use six GIC ITS blocks. This results
in change in base address of the GIC Redistributor to accomodate two
new GIC ITS blocks. Update the base address of GICR to reflect the same.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I740a547328fb9a9f25d7a09c08e61bdbc8bf781c
2020-12-16 13:29:37 +05:30
Arunachalam Ganapathy 39460d0570 plat: tc0: OP-TEE as S-EL1 SP with SPMC at S-EL2
This patch adds support to enable OP-TEE as S-EL1 SP with SPMC at S-EL2
     - create SPMC manifest file with OP-TEE as SP
     - add support for ARM_SPMC_MANIFEST_DTS build option
     - add optee entry with ffa as method in tc0.dts

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Ia9b5c22c6f605d3886914bbac8ac45e8365671cb
2020-12-14 18:02:33 +00:00
Arunachalam Ganapathy 86069c0cba plat: tc0: enable opteed support
Enable SPD=opteed support for tc0 platform.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Ieb038d645c68fbe6b5a211c7279569e21b476fc3
2020-12-14 11:50:10 +00:00
Madhukar Pappireddy bd054fd66b Merge changes from topic "rdevans" into integration
* changes:
  doc: Update list of supported FVP platforms
  board/rdn2: add board support for rdn2 platform
  plat/arm/sgi: adapt to changes in memory map
  plat/arm/sgi: add platform id value for rdn2 platform
  plat/arm/sgi: platform definitions for upcoming platforms
  plat/arm/sgi: refactor header file inclusions
  plat/arm/sgi: refactor the inclusion of memory mapping
2020-12-11 15:21:54 +00:00
Aditya Angadi 34e443e21d board/rdn2: add board support for rdn2 platform
Add the initial board support for RD-N2 platform.

Change-Id: I8325885bf248dd92191d6fc92a2da91c23118f8c
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 10:44:04 +00:00
Aditya Angadi 6bb9f7a1ab plat/arm/sgi: adapt to changes in memory map
Upcoming RD platforms will have an updated memory map for the various
pheripherals on the system. So, for the newer platforms, handle the
memory mapping and other platform specific functionality separately
from the existing platforms.

Change-Id: Iab1355a4c8ea1f6db4f79fcdd6eed907903b6a18
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 10:40:26 +00:00
Aditya Angadi 1b19ad6847 plat/arm/sgi: add platform id value for rdn2 platform
In preparation for adding the board support for RD-N2 platform, add
macros to define the platform id and the corresponding SCMI platform
info for the RD-N2 platform.

Change-Id: Ie764ae618732b39e316f7ed080421f5d79adab21
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 10:40:17 +00:00
Aditya Angadi 284efb16b4 plat/arm/sgi: platform definitions for upcoming platforms
Upcoming RD platforms have changes in the SOC address map from that
of the existing platforms. As a prepartory step to add support for the
upcoming platforms, create platform definitions for those platforms.

Change-Id: Ic5df9fed02c44e65ec260bbb5efc1b8dbd919a56
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 10:40:08 +00:00
Aditya Angadi 60f995fd98 plat/arm/sgi: refactor header file inclusions
Upcoming RD platforms have deviations in various definitions of
platform macros from that of the exisiting platforms. In preparation
for adding support for those upcoming RD platforms, refactor the
header file inclusion to allow newer platforms to use a different
set of platform macros.

Change-Id: Ic80283ddadafaa7f766f300652cb0d4e507efdb6
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 10:37:11 +00:00
Aditya Angadi db2aeddc79 plat/arm/sgi: refactor the inclusion of memory mapping
Upcoming RD platforms have a different memory map from those of the
existing platforms. So make the build of the existing mmap entries to be
usable only for existing platforms and let upcoming platforms define
a different set of mmap entries.

Change-Id: Id1ef0293efe8749c78a99237e78d32573c7233aa
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-12-09 15:12:18 +05:30
Olivier Deprez 89832ac9ef spm: provide number of vCPUs and VM size for first SP
The primary VM concept is removed from the SPMC.
Update the SPMC manifests with number of Execution Contexts
and SP workspace size for the first Secure Partition (as it
is done for NWd secondary VMs and other SPs).

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I3b9c52666f7dfe74ab1f7d2148ad0070ee44b54e
2020-12-08 13:35:28 +01:00
Olivier Deprez 5134fcbb47 spm: remove chosen node from SPMC manifests
The chosen node is no longer required as the SPMC implements
a specific boot flow which no longer requires this node.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ib566b602a7f83003a1b2d0ba5f6ebf4d8b7a9156
2020-12-08 13:35:28 +01:00
Olivier Deprez 76d22f06dc spm: move OP-TEE SP manifest DTS to FVP platform
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I0981c43e2ef8172138f65d95eac7b20f8969394e
2020-12-08 13:35:28 +01:00
Olivier Deprez b635d11bcd spm: remove device-memory node from SPMC manifests
The PVM concept is removed from the SPMC so the device-memory
node which is specifying the device memory range for the PVM
is no longer applicable.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: If0cb956e0197028b24ecb78952c66ec454904516
2020-12-08 13:35:28 +01:00
Javier Almansa Sobrino 25bbbd2d63 Add support for Neoverse-N2 CPUs.
Enable basic support for Neoverse-N2 CPUs.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I498adc2d9fc61ac6e1af8ece131039410872e8ad
2020-11-30 19:12:56 +00:00
Alexei Fedorov 8109d2dd69 Merge "Use constant stack size with RECLAIM_INIT_CODE" into integration 2020-10-29 18:00:13 +00:00
David Horstmann 3ed5606bd1 Use constant stack size with RECLAIM_INIT_CODE
Currently, when RECLAIM_INIT_CODE is set, the
stacks are scaled to ensure that the entirety
of the init section can be reclaimed as stack.

This causes an issue in lib/psci/aarch64/psci_helpers.S,
where the stack size is used for cache operations in
psci_do_pwrdown_cache_maintenance(). If the stacks
are scaled, then the PSCI code may fail to invalidate
some of the stack memory before power down.

Resizing stacks is also not good for stability in general,
since code that works with a small number of cores may
overflow the stack when the number of cores is increased.

Change to make every stack be PLATFORM_STACK_SIZE big,
and allow the total stack to be smaller than the
init section.

Any pages of the init section not reclaimed as
stack will be set to read-only and execute-never,
for security.

Change-Id: I10b3884981006431f2fcbec3864c81d4a8c246e8
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2020-10-28 17:58:49 +00:00
Olivier Deprez 00ad74c7af Merge "SPMC: adjust device region for first secure partition" into integration 2020-10-26 09:51:32 +00:00
Olivier Deprez d0d63afeb4 SPMC: adjust device region for first secure partition
For the first partition, mark first 2GB as device memory excluding
the Trusted DRAM region reserved for the SPMC.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I3ff110b3facf5b6d41ac2519ff6ca5e30a0a502b
2020-10-22 00:12:00 +02:00
Usama Arif 879b5b8bca plat: tc0: Configure TZC with secure world regions
This includes configuration for SPMC and trusted OS.

Change-Id: Ie24df200f446b3f5b23f5f764b115c7191e6ada3
Signed-off-by: Usama Arif <usama.arif@arm.com>
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2020-10-20 20:07:17 +00:00
Arunachalam Ganapathy b0d127515a plat: tc0: Enable SPMC execution at S-EL2
This patch enables SPMC execution at S-EL2 by adding below changes

    - Map TC0_MAP_TZC_DRAM1 for loading SPMC
    - Add details of cactus test secure partitions
    - Adds tc0 spmc manifest file with details on secure partitions
    - Inlcude TOS_FW_CONFIG when SPM is spmd
    - Increases bl2 image size

SPMC at S-EL2 is only enabled when build with SPD=spmd.

Change-Id: I4c5f70911903c232ee8ecca57f1e288d6b1cd647
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2020-10-20 20:07:12 +00:00
Arunachalam Ganapathy a3ecbb3553 plat: tc0: Add TZC DRAM1 region for SPMC and trusted OS
- Reserve 32MB below ARM_AP_TZC_DRAM1_BASE for TC0_TZC_DRAM1
- Add TC0_NS_DRAM1 base and mapping
- Reserve memory region in tc0.dts

Change-Id: If2431f7f68e4255e28c86a0e89637dab7c424a13
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2020-10-20 20:07:06 +00:00
Arunachalam Ganapathy d32113c7f3 plat: arm: Make BL32_BASE platform dependent when SPD_spmd is enabled
To support platforms without Trusted DRAM this patch defines
PLAT_ARM_SPMC_BASE and enables platform to use either Trusted DRAM or
DRAM region behind TZC.

Change-Id: Icaa5c7d33334258ff27e8e0bfd0812c304e68ae4
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2020-10-20 20:06:59 +00:00
Arunachalam Ganapathy c398caf509 plat: tc0: Disable SPE
Statistical Profiling Extension is not supported by Matterhorn core

Change-Id: Iec652f1c6d6b6a9bf118ba682276a7c70a6abc0d
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2020-10-20 20:06:54 +00:00
Joanna Farley 943aff0c16 Merge "Increase type widths to satisfy width requirements" into integration 2020-10-18 14:51:00 +00:00
Jimmy Brisson d7b5f40823 Increase type widths to satisfy width requirements
Usually, C has no problem up-converting types to larger bit sizes. MISRA
rule 10.7 requires that you not do this, or be very explicit about this.
This resolves the following required rule:

    bl1/aarch64/bl1_context_mgmt.c:81:[MISRA C-2012 Rule 10.7 (required)]<None>
    The width of the composite expression "0U | ((mode & 3U) << 2U) | 1U |
    0x3c0U" (32 bits) is less that the right hand operand
    "18446744073709547519ULL" (64 bits).

This also resolves MISRA defects such as:

    bl2/aarch64/bl2arch_setup.c:18:[MISRA C-2012 Rule 12.2 (required)]
    In the expression "3U << 20", shifting more than 7 bits, the number
    of bits in the essential type of the left expression, "3U", is
    not allowed.

Further, MISRA requires that all shifts don't overflow. The definition of
PAGE_SIZE was (1U << 12), and 1U is 8 bits. This caused about 50 issues.
This fixes the violation by changing the definition to 1UL << 12. Since
this uses 32bits, it should not create any issues for aarch32.

This patch also contains a fix for a build failure in the sun50i_a64
platform. Specifically, these misra fixes removed a single and
instruction,

    92407e73        and     x19, x19, #0xffffffff

from the cm_setup_context function caused a relocation in
psci_cpus_on_start to require a linker-generated stub. This increased the
size of the .text section and caused an alignment later on to go over a
page boundary and round up to the end of RAM before placing the .data
section. This sectionn is of non-zero size and therefore causes a link
error.

The fix included in this reorders the functions during link time
without changing their ording with respect to alignment.

Change-Id: I76b4b662c3d262296728a8b9aab7a33b02087f16
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-12 10:55:03 -05:00
Jimmy Brisson 831b0e9824 Don't return error information from console_flush
And from crash_console_flush.

We ignore the error information return by console_flush in _every_
place where we call it, and casting the return type to void does not
work around the MISRA violation that this causes. Instead, we collect
the error information from the driver (to avoid changing that API), and
don't return it to the caller.

Change-Id: I1e35afe01764d5c8f0efd04f8949d333ffb688c1
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-09 10:21:50 -05:00
Madhukar Pappireddy a4fdb893a8 Merge changes from topics "rename-herculesae-a78ae", "rename-zeus-v1" into integration
* changes:
  Rename Neoverse Zeus to Neoverse V1
  Rename Cortex Hercules AE to Cortex 78 AE
2020-10-06 23:35:55 +00:00
Usama Arif 3bfcc9d700 plat/arm: common: add guard for arm_get_rotpk_info_regs
Only define arm_get_rotpk_info_regs if ROTPK is in registers,
i.e. (ARM_ROTPK_LOCATION_ID == ARM_ROTPK_REGS_ID). This will
allow platform build without definition of TZ_PUB_KEY_HASH_BASE
if dedicated registers for ROTPK are not available on the platform.

Change-Id: I74ee2d5007f5d876a031a1efca20ebee2dede0c7
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-06 12:14:34 +00:00
Jimmy Brisson 467937b63d Rename Neoverse Zeus to Neoverse V1
Change-Id: Ieb411e2f8092fa82062e619305b680673a8f184f
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-05 15:14:11 -05:00
Jimmy Brisson 5effe0beba Rename Cortex Hercules AE to Cortex 78 AE
Change-Id: Ic0ca51a855660509264ff0d084c068e1421ad09a
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-05 15:14:11 -05:00
Chandni Cherukuri 6c07a9273b morello: Add changes to fix build of Morello Platform
This patch makes changes required to get the morello
platform working with the tip of TF-A.

Change-Id: I095006615c9959bba49fcc75b52e1de7d7486309
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2020-10-02 12:25:09 +05:30
André Przywara 2173b3e05f Merge changes from topic "fpga_generic" into integration
* changes:
  arm_fpga: Add platform documentation
  arm_fpga: Add post-build linker script
  arm_fpga: Add ROM trampoline
  arm_fpga: Add devicetree file
  arm_fpga: Remove SPE PMU DT node if SPE is not available
  arm_fpga: Adjust GICR size in DT to match number of cores
  fdt: Add function to adjust GICv3 redistributor size
  drivers: arm: gicv3: Allow detecting number of cores
2020-09-30 00:13:29 +00:00
Andre Przywara 01301b116e arm_fpga: Add post-build linker script
For the Arm Ltd. FPGAs to run, we need to load several payloads into the
FPGA's memory:
- Some trampoline code at address 0x0, to jump to BL31's entry point.
- The actual BL31 binary at the beginning of DRAM.
- The (generic) DTB image to describe the hardware.
- The actual non-secure payloads (kernel, ramdisks, ...)

The latter is application specific, but the first three blobs are rather
generic.
Since the uploader tool supports ELF binaries, it seems helpful to
combine these three images into one .axf file, as this also simplifies
the command line.

Add a post-build linker script, that combines those three bits into one
ELF file, together with their specific load addresses.
Include a call to "ld" with this linker script in the platform Makefile,
so it will be build automatically. The result will be called "bl31.axf".

Change-Id: I4a90da16fa1e0e83b51d19e5b1daf61f5a0bbfca
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-29 13:28:25 +01:00
Andre Przywara f45c6d8623 arm_fpga: Add ROM trampoline
The application cores of the FPGAs used in Arm Ltd. start execution at
address 0x0. This is the location of some (emulated) ROM area (which can
be written to by the uploading tool).
Since the arm_fpga port is configured to run from DRAM, we load BL31 to
the beginning of DRAM (mapped at 2GB). This requires some small
trampoline code in the "ROM" to jump to the BL31 entry point.

To avoid some extra magic binary, add a tiny assembly file with that
trivial jump instruction to the tree, so this binary can be created
alongside BL31.

Change-Id: I9e4439fc0f093fa24dd49a8377c9edb030fbb477
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-29 13:28:25 +01:00
Andre Przywara b48883c79a arm_fpga: Add devicetree file
The FPGA images used in Arm Ltd. focus on CPU cores, so they share a
common platform, with a minimal set of peripherals (interconnect, GIC,
UART).
This allows to support most platforms with a single devicetree file.
The topology and number of CPU cores differ, but those will added at
runtime, in BL31. Other adjustments (GICR size, SPE node, command line)
are also done at this point.

Add the common devicetree file to TF-A's build system, so it can be
build together with BL31. At runtime, the resulting .dtb file should be
uploaded to the address given with FPGA_PRELOADED_DTB_BASE at build time.

Change-Id: I3206d6131059502ec96896e95329865452c9d83e
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-29 13:28:25 +01:00
Andre Przywara 40a0de1972 arm_fpga: Remove SPE PMU DT node if SPE is not available
The Statistical Profiling Extension (SPE) is an architectural feature we
can safely detect at runtime. However it still relies on one piece of
platform-specific information: the interrupt line it is connected
to. This requires SPE to be described in a devicetree node.

Since SPE support varies with the CPU cores found on an FPGA image, we
should detect the presence of SPE at runtime, and remove a potentially
existing SPE PMU node from the DT.

This allows to always have the SPE node in a generic devicetree file,
without risking exposing it on a CPU without this feature.

Change-Id: I73d83ea8509b03fe7bba20b9cce8d1335035fa31
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-29 13:28:25 +01:00
Andre Przywara 283e5595af arm_fpga: Adjust GICR size in DT to match number of cores
The size of a GICv3 redistributor region depends on the number of
cores in the system. For the ARM FPGA port, we detect the topology at
runtime, and adjust the CPU DT nodes accordingly.
Now the size of the GICR region must also be adjusted, or Linux will
fail to initialise the GICv3.

Use the newly introduced function to overwrite the GICR size entry in
the GICv3 reg property. We count the number of existing cores by
iterating over the GICR frames until we find the LAST bit set in TYPER.

Change-Id: Ib69565600859de9b1b15ceb8495172cd26d16fce
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-29 13:28:25 +01:00
Manish Pandey 609115a627 Merge changes I1ecbe5a1,Ib5945c37,Ic6b79648 into integration
* changes:
  plat/arm: Add platform support for Morello
  fdts: add device tree sources for morello platform
  lib/cpus: add support for Morello Rainier CPUs
2020-09-29 12:17:21 +00:00
André Przywara 478fc4f238 Merge "arm_fpga: Add support for unknown MPIDs" into integration 2020-09-28 18:25:03 +00:00
Chandni Cherukuri dfd5bfb097 plat/arm: Add platform support for Morello
This patch adds support for Morello platform.
It is an initial port which includes only BL31 support
as the System Control Processor (SCP) is expected to take
the role of primary bootloader.

Change-Id: I1ecbe5a14a2d487b2ecea3c1ca227f08473ed2dd
Co-authored-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Signed-off-by: Anurag Koul <anurag.koul@arm.com>
2020-09-28 19:33:24 +05:30
Javier Almansa Sobrino 1994e56221 arm_fpga: Add support for unknown MPIDs
This patch allows the system to fallback to a default CPU library
in case the MPID does not match with any of the supported ones.

This feature can be enabled by setting SUPPORT_UNKNOWN_MPID build
option to 1 (enabled by default only on arm_fpga platform).

This feature can be very dangerous on a production image and
therefore it MUST be disabled for Release images.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I0df7ef2b012d7d60a4fd5de44dea1fbbb46881ba
2020-09-25 15:45:50 +01:00
Olivier Deprez 6b745042ea Merge changes from topic "tc0_architecture_change" into integration
* changes:
  plat: tc0: enable TZC
  fdts: tc0: update MHUv2 interrupt number
2020-09-25 07:08:36 +00:00
Manish Pandey b21ecb4ef0 Merge "plat/arm/css/sgi: Map flash used for mem_protect" into integration 2020-09-24 21:53:38 +00:00
Olivier Deprez 21023273c9 Merge "plat/arm: Introduce and use libc_asm.mk makefile" into integration 2020-09-24 14:39:24 +00:00
Sami Mujawar 7c15a8c14f plat/arm/css/sgi: Map flash used for mem_protect
The SGI platform defines the macro PLAT_ARM_MEM_PROT_ADDR which
indicates that the platform has mitigation for cold reboot attacks.

However, the flash memory used for the mem_protect region was not
mapped. This results in a crash when an OS calls PSCI MEM_PROTECT.

To fix this map the flash region used for mem_protect.

Change-Id: Ia494f924ecfe2ce835c045689ba8f942bf0941f4
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2020-09-24 19:15:54 +05:30
Usama Arif 16796a25fe
plat: tc0: enable TZC
Change-Id: Ic2bb8482f0b602f6b7850d4fa553448bc4931edc
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-09-24 10:50:25 +01:00
Manish Pandey 5c5d82848d Merge "SPMC: adjust the number of EC context to max number of PEs" into integration 2020-09-22 09:50:31 +00:00
Manish Pandey 101daafd6b Merge changes from topic "ehf_common" into integration
* changes:
  plat: tegra: Use generic ehf defines
  ehf: use common priority level enumuration
2020-09-18 14:20:02 +00:00
Olivier Deprez 95879319f5 SPMC: adjust the number of EC context to max number of PEs
According to [1] and in context of FF-A v1.0 a secure partition must
have either one EC (migratable UP) or a number of ECs equal to the
number of PEs (pinned MP). Adjust the SPMC manifest such that the
number of ECs is equal to the number of PEs.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/components/
secure-partition-manager.html#platform-topology

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ie8c7d96ae7107cb27f5b97882d8f476c18e026d4
2020-09-15 17:25:57 +02:00
Manish V Badarkhe 70fb765396 plat/arm: fvp: Increase BL2 maximum size
Increased BL2 maximum size when CoT descriptors are placed
in device tree.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I6466d2841e189e7f15eb4f1a8db070542893cb5b
2020-09-15 15:14:53 +00:00
Manish V Badarkhe 28e9a55fc8 lib: fconf: Implement a parser to populate CoT
Implemented a parser which populates the properties of
the CoT descriptors as per the binding document [1].
'COT_DESC_IN_DTB' build option is disabled by default and can
be enabled in future for all Arm platforms by making necessary
changes in the memory map.
Currently, this parser is tested only for FVP platform.

[1]:
https://trustedfirmware-a.readthedocs.io/en/latest/components/cot-binding.html

Change-Id: I2f911206087a1a2942aa728de151d2ac269d27cc
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2020-09-15 16:13:26 +01:00
Manish Pandey 9cdff51097 Merge "tc0: increase SCP_BL2 size to 128 kB" into integration 2020-09-11 14:01:50 +00:00
Manish Pandey ab9646f511 Merge "SPM: Get rid of uint32_t array representation of UUID" into integration 2020-09-11 10:47:48 +00:00
Usama Arif dd14887e15
tc0: increase SCP_BL2 size to 128 kB
The size of debug binaries of SCP has increased beyond the current
limit of 80kB set in platform. Hence, increase it to 128kB.

Change-Id: I5dbcf87f8fb35672b39abdb942c0691fb339444a
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-09-10 15:05:58 +01:00