Commit graph

1685 commits

Author SHA1 Message Date
Manish Pandey
7754b770cf feat(tc): make SPE feature asymmetric
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ibf0fecb2a97cb0f3508e01e0907e61e3c437ac00
2024-08-17 09:36:23 +01:00
Manish V Badarkhe
2d4f264ba5 Merge changes from topic "romlib-fixes" into integration
* changes:
  fix(romlib): wrap indirectly included functions
  fix(arm): remove duplicate jumptable entry
2024-08-17 10:09:06 +02:00
Manish Pandey
9b1f2c7957 Merge "fix(rdv3): remove NEED_* from RD-V3 makefile" into integration 2024-08-16 18:00:12 +02:00
Manish V Badarkhe
26f2f24c69 Merge changes from topic "cot-dt2c" into integration
* changes:
  feat(arm): update documentation for cot-dt2c
  feat(arm): remove the bl2 static c file
  feat(arm): generate tbbr c file CoT dt2c
  feat(arm): makefile invoke CoT dt2c
  feat(auth): standalone CoT dt2c tool
  refactor(auth): separate bl1 and bl2 CoT
  refactor(st): align the NV counter naming
  refactor(fvp): align the NV counter naming
2024-08-14 18:52:20 +02:00
Madhukar Pappireddy
97a689bbc1 Merge "feat(spm): change UART0-1 to NS device region" into integration 2024-08-13 16:42:00 +02:00
Xialin Liu
04d02a9c0b refactor(fvp): align the NV counter naming
Align the naming of nv_counter to nv_ctr in the DTBs
so that they match with the static C files. Update the
binding documentation accordingly. This renaming is beneficial
for the upcoming conversion tool that will convert CoT DT files
to C files.

Change-Id: If65d51ad9fc6445b1ae9937f1691becf8742cf01
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Jaylyn Ren
a3eef39f45 fix(rdv3): remove NEED_* from RD-V3 makefile
As the NEED_* are internal flags used in the build system and are not
meant to be used by platforms, remove them from the RD-V3 makefile.

Signed-off-by: Jaylyn Ren <Jaylyn.Ren2@arm.com>
Change-Id: If7144b9d72c16e8025f929f2546abd96194615ce
2024-08-06 16:49:40 +01:00
Manish V Badarkhe
18faaa2424 Merge changes from topic "us_pmu" into integration
* changes:
  fix(tc): correct CPU PMU binding
  feat(tc): add device tree binding for SPE
  feat(tc): add PPI partitions in DT binding
  feat(tc): change GIC DT property 'interrupt-cells' to 4
  feat(tc): add NI-Tower PMU node for TC3
  feat(tc): setup ni-tower non-secure access for TC3
2024-08-05 17:43:33 +02:00
Jagdish Gediya
89c58a5087 feat(tc): setup ni-tower non-secure access for TC3
NI-Tower's component's registers are need to be accessed from
kernel NI-PMU driver so enable NS access to it.

Change-Id: I83a8b3a1d2778baf767ff93263e246d127ef8114
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:51 +01:00
Manish Pandey
bbca58ffd3 Merge changes from topic "corstone1000-bugfixes" into integration
* changes:
  fix(corstone1000): update memory layout comments
  fix(corstone1000): clean cache and disable interrupt before system reset
  fix(corstone1000): remove unused NS_SHARED_RAM region
  fix(corstone1000): pass spsr value explicitly
2024-08-05 13:48:38 +02:00
Bence Balogh
d7417adc21 fix(corstone1000): update memory layout comments
The SRAM (CVM) memory layout was outdated in the platform_defs.h of
the Corstone-1000 platform. Updated it to list every bootloaders and
to be aligned with the implementation. Also added the starting (base)
addresses of each partition.

Change-Id: Ie8e8416ee2650ff25a8d4c61d8d9af789bc639c1
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
2024-08-02 17:42:03 +02:00
Emekcan Aras
335c4f8b30 fix(corstone1000): clean cache and disable interrupt before system reset
Corstone1000 does not properly clean the cache and disable gic interrupts
before the reset. This causes a race condition especially in FVP after
reset. This adds proper sequence before resetting the platform.

Change-Id: I22791eec2ec0ca61d201d8a745972a351248aa3d
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
2024-08-02 17:41:56 +02:00
Emekcan Aras
83c11c0bd1 fix(corstone1000): remove unused NS_SHARED_RAM region
After enabling additional features in Trusted Services, the size of BL32
image (OP-TEE + Trusted Services SPs) is larger now. To create more space
in secure RAM for BL32 image, this patch removes NS_SHARED_RAM region
which is not currently used by corstone1000 platform.

