Commit graph

11338 commits

Author SHA1 Message Date
Jeremie Corbier
358aa6b211 feat(zynqmp): add support for ProvenCore
ProvenCore requires secure SGIs to be handled at S-EL1. This patch
overrides the default ZynqMP configuration to handle them at EL3 in case
ProvenCore SPD is enabled.

Signed-off-by: Jeremie Corbier <jeremie.corbier@provenrun.com>
Signed-off-by: Mélanie Favre <melanie.favre@provenrun.com>
Change-Id: I2e36d2983f82fbb9b7acf7e18791b8ed92811b60
2022-09-15 22:26:57 +02:00
Florian Lugou
b0980e5843 feat(services): add a SPD for ProvenCore
Adds a dispatcher for ProvenCore based on the test secure payload
dispatcher.

Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
Change-Id: I978afc3af6a6f65791655685a7bc80070673c9f3
2022-09-15 22:26:57 +02:00
Sieu Mun Tang
dd7adcf3a8 fix(intel): fix asynchronous read response by copying data to input buffer
To fix that response should not be NULL when there is response data
need to be sent to input buffer by SDM.

Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: Id70289521792f5f995456d2e67e18f0185ca3fc0
2022-09-16 02:51:35 +08:00
Sieu Mun Tang
fbf7aef408 fix(intel): fix Mac verify update and finalize for return response data
To fix that the response data is returned when the source size ready
is still fit for response data size.

Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: Id8924137a5c33888e7042e9ab0e0e8c49b4a41ed
2022-09-16 02:49:01 +08:00
Pranav Madhu
18884c002e feat(sgi): enable css implementation of warm reset
Enable the CSS implementation of the warm reset for the rdn2 platform.

In addition to these  changes, fix coding style issues that are not
directly related to the code being introduced in this patch.

Change-Id: I75128d8bbcccbc26cf1e904691c7ef71349c622f
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
14a2892309 feat(scmi): send powerdown request to online secondary cpus
To initiate a reset or reboot, the nonsecure OS invokes the PSCI
SYSTEM_RESET function from any one core. As per the PSCI specification,
it is the responsibility of firmware to implement the system view of
the reset or reboot operation. For the platforms supported by CSS,
trigger the reset/reboot operation by sending an SGI to rest all CPUs
which are online. The CPUs respond to this interrupt by initiating its
powerdown sequence.

In addition to these changes, fix coding style issues that are not
directly related to the code being introduced in this patch.

Change-Id: I547253ee28ef7eefa78180d016893671a406bbfa
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
f1fe1440db feat(plat/arm/css): add interrupt handler for reboot request
Add platform specific interrupt handler for handling the reboot of
all CPU's. On shutdown/reboot, only one CPU invoke PSCI and enter into
trusted firmware. The CPU which entered trusted firmware signals the
rest of the cores which are online using SGI to initiate power down
sequence. On receiving the SGI, the handler will power down the
GIC redistributor interface of the respective core, configure the power
control register and power down the CPU by executing wfi.

In addition to these changes, fix coding style issues that are not
directly related to the code being introduced in this patch.

Change-Id: I4917dfdc47be5ce7367bee629486a6344cdd706f
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
65bbb9358b refactor(psci): move psci_do_pwrdown_sequence() out of private header
Move the psci_do_pwrdown_sequence() function declaration from PSCI
private header to common header. The psci_do_pwrdown_sequence is
required to support warm reset, where each CPU need to execute the
powerdown sequence.

Change-Id: I298e7a120be814941fa91c0b001002a080e56263
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
158ed580bd feat(plat/arm/css): add per-cpu power down support for warm reset
Add a new function to setup a SGI interrupt that will be used to trigger
a request for per-cpu power down when executing the PSCI SYSTEM_RESET
request. This will be used on CSS platform that require all the CPUs to
execute the CPU specific power down sequence to complete a warm reboot
sequence in which only the CPUs are power cycled.

Change-Id: I80da0f6c3cd0c5c442c82239ba1e1f773821a7f5
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
5cf9cc130a feat(scmi): set warm reboot entry point
Before issuing the system power down command, set the trusted mailbox
to 0. This will ensure that in the case of a warm/cold reset, the
primary CPU executes from the cold boot sequence, clearing any stale
jump address at this location.

