Commit graph

15115 commits

Author SHA1 Message Date
Xialin Liu
b95f398ebd feat(arm): update documentation for cot-dt2c
Add documentation for the cot-dt2c feature

Change-Id: I27383882b639e39217d09ca76e316098cc4753d0
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
ac106f208f feat(arm): remove the bl2 static c file
There is no need for the bl2 static c file for
CCA and Duaroot CoT, remove them from the repo

Change-Id: I251d085034dae0f6b3c6cefdbb129a9e1dd0530b
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
479c833afc feat(arm): generate tbbr c file CoT dt2c
Integrate the cot-dt2c tool into build process
for TBBR configuration

Change-Id: I42ccbc96c5c8fd21266200e427306a80236a78aa
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
0e0fab0ca2 feat(arm): makefile invoke CoT dt2c
Change the makefile to call the cot-dt2c tool
during the build for Arm platform

Change-Id: Idb7c02cca6b9ddd87f575a42c88e7b2660b896e0
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
4274d6f885 feat(auth): standalone CoT dt2c tool
Add the standalone CoT dt2c tool for CoT DTB conversion to
c file

Change-Id: If28e580a4c2825f5dc9008e93cd2aae3fc173e73
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
3146a70af2 refactor(auth): separate bl1 and bl2 CoT
Separate the bl1 and bl2 CoT into individual C files for the
upcoming tool, i.e. the CoT device tree-to-source file generator.

Change-Id: I0d24791991b3539c7aef9a562920dc62fecdc69a
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
b6a95c4a80 refactor(st): align the NV counter naming
align the nv counter naming for stm32mp1-cot-descriptor.dtsi file

Change-Id: I8c41c5e323e8bf867e08b4590dfb42e86204ab65
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01: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
Madhukar Pappireddy
9babc7c2d6 Merge changes from topic "enable_a53_clk" into integration
* changes:
  feat(nxp-clk): enable the A53 clock
  feat(nxp-clk): add ARM PLL ODIV enablement
  feat(nxp-clk): add ARM PLL enablement
  feat(nxp-clk): set rate for clock muxes
2024-08-06 18:23:58 +02:00
Manish Pandey
0cd2056c78 Merge "fix(nxp-sfp): shift gpio register offsets by 2" into integration 2024-08-06 16:04:22 +02:00
Manish Pandey
b4f72cfa08 Merge "refactor(cpufeat): feat detect helpers inlining" into integration 2024-08-06 15:58:57 +02:00
Manish V Badarkhe
5cc5ded833 Merge "fix(ast2700): fix mpll calculate statement" into integration 2024-08-06 15:58:34 +02: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
7aca660c4e fix(tc): correct CPU PMU binding
CPU PMU types are not same for all CPUs on TC platforms, so define the
PMU nodes per micro architectures.

Change-Id: I4e940976cdda9a6eab3e15936c6c41a2bb668c9d
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:59 +01:00
Jagdish Gediya
77080f6aaf feat(tc): add device tree binding for SPE
Add node for Statistical Profiling Extension, which provides
periodic sampling of operations in the CPU pipeline and reports
this via the perf AUX interface.

Change-Id: Ic7a9d9ce927edbce02c7c09470a009dc56247240
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:59 +01:00
Jagdish Gediya
ebc991b3a1 feat(tc): add PPI partitions in DT binding
Define ppi-partitions for little, middle, and big cpu groups. PPI
affinity is expressed as a single "ppi-partitions" node, containing a
set of sub-nodes for each microarchitecture type, each with the
property 'affinity' which should be a list of phandles to CPU nodes.

PPI paritions are useful to affine specific PPI with set of CPUs
so that the drivers of micro-architecture specific nodes which uses
PPI can be divided based on CPU list e.g. SPE-PMU, CPU-PMU etc.

Change-Id: If7d47f71387ac982d2d992a0ce2de1652d564bd6
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:59 +01:00
Jagdish Gediya
1300bbce15 feat(tc): change GIC DT property 'interrupt-cells' to 4
Change the GIC's DT property 'interrupt-cells' to 4, so the 4th cell is
a phandle to a node describing a set of CPUs this interrupt is affine
to.

If an interrupt is a PPI, and the node pointed in the 4th cell must be a
subnode of the "ppi-partitions" in the GIC node. For interrupt types
other than PPI, this cell must be zero. This is a preparison for
sequential changes for interrupt partitions, as the first step, it sets
all zeros for the interrupt affinity.

Change-Id: I66490a86a27aad5db6b1a42c2d8e0d042eee46a9
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:59 +01:00
Jagdish Gediya
169eb7daf2 feat(tc): add NI-Tower PMU node for TC3
Enable NI-Tower PMU on TC3.