Change-Id: I1e9468fd2dcb66b4d21fce245097ba51331ec54d
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
2024-07-31 11:15:28 +02:00
Emekcan Aras
32690bacb9 fix(corstone1000): pass spsr value explicitly
Passes spsr value for BL33 (U-Boot) explicitly between different boot
stages. This information is needed in order to boot properly.

Change-Id: I06b5b750f963f8609e00ff6bf2838bac0f8b7b28
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
2024-07-31 11:15:28 +02:00
Jimmy Brisson
180a3a9ed3 fix(arm): remove duplicate jumptable entry
Change-Id: I4cc4ef493318372ec0d0531ca3e98196e7065ab9
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-07-30 11:47:15 -05:00
Harrison Mutai
1a0ebff784 feat(arm): add fw handoff support for RESET_TO_BL31
Change-Id: I78f3c5606f0221bb5fc613a973a7d3fe187db35b
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-07-30 10:26:07 +00:00
Manish V Badarkhe
4bcf5b847c Merge changes from topic "jc/refact_el1_ctx" into integration
* changes:
  refactor(cm): convert el1-ctx assembly offset entries to c structure
  feat(cm): add explicit context entries for ERRATA_SPECULATIVE_AT
2024-07-29 19:21:30 +02:00
Manish Pandey
aca05c5991 Merge "fix(fvp): add secure uart interrupt in device region" into integration 2024-07-29 15:55:35 +02:00
Manish Pandey
5477fb37e6 Merge "feat(fvp): add flash areas for secure partition" into integration 2024-07-29 15:11:27 +02:00
levi.yun
9fb767630d feat(fvp): add flash areas for secure partition
To support UEFI secure variable service,
StandaloneMm which runs in BL32 should know flash areas.
Add flash memory areas and system register region
so that StandaloneMm access to flash storages.

Change-Id: I803bda9664a17a0b978ebff90974eaf5442a91cd
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-29 09:55:43 +01:00
Olivier Deprez
fc3a01aac3 fix(fvp): add secure uart interrupt in device region
OP-TEE enables the use case of a secure interrupt triggered by the UART
driver. This interrupt is routed by FFA_INTERRUPT interface to OP-TEE.
Define the UART interrupt in the FF-A device region node.
Without this change, OPTEE panics at the boot with the following:

  |  I/TC: No non-secure external DT
  |  I/TC: manifest DT found
  |  I/TC: OP-TEE version: 4.3.0-23-gfcd8750677db
  |  I/TC: WARNING: This OP-TEE configuration might be insecure!
  |  I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
  |  I/TC: Primary CPU initializing
  |  E/TC:0 0 assertion '!res' failed at core/drivers/hfic.c:56 <hfic_op_enable>
  |  E/TC:0 0 Panic at core/kernel/assert.c:28 <_assert_break>
  |  E/TC:0 0 TEE load address @ 0x6284000

Change-Id: Icddcdfd032315aeee65ba3100f3a6b470a74435d
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-26 23:13:23 +02:00
Jayanth Dodderi Chidanand
42e35d2f8c refactor(cm): convert el1-ctx assembly offset entries to c structure
Currently the EL1 part of the context structure (el1_sysregs_t),
is coupled with feature flags reducing the context memory allocation
for platforms, that don't enable/support all the architectural
features at once.

Similar to the el2 context optimization commit-"d6af234" this patch
further improves this section by converting the assembly context-offset
entries into a c structure. It relies on garbage collection of the
linker removing unreferenced structures from memory, as well as aiding
in readability and future maintenance. Additionally, it eliminates
the #ifs usage in 'context_mgmt.c' source file.

Change-Id: If6075931cec994bc89231241337eccc7042c5ede
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-07-26 17:08:12 +01:00
Jayanth Dodderi Chidanand
59b7c0a03f feat(cm): add explicit context entries for ERRATA_SPECULATIVE_AT
* Currently, "ERRATA_SPECUALTIVE_AT" errata is enabled by default
  for few cores and they need context entries for saving and
  restoring EL1 regs "SCTLR_EL1 and TCR_EL1" registers at all times.

* This prevents the mechanism of decoupling EL1 and EL2 registers,
  as EL3 firmware shouldn't be handling both simultaneously.

* Depending on the build configuration either EL1 or EL2 context
  structures need to included, which would result in saving a good
  amount of context memory.

* In order to achieve this it's essential to have explicit context
  entries for registers supporting "ERRATA_SPECULATIVE_AT".

* This patch adds two context entries under "errata_speculative_at"
  structure to assist this errata and thereby allows decoupling
  EL1 and EL2 context structures.

Change-Id: Ia50626eea8fb64899a2e2d81622adbe07fe77d65
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2024-07-26 15:36:31 +01:00
Manish Pandey
e7c060d559 Merge "feat(fgt2): add support for FEAT_FGT2" into integration 2024-07-24 17:26:21 +02:00
Jagdish Gediya
e1b76cb06a feat(tc): enable Last-level cache (LLC)
The EXTLLC bit in CPUECTLR_EL1 register indicates that an external
Last-level cache is present in the system.

