Commit graph

15499 commits

Author SHA1 Message Date
Ryan Everett
8570895a1b refactor(mbedtls): remove hack in LIBMBEDTLS_CFLAGS
MbedTLS 3.6.1 fixed the issue which previously
produced this warning, so this hack is no longer
necessary.

Change-Id: I934adefbf2fed16e16b9d98bc8674125b70b08fc
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-09-19 10:37:02 +02:00
Ryan Everett
5acc316466 docs(prerequisites): update MbedTLS version to 3.6.1
This new update to the LTS branch of MbedTLS provides minor
enhancements and bug fixes; including some security
fixes, and a fix to a compilation warning which
previously affected TF-A.
Full patch notes to this MbedTLS update can be found at
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.1.

Change-Id: I1a68dfcb52a8361c1689cb6ef12d265a6462fda3
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-09-19 10:36:55 +02:00
Olivier Deprez
cb008a1240 Merge "docs: fix ff-a manifest binding document" into integration 2024-09-19 09:57:31 +02:00
Madhukar Pappireddy
3406ff00aa docs: fix ff-a manifest binding document
The support for runtime-model has never been implemented by any SPMC.
Hence, remove the corresponding field from binding document.

Also, fix the incorrect description of the `managed-exit-virq` property.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I0a5ef3f08202a8c76edd9a6e1ac680ac3a38ca60
2024-09-18 15:10:13 -05:00
Abhi.Singh
11dff59946 fix(rpi3): manually populate CNTFRQ reg
The rpi3 does not initialize the generic timer in BL1, which is now
required to use the delay timer in the dTPM driver. This change sets the
counter frequency register (CNTFRQ) with the rpi3's system counter
frequency value, as a prerequisite for timer initialization, and then
initializes the generic timer all during BL1 setup.

Change-Id: I4e2475b63ce4a97653202f94f506b5d3edc4c1a7
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2024-09-18 11:26:38 -05:00
Olivier Deprez
b80feed760 docs: update TF-A Nov'24 release dates
Planning TF-A v2.12 release in Nov'24.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I0fa6885cc67e13560a79f8144bc23df6172a05c0
2024-09-18 14:29:15 +02:00
XiaoDong Huang
b833bbe6f0 feat(rk3588): enable crypto function
The CPU crypto is not default on when power up, need to enable it by
software.

Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Ifee2eab55d9c13cef5f15926fb80016845e2a66d
2024-09-18 19:59:10 +08:00
Olivier Deprez
bfbb1cb973 Merge "fix(xilinx): map PMC_GPIO device node to interrupt for wakeup source" into integration 2024-09-18 12:00:46 +02:00
Yann Gautier
88c66f6118 Merge "chore(gpt): fix typo in comment" into integration 2024-09-18 09:08:33 +02:00
Andrey Skvortsov
1b2fb6adb5 feat(build): add ability to define platform specific defaults
In some cases it maybe needed to override some default settings on a
particular platform. For example, enable ENABLE_LTO on a size
constrained platform.

Change-Id: I556d26f6b81c0f3ceb40b7196180995dde22afd0
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2024-09-17 21:44:39 +03:00
Moritz Fischer
670150b804 chore(gpt): fix typo in comment
Fix a confusing typo in comment docstring.

Change-Id: I9424454b9fa140bf6a482dea7f8cba24806068b6
Signed-off-by: Moritz Fischer <moritzf@google.com>
2024-09-17 18:16:00 +02:00
Yann Gautier
a16dad0b22 Merge "fix(xilinx): warn if reserved memory pre-exists in DT" into integration 2024-09-17 14:34:17 +02:00
Joanna Farley
000d80b5a8 Merge "fix(versal): kernel QEMU boot is failing on versal platform" into integration 2024-09-17 11:56:33 +02:00
Joanna Farley
50a1e6810b Merge "feat(versal): add support for QEMU COSIM platform" into integration 2024-09-17 11:56:28 +02:00
Manish V Badarkhe
45252f14be Merge "feat(fvp): scale SP_MIN max size based on SRAM size" into integration 2024-09-17 11:19:59 +02:00
Maheedhar Bollapalli
729477fd86 fix(xilinx): warn if reserved memory pre-exists in DT
Memory reservation for tf-a does not happen in
runtime if memory reservation node pre-exists in DT.
Presence of reserved area is checked and user is
warned if it pre-exists.