Change-Id: I491ef5baf7a6728acd7e90e4558939ba77b8f9bf
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Pranav Madhu
e689048e20 fix(gicv3): update the affinity mask to 8 bit
The GIC ICC_SGI0R_EL1 register's affinity fields are 8bit wide for GIC
v3 and v4. Fix the SGIR_AFF_MASK variable accordingly.

Change-Id: I09f3fdd006708b40162776620f82abcfc6c3f782
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2022-09-15 18:09:56 +05:30
Manish Pandey
50c712d4ae Merge "fix: 'sp_mk_generator.py' reference to undef var" into integration 2022-09-15 14:28:34 +02:00
Rupinderjit Singh
a816de564f feat(tc): add RTC PL031 device tree node
It enables RTC PL031 driver in kernel.

Signed-off-by: Rupinderjit Singh <rupinderjit.singh@arm.com>
Change-Id: I6d7c1a5b6ce11b3d594f7575a747e72826c8d9b8
2022-09-15 13:04:44 +01:00
Manish Pandey
c6957b66e6 Merge "feat(gicv3): validate multichip data for GIC-700" into integration 2022-09-15 11:04:41 +02:00
Manish Pandey
f171ea2a1e Merge "fix(context mgmt): remove explicit ICC_SRE_EL2 register read" into integration 2022-09-15 10:49:38 +02:00
Joanna Farley
4e407e0d25 Merge "fix(versal): route GIC IPI interrupts during setup" into integration 2022-09-15 09:16:20 +02:00
Joanna Farley
71f286c211 Merge "fix(zynqmp): move debug bl31 based address back to OCM" into integration 2022-09-15 09:15:21 +02:00
Tanmay Shah
04cc91b43c fix(versal): route GIC IPI interrupts during setup
If primary core is down, then IPI interrupt should be
routed to another core for processing.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: I01d7c4232a18c0c3b3f3f9ddadfa6ff5bd2f2471
2022-09-14 17:46:05 +02:00
J-Alves
0be2475f69 fix: 'sp_mk_generator.py' reference to undef var
The script 'sp_mk_generator.py' was reworked in [1]. There was a
reference the variable 'data' left. This variable 'data' used to refer
to the json data of a the sp layout file.
This patch fixed the reference with the proper variable according to the
rework [1].

