Commit graph

15333 commits

Author SHA1 Message Date
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
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
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
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
Yann Gautier
aa7f6cd8b3 feat(st): manage BL31 FCONF load_info struct
As the file is common with STM32MP1, which is AARCH32, the BL31 entry
is put under __aarch64__ flag.

Change-Id: I1efc406717842235264dc6cc3605229659364b02
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
2024-09-06 15:33:39 +02:00
Olivier Deprez
eb366ee769 Merge "build: use ar over gcc-ar" into integration 2024-09-06 09:02:56 +02:00
Manish V Badarkhe
7dd66eec5a Merge changes from topic "jc/tcr2_asymmetric_support" into integration
* changes:
  feat(cm): handle asymmetry for FEAT_TCR2
  feat(tc): make TCR2 feature asymmetric
2024-09-05 18:30:22 +02:00
Jayanth Dodderi Chidanand
f4303d05ea feat(cm): handle asymmetry for FEAT_TCR2
With introduction of FEAT_STATE_CHECK_ASYMMETRIC, the asymmetry of cores
can be handled. FEAT_TCR2 is one of the features which can be
asymmetric across cores and the respective support is added here.

Adding a function to handle this asymmetry by re-visting the
feature presence on running core.
There are two possible cases:
 - If the primary core has the feature and secondary does not have it
   then the feature is disabled.
 - If the primary does not have the feature and secondary has it then,
   the feature need to be enabled in secondary cores.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I73a70891d52268ddfa4effe40edf04115f5821ca
2024-09-05 16:28:23 +01:00
Jayanth Dodderi Chidanand
3e8a82a030 feat(tc): make TCR2 feature asymmetric
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I6209dc46ddecaa09cc1220fe9488b3771ea6dc38
2024-09-05 14:11:11 +01:00
Maheedhar Bollapalli
282bce19bb feat(versal2): implement USB_SET_STATE dummy IOCTL
USB DWC3 driver calls firmware API to set USB D0/D3 power states.
In absence of firmware driver probe these PM APIs return -ENODEV
and DWC3 driver probe fails. Till PLM implement these PM APIs as
a temporary workaround add dummy PM implementation in TFA.

Change-Id: I8768301524ffdc2f275221296feaa2a3ad0ad4f6
Signed-off-by: Maheedhar Bollapalli <MaheedharSai.Bollapalli@amd.com>
2024-09-05 17:02:15 +05:30
Madhukar Pappireddy
b76929825b Merge "fix(spmd): remove spmd_handle_spmc_message" into integration 2024-09-04 18:46:19 +02:00
Chris Kay
732c6bbe28 build: use ar over gcc-ar
It has been a sufficiently long time since the last release of binutils
did not automatically enable the LTO plugin. Migrate to `ar` rather than
using the `gcc-ar` build wrapper, which saves us some pain trying to
locate the proper archiver.

Change-Id: I6f8b895d6a470d2b7cd5b98ccb23c54b35d7ad12
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-04 14:08:00 +00:00
Joanna Farley
19bcffad58 Merge "fix(xilinx): optimize logic to read IPI response" into integration 2024-09-04 13:39:09 +02:00
Manish V Badarkhe
0c755a2c66 Merge changes from topic "mbedtls-config-cleanup" into integration
* changes:
  chore(qemu): remove duplicate define
  chore(imx): remove duplicate define
  chore(arm): remove duplicate defines
  chore(mbedtls): remove hash configs
2024-09-04 12:18:36 +02:00
Jens Wiklander
1f3ca0ef5b chore(qemu): remove duplicate define
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: Id18abe80ab56fd51a9c2c1206b22d87f1e3871eb
2024-09-04 10:57:20 +02:00
Jimmy Brisson
d744e0f720 chore(imx): remove duplicate define
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
Change-Id: If55d4e2777ca2cdcf55da3b2a60d99f694a2c94d
2024-09-04 10:55:54 +02:00
Jimmy Brisson
f8e31baa9c chore(arm): remove duplicate defines
Change-Id: I9eea1610660bfa92f7781deab60e29eae11c4ba6
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-09-04 10:55:41 +02:00