Change-Id: I50e18be942777747e9074bb9d8e0305a29c28178
Signed-off-by: Maheedhar Bollapalli <MaheedharSai.Bollapalli@amd.com>
2024-09-17 14:24:28 +05:30
Olivier Deprez
86aaa45ef7 Merge "docs: add load address relative offset node" into integration 2024-09-16 13:50:12 +02:00
Soby Mathew
8c99b19e53 Merge "fix(qemu): update rmmd_attest_get_platform_token()" into integration 2024-09-16 11:11:13 +02:00
Davidson K
ac22a77c96 docs: add load address relative offset node
When this is provided in the partition manifest, it should be added to
the load address to get the base address of the region.

Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
Change-Id: Ib6d3d6a29af0a3eb87fac67c58220ba25342e1cd
2024-09-16 14:23:14 +05:30
Manish V Badarkhe
ccd580c453 Merge changes I09ab0a5c,I87d0a492,I613a52ae,I2fcd8d32,Ie91527a7, ... into integration
* changes:
  feat(stm32mp2): manage DDR FW via FIP
  feat(stm32mp2): introduce DDR type compilation flags
  feat(stm32mp2): add RISAB registers description
  feat(stm32mp2-fdts): add BL31 info in fw-config
  feat(stm32mp2): add minimal support for BL31
  feat(st): manage BL31 FCONF load_info struct
2024-09-16 10:34:52 +02:00
Akshay Belsare
db827f99a0 feat(versal): add support for QEMU COSIM platform
QEMU COSIM introduces a new platform id for Versal Platform.
QEMU COSIM is equivalent to QEMU with additional COSIM
extensions, so just switching platform_id to QEMU if QEMU COSIM
id is detected.

Change-Id: If81e0bf04301c7101f89d0df13134f7d04e8c257
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2024-09-16 06:35:25 +02:00
Maxime Méré
ae84525f44 feat(stm32mp2): manage DDR FW via FIP
This feature is enabled by default using STM32MP_DDR_FIP_IO_STORAGE.

DDR firmware binary is loaded from FIP to SRAM1 which needs to be
mapped.
Only half of the SRAM1 will be allocated to TF-A.
RISAB3 has to be configured to allow access to SRAM1.
Add image ID and update maximum number on platform side also.

Fill related descriptor information, add policy and update numbers.
DDR_TYPE variable is used to identify binary file, and image is now
added in the fiptool command line.

The DDR PHY firmware is not in TF-A repository. It can be found at
https://github.com/STMicroelectronics/stm32-ddr-phy-binary
To ease the selection of the firmware path, STM32MP_DDR_FW_PATH is added
to platform.mk file.

Change-Id: I09ab0a5c63406055a7b5ccd16d65e443de47ca2f
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
2024-09-13 17:57:58 +02:00
Nicolas Le Bayon
d07e9467d3 feat(stm32mp2): introduce DDR type compilation flags
Binary size limitation implies to define DDR type build flags.
User must set one single type in the build command line.
DDR_TYPE is then deduced, and will help in relative definitions.
A check routine is implemented to verify correct configuration.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: I87d0a492196efea33831d9c090e6e434cc7c0a1e
2024-09-13 17:56:03 +02:00
Yann Gautier
631c5f86d5 feat(stm32mp2): add RISAB registers description
Describe the RISAB (Resource isolation slave unit for address space
protection (block-based)) peripheral registers.

Change-Id: I613a52ae6d94264137378b805119d38ee59ae762
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
2024-09-13 17:55:43 +02:00
Yann Gautier
a370c856f1 feat(stm32mp2-fdts): add BL31 info in fw-config
Add BL31 load address (beginning on SYSRAM) and size in fw-config DT
file.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: I2fcd8d326f394090401ac59b47216d59d3e911bc
2024-09-13 17:38:11 +02:00
Yann Gautier
03020b6688 feat(stm32mp2): add minimal support for BL31
Add the required files to compile BL31 on STM32MP2.
Update BL2 configuration to load BL31. The platform boots until BL31,
but stops here as no other binaries are loaded as DDR is not
initialized.
At runtime, BL31 will use only the first half of the SYSRAM, the upper
half will be used for non-secure DMA LLIs. To be sure nothing from this
area is still in the cache, invalidate the upper SYSRAM before enabling
BL31 cache. BL31 should then map only first half of the SYSRAM. But it
must temporarily map the upper half read-only, as this is where we will
retrieve BL2 parameters, used to fill registers for next boot stages.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: Ie91527a7a26625624b4b3c65fb6a0ca9dd355dbd
2024-09-13 17:37:56 +02:00
Manish V Badarkhe
056b4154ae Merge changes from topic "draft-ffm-rats-cca-token-00" into integration
* changes:
  refactor(docs): update RSE docs to match the example CCA token
  refactor(qemu): use the example CCA platform token from iat-verifier
  refactor(fvp): use the example CCA platform token from iat-verifier