Change-Id: I8a4d4e31e84ab33f95bc8b7661e873cf97561b79
Signed-off-by: Jagdish Gediya <jagdish.gediya@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-08-05 16:25:59 +01: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 V Badarkhe
1baf62469e Merge changes from topic "ar/asymmetricSupport" into integration
* changes:
  feat(trbe): introduce trbe_disable() function
  feat(spe): introduce spe_disable() function
  chore(spe): rename spe_disable() to spe_stop()
2024-08-05 17:16:52 +02: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
Manish Pandey
9bfad24c3b Merge changes from topic "hm/handoff" into integration
* changes:
  fix(arm): move HW_CONFIG relocation into BL31
  feat: add option to input attr as string of flag names
  feat: add option to input text instead of tag id number
  feat: add creating transfer lists from yaml files
2024-08-05 12:35:49 +02:00
Manish V Badarkhe
9268bc23f1 Merge "fix(arm): correct the RESET_TO_BL31 x1 handoff arg" into integration 2024-08-05 12:31:35 +02:00
Manish V Badarkhe
fe40084d3b Merge "fix(docs): refactor poetry dependency group" into integration 2024-08-02 18:16: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
Harrison Mutai
fe94a21a68 fix(arm): move HW_CONFIG relocation into BL31
Refactor DT relocation logic from BL2 to BL31 for non-secure DRAM.
Previously, BL2 was responsible for copying the DT into SRAM and DRAM,
resulting in duplicate code in BL31 to cater for the `RESET_TO_BL31`
case. By moving the re-location logic to BL31, we simplify handling of
the non-secure DT and TL.

Change-Id: Id239f9410669afe4b223fa8d8bb093084a0e5e1b
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-08-02 14:59:47 +00:00
Harrison Mutai
4a29299f2e fix(docs): refactor poetry dependency group
Rename 'doc' group to 'docs' for consistency, this is to follow the
widely accepted convention of using plural nouns groups that contain
multiple items. This change signifies that the 'docs' group includes a
collection of documentation-related dependencies.

Also, ensure that the dependencies are actually conditionally installed
by setting the group as optional. This was missing in the original
change.

Change-Id: I07caccfb1b57bc2dc1e7596899dfb926e8a5f71a
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-08-02 14:24:07 +00:00
Harrison Mutai
5da68cc477 fix(arm): correct the RESET_TO_BL31 x1 handoff arg
Use the designated macro to accurately set the signature within the
parameters transferred from BL33 to the non-secure payload.

Change-Id: Id91319121a70b2c72f8489450f191ca4f129cfcb
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-08-02 14:09:27 +00:00
Charlie Bareham
4dcbba98ce feat: add option to input attr as string of flag names
Change-Id: I56f0364ef43c9d415a335474e15b68e79db37f5d
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
2024-08-02 12:14:53 +00:00
Charlie Bareham
792e8e896f feat: add option to input text instead of tag id number
Change-Id: I6d1b1a20d1cd5b073d7d614da102b9e6bd8ea522
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
2024-08-02 12:14:53 +00:00
Charlie Bareham
311209934e feat: add creating transfer lists from yaml files
This commit adds a command create-from-yaml to tlc, which
creates a transfer list from a yaml file. It also changes
the files structure of the fixtures in the unit tests so
they are in a directory called trusted-firmware-a. This
is necessary because blob file paths in the yaml file are
relative to the root of TF-A.

The blob files are not verified by TLC, so it can be used
to load arbitrary binary information into the transfer
list. The authenticity of the transfer list must be
ensured by the loader.

Change-Id: Idf704ce5d9b7e28b31f471ac337e4aef33d0ad8a
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
2024-08-02 12:14:53 +00:00
Manish Pandey
0c331352a0 Merge "refactor(mbedtls): rewrite psa crt verification" into integration 2024-08-02 10:23:30 +02:00
Manish V Badarkhe
66f6d3bf8f Merge "fix(docs): point poetry readthedocs virtual env" into integration 2024-08-01 19:07:20 +02:00
Harrison Mutai
5383a88b93 fix(docs): point poetry readthedocs virtual env
RTD uses a mixture of poetry and pip to install packages in the build
environment. In the past it was recommended to disable poetry from
creating a fresh virtual environment. Instead, the expectation was that
poetry would be able to detect it's current virtual environment and
install the packages in the right place. This was recently updated to
allow poetry to better allow dependcy management by poetry [1]. Remove
this configuration and explicitly point Poetry to the virtual
environment.

[1] https://github.com/readthedocs/readthedocs.org/pull/11152

