Commit Graph

8567 Commits

Author SHA1 Message Date
J-Alves e46b2fd210 SPM: Fix error codes size in SPMD handler
FF-A specification states that error codes should be typed int32_t.
SPMD's uses uint64_t for return values, which if assigned with a signed
type would have sign extension, and change the size of the return from
32-bit to 64-bit.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I288ab2ffec8330a2fe1f21df14e22c34bd83ced3
2021-03-19 15:07:46 +01:00
Madhukar Pappireddy 2e0e51f425 Merge "Bug fix in tspd interrupt handling when TSP_NS_INTR_ASYNC_PREEMPT is enabled" into integration 2021-03-18 21:26:57 +01:00
Madhukar Pappireddy cab2b183be Merge "tools_share/uuid: Add EFI_GUID representation" into integration 2021-03-18 16:56:51 +01:00
Madhukar Pappireddy 0888fcf252 Merge "plat: xilinx: versal: Remove cortex-a53 compilation" into integration 2021-03-18 15:15:11 +01:00
Madhukar Pappireddy 51bb1d7361 Bug fix in tspd interrupt handling when TSP_NS_INTR_ASYNC_PREEMPT is enabled
Typically, interrupts for a specific security state get handled in the
same security execption level if the execution is in the same security
state. For example, if a non-secure interrupt gets fired when CPU is
executing in NS-EL2 it gets handled in the non-secure world.

However, interrupts belonging to the opposite security state typically
demand a world(context) switch. This is inline with the security
principle which states a secure interrupt has to be handled in the
secure world. Hence, the TSPD in EL3 expects the context(handle) for a
secure interrupt to be non-secure and vice versa.

The function "tspd_sel1_interrupt_handler" is the handler registered
for S-EL1 interrupts by the TSPD. Based on the above assumption, it
provides an assertion to validate if the interrupt originated from
non-secure world and upon success arranges entry into the TSP at
'tsp_sel1_intr_entry' for handling the interrupt.

However, a race condition between non-secure and secure interrupts can
lead to a scenario where the above assumptions do not hold true and
further leading to following assert fail.

This patch fixes the bug which causes this assert fail:

	ASSERT: services/spd/tspd/tspd_main.c:105
	BACKTRACE: START: assert
	0: EL3: 0x400c128
	1: EL3: 0x400faf8
	2: EL3: 0x40099a4
	3: EL3: 0x4010d54
	BACKTRACE: END: assert

Change-Id: I359d30fb5dbb1429a4a3c3fff37fdc64c07e9414
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-03-18 08:38:23 -05:00
Madhukar Pappireddy 0fb7363899 Merge "plat: xilinx: Add timeout while waiting for IPI Ack" into integration 2021-03-18 14:15:48 +01:00
Tomas Pilar e831923f95 tools_share/uuid: Add EFI_GUID representation
The UEFI specification details the represenatation
for the EFI_GUID type. Add this representation to the
uuid_helper_t union type so that GUID definitions
can be shared verbatim between UEFI and TF-A header
files.

