Commit graph

12881 commits

Author SHA1 Message Date
Manish V Badarkhe
acd03f4b75 docs: move common build option from Arm-specific to common file
Moved common build options from Arm-specific file to common build
file.

Change-Id: If74b6223972ae3a6c11d9f9d2fbd8d2ee008b6e5
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-06-27 12:47:28 +01:00
Manish Pandey
3995f30c55 Merge "refactor(build): merge march32/64 directives" into integration 2023-06-27 10:19:56 +02:00
Manish V Badarkhe
b7d9755ec0 Merge "refactor(fdt-wrappers): fix for unit testing errors" into integration 2023-06-27 10:10:05 +02:00
Juan Pablo Conde
e7c0f42a2e refactor(fdt-wrappers): fix for unit testing errors
As the unit testing project uses the host machine GCC version to
compile, it is marking non-casted references as errors. This patch adds
the proper casting, so it compiles correctly for both Arm platforms and
host machines for unit testing.

Change-Id: Iee96e9117301ba28b6f164aac2cd36dc0f8b6be8
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
2023-06-26 15:03:08 -05:00
Lauren Wehrmeister
14196178f1 Merge "refactor(cpus): add Cortex-A32 errata framework information" into integration 2023-06-26 18:27:32 +02:00
Kathleen Capella
0452359a48 refactor(cpus): add Cortex-A32 errata framework information
Replace errata_report with errata_report_shim.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: I5a43b0985f070f887474120eb8f5f7c01ba4af5f
2023-06-26 16:46:31 +02:00
Joanna Farley
f1b7a99aa0 Merge "chore(xilinx): follow kernel doc format for functional documentation" into integration 2023-06-23 16:17:59 +02:00
Manish V Badarkhe
059b19bd44 Merge "docs: move the Juno-specific build option to Arm build option file" into integration 2023-06-23 16:01:50 +02:00
Manish V Badarkhe
e8947b27fe Merge "feat(fvp): allow configurable FVP Trusted SRAM size" into integration 2023-06-23 16:01:09 +02:00
Manish Pandey
6b6cefbf7b Merge changes from topic "RAS_REFACTORING" into integration
* changes:
  feat(board/rdn2): enable base element RAM RAS support on RD-N2 platform
  feat(plat/arm): add memory map entry for CPER memory region
  feat(plat/arm): firmware first error handling support for base RAMs
  feat(plat/arm): update common platform RAS implementation
  feat(plat/sgi): remove RAS setup call from common code
  refactor(plat/sgi): deprecate DMC-620 RAS support
  fix(plat/common): register PLAT_SP_PRI only if not already registered
  fix(plat/sgi): update PLAT_SP_PRI macro definition
  fix(plat/arm): add RAS_FFH_SUPPORT check for RAS EHF priority
2023-06-23 15:18:26 +02:00
Omkar Anand Kulkarni
0288632665 feat(board/rdn2): enable base element RAM RAS support on RD-N2 platform
To enable firmware first support for base element RAMs on RD-N2 platform
this patch adds following support
- Includes SDEI header to enable SDEI feature on RD-N2 platform.
- Add TZC configuration for CPER memory region for RD-N2 platform
  variants. This region is marked for non-secure access as OSPM and
  firmware need to access this region.
- Defines all base element RAM errors for RD-N2 platform variants.
- Defines a platform RAS event map and respective RAS config data
  structure.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ideaed598f4924f3b9836d4d7e9ef76b9b7580b48
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
4dc91ac906 feat(plat/arm): add memory map entry for CPER memory region
In firmware-first error handling approach the firmware consumes the
hardware fault interrupt, processes the error and notifies the fault to
OSPM. Firmware also shares the error information with the OSPM using a
standard format called Common Platform Error Record (CPER). The CPER is
placed in reserved memory that is shared between OSPM and the firmware.
On RD-N2 platform variants carve out a reserved memory space for the
CPER buffer. This patch enables CPER memory map region on RD-N2 platform
variants.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ib2645c90d4dc975f57bb143795f61f74f4f81494
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
5b77a0e675 feat(plat/arm): firmware first error handling support for base RAMs
RD-N2 platform variants support base element RAM. The RAMs implement
ECC that detects ECC 1/2-bit errors and reports them via interrupts. The
error information is reported as part of error record frames defined for
base element RAMs.

