Commit graph

5672 commits

Author SHA1 Message Date
Manish V Badarkhe
54b3fc63e4 Merge "feat(qti): updated soc version for sc7180 and sc7280" into integration 2022-11-04 18:55:26 +01:00
Olivier Deprez
07217574af Merge changes from topic "hikey960-el3-spmc" into integration
* changes:
  feat(hikey960): read serial number from UFS
  feat(hikey960): add a FF-A logical partition
  feat(hikey960): add memory sharing hooks for SPMC_AT_EL3
  feat(hikey960): add plat-defines for SPMC_AT_EL3
  feat(hikey960): define a datastore for SPMC_AT_EL3
  feat(hikey960): add SP manifest for SPMC_AT_EL3
  feat(hikey960): increase secure workspace to 64MB
  feat(hikey960): upgrade to xlat_tables_v2
2022-11-04 10:47:54 +01:00
Bharath N
39fdd3d85d feat(qti): updated soc version for sc7180 and sc7280
SMCCC_GET_SOC_VERSION SMC will return soc id to distinguish
different varaints in sc7180 and sc7280

Signed-off-by: Bharath N <quic_bharn@quicinc.com>
Change-Id: I72ea4bdb8193c816ba249c1e0755784c9b9bb7da
2022-11-03 16:29:13 +05:30
Arthur Cassegrain
c371b83f0c feat(hikey960): read serial number from UFS
Serial number is written into UFS by fastboot
Pass BL2 params to BL31 (serial number)

Change-Id: I9a490db07ca10088da69191a2f2c1621d44a278c
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:03 +01:00
Lukas Hanel
25a357f193 feat(hikey960): add a FF-A logical partition
Required to compile with SPMC_AT_EL3=1
Copied from FVP, sample code for platforms

Change-Id: I7d8a4d8846a328b05cf45a5044802ea3e2f7fb67
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:03 +01:00
vallau01
5f905a2498 feat(hikey960): add memory sharing hooks for SPMC_AT_EL3
These allows a platform to do any System-MMU/IOMMU configuration
in line with FF-A memory sharing.

Change-Id: Id517759198421a32c5d16bf5bb99590275e77736
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:03 +01:00
Lukas Hanel
feebd4c7a8 feat(hikey960): add plat-defines for SPMC_AT_EL3
To use SPMC_AT_EL3, a platform must define a few configuration
options. Copied them from fvp platform to hikey960.

Change-Id: Ifd60d69bf79f2f340fe93fe030ab8c538b3a56e4
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:03 +01:00
Lukas Hanel
e618c621b3 feat(hikey960): define a datastore for SPMC_AT_EL3
Kinibi now has 60MB (instead of 64MB).
Increase XLAT tables for BL31

Change-Id: I6843d26198a7d8bdb812e394e4482b1c35afa4c0
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:03 +01:00
Lukas Hanel
6971642d23 feat(hikey960): add SP manifest for SPMC_AT_EL3
The purpose of this patch is to show silicon partners how to upgrade
existing TF-A port to include a manifest that is required with FF-A.

The manifest values are consumed by TF-A SPMC_AT_EL3 and by the TEE.