[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=a96a07bfb66b7d38fe3da824e8ba183967659008

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I9ddbfa8d55a114bcef6997920522571e070fc7d2
2022-09-14 15:56:03 +01:00
Florian Lugou
dcb31ff790 feat(gic): add APIs to raise NS and S-EL1 SGIs
This patch adds two helper functions:
 - plat_ic_raise_ns_sgi to raise a NS SGI
 - plat_ic_raise_s_el1_sgi to raise a S-EL1 SGI

Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
Change-Id: I6f262dd1da1d77fec3f850eb74189e726b8e24da
2022-09-14 16:08:29 +02:00
Varun Wadekar
2b28727e6d fix(context mgmt): remove explicit ICC_SRE_EL2 register read
ICC_SRE_EL2 has only 4 bits, while others are RES0. The library programs
all four of them already, so there is no need to read the previous
settings from the actual register.

This patch removes the explicit register read as a result.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: Iff0cb3b0d6fd85e5ae891068e440d855973a1c5e
2022-09-14 13:39:28 +02:00
Manish V Badarkhe
9dedc1ab21 Merge changes from topic "morello-dt-fix" into integration
* changes:
  fix(morello): dts: remove #a-c and #s-c from memory node
  fix(morello): dts: fix GICv3 compatible string
  fix(morello): dts: fix DT node naming
  fix(morello): dts: fix SCMI shmem/mboxes grouping
  fix(morello): dts: use documented DPU compatible string
  fix(morello): dts: fix DP SMMU IRQ ordering
  fix(morello): dts: fix SMMU IRQ ordering
  fix(morello): dts: add model names
  fix(morello): dts: fix stdout-path target
2022-09-14 12:35:29 +02:00
Joanna Farley
febefa4dbb Merge changes from topic "xilinx-pm-misc-changes" into integration
* changes:
  fix(xilinx): update define for ZynqMP specific functions
  fix(xilinx): remove unnecessary header include
  fix(xilinx): include missing header
2022-09-14 12:01:37 +02:00
Joanna Farley
77135473c5 Merge changes from topic "xilinx-misc-changes" into integration
* changes:
  chore(zynqmp): fix comment style in zynqmp_def.h
  chore(versal): add missing dot at the end of sentence
  fix(zynqmp): remove additional 0x in %p print
  fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
2022-09-14 11:52:29 +02:00
Rajan Vaja
24b5b53a59 fix(xilinx): update define for ZynqMP specific functions
Instead of exclude code for Versal, define only for ZynqMP.
For new platforms this code should be excluded so instead of
excluding for all platform, define only for ZynqMP.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I45798dadc0f374c5794f517f7d0158675a75caa9
2022-09-14 10:15:16 +02:00
Rajan Vaja
0ee2dc118c fix(xilinx): remove unnecessary header include
Platform specific IPI header inclusion is not required
in common IPI source file. So remove inclusion of the same.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I6686757f00370c6ec42b5ee2c44ea5cd13da70c0
2022-09-14 10:12:42 +02:00
Rajan Vaja
28ba140021 fix(xilinx): include missing header
pm_ipi.h needs some definitions from stddef.h so include it.
Currently it is working because required file is included
indirectly due to other includes.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ic4a6c469c3152e21eaeb365ba96f3a29f14593bf
2022-09-14 10:12:16 +02:00
Michal Simek
f114fd3b10 chore(zynqmp): fix comment style in zynqmp_def.h
Add missing space in one line comment to follow common coding style.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Idebf8f34bf48444ee20a68ac3e6fd7f5a41bf8b0
2022-09-14 09:35:58 +02:00
Michal Simek
8f4b37f12e chore(versal): add missing dot at the end of sentence
Add missing dot at the end of sentence.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I356e65fd8c572c12795e3492dd02d73f48cb4b67
2022-09-14 09:34:46 +02:00
Michal Simek
05a6107ff1 fix(zynqmp): remove additional 0x in %p print
%p is already printing value in hex that's why 0x prefix is not needed.
Origin message looks like this
"NOTICE:  Can't read DT at 0x0x100000"
and after fixing
"NOTICE:  Can't read DT at 0x100000"

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: If83c485a61441f6105d8cbd797f04060dfce2817
2022-09-14 09:31:33 +02:00
Michal Simek
68ffcd1bb2 fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
Fix some Misra-C violations. The similar fixes were done by commit
eb0d2b1772 ("fix(zynqmp): resolve misra R15.6 warnings") and commit
dd1fe7178b ("fix(zynqmp): resolve misra R14.4 warnings").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I3ffa92724a09871f7f99c9ac6c326994c165e9bd
2022-09-14 09:26:23 +02:00
Joanna Farley
28a28511c4 Merge "fix(zynqmp): ensure memory write finish with dsb()" into integration 2022-09-14 09:14:34 +02:00
Bipin Ravi
959256766e Merge "fix(cpus): workaround for Cortex-A710 2216384" into integration 2022-09-13 20:59:43 +02:00
Tanmay Shah
ac6c135c83 fix(zynqmp): ensure memory write finish with dsb()
GICD reg write must complete before core goes to idle
mode. Achieve this with dsb() barrier instruction in IPI
ISR

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: I5af42ca901567ee5e54a5434ebe3e673a92cb9be
2022-09-13 11:19:01 -07:00
Jayanth Dodderi Chidanand
49154435ca docs(build): update GCC to 11.3.Rel1 version
This toolchain provides multiple cross compilers and is publicly
available on https://developer.arm.com/

We build TF-A in CI using:
AArch32 bare-metal target (arm-none-eabi)
AArch64 ELF bare-metal target (aarch64-none-elf)

Change-Id: I94e13f6c1ebe3a4a58ca6c79c1605bd300b372d3
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-09-13 17:46:41 +01:00
Michal Simek
0ba3d7a4ca fix(zynqmp): move debug bl31 based address back to OCM
The commit 389594dfa7 ("fix(zynqmp): move bl31 with DEBUG=1 back to OCM")
tried to move address to OCM but address was actually out of OCM and likely
it was typo. Correct default address should be 0xfffe5000. If TF-A size is
bigger please select location DDR which should be fine for DEBUG cases.

Reported-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I055f3a59cdca527f6029fcc2a19d76be35924d24
2022-09-13 14:33:36 +02:00
Jay Buddhabhatti
f99306d49b feat(versal): update macro name to generic and move to common place
Update TZ_VERSION macro name to generic macro name and move to
common header file so that it can be used for keystoneb.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@xilinx.com>
Acked-by: Tanmay Shah <tanmay.shah@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ic3819eea78b6c7b51ffaa13081026dd191b76125
2022-09-13 14:01:23 +02:00
Joanna Farley
207bda950d Merge changes Id49d94f6,I35316310 into integration
* changes:
  feat(versal): add infrastructure to handle multiple interrupts
  fix(versal): add SGI register call version check
2022-09-13 10:24:37 +02:00
Joanna Farley
1790036de3 Merge "docs(porting-guide): correct typo of "bits" to "bytes"" into integration 2022-09-13 09:37:39 +02:00
Tanmay Shah
e497421d7f feat(versal): add infrastructure to handle multiple interrupts
Only one hardcode interrupt handler is supported as of now.
This is IPI interrupt between APU and PMC processor.
This patch adds infrastructure to register multiple interrupt
handlers. This infrastructure was used and tested for two
interrupts and so, interrupt id and handler container size is
2 which is defined by MAX_INTR_EL3. Interrupt id is not used
as container index due to size constraints. User is expected to
adjust MAX_INTR_EL3 based on how many interrupts are handled in
TF-A

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: Id49d94f6773fbb6874ccf89c0d12572efc7e678e
2022-09-13 09:22:47 +02:00
Tanmay Shah
5897e13544 fix(versal): add SGI register call version check
PM_FEATURE_CHECK is supported only for platform
management API. PM_LOAD_PDI command is not intended
for platform management. This patch removes version
check of PM_LOAD_PDI and adds version check of command
that is used for SGI registartion.

Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
Change-Id: I353163109b639acab73120f405a811770e8831a0
2022-09-13 09:22:36 +02:00
Joanna Farley
69034793b6 Merge "chore: use tabs for indentation" into integration 2022-09-13 09:18:57 +02:00
Jorge Troncoso
b0f473f500 chore: use tabs for indentation
This patch changes the definition of image_info_t to follow the TF-A
coding style documented at
https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-style.html

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: I17af22b4ba60b41cf0b5fa84ac47beeb1536edcc
2022-09-12 15:12:01 -07:00
Max Yu
5c60b8c8ce docs(porting-guide): correct typo of "bits" to "bytes"
The CACHE_WRITEBACK_GRANULE is documented to be in bits, but
specifying the value in bits broke a build. Further investigation
suggests that the value should in fact be in bytes. See
https://github.com/ARM-software/arm-trusted-firmware/blob/master/include/arch/aarch64/
smccc_helpers.h#L101
and
https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Type-Attributes.html

Change-Id: I9a2b2fbe18d5a58a8f9aeb2726a0623f3484c88e
Signed-off-by: Max Yu <maxlyu@google.com>
2022-09-12 22:35:14 +02:00
Manish Pandey
ad6a2e6da1 Merge "fix(mmc): resolve the build error" into integration 2022-09-12 10:42:27 +02:00
Jayanth Dodderi Chidanand
ccf8392ccb fix(mmc): resolve the build error
Adding the header file plat/common/common_def.h to
resolve the "SIZE_128" undeclared identifier error.

Change-Id: I399edf4248776f6dd9f93e000b8672cadc71509d
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-09-09 17:28:04 +01:00
Manish Pandey
1309c6c805 Merge changes from topic "fix_fip_in_emmc_boot" into integration
* changes:
  fix(st): add max size for FIP in eMMC boot part
  feat(mmc): get boot partition size
2022-09-08 13:40:36 +02:00
Manish V Badarkhe
51558209ef Merge "fix(cpus): workaround for Cortex-A78C erratum 2376749" into integration 2022-09-08 13:27:11 +02:00
Akram Ahmad
5d3c1f5890 fix(cpus): workaround for Cortex-A78C erratum 2376749
Cortex-A78C erratum 2376749 is a Cat B erratum that applies
to revisions r0p1 and r0p2 of the A78C and is currently open.
The workaround is to set CPUACTLR2_EL1[0] to 1 to force
PLDW/PFRM ST to behave like PLD/PRFM LD and not cause
invalidations to other PE caches.

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

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: I3b29f4b7f167bf499d5d11ffef91a94861bd1383
2022-09-08 13:25:42 +02:00
Manish Pandey
bbdf2591ba Merge changes Idde51a13,Ife8f1e84 into integration
* changes:
  feat(mediatek): add smcc call for MSDC
  refactor(mediatek): refactor plat_sip_calls.h for mt8192/mt8195/mt8186
2022-09-08 12:44:24 +02:00