This bit is not set for CPUs on TC3 platform despite there is
presence of LLC in MCN, so set them.

Change-Id: I5f889e67dce2b1d00e4ee66a8c255cf7911825b0
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-07-24 14:35:10 +01:00
Daniel Boulby
cd656a5612 feat(spm): change UART0-1 to NS device region
To enable device memory sharing test make memory region for UART0
and 1 a NS device region so that it can be shared by tf-a-tests
to the cactus SP.

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: Iadfe02a65f5d4a8b60296f07c4943dd31f201453
2024-07-23 17:39:18 +01:00
Jagdish Gediya
de8b9cedcc feat(tc): enable el1 access to DSU PMU registers
DSU PMU registers are write accessible in EL1 if the ACTLR_EL3[12] bit
and the ACTLR_EL2[12] bit are set to 1, and these registers are need to
be set for all cores, so set these bits in platform reset handler.

Change-Id: I1db6915939727f0909c05c8b103e37984aadb443
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-07-23 15:34:25 +01:00
Jagdish Gediya
3960bcda2b style(tc): remove comment for plat_reset_handler
The comment for plat_reset_handler doesn't make sense. It is likely a
copy-and-paste error while adding the code, so remove it.

Change-Id: Iab8c8c799c184fa99966770d47ecb11bbc640515
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
2024-07-23 15:34:25 +01:00
Manish V Badarkhe
31d4c3e983 Merge "fix(corstone1000): include platform header file" into integration 2024-07-23 11:25:41 +02:00
Harsimran Singh Tungal
783e5abe94 fix(corstone1000): include platform header file
Include platform.h file in order to remove following compiler errors,
as some warnings are being treated as errors now.
error: implicit declaration of function
'plat_core_pos_by_mpidr'[-Wimplicit-function-declaration]

Change-Id: Ie223e11e138ec9b0eef7342f450b90b215a49b15
Signed-off-by: Harsimran Singh Tungal <harsimransingh.tungal@arm.com>
2024-07-23 09:56:20 +01:00
Manish Pandey
c5b8de86c8 Merge "feat(debugv8p9): add support for FEAT_Debugv8p9" into integration 2024-07-22 18:07:11 +02:00
Arvind Ram Prakash
33e6aaacf1 feat(fgt2): add support for FEAT_FGT2
This patch disables trapping to EL3 when the FEAT_FGT2
specific trap registers are accessed by setting the
SCR_EL3.FGTEn2 bit

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I6d2b614affb9067b2bc3d7bf0ae7d169d031592a
2024-07-18 13:49:43 -05:00
Arvind Ram Prakash
83271d5a5a feat(debugv8p9): add support for FEAT_Debugv8p9
This patch enables FEAT_Debugv8p9 and prevents EL1/0 from
trapping to EL3 when accessing MDSELR_EL1 register by
setting the MDCR_EL3.EBWE bit.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I3613af1dd8cb8c0d3c33dc959f170846c0b9695a
2024-07-18 13:49:43 -05:00
Sudeep Holla
41d73bffe1 feat(fvp): add SPM manifest for OP-TEE at S-EL1 without S-EL2/Hafnium
Provide manifest to boot OP-TEE at S-EL1 running SPMC with secure EL2
disabled and TF-A at secure EL3 running SPMD.

Change-Id: If8547b5a514fb48eec88a8d56d718f1c1591cf1f
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
4739372278 fix(fvp): update the memory size allocated to optee at EL1
Update the memory size allocated to optee at EL1 to 0xd80000 to match
the size specified by mem-size in optee manifest.

Change-Id: I6826a56d0f68a6a2b5181f849a741a9bf1f0829b
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
18ec9bdc2d fix(fvp): add DRAM memory regions that linux kernel can share
The memory regions that Linux kernel can share including TX/RX buffers
encompass the entire DRAM. Update it accordingly. Without this,
when the Linux kernel call FFA_RXTX_MAP, it fails sometime and the
below error from the secure world appears:

  |  ERROR: arch_other_world_vm_configure_rxtx_map: send page is invalid
  | 		(expected 0x87, got 0x7c)

Change-Id: Idb40907af2e0c1d4e60979b4948db2fc70971145
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
4f37e1e8b2 feat(fvp): update FF-A version to v1.1 supported by optee
OPTEE now supports FF-A v1.1, lets us bump the FF-A version in the
OPTEE FF-A manifest.

Change-Id: Ia51cbe1af619895945240004a4163a4c4bda2ee5
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
887cec9cae feat(fvp): replace managed-exit with ns-interrupts-action
Commit 10b292e649 ("docs(spm): update FF-A manifest binding")
deprecated managed-exit in favor of newly added mandatory
ns-interrupts-action attribute. Replace managed-exit with
ns-interrupts-action before it becomes obsolete.