Change-Id: Ie44ac141f70dd0025e186581d26dce1c1c29fce6
Signed-off-by: Tomas Pilar <tomas@nuviainc.com>
2021-03-18 14:14:22 +01:00
Madhukar Pappireddy 706058c255 Merge "mmc:prevent accessing to the released space in case of wrong usage" into integration 2021-03-18 14:11:20 +01:00
Sandrine Bailleux e3ff1766e3 Merge "tzc400: correct FAIL_CONTROL Privileged bit" into integration 2021-03-17 13:51:11 +01:00
deqi.hu 13f3c5166f mmc:prevent accessing to the released space in case of wrong usage
1.Since in mmc_init, the most of mmc_device_info passed in are temporary variables.
  In order to avoid referencing the released space on the stack when maybe MISUSED,
  it`s better to use global variables to store mmc_device_info in mmc.c
2.Delete redundant;

Signed-off-by: deqi.hu@siengine.com
Change-Id: I51ae90e7f878b19b4963508b3f7ec66339015ebc
2021-03-17 11:04:21 +01: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
Michal Simek 4a7b060b3d plat: xilinx: versal: Remove cortex-a53 compilation
Versal is a72 based that's why there is no reason to build low level
assemble code for a53.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Change-Id: Iff9cf2582102d951825b87fd9af18e831ca717d6
2021-03-16 13:17:37 +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
Olivier Deprez 473ced5670 SPMD: lock the g_spmd_pm structure
Add a lock and spin lock/unlock calls when accessing the fields of the
SPMD PM structure.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I9bab705564dc1ba003c29512b1f9be5f126fbb0d
2021-03-15 12:29:19 +01:00
Olivier Deprez cdb49d475e FF-A: implement FFA_SECONDARY_EP_REGISTER
Remove the former impdef SPMD service for SPMC entry point
registration. Replace with FFA_SECONDARY_EP_REGISTER ABI
providing a single entry point address into the SPMC for
primary and secondary cold boot.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I067adeec25fc12cdae90c15a616903b4ac4d4d83
2021-03-15 12:29:11 +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
Usama Arif 614c14e778
cpus: add Matterhorn ELP ARM cpu library
Change-Id: Ie1acde619a5b21e09717c0e80befb6d53fd16607
Signed-off-by: Usama Arif <usama.arif@arm.com>
2021-03-10 16:09:31 +00:00
Madhukar Pappireddy a8fb76e59c Merge changes I9c9ed516,I2788eaf6 into integration
* changes:
  qemu/qemu_sbsa: fix memory type of secure NOR flash
  qemu/qemu_sbsa: spm_mm supports 512 cores
2021-03-10 15:35:50 +01:00
Madhukar Pappireddy ce19ac9068 Merge "plat: xilinx: zynqmp: Add missing ids for 43/46/47dr devices" into integration 2021-03-10 15:35:32 +01:00
Manish Pandey 23be96cb48 Merge "plat/rockchip: Use common gicv2.mk" into integration 2021-03-09 22:22:25 +01:00
Heiko Stuebner c414019bc3 plat/rockchip: Use common gicv2.mk
Compiling BL31 for the Rockchip platform now produces a message about
the deprecation of gic_common.c.
Follow the advice and use include gicv2.mk instead.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Change-Id: I396b977d57975dba27cfed801ad5264bbbde2b5e
2021-03-09 17:12:42 +01:00
Madhukar Pappireddy 4e5c3104f9 Merge "mediatek: mt8192: fix MISSING_BREAK" into integration 2021-03-08 19:41:55 +01:00
Yann Gautier 4f81ed8e1a tzc400: correct FAIL_CONTROL Privileged bit
When bit 20 of TZC400 Fail control register [1] is set to 1, it means
Privileged access, the macros FAIL_CONTROL_PRIV_PRIV and
FAIL_CONTROL_PRIV_UNPRIV are then updated to reflect this.

 [1] https://developer.arm.com/documentation/ddi0504/c/programmers-model/register-descriptions/fail-control-register?lang=en

Change-Id: I01e522fded5cf66c9827293ddcf543c79f9e509e
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-03-08 18:15:26 +01:00
Roger Lu 6d98e75038 mediatek: mt8192: fix MISSING_BREAK
The case for value "VCOREFS_SMC_CMD_INIT" is not
terminated by a "break" statement.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Change-Id: I56cc7c1648e101c0da6e77e592e6edbd5d37724e
2021-03-08 11:42:37 +08:00
Mark Dykes 2c62b00e8c Merge "SDEI: updata the affinity of shared event" into integration 2021-03-05 22:22:15 +01:00
Tony Xie 6ccbcff502 SDEI: updata the affinity of shared event
when updata routing of an SDEI event, if the registration flags
is SDEI_REGF_RM_PE, need to updata the affinity of shared event.

Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Change-Id: Ie5d7cc4199253f6af1c28b407f712caac3092d06
2021-03-05 21:33:58 +01:00
Manish Pandey 8c8efa8620 Merge changes I76eee5c5,Ie45ab1d8,Iddcb83d3,I4425777d,I5be2837c, ... into integration
* changes:
  drivers/gicv3: also shift eSPI register offset in GICD_OFFSET_64()
  drivers/gicv3: add debug log for maximum INTID of SPI and eSPI
  drivers/gicv3: limit SPI ID to avoid misjudgement in GICD_OFFSET()
  drivers/gicv3: fix logical issue for num_eints
  drivers/gicv3: fix potential GICD context override with ESPI enabled
  drivers/gicv3: use mpidr to probe GICR for current CPU
2021-03-05 10:14:03 +01:00
Madhukar Pappireddy 42de214f8f Merge "Print newline after hex address in aarch64 el3_panic function" into integration 2021-03-04 19:53:52 +01:00
Pali Rohár 805f22babd Print newline after hex address in aarch64 el3_panic function
Make the aarch64's el3_panic() function print a newline character after
PC address, otherwise the output can get mangled in one line with output
from other firmware. Here is an example of how the output of el3_panic()
got mangled with Linux' console output:

    ERROR:   Unhandled External Abort received on 0x80000001 at EL3!
    ERROR:    exception reason=1 syndrome=0x92000210
    PANIC at PC : 0x0000000004027400[13438.473133] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
    [13438.479255] rcu:     1-...0: (4 ticks this GP) idle=35e/1/0x4000000000000000 softirq=146459/146459 fqs=2625

The aarch32 version of this function already does this.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I9f0d032c6cd1e2be7a1837f9c8e8244d30633993
2021-03-04 11:05:31 +01:00
Mark Dykes 893716d7ff Merge "docs: Add GIC600AE FVP model version information" into integration 2021-03-03 21:30:17 +01:00
Madhukar Pappireddy 88ddb60123 Merge "mediatek: mt8192: Add MPU Support for SCP/PCIe" into integration 2021-03-03 17:29:03 +01:00
Madhukar Pappireddy 258f6a2d40 Merge changes I4bd4612a,Id13a06d4,I0ea7f610,Ie6a7063b into integration
* changes:
  mediatek: mt8192: Add Vcore DVFS driver
  mediatek: mt8192: Add SPM suspend driver
  mediatek: mt8192: supports mcusys off when system suspend
  mediatek: mt8192: Add lpm driver
2021-03-03 17:06:56 +01:00
Xi Chen a564bdc551 mediatek: mt8192: Add MPU Support for SCP/PCIe
1 Only enable domain D0 and D1:PCIe access 0xC0000000~0xC4000000;
2 Only enable domain D0 and D3(SCP) access 0x50000000~0x51400000;

Signed-off-by: Xi Chen <xixi.chen@mediatek.com>
Change-Id: Ic4f9e6d85bfd1cebdb24ffc1d14309c89c103b2a
2021-03-03 19:07:45 +08:00
Roger Lu f3febcca5a mediatek: mt8192: Add Vcore DVFS driver
Change-Id: I4bd4612a7c7727a5be70957ae940e5f51c7ca5e6
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
2021-03-03 19:04:43 +08:00
Roger Lu ebb44440a7 mediatek: mt8192: Add SPM suspend driver
Supports dram/mainpll/26m off when system suspend

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Change-Id: Id13a06d4132f00fb60066de75920ecac18306e32
2021-03-03 19:04:43 +08:00
Roger Lu df60025fe2 mediatek: mt8192: supports mcusys off when system suspend
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Change-Id: I0ea7f61085ea9ba26c580107ef0cb9940a25f5e2
2021-03-03 19:04:43 +08:00
Roger Lu cab4919955 mediatek: mt8192: Add lpm driver
Low Power Management (LPM) helps find a suitable configuration
for letting system entering idle or suspend with the most
resources off.

Change-Id: Ie6a7063b666cf338cff5bc972c9025b26de482eb
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
2021-03-03 19:04:43 +08:00
Venkatesh Yadav Abbarapu 1b7e5ca998 plat: xilinx: zynqmp: Add missing ids for 43/46/47dr devices
Add support for ZU43DR, ZU46DR and ZU47DR to the list of zynqmp
devices. The ZU43DR, ZU46DR and ZU47DR RFSoC silicon id values are
0x7d, 0x78 and 0x7f.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Change-Id: I566f707116d83475de7c87a6004ca96bf7bccebe
2021-03-03 00:49:39 -07:00
Madhukar Pappireddy c0f0ab53b4 Merge "fdts: enable virtIO P9 device for morello fvp platform" into integration 2021-03-02 16:46:33 +01:00
bipin.ravi 8ef06b6cdd Merge "Add Makalu CPU lib" into integration 2021-03-02 16:21:22 +01:00
Manish Pandey 0cd5d1d19d Merge "lib/extensions/ras: fix bug of binary search" into integration 2021-03-02 15:00:08 +01:00
sah01 4bf98b27dc fdts: enable virtIO P9 device for morello fvp platform
Signed-off-by: sah01 <sahil@arm.com>
Change-Id: Ic11d739c0bf2076354716cc06fbe25e9000a21e7
2021-03-02 11:29:31 +01:00
Manish Pandey ef4c1e19bf Merge "Enable v8.6 AMU enhancements (FEAT_AMUv1p1)" into integration 2021-03-02 10:30:40 +01:00
Tejas Patel 4d9b9b2352 plat: xilinx: Add timeout while waiting for IPI Ack
Return timeout error if, IPI is not acked in specified timeout.

Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Change-Id: I27be3d4d4eb5bc57f6a84c839e2586278c0aec19
2021-03-01 20:26:59 -08: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
Manish V Badarkhe 051906bb2e docs: Add GIC600AE FVP model version information
Added GIC600AE FVP model version information.

Change-Id: I15d25fbdb8e09900976d5993032ec049f8db79f2
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-03-01 22:19:48 +00:00
Masahisa Kojima 206fa996b8 qemu/qemu_sbsa: fix memory type of secure NOR flash
This commit fixes the wrong memory type, secure NOR flash
shall be mapped as MT_DEVICE.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: I9c9ed51675d84ded675bb56b2e4ec7a08184c602
2021-03-01 15:52:10 +09:00