Commit graph

11602 commits

Author SHA1 Message Date
Shawn Guo
ad6eb1951b fix(imx8m): update poweroff related SNVS_LPCR bits only
Function imx_system_off() writes SNVS_LPCR register to power off the SoC
without bit masking.  This clears other bits like LPWUI_EN and breaks
the function of SoC wake-up using RTC alarm.  Fix it by updating poweroff
related bits only.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Change-Id: If641af4dc1103c67e1a645c03bb36a5f56665aef
2022-10-26 18:57:39 +08:00
Manish V Badarkhe
cda12ab9c7 Merge "fix(gicv3/multichip): fix overflow caused by left shift" into integration 2022-10-26 09:45:24 +02:00
Madhukar Pappireddy
36d18c542e Merge "fix(stm32mp13-fdts): correct PLL nodes name" into integration 2022-10-24 21:41:31 +02:00
Arvind Ram Prakash
94eb127719 fix(build): fix arch32 build issue for clang
Fixed the qemu 32 bit clang build fail caused because of
no march32 directives in TF_CFLAGS_aarch32 variable

march32_directive is initialized later in Makefile and since clang build
uses Immediate set instead of Lazy set , TF_CFLAGS_aarch32 doesn't
have mcpu variable.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I09094a0912ee2d9d0e11f65135a352de8a135936
2022-10-24 12:06:41 -05:00
Daniel Boulby
8a6a9560b5 feat(compiler-rt): update compiler-rt source files
Update the compiler-rt source files to the tip of the llvm-project [1].
To do this some new header files were pulled in from the freebsd-src
repo [2].

[1] https://github.com/llvm/llvm-project/commit/fae258e
[2] https://github.com/freebsd/freebsd-src/commit/243a0eda

Change-Id: I1a012b1fe04e127d35e208923877c98c5d999d00
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-24 16:49:32 +01:00
Daniel Boulby
93cec697de fix(deps): add missing aeabi_memcpy.S
Add missing aeabi_memcpy.S file from llvm compiler-rt library [1]. This
is required for Aarch32 builds with clang.

[1] https://github.com/llvm/llvm-project.git

Change-Id: I7fd6ab1e81dd45d24afef49a3eb8fcdcbc5c082f
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-24 16:49:32 +01:00
Daniel Boulby
a194255d75 feat(zlib): update zlib source files
Upgrade the zlib source files to the ones present in the version 1.2.13
of zlib [1]. Since 1.2.11 the use of Arm crc32 instructions has been
introduced so update the files to make use of this.

[1] https://github.com/madler/zlib/tree/v1.2.13

Change-Id: Ideef78c56f05ae7daec390d00dcaa8f66b18729e
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-24 16:49:32 +01:00
Daniel Boulby
98a43d9f6c docs(changelog): add zlib and compiler-rt scope
Change-Id: Id98ca7762fd17cb793b0ec9119d0b026195cf2c2
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-24 16:49:26 +01:00
Arthur Cassegrain
e0eea337b3 feat(hikey960): increase secure workspace to 64MB
Common TEE use cases require 64 MB these days, and not just 16 MB.
This in turn requires more XLAT tables to be pre-allocated for BL31.

Change-Id: I85c4033da64785f3e3272b0e9a4da4bceb20fcc7
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-10-24 15:29:30 +02:00
Lukas Hanel
6cfc8078d0 feat(hikey960): upgrade to xlat_tables_v2
Allow 36-bit addresses.
Don't map BL32 memory into BL31 to save space

Change-Id: I033132354dc4b9876f4a384491097b9b5238e700
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-10-24 13:53:44 +02:00
Manish V Badarkhe
891de85507 Merge "fix(rme): relax RME compiler requirements" into integration 2022-10-21 10:17:52 +02:00
Sandrine Bailleux
4e5d262345 Merge changes from topic "imx8m-hab-support" into integration
* changes:
  docs(imx8m): update for high assurance boot
  feat(imx8m): add support for high assurance boot
  feat(imx8mp): add hab and map required memory blocks
  feat(imx8mn): add hab and map required memory blocks
  feat(imx8mm): add hab and map required memory blocks
2022-10-21 09:35:32 +02:00
Jorge Troncoso
25135cebd3 style(linker_script): fix indentation
Use four spaces for indentation to maintain a consistent style. This
attempts to make the linker scripts more friendly for readers.

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: Iaf26d3c8bd7053fd9605a64ebccdae0792a90b9e
2022-10-20 21:49:52 -07:00
Manish V Badarkhe
07dc8ba93b build: deprecate Arm rdn1edge and sgi575 FVP platforms
Arm has decided to deprecate the sgi575 and rdn1edge platforms.
The development of software and fast models for these platforms
has been discontinued. rdn1edge platform has been superseded by the
rdn2 platform, which is already supported in TF-A and CI work is
underway for this platform.

Change-Id: If2228fb73549b244c3a5b0e5746617b3f24fe771
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2022-10-20 19:57:31 +01:00
Marco Felsch
a8e6a2c83c feat(imx8mm): add BL31 PIE support
Enable PIE support so the BL31 firmware can be loaded from anywhere
within the OCRAM (SRAM). For the PIE support we only need to replace the
BL31_BASE define by the BL31_START symbol which is a relocatable and we
need to enable it by setting ENABLE_PIE := 1.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I52e654917167f0faf6aa437da233d8faf1f2bb26
2022-10-20 18:22:43 +02:00
Marco Felsch
40ff8ff8fd refactor(imx8mm): introduce BL2_SIZE and BL31_SIZE
No functional change.

Introduce BLx_SIZE defines and calculate the limits based on the
BLx_BASE and the BLx_SIZE define. Also make use of SZ_128K to make it
easier to read. This is required for later BL31 PIE support since it
drops the calculation based on the BL31_LIMIT and BL31_BASE.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I8670faa5d5a572ef230011594f3d0d594fb257d9
2022-10-20 18:22:43 +02:00
Marco Felsch
0b727248ce refactor(imx8mm): make use of setup_page_tables()
No functional change. Use the setup_page_tables() helper function which
does the three calls for us. Also the function has some logging support
which will be nice during debugging.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: Ic465491ff5468e812e805de56be3b6b92d245080
2022-10-20 18:22:43 +02:00
Marco Felsch
686a5bc894 refactor(imx8mm): cleanup the mmap region settings
No functional change.

Introduce the bl_regions array to gather all regions and make use of the
MAP_REGION_FLAT() macro. The array is than passed to mmap_add() to map
all regions. While on it introduce some defines so the addr, size and
flags can be read more easily.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I9f0ae9fc89514db71bef734b867c46574833831c
2022-10-20 18:22:30 +02:00
Marco Felsch
62d37a4362 feat(imx8mn): add BL31 PIE support
Enable PIE support so the BL31 firmware can be loaded from anywhere
within the OCRAM (SRAM). For the PIE support we only need to replace the
BL31_BASE define by the BL31_START symbol which is a relocatable and we
need to enable it by setting ENABLE_PIE := 1.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I33c8e35c35112d70d2725eebe484a853a8aad9e0
2022-10-20 18:21:33 +02:00
Marco Felsch
796a249c2d refactor(imx8mn): introduce BL31_SIZE
Introduce BL31_SIZE define and calculate the limit based on the
BL31_BASE and the BL31_SIZE define. Also make use of SZ_128K to make it
easier to read. This is required for later BL31 PIE support since it
drops the calculation based on the BL31_LIMIT and BL31_BASE.

While on it remove the duplicated <lib/utils_def.h> include.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: Ifca40bd5682ef993db986439115abd9e9a66a5b2
2022-10-20 18:21:33 +02:00
Marco Felsch
602b3286a5 refactor(imx8mn): make use of setup_page_tables()
No functional change.

Use the setup_page_tables() helper function which does the three calls
for us. Also the function has some logging support which will be nice
during debugging.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I2f0182f19300a3a57bbeb7e2107c5fb5525dd0c1
2022-10-20 18:21:33 +02:00
Marco Felsch
b6ac8cc27e refactor(imx8mn): cleanup the mmap region settings
No functional change.

Introduce the bl_regions array to gather all regions and make use of the
MAP_REGION_FLAT() macro. The array is than passed to mmap_add() to map
all regions. While on it introduce some defines so the addr, size and
flags can be read more easily.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: Id5849d2a7326a943927f458f1c6abbc041f5be18
2022-10-20 18:21:28 +02:00
Marco Felsch
7a443fefa4 feat(imx8mp): add BL31 PIE support
Enable PIE support so the BL31 firmware can be loaded from anywhere
within the OCRAM (SRAM). How important this is shows the back and forth
of the BL31_BASE address starting with TF-A v2.5. Since then the
BL31_BASE address wasn't stable and choosing the correct combination of
SPL version loadaddress and TF-A version loadaddr was tricky.

For the PIE support we only need to replace the BL31_BASE by the
BL31_START which is a relocatable symbol and to enable it by setting
ENABLE_PIE := 1.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I4214db1f27120f9f9cd1413ccd7a5a7d095ff45d
2022-10-20 18:20:27 +02:00
Marco Felsch
5fe51c93f8 refactor(imx8mp): introduce BL2_SIZE and BL31_SIZE
No functional change.

Introduce BLx_SIZE defines and calculate the limits based on the
BLx_BASE and the BLx_SIZE define. Also make use of SZ_128K to make it
easier to read. This is required for later BL31 PIE support since it
drops the calculation based on the BL31_LIMIT and BL31_BASE.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: Idae34c1dfcedd35238fe083149080a199d50eed0
2022-10-20 18:20:27 +02:00
Marco Felsch
c52966f963 refactor(imx8mp): make use of setup_page_tables()
No functional change. Use the setup_page_tables() helper function which
does the three calls for us. Also the function has some logging support
which will be nice during debugging.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I350965414939865220f745ef5b24d2cdc3095e7b
2022-10-20 18:20:27 +02:00
Marco Felsch
c995943de8 refactor(imx8mp): cleanup the mmap region settings
Introduce the bl_regions array to gather all regions and make use of the
MAP_REGION_FLAT() macro. The array is than passed to mmap_add() to map
all regions. While on it introduce some defines so the addr, size and
flags can be read more easily. No functional change done.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I7f637beea61138a86d691cd78fba2dd17e4dc925
2022-10-20 18:20:19 +02:00
Marco Felsch
5d2d3328db feat(imx8m): make psci common code pie compatible
Swap the BL31_BASE define with the BL31_START symbol. This is required
for later added PIE support because the symbol location can be relocated
whereas the define can't be relocated. In case of disabled PIE support
BL31_START equals BL31_BASE and so we don't need a ifdef.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: Ic1bbf3af5b346898bfcbb207ffc27d9a5bdcaae7
2022-10-20 18:16:41 +02:00
Marco Felsch
6c8f523138 fix(imx8m): fix dram retention fsp_table access
The fsp_table access by [i-1] can cause invalid memory access in case of
i=0. This can be the case if no fsp_table is available. Fix this by
adding the idx variable which tracks the correct index.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: If2285517eb9fe837f3ad54360307a77a658bf62c
2022-10-20 18:16:41 +02:00
Andre Przywara
c6877763cd fix(aarch64): make AArch64 FGT feature detection more robust
The ARMv8 ARM says about the values in the ID register scheme:

==== D17.1.3 Principles of the ID scheme for fields in ID registers ===
The ID fields, which are either signed or unsigned, use increasing
numerical values to indicate increases in functionality. Therefore,
if a value of 0x1 indicates the presence of some instructions, then
the value 0x2 will indicate the presence of those instructions plus
some additional instructions or functionality. This means software
can be written in the form:
     if (value >= number) {
         // do something that relies on the value of the feature
     }
=======================================================================

So to check for the presence of a certain architecture feature, we
should not check against a certain specific value, as it's done right
now in several cases.

Relax the test for Fine Grained Trapping (FGT) to just check against
the field being 0 or not.

This fixes TF-A crashing due to an unhandled exception, when running a
Linux kernel on an FVP enabling ARMv8.9 features. The value of
ID_AA64MMFR0_EL1.FGT went from 0b0001 to 0b0010 there.

Change-Id: Ic3f1625a7650306ed388a0660429ca8823c673c2
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-10-20 16:11:26 +01:00
Madhukar Pappireddy
9287a3fa75 Merge "fix(cpus): fix cpu version check for Neoverse N2, V1" into integration 2022-10-20 15:56:57 +02:00
Madhukar Pappireddy
712a32d9ff Merge "fix(cpus): workaround for Cortex-A510 erratum 2666669" into integration 2022-10-20 15:03:13 +02:00
Joanna Farley
4e7983b71d Merge "feat(ethos-n)!: add support for SMMU streams" into integration 2022-10-20 11:04:48 +02:00
Bipin Ravi
03ebf409c7 fix(cpus): fix cpu version check for Neoverse N2, V1
The CPU version check was moved wrongly down in N2 and missing in V1.
The patch fixes the issues.

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Icb6e5285d6cc97fbe416fe1f0b1ab7afbd8a8809
2022-10-19 10:29:16 -05:00
Andrey Zhizhikin
de7e9b562a docs(imx8m): update for high assurance boot
Add a section into documentation listing the support for High Assurance
Boot (HABv4), note on the DRAM mapping, and reference to the external
documentation.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: Iaca97f4ac2595e35de2664a880394519f96eca07
2022-10-19 15:55:15 +02:00
Andrey Zhizhikin
720e7b66f2 feat(imx8m): add support for high assurance boot
Introduce support for High Assurance Boot (HABv4), which is used to
establish and extend the Root-of-Trust during FW loading at any given
boot stage.

This commit introduces support for HAB ROM Vector Table (RVT) API, which
is normally used by post-ROM code to authenticate additional boot images
(Kernel, FDT, FIT, etc.) that are taking part in the Root-of-Trust.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: I780d308369824fa4850844eb9e91768e417166a0
2022-10-19 15:55:15 +02:00
Andrey Zhizhikin
62a93aa7af feat(imx8mp): add hab and map required memory blocks
In order for HAB to perform operations, memory regions has to be mapped
in TF-A, which HAB ROM code would use internally.

Include those memory blocks for i.MX8M+ SoC. Of a special note, the DRAM
block is mapped with complete size available on the platform and uses
MT_RW attributes, this is required to minimize the size of translation
tables and provide a possibility to exchange the execution results
between EL3 and EL1&2, see details in [1].

Link: [1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16880
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: I986cdce434d1ec9ea8b3c0d5599edde55b9b30f8
2022-10-19 15:54:39 +02:00
Andrey Zhizhikin
b5f06d3dfa feat(imx8mn): add hab and map required memory blocks
In order for HAB to perform operations, memory regions has to be mapped
in TF-A, which HAB ROM code would use internally.

Include those memory blocks for i.MX8MN SoC. Of a special note, the DRAM
block is mapped with complete size available on the platform and uses
MT_RW attributes, this is required to minimize the size of translation
tables and provide a possibility to exchange the execution results
between EL3 and EL1&2, see details in [1].

Link: [1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16880
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: If7a2b718658db452871e1ae56b71a4983e8ef2fe
2022-10-19 15:53:01 +02:00
Andrey Zhizhikin
5941f37288 feat(imx8mm): add hab and map required memory blocks
In order for HAB to perform operations, memory regions has to be mapped
in TF-A, which HAB ROM code would use internally.

Include those memory blocks for i.MX8MM SoC. Of a special note, the DRAM
block is mapped with complete size available on the platform and uses
MT_RW attributes, this is required to minimize the size of translation
tables and provide a possibility to exchange the execution results
between EL3 and EL1&2, see details in [1].

Link: [1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16880
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: I6a3a3d7105b85c2f4ab6ea6cfbca67c9a325eb11
2022-10-19 15:47:39 +02:00
Daniel Boulby
94b2f94bd6 feat(libfdt): upgrade libfdt source files
Update the libfdt source files to the upstream commit e37c256 [1].

[1] https://github.com/dgibson/dtc/commit/e37c256

Change-Id: I00e29b467ff6f8c094f68245232a7cedeaa14aef
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-19 14:07:46 +01:00
Daniel Boulby
81f4abb8ec docs(prerequisites): upgrade to Mbed TLS 2.28.1
In anticpation of the next Trusted Firmware release update the to newest
2.x Mbed TLS library [1].

Note that the Mbed TLS project published version 3.x some time ago.
However, as this is a major release with API breakages, upgrading to
this one might require some more involved changes in TF-A, which we are
not ready to do. We shall upgrade to Mbed TLS 3.x after the v2.8 release
of TF-A.

[1] https://github.com/Mbed-TLS/mbedtls/tree/v2.28.1

Change-Id: I7594ad062a693d2ecc3b1705e944dce2c3c43bb2
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-10-19 11:53:56 +01:00
Sandrine Bailleux
61fe7826d8 Merge "feat(fvp): build delegated attestation in BL31" into integration 2022-10-18 16:20:05 +02:00
Vivek Gautam
108488f9ac feat(rdn2): enable extended SPI support
Enable the GIC_EXT_INTID configuration to support extended interrupt
IDs for RD-N2 multichip platform.

Signed-off-by: Vivek Gautam <vivek.gautam@arm.com>
Change-Id: Ic8d59ba0e692e5f13f3cdeffc64d76cd4741aa11
2022-10-17 21:58:44 +05:30
Vivek Gautam
9f0835e915 feat(rdn2): add SPI ID ranges for RD-N2 multichip platform
Add the SPI ID ranges for various chips on RD-N2 multichip platform
(rdn2cfg2). Also fix the max SPI ID for chip#0 that was incorrectly
set.
The SPI ranges for rdn2cfg2 platform are as shown below:
============================================
Chip# |  CHIP_START_INTID  |  CHIP_END_INTID
============================================
0     |     32             |    511
1     |     512            |    991
2     |     4096           |    4575
3     |     4576           |    5055

Signed-off-by: Vivek Gautam <vivek.gautam@arm.com>
Change-Id: I146944af1ffe52c300eef2ef48b1077a9559bf41
2022-10-17 21:58:44 +05:30
André Przywara
cf17f7c456 Merge "chore(rpi3): remove redundant code" into integration 2022-10-17 15:57:40 +02:00
Manish V Badarkhe
70360382b3 Merge "docs(maintainers): add NPU driver owners" into integration 2022-10-17 15:20:19 +02:00
Mikael Olsson
60c4394357 docs(maintainers): add NPU driver owners
Code owners have been added for the Arm(R) Ethos(TM)-N NPU driver.

Change-Id: I0bda0d95151cdff5cd3a793c6c0e9ef6a9a5f50b
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2022-10-17 11:04:14 +02:00
Joanna Farley
e504ce5fae Merge "fix(versal_net): Enable a78 errata workarounds" into integration 2022-10-14 19:58:35 +02:00
Akshay Belsare
bcc6e4a02a fix(versal_net): Enable a78 errata workarounds
TF-A is reporting that erratum are missing to be enabled.

Enable the Following errata workaround to Cortex-A78 AE CPU for versal_net
ERRATA_A78_AE_1941500
ERRATA_A78_AE_1951502
ERRATA_A78_AE_2376748
ERRATA_A78_AE_2395408

For further information refer to
https://developer.arm.com/documentation/SDEN1707912/1300/

Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Change-Id: Ib7fc16e035feab1dfbd88c1f8ce128b057eee86d
2022-10-14 17:52:58 +05:30
Akram Ahmad
afb5d069a6 fix(cpus): workaround for Cortex-A510 erratum 2666669
Cortex-A510 erratum 2666669 applies to revisions r1p1 and lower,
and is fixed in r1p2. The errata is mitigated by setting
IMP_CPUACTLR_EL1[38] to 1.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1873351/latest
https://developer.arm.com/documentation/SDEN1873361/latest

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: Ief27e4a155e43e75f05f2710d0c7bd5da2dec43f
2022-10-13 16:19:50 -05:00
Sandrine Bailleux
0271eddb0c feat(fvp): build delegated attestation in BL31
Right now, the delegated attestation module is not used in TF-A. This
means it's not even getting built and so the CI system cannot detect
build regressions.

Eventually, delegated attestation will be involved in a new runtime
service exposed by BL31 to lower exception levels. We are not there
yet but let's already include it into BL31 image, so we get build
coverage and static analysis on the code. Note that we make sure to
cover both PLAT_RSS_NOT_SUPPORTED=0 and PLAT_RSS_NOT_SUPPORTED=1
configurations.

Delegated attestation is currently made dependent on measured boot
support. This dependency is not at the source code level (attestation
code does not invoke any measured boot interfaces) but it is rather a
logical dependency: attestation without boot measurements is not very
useful...

For now, this is good enough for our purpose but the conditions under
which the attestation code is included might change in the future.

Change-Id: I616715c3dd0418a1bbf1019df3ff9acd8461e705
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-10-13 15:36:38 +02:00