Change-Id: I58e49ba6f6d122e70bbcf1dbb10220881a09faf3
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-08-01 15:48:44 +00:00
Ryan Everett
0bc36c839f refactor(mbedtls): rewrite psa crt verification
This new version uses fewer internal functions
in favour of calling equivalent mbedtls APIs.

Change-Id: I0c2c20a74687211f2d554501f57898da07b01739
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-08-01 16:39:13 +01:00
Kevin Chen
aa09622233 fix(ast2700): fix mpll calculate statement
pll_reg.b.bypass equal to 1U, bypass the mpll calculating
pll_reg.b.bypass equal to 0U, need to calculate mpll

Change-Id: I6cace1509d9429a97c7c9481dc1e2e4f95134d6c
Signed-off-by: Kevin Chen <kevin_chen@aspeedtech.com>
2024-08-01 14:55:15 +08:00
André Przywara
80cd7dd1bb Merge "fix(allwinner): dtb: check for correct error condition" into integration 2024-07-31 18:35:49 +02:00
Manish Pandey
47add9d3ed Merge changes from topic "hm/handoff" into integration
* changes:
  build: make poetry use existing lock file
  feat(arm): add fw handoff support for RESET_TO_BL31
  feat(tlc): add host tool for static TL generation
2024-07-31 16:44:12 +02:00
Andre Przywara
7300a4d167 fix(allwinner): dtb: check for correct error condition
In sunxi_soc_fdt_fixup(), we check for the value of "ret" again, after
calling fdt_node_offset_by_phandle(), even though the error value of
that lands in "node".

Check for "node" being non-negative instead, to properly detect any
errors here.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I57c1406388dbe11d343038da173019519e18af3e
2024-07-31 10:58:55 +01:00
Manish Pandey
a169b8fbc2 Merge "build: fix missing $$(@D)/ from sp_gen.mk" into integration 2024-07-31 11:32:43 +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
Chris Kay
fd74ca0d6b build: fix missing $$(@D)/ from sp_gen.mk
This target can currently fail as the `$(BUILD_PLAT)` target no longer exists, as it is now `$(BUILD_PLAT)/` (with an explicit trailing slash).

Change-Id: I9172b2f51f6e02e6369f62468ea63a64ec0f6dd1
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-07-30 17:26:10 +02:00
Charlie Bareham
e182f4380c build: make poetry use existing lock file
This makes the build reproducible.

When `make dev-install` was run, it would ignore the existing
poetry lock file, install different versions of all the
libraries, then overwrite the lock file. Once `--no-update`
is added, it stops doing that, and installs exactly what is
in the poetry lock file.

Change-Id: If62637a40504d23deb47a05347a272e1c13bf41e
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
2024-07-30 10:26:07 +00: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
Harrison Mutai
6ac31f3e76 feat(tlc): add host tool for static TL generation
Transfer List Compiler is a command line tool that enables the static
generation of TL's compliant with version 0.9 of the firmware handoff
specification. The intent of this tool is to support information passing
via the firmware handoff framework to bootloaders that run without
preceding images (i.e. `RESET_TO_BL31`).

It currently allows for TL's to be statically generated from blobs of
data, and modified by removing/adding TE's. Future work will provide
support for TL generation from configuration file.

Change-Id: Iff670842e34c9ad18eac935248ee2aece43dc533
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Co-authored-by: Charlie Bareham <charlie.bareham@arm.com>
2024-07-30 10:25:57 +00:00
Arvind Ram Prakash
b36e975ea3 feat(trbe): introduce trbe_disable() function
This patch adds trbe_disable() which disables Trace buffer access
from lower ELs in all security state. This function makes Secure
state the owner of Trace buffer and access from EL2/EL1 generate
trap exceptions to EL3.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: If3e3bd621684b3c28f44c3ed2fe3df30b143f8cd
2024-07-29 20:35:14 +01:00
Manish Pandey
651fe5073c feat(spe): introduce spe_disable() function
Introduce a function to disable SPE feature for Non-secure state and do
the default setting of making Secure state the owner of profiling
buffers and trap access of profiling and profiling buffer control
registers from lower ELs to EL3.

This functionality is required to handle asymmetric cores where SPE has
to disabled at runtime.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I2f99e922e8df06bfc900c153137aef7c9dcfd759
2024-07-29 20:34:18 +01:00
Manish Pandey
4de07b4be7 chore(spe): rename spe_disable() to spe_stop()
During CPU power down, we stop the profiling by calling spe_disable()
function. From TF-A point of view, enable/disable means the avaibility
of the feature for lower EL. In this case we are not actully disabling
the feautre but stoping it before power down.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I6e3b39c5c35d330c51e7ac715446a8b36bf9531f
2024-07-29 20:34:04 +01:00