2024-09-13 16:22:46 +02:00
Jean-Philippe Brucker
9248ee0cc4 fix(qemu): update rmmd_attest_get_platform_token()
Update the parameters to rmmd_attest_get_platform_token(), which can now
handle platform tokens larger than 4kB. Since the QEMU sample token is
smaller than 4kB, our implementation remains the same. Take the
opportunity to clean up the function slightly.

Change-Id: Id5a1d576968ebd160d2b79c1f38392d4ecc89421
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2024-09-13 16:10:01 +02:00
Soby Mathew
051c7ad81f Merge "refactor(rmmd): plat token requests in pieces" into integration 2024-09-13 16:05:16 +02:00
Juan Pablo Conde
42cf602662 refactor(rmmd): plat token requests in pieces
Until now, the attestation token size was limited by the size of the
shared buffer between RMM and TF-A. With this change, RMM can now
request the token in pieces, so they fit in the shared buffer. A new
output parameter was added to the SMC call, which will return (along
with the size of bytes copied into the buffer) the number of bytes
of the token that remain to be retrieved.

TF-A will keep an offset variable that will indicate the position in
the token where the next call will retrieve bytes from. This offset
will be increased on every call by adding the number number of bytes
copied. If the received hash size is not 0, TF-A will reset the
offset to 0 and copy from that position on.

The SMC call will now return at most the size of the shared buffer
in bytes on every call. Therefore, from now on, multiple SMC calls
may be needed to be issued if the token size exceeds the shared
buffer size.

Change-Id: I591f7013d06f64e98afaf9535dbea6f815799723
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
2024-09-13 16:04:16 +02:00
Maheedhar Bollapalli
8e5252f3c0 fix(versal): kernel QEMU boot is failing on versal platform
Due to deprecation of VERSAL_PLATFORM build argument,
the board detection is done at runtime due to this the cpu
and uart clock freq was not set as required to silicon values.

Updated Versal QEMU cpu_clock and uart_clock to silicon values.

Change-Id: I7c772f07ba45eb7e0ae095fd670718190e24f0d7
Signed-off-by: Maheedhar Bollapalli <MaheedharSai.Bollapalli@amd.com>
2024-09-13 11:56:05 +00:00
Tamas Ban
5c8b5f9f8b refactor(docs): update RSE docs to match the example CCA token
The RSE documentation includes binary and JSON dumps of the CCA platform
token. This change updates those to match the example CCA platform
token from [1] and [2], which is also the one returned by the FVP and
QEMU platforms.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Icf91035c5a56c8fa34a7055a969a6ebd8242d460
2024-09-13 13:04:53 +02:00
Tamas Ban
3ba9fca7ed refactor(qemu): use the example CCA platform token from iat-verifier
In [1] and [2], the example CCA platform token has been updated to be
aligned with the new profile(s) defined in draft-ffm-rats-cca-token-00.

This change replaces the static CCA platform token in QEMU.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I9153df1e6c1be81e669d5495dbe8d1a52e86cdff
2024-09-12 15:56:33 +02:00
Tamas Ban
4f3e0cdc45 refactor(fvp): use the example CCA platform token from iat-verifier
In [1] and [2], the example CCA platform token has been updated to be
aligned with the new profile(s) defined in draft-ffm-rats-cca-token-00.

This change replaces the static CCA platform token in the FVP platform.

[1] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/30812
[2] https://review.trustedfirmware.org/c/TF-M/tf-m-tools/+/31036

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ia23f0dffe618dca04f9f3c46c953a6f021101b09
2024-09-12 15:56:33 +02:00
Manish V Badarkhe
da5984db53 Merge "fix(fvp): enable FEAT_MTE2" into integration 2024-09-12 15:46:43 +02:00
Olivier Deprez
fb42d7f6c1 Merge "fix(mte): improve ENABLE_FEAT_MTE deprecation warning" into integration 2024-09-12 14:38:41 +02:00
Andre Przywara
d081c6116e fix(fvp): enable FEAT_MTE2
ENABLE_FEAT_MTE2 controls the trapping of some MTE related system
registers. If the memory_tagging_support_level parameter on the FVP
command line is set to higher values, non-secure world will see the
feature bits in the CPU ID registers and will use those registers,
triggering a panic in BL31.

Enable the feature in the optional form for the FVP build, to avoid any
panics.

Change-Id: I26ba444d784adf165db81048f93e11361c7f11ac
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-09-12 11:51:13 +01:00
Ryan Everett
3b5eca9e7a feat(fvp): scale SP_MIN max size based on SRAM size
The maximum size for SP_MIN in the FVP is currently
fixed and does not scale with the SRAM size.
This update adjusts the SP_MIN size according to
the SRAM size used to build the FVP platform.