This patch provides reference error handler implementation to handle
1/2-bit RAS errors that occur on base element RAM's. On error event the
error handler reads the error records information and forwards the event
to secure partition. Secure partition creates a CPER record from this
error information. Finally the handler notifies the OS about the RAS
error using the SDEI notification mechanism.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ic209c714de6cd2d4c845198b03724940a2e1c240
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
7f15131df4 feat(plat/arm): update common platform RAS implementation
Refactor the RAS implementation to be used as common platform RAS
implementation for all the platforms. As part of refactoring this patch
extends support to configure interrupt as PPI interrupt type in addition
to currently supported SPI interrupts.

This patch defines a RAS config data structure to be defined by each
platform. The RAS config data structure carries the event map and size
information. Each platform code during initialization phase must define
this RAS config and register it with common platform RAS module.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: I4019b31386a7e9c197bcc83bdca47876ee854d0f
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
0f5e8eb453 feat(plat/sgi): remove RAS setup call from common code
In preparation of refactoring the support for platform error handling,
remove the call to RAS platform setup call from SGI specific common
code. This function will be called from platform code after the
refactoring.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: If4a87e0adf166b1c99bf5999f2f89efa6c7c6afc
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
258d5f06e3 refactor(plat/sgi): deprecate DMC-620 RAS support
Remove DMC-620 specific code from platform RAS implementation. DMC-620
RAS support is not supported on SGI and RD platforms. The rest of the
platform specific code maintained will be reused for supporting RAS
error handling on RD-N2 and later platforms.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ic03ae0e3298628330c5f7c25bafb0131f7b9d5b6
2023-06-23 16:09:56 +05:30
Omkar Anand Kulkarni
bf01999aba fix(plat/common): register PLAT_SP_PRI only if not already registered
Build fails when RAS and SPM are enabled together and when PLAT_SP_PRI
EHF priority is equal to PLAT_RAS_PRI EHF priority.

So add checks to register SPM priority with the EHF framework only when
the priority is different from RAS priority or when RAS is not enabled
on the platform.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ie14f82d27c9835b24890cc4561a56821881cf0ec
2023-06-23 16:08:20 +05:30
Omkar Anand Kulkarni
6f689a51a5 fix(plat/sgi): update PLAT_SP_PRI macro definition
PLAT_SP_PRI EHF priority is defined to be same as the PLAT_RAS_PRI EHF
priority. But PLAT_RAS_PRIORITY is defined only if RAS_FFH_SUPPORT is
enabled. This patch defines priority value for PLAT_SP_PRI if
RAS_FFH_SUPPORT is not enabled.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: Ib3747317d2ecc088fbbf1f5f283726a330454c93
2023-06-23 15:13:02 +05:30
Omkar Anand Kulkarni
1c012840ca fix(plat/arm): add RAS_FFH_SUPPORT check for RAS EHF priority
Define RAS EHF priority only if RAS_FFH_SUPPORT is enabled.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
Change-Id: I0183a0af510337c8dfb9d12427541fa6c91bb4a5
2023-06-23 15:08:44 +05:30
Prasad Kummari
de7ed953e3 chore(xilinx): follow kernel doc format for functional documentation
For TF-A, there is no format specified for functional documentation.
For AMD-Xilinx platforms, following kernel-doc format for the functional
documentation to make sure AMD-xilinx documentation is align with
actual code.

For example use kernel-doc from linux to call:
<linux>/scripts/kernel-doc -man -v 1 >/dev/null file...

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Change-Id: Idcc9def408b6c8da35b36f67ef82fc00890e998c
2023-06-23 08:07:13 +01:00
Govindraj Raja
d4089fb8d8 refactor(build): merge march32/64 directives
Both march32-directive and march64-directive eventually generate the
same march option that will passed to compiler.

Merge this two separate directives to a common one as march-directive.