Change-Id: I9b55f6c55af3510260a9c5a01755a9b66d75823e
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
75265a16c9 fix(fvp): add optee specific mem-size attribute
Without the mem-size attribute, the OPTEE boot panics with below
error:
  |  get_sec_mem_from_manifest:1594 Can't read "mem-size" from FF-A
  |  		manifest at 0x6281000: error -1
  |  Panic at core/arch/arm/kernel/boot.c:1596 <get_sec_mem_from_manifest>
  |  TEE load address @ 0x6284000
  |  Call stack:
  |  0x0628c7fc
  |  0x06298788
  |  0x0628c480

Adding the mem-size attribute fixes the boot. This is OPTEE specific
extension.

Change-Id: I2801c8b4a89cffafff14c788319ad106b03ffef0
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Sudeep Holla
bf36351aca fix(fvp): fix the FF-A optee manifest by adding the boot info node
Without the FF-A manifest boot info node, the OPTEE boot as S-EL1 VM
crashes currently with the below error:
  |  WARNING: Stage-2 page fault: pc=0x628c41c, vmid=0x8001, vcpu=0,
  | 			vaddr=0xd00000, ipaddr=0xd00000, mode=0x1 0x7c
  |  NOTICE: Injecting Data Abort exception into VM 0x8001.

Adding the boot info node fixes the OPTEE boot.

While at it, also update copyright year in the file.

Change-Id: I1fd0bf4e38bb95deedc74fa04d1e6bb057424c04
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-07-15 17:15:01 +01:00
Manish V Badarkhe
c16e919803 Merge "chore(rdv3): rename platform RD-Fremont to RD-V3" into integration 2024-07-15 08:12:58 +02:00
Jerry Wang
137ab5cb09 chore(rdv3): rename platform RD-Fremont to RD-V3
Arm has decided to rename RD-Fremont to RD-V3 to align with its
existing product lineup, such as RD-V1, RD-V2, etc. This change
replaces all occurences of "Fremont" with "V3" in file names and
contents.

Change-Id: I302103492f962a7ac74854633ad68701b2a7f420
Signed-off-by: Jerry Wang <Jerry.Wang4@arm.com>
2024-07-12 15:33:19 +01:00
Manish V Badarkhe
c06b555d7b Merge "fix(tc): add stubs for soc_css_init functions" into integration 2024-07-10 15:07:28 +02:00
Manish V Badarkhe
0dac0e1f68 Merge "fix(tc): don't enable TZC on TC3" into integration 2024-07-10 15:07:16 +02:00
Manish V Badarkhe
3512adc420 Merge "fix(tc): enable MTE2 unconditionally" into integration 2024-07-10 15:07:04 +02:00
Tintu Thomas
be8eaa5e62 fix(tc): enable MTE2 unconditionally
Keeping the MTE2 enablement under the SPMD check is breaking for FPGA
and CI test, as SPMD is absent in these cases.

Enable MTE2 unconditionally so that all the supported platforms can use
it.

Change-Id: Id86893f0e2767a8686c3dca0ea092907d5c107ba
Signed-off-by: Tintu Thomas <tintu.thomas@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-07-08 11:08:57 +01:00
Tintu Thomas
8ce29a74a4 fix(tc): don't enable TZC on TC3
TZC is being replaced by MSF module on TC3. For fixing boot failure on
TC3, don't enable TZC module on the TC3 platform.

Change-Id: I4434cb28bf523be8dd882f5f8799223642822ee2
Signed-off-by: Tintu Thomas <tintu.thomas@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-07-04 14:35:04 +01:00
Tamas Ban
3201faf356 feat(tc): provide target_locality info of AP FW components
The target_locality attribute is meant to specify that
a certain SW component is expected to run and thereby
send DPE commands from a given security domain. The DPE
service must be capable of determining the locality of
a client on his own. RSE determines the client's locality
based on the MHU channel used for communication.

If the expected locality (specified by the parent component)
is not matching with the determined locality by DPE
service then command fails.

The goal is to protect against spoofing when a
context_handle is stolen and used by a component
that should not have access.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I96d255de231611cfed10eef4335a47b91c2c94de
2024-07-03 15:03:20 +02:00
Tamas Ban
4f5beb56de refactor(tc): rename DPE header
The new name is more generic. The goal to add here
all platform dependent defines / data / config which
is DPE related.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I5b521932c45d8a9c43ea2344dde83c210801cfee
2024-07-03 15:01:49 +02:00
Manish Pandey
5f960f0a08 Merge "refactor(tc): use the example CCA platform token from iat-verifier" into integration 2024-07-03 14:43:33 +02:00