Change-Id: I95527e8ae6f8a73c336ed4fe05ace5de86d8991d
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-09-12 10:47:45 +01:00
Manish V Badarkhe
97a9c7ab9e Merge "fix(checkpatch): detect issues in commit message" into integration 2024-09-12 10:54:45 +02:00
Yann Gautier
078ea6657c Merge "feat(mediatek): change log level from INFO to VERBOSE" into integration 2024-09-12 10:48:59 +02:00
Ronak Jain
692d32b573 fix(xilinx): map PMC_GPIO device node to interrupt for wakeup source
Currently, PMC_GPIO device node was not mapped with interrupt number
during the setup of wakeup source while suspending. As a result,
system cannot resume using PMC_GPIO as wakeup source.

To address this issue, add an entry for PMC_GPIO node to map with its
corresponding interrupt number.

Change-Id: Ic681b7b2e7c0b3bd542c8e4664a2129e4b91c459
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
2024-09-11 23:06:08 -07:00
Gavin Liu
5f2f384890 feat(mediatek): change log level from INFO to VERBOSE
This change aims to reduce unnecessary information in the default log
output, so change to use VERBOSE.

Change-Id: I80ea57cd4164bdcef915db5392a63ae8982a634f
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2024-09-12 07:30:30 +02:00
Soby Mathew
416616567a Merge changes If374b491,I6b63b9c6 into integration
* changes:
  fix(qemu): exclude GPT reserve from BL32_MEM_SIZE
  fix(qemu): fix L0 GPT page table mapping
2024-09-11 12:27:22 +02:00
Chris Kay
9cea2c362f build: allow multiple toolchain defaults
This change enables a fairly commonly-requested use-case, which is to
fall back to the host system's native toolchain when building on AArch64
if the bare-metal toolchain is not available.

In this situation, if the `aarch64-none-elf` GCC toolchain cannot be
located, the build system will look for `aarch64-linux-gnu` before
giving up.

Change-Id: I39d2a8837b651b28cf0eafa92f6003a7f66767a0
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-10 12:36:19 +00:00
Chris Kay
3789c3c000 build: determine toolchain tools dynamically
Since the introduction of the toolchain detection framework into the
build system, we have done determination and identification of the
toolchain(s) used for the build at the initialization of the build
system.

This incurs a large cost to the build every time - for every toolchain
that has been requested by the current makefile, we try to identify each
tool in the list of known tool classes, even if that tool doesn't
actually see any use.

For the clean and check-like targets we worked around this by disabling
most of the toolchains if we detect these targets, but this is
inflexible and not very reliable, and it still means that when building
normal targets we are incurring that cost for all tools whether they are
used or not.

This change instead modifies the toolchain detection framework to only
initialize a tool for a given toolchain when it is first used. This does
mean that we can no longer warn about an incorrectly-configured
toolchain at the beginning of build system invocation, but it has the
advantage of substantially reducing build time and the complexity of
*using* the framework (at the cost of an increase in complexity in the
framework itself).

Change-Id: I7f3d06b2eb58c1b26a846791a13b0037f32c8013
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-10 09:47:06 +00:00
Olivier Deprez
0631d68d85 Merge "fix(arm): add extra hash config to validate ROTPK" into integration 2024-09-09 17:32:38 +02:00
Manish V Badarkhe
014975cea4 fix(arm): add extra hash config to validate ROTPK
The default mbedTLS configuration enables hash algorithms based on
the HASH_ALG or MBOOT_EL_HASH_ALG selected. However, the Arm ROTPK
is always embedded as a SHA256 hash in BL1 and BL2. In the future,
we may need to adjust this to use the HASH_ALG algorithm for
embedding the ROTPK hash.

As a temporary workaround, a separate mbedTLS configuration has
been created for Arm platforms to explicitly set SHA256 defines,
rather than relying on the default configuration. This adjustment
is reflected in the mbedTLS configuration file for the TC platform
as well as in the PSA Crypto configuration file.

Change-Id: Ib3128ce7b0fb5c0858624ecbc998d456968beddf
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-09-09 11:22:28 +01:00
Joanna Farley
75fdb32f09 Merge "feat(versal2): implement USB_SET_STATE dummy IOCTL" into integration 2024-09-09 09:54:25 +02:00
Madhukar Pappireddy
829d0a88b9 Merge "fix(gicv3): fix GITS_CTLR.Quiescent bit definition" into integration 2024-09-08 15:36:20 +02:00
magicse7en
2da29d2d07 fix(gicv3): fix GITS_CTLR.Quiescent bit definition
GITS_CTLR.Quiescent is bit31, not bit1.
So fix GITS_CTLR_QUIESCENT_BIT to BIT32(31).

Change-Id: Ic16a52e0c4e557d68a8128ccc7e7a0f1a316a23b
Signed-off-by: Joe Yang <magicse7en@outlook.com>
2024-09-06 23:26:40 +02:00