Change-Id: I220d2b782eb3b54e13ffd5b6a581d0e6da68756a
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-06-22 16:37:03 -05:00
Manish V Badarkhe
e09b8aa5a5 Merge "fix(morello): configure platform specific secure SPIs" into integration 2023-06-22 23:17:30 +02:00
Werner Lewis
80f8769b26 fix(morello): configure platform specific secure SPIs
Previous implementation used common CSS interrupts, which do not match
the Morello platform interrupt map. Updated to configure Secure
interrupts according to the Morello TRM and InfraSYSDESIGN4.0
specification.

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Change-Id: I783a472d92601d86f1844f0d035dd0d036b2bfca
2023-06-22 22:36:57 +02:00
Manish V Badarkhe
c4c7efe79e Merge changes from topic "msm8916-spmin" into integration
* changes:
  docs(msm8916): document new build options
  feat(msm8916): allow selecting which UART to use
  feat(msm8916): add SP_MIN port for AArch32
  refactor(msm8916): detect cold boot in plat_get_my_entrypoint
  feat(msm8916): add Test Secure Payload (TSP) port
  build(msm8916): place bl32 directly after bl31
  refactor(msm8916): separate common platform setup code
2023-06-22 17:00:52 +02:00
Manish Pandey
0ad935f72a Merge changes from topic "ffa_el3_spmc_fixes" into integration
* changes:
  fix(tsp): fix destination ID in direct request
  fix(el3-spm): fix LSP direct message response
  fix(el3-spm): improve direct messaging validation
2023-06-22 16:49:55 +02:00
Manish V Badarkhe
31df063281 docs: move the Juno-specific build option to Arm build option file
Moved the Juno-specific build option from the common build option
file to the Arm build option file.

Change-Id: I0f53203f0cfca4a3baadab2cee4339c9694cfe8b
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-06-22 16:00:32 +02:00
Manish Pandey
f6b8e72506 Merge changes I08300ec4,I0f6fa9ce,I8f0a659a into integration
* changes:
  refactor(el3-spmc): add comments and cleanup code
  refactor(el3-spmc): avoid extra loop
  fix(el3-spmc): validate memory address alignment
2023-06-22 12:36:54 +02:00
Manish Pandey
2bb8755922 Merge "feat(plat/qemu): add sdei support for QEMU" into integration 2023-06-22 10:41:33 +02:00
Marc Bonnici
ed23d274fa fix(tsp): fix destination ID in direct request
Ensure the TSP ID is set as the source ID in a direct request.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: Ia082fe5a1da6f2994072ec70c6ba818212a52f20
2023-06-21 22:12:03 +01:00
Marc Bonnici
c040621dba fix(el3-spm): fix LSP direct message response
Ensure that the example LSP correctly sets the
sender/receiver field in a direct response.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I482c08d4657617adb00b0f3cf3c8ddc84f1bf7c8
2023-06-21 22:12:03 +01:00
Marc Bonnici
48fe24c50c fix(el3-spm): improve direct messaging validation
Perform additional validation of the source and destination
IDs of direct messages.
Additionally track the sender of a direct request to allow
validating the target of the corresponding direct response.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I8d39d53a02b8333246f1500c79ba04f149459c16
2023-06-21 22:11:44 +01:00
Chris Kay
41e56f422d feat(fvp): allow configurable FVP Trusted SRAM size
In some build configurations TF-A can exceed the existing 256KB SRAM,
triggering a build failure. More recent versions of the base FVP allow
you to configure a larger Trusted SRAM of 512KB.

This change introduces the `FVP_TRUSTED_SRAM_SIZE` build option, which
allows you to explicitly specify how much of the Trusted SRAM to
utilise, e.g.:

    FVP_TRUSTED_SRAM_SIZE=384

This allows previously-failing configurations to build successfully by
utilising more than the originally-allocated 256KB of the Trusted SRAM
while maintaining compatibility with older configurations/models that
only require/have 256KB.

Change-Id: I8344d3718564cd2bd53f1e6860e2fe341ae240b0
Signed-off-by: Chris Kay <chris.kay@arm.com>
2023-06-21 14:16:11 +02:00
Lauren Wehrmeister
83fde9fcdf Merge "feat(cpus): conform DSU errata to errata framework PCS" into integration 2023-06-20 21:19:49 +02:00
Stephan Gerhold
b4e49e3fe4 docs(msm8916): document new build options
Update the MSM8916 platform documentation with the new build options
introduced in the previous changes:

  - AArch32 (BL32/SP_MIN)
  - UART selection