Change-Id: Ied81187d6b1cfb72ad2e9020dfc19ad73d80186f
Signed-off-by: Cedric Chan <cedric.chan@trustonic.com>
Signed-off-by: vallau01 <valentin.laurent@trustonic.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
2022-11-02 15:35:00 +01:00
Madhukar Pappireddy
b139f8527e Merge "feat(imx8mm): add BL31 PIE support" into integration 2022-11-01 15:16:07 +01:00
Madhukar Pappireddy
c41a196f56 Merge "refactor(imx8mm): introduce BL2_SIZE and BL31_SIZE" into integration 2022-11-01 15:16:03 +01:00
Madhukar Pappireddy
473bed8ffd Merge "refactor(imx8mm): make use of setup_page_tables()" into integration 2022-11-01 15:15:52 +01:00
Madhukar Pappireddy
a213c27ba7 Merge "refactor(imx8mm): cleanup the mmap region settings" into integration 2022-11-01 15:15:45 +01:00
Madhukar Pappireddy
d81fc8e60e Merge "feat(imx8mn): add BL31 PIE support" into integration 2022-11-01 15:15:04 +01:00
Madhukar Pappireddy
89cb9c579e Merge "refactor(imx8mn): introduce BL31_SIZE" into integration 2022-11-01 15:14:58 +01:00
Madhukar Pappireddy
ebaf46c8e3 Merge "refactor(imx8mn): make use of setup_page_tables()" into integration 2022-11-01 15:14:53 +01:00
Madhukar Pappireddy
d907a04988 Merge "refactor(imx8mn): cleanup the mmap region settings" into integration 2022-11-01 15:14:48 +01:00
Madhukar Pappireddy
5178175c50 Merge "feat(imx8mp): add BL31 PIE support" into integration 2022-11-01 15:14:41 +01:00
Madhukar Pappireddy
c564d817e4 Merge "refactor(imx8mp): introduce BL2_SIZE and BL31_SIZE" into integration 2022-11-01 15:14:36 +01:00
Madhukar Pappireddy
2668742c87 Merge "refactor(imx8mp): make use of setup_page_tables()" into integration 2022-11-01 15:14:30 +01:00
Madhukar Pappireddy
f8f2440fdc Merge "refactor(imx8mp): cleanup the mmap region settings" into integration 2022-11-01 15:14:25 +01:00
Madhukar Pappireddy
8f93151aac Merge "feat(imx8m): make psci common code pie compatible" into integration 2022-11-01 15:14:16 +01:00
Madhukar Pappireddy
0f0a9dbfa7 Merge "fix(imx8m): fix dram retention fsp_table access" into integration 2022-11-01 15:14:10 +01:00
Manish Pandey
0ccce52362 Merge "fix(mediatek): switch console to runtime state before leaving BL31" into integration 2022-11-01 12:44:02 +01:00
Manish Pandey
6325f661c2 Merge "build: deprecate Arm rdn1edge and sgi575 FVP platforms" into integration 2022-10-31 11:23:45 +01:00
Bipin Ravi
92b62c16b7 Merge changes I7d3a97df,I5935b4bc,I9a325c5b,Ie29bd3a5,Iebb90cf2 into integration
* changes:
  fix(cpus): workaround for Cortex-A710 erratum 2291219
  fix(cpus): workaround for Cortex-X3 erratum 2313909
  fix(cpus): workaround for Neoverse-N2 erratum 2326639
  fix(rpi3): tighten platform pwr_domain_pwr_down_wfi behaviour
  chore: rename Makalu ELP to Cortex-X3
2022-10-27 19:21:46 +02:00
Boyan Karatotev
028c4e42d8 fix(rpi3): tighten platform pwr_domain_pwr_down_wfi behaviour
Platforms which implement pwr_domain_pwr_down_wfi differ substantially
in behaviour. However, different cpus require similar sequences to power
down. This patch tightens the behaviour of these platforms to end on a
wfi loop after performing platform power down. This is required so that
platforms behave more consistently on power down, in cases where the wfi
can fall through.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ie29bd3a5e654780bacb4e07a6d123ac6d2467c1f
2022-10-27 13:46:02 +01:00
Rex-BC Chen
fcf4dd9f79 fix(mediatek): switch console to runtime state before leaving BL31
We should switch console to runtime state. If we don't do this, the
state will keep boot state even we exit from BL31.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: Id2269ccf2fdc22e0fa088c3c0365836730172233
2022-10-26 21:24:25 +08:00
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
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
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
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
Joanna Farley
4e7983b71d Merge "feat(ethos-n)!: add support for SMMU streams" into integration 2022-10-20 11:04:48 +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