While at it, also document the build options that allow changing the
memory addresses (PRELOADED_BL33_BASE, BL31_BASE, BL32_BASE).

Change-Id: I2370c8264982317693f69fda0b03a255f12bafe2
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:53 +02:00
Stephan Gerhold
aad23f1a2c feat(msm8916): allow selecting which UART to use
At the moment the msm8916 platform port always uses UART number 2 for
debug output. In some situations it is necessary to change this, either
because only the other UART is exposed on the board or for runtime
debugging, to avoid conflicting with the normal world.

Make the UART to use configurable using QTI_UART_NUM on the make
command line and also add QTI_RUNTIME_UART as an option to keep using
the UART after early boot. The latter is disabled by default since it
requires reserving the UART and related clocks inside the normal world.

Change-Id: I14725f954bbcecebcf317e8601922a3d00f2ec28
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:48 +02:00
Stephan Gerhold
45b2bd0acb feat(msm8916): add SP_MIN port for AArch32
Use the new shared msm8916 setup code to allow compiling the minimal
AArch32 Secure Payload (SP_MIN) as simple PSCI implementation.

AArch64 is preferred for the Cortex-A53 cores in MSM8916 but there are
some similar platforms with AArch32-only Cortex-A7 cores that can
benefit from this in future changes.

The AArch32 assembly implementation for msm8916_helpers.S and
uartdm_console.S is a direct port of the AArch64 implementation.
Only plat_get_my_entrypoint is slightly different because there is no
need to handle the "boot remapper" on cold boot for AArch32.

Change-Id: Idf160e86fb3e685fcedec3e051400e6273997b74
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:44 +02:00
Stephan Gerhold
25132f7820 refactor(msm8916): detect cold boot in plat_get_my_entrypoint
The msm8916 platform port needs to disable the TCM redirect to the L2
cache as early as possible during cold boot to avoid crashes. Right now
this is done in plat_reset_handler by checking if BL31 was started
through the "boot remapper", which redirects memory accesses around the
fixed CPU reset address (0x0) to the actual link address of BL31. On
AArch64 this is always the case during cold boot, since a CPU reset was
necessary to switch from AArch32 in the initial bootloader to AArch64.

On AArch32, SP_MIN starts running at the real link address immediately,
so the initial cold boot must be detected with a different approach.

To keep the AArch32 and AArch64 implementation of this functionality
consistent, move this functionality to plat_get_my_entrypoint, by
checking if the msm8916_entry_point is still zero or was already
updated for later warm boots by the PSCI code.

Also, avoid entering BL31 twice and instead add the BL31_BASE offset
to the return address in the link register. This allows preserving the
bootloader arguments in x0-x3 because they otherwise get lost.

Change-Id: I90286c6cacf23f44ed7930a3e7e33804ca63c391
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:41 +02:00
Stephan Gerhold
6b8f9e16a7 feat(msm8916): add Test Secure Payload (TSP) port
Use the new shared msm8916 setup code to easily allow compiling the
Test Secure Payload (TSP) for the msm8916 platform.

Unlike BL31, TSP only calls msm8916_platform_setup() but not
msm8916_configure() because this is already done in BL31.

Change-Id: I3225ef9e61387d49870e9759ffd5b899a8805961
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:37 +02:00
Stephan Gerhold
4181ec8cec build(msm8916): place bl32 directly after bl31
At the moment there are two entirely separate memory regions for BL31
and BL32. However, since BL31 is very small (<= 128 KiB) there is
actually still plenty of space after BL31.

Drop the extra memory region for BL32 and place it directly after BL31
(i.e. BL31_LIMIT). If needed it is still possible to change it on the
make command line.

While at it, move the definitions to the bottom of the make file so
they come immediately before the related add_define calls.

Change-Id: I5184dcc2d89a92f1384508f973d56fd963e7befb
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:32 +02:00
Stephan Gerhold
840831b2e0 refactor(msm8916): separate common platform setup code
In preparation of adding BL32 support for the msm8916 platform
(AArch32/SP_MIN and TSP), separate the common platform setup code into
shared msm8916_setup.c and msm8916_config.c files which can be called
from both BL31 and BL32.

msm8916_setup.c contains the relevant shared code for BL31/SP_MIN/TSP,
while msm8916_config.c is cold boot configuration code that is only
relevant for BL31 and SP_MIN (but not TSP).

No functional change.

Change-Id: I055522d5ad8c03dfb8e09236dc47dd383a480e95
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-06-20 18:52:29 +02:00
Manish Pandey
732af872d4 Merge changes from topic "xlnx_zynqmp_sizefixes" into integration
* changes:
  fix(zynqmp): type cast addresses to fix overflow issue
  fix: integer suffix macro definition
2023-06-20 18:45:23 +02:00
Manish Pandey
733cc2ad2c Merge "fix(build): include Cortex-A78AE cpu file for FVP" into integration 2023-06-20 18:43:32 +02:00
Demi Marie Obenour
95c56cb189 refactor(el3-spmc): add comments and cleanup code
No functional change intended.

Change-Id: I08300ec4cb2e11d26c4a108769919d0c474292ff
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-20 11:18:05 -04:00
Demi Marie Obenour
b8007bebea refactor(el3-spmc): avoid extra loop
Using one loop for the duplicate partition ID check is both simpler and
faster.

Change-Id: I0f6fa9ceb1aadf4383fa9be16605c39ad8643a43
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-20 11:18:05 -04:00
Demi Marie Obenour
327b5b8b74 fix(el3-spmc): validate memory address alignment
This ensures that addresses shared using FF-A are 4K aligned, as
required by the specification.

Change-Id: I8f0a659a095fdb9391398757141d613ac9bf9b42
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-20 11:18:05 -04:00
Olivier Deprez
e779c1afe2 Merge changes Ic58f4966,Ib7b438b8,I400f0f1f into integration
* changes:
  refactor(el3-spmc): add comments
  refactor(el3-spmc): move checks after loop
  refactor(el3-spmc): validate alignment earlier
2023-06-20 16:07:36 +02:00
Manish Pandey
1f58063bf9 Merge "feat(intel): add intel_rsu_update() to sip_svc_v2" into integration 2023-06-20 15:35:28 +02:00
Manish Pandey
3a95b5d5ea Merge "feat(lib): implement memcpy_s in lib" into integration 2023-06-20 15:34:24 +02:00
Akshay Belsare
91291633a1 fix(zynqmp): type cast addresses to fix overflow issue
Type cast the build time base and size argument to unsigned integer
and the limit derived from these two as unsigned long to avoid
size overflow issue during build.

For zynqmp platform, calculating the limit without typecasting results
in build error as follows

make -j DEBUG=0 RESET_TO_BL31=1 PLAT=zynqmp \
ZYNQMP_ATF_MEM_BASE=0x70000000 ZYNQMP_ATF_MEM_SIZE=0x10000000 \
XILINX_OF_BOARD_DTB_ADDR=0x100000 bl31

plat/xilinx/zynqmp/include/platform_def.h:51:62:
error: integer overflow in expression of type 'int' results
				in '-2147483648' [-Werror=overflow]
 51 | # define BL31_LIMIT   (ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE)

Change-Id: Id093a50e748884d4fba65626e94f361f6c23cecc
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-06-20 15:22:24 +02:00
Akshay Belsare
1a56ed4b35 fix: integer suffix macro definition
The current implementation of macro L/LL/UL/ULL concatenates the input
with "L"/"LL"/"UL"/"ULL" respectively.
In the case where a macro is passed to L/LL/UL/ULL as input,
the input macro name is concatenated with, rather than expanding
the input macro and then concatenating it.
The implementation of L/LL/UL/ULL is modified to two level macro,
so as to concatenate to the expansion of a macro argument.

Change 5b33ad174a "Unify type of "cpu_idx" across PSCI module."
has modified the implementation of U() to two level macros without
changing the implementation of other macros.

Change-Id: Ie93d67dff5ce96223a3faf6c98b98fcda530fc34
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-06-20 15:22:19 +02:00