Commit graph

11065 commits

Author SHA1 Message Date
Johann Neuhauser
51e223058f feat(stm32mp15-fdts): add Avenger96 board with STM32MP157A DHCOR SoM
This should replace the stm32mp157a-avenger96.dts with the new device
tree files split into the STM32MP15 DHCOR SoM definition and the
Avenger96 baseboard like it's done in Linux and U-Boot.

Differences to stm32mp157a-avenger96.dts:
- Enable sdmmc2 for booting from eMMC
- improved clock settings like in U-Boot commit b6055945
  "ARM: dts: stm32: Adjust PLL4 settings on AV96 again"
- improved DDR settings for DHSOMs like in U-Boot commit 92ca0f74
  "ARM: dts: stm32: Synchronize DDR setttings on DH SoMs"

TF-A with this new dts(i) files on this board was fully tested with
the latest OP-TEE developer setup.

Change-Id: I85ce8eca7747965af3555fc19fd7b192dc3e5740
Signed-off-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
2022-08-25 22:11:33 +02:00
Olivier Deprez
0c0bab0cb4 Merge changes from topic "ffa_el3_spmc" into integration
* changes:
  feat(tsp): enable test cases for EL3 SPMC
  feat(tsp): increase stack size for tsp
  feat(tsp): add ffa_helpers to enable more FF-A functionality
2022-08-25 16:28:09 +02:00
Marc Bonnici
15ca1ee342 feat(tsp): enable test cases for EL3 SPMC
Introduce initial test cases to the TSP which are
designed to be exercised by the FF-A Test Driver
in the Normal World. These have been designed to
test basic functionality of the EL3 SPMC.

These tests currently ensure the following functionality:
  - Partition discovery.
  - Direct messaging.
  - Communication with a Logical SP.
  - Memory Sharing and Lending ABIs
  - Sharing of contiguous and non-contiguous memory regions.
  - Memory region descriptors spread of over multiple
    invocations.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: Iaee4180aa18d6b7ac7b53685c6589f0ab306e876
2022-08-25 14:57:20 +01:00
Shruti Gupta
5b7bd2af0b feat(tsp): increase stack size for tsp
TSP testcases for EL3 SPMC have higher stack usage.

Change-Id: Ib5bfdccc6d0f65174e257f3b0e8b41bcd3c704a6
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
2022-08-25 13:37:34 +01:00
Marc Bonnici
e9b1f300a9 feat(tsp): add ffa_helpers to enable more FF-A functionality
Include ffa_helpers originally taken from the TF-A Tests repo
to provide support for additional FF-A functionality.

Change-Id: Iacc3ee270d5e3903f86f8078ed915d1e791c1298
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
2022-08-25 13:37:19 +01:00
Bipin Ravi
748749a870 Merge "fix(errata): workaround for Cortex-A510 erratum 2371937" into integration 2022-08-24 23:46:02 +02:00
Bipin Ravi
ac2605e69a Merge "fix(errata): workaround for Cortex-A78C erratum 2395411" into integration 2022-08-24 23:37:52 +02:00
Akram Ahmad
4b6f0026ea fix(errata): workaround for Cortex-A78C erratum 2395411
Cortex-A78C erratum 2395411 is a Cat B erratum that affects
revisions r0p1 and r0p2, and is currently open. The workaround
is to set CPUACTLR2_EL1[40] to 1, which will disable folding
of demand requests into older prefetches with L2 miss requests
outstanding.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN2004089/latest

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: I4f0fb278ac20a2eb4dd7e4efd1b1246dd85e48c4
2022-08-24 19:46:13 +01:00
Bipin Ravi
e221c55c52 Merge "fix(errata): workaround for Cortex-A710 erratum 2147715" into integration 2022-08-24 20:10:21 +02:00
Akram Ahmad
a67c1b1b2b fix(errata): workaround for Cortex-A510 erratum 2371937
Cortex-A510 erratum 2371937 is a Cat B erratum that applies
to revisions r0p0, r0p1, r0p2, r0p3, r1p0, and r1p1. It is
fixed in r1p2. The workaround is to set the ATOM field of
CPUECTLR_EL1 (bits [40:38]) to 0b010, which will force all
cacheable atomic operations to be executed near.

SDEN can be found here:
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: Ia219a609a3397e39631de65831ecff8a3cd1227e
2022-08-24 16:35:25 +02:00
Olivier Deprez
19037a7100 Merge changes from topic "ffa_el3_spmc" into integration
* changes:
  feat(tsp): add FF-A support to the TSP
  feat(fvp/tsp_manifest): add example manifest for TSP
  fix(spmc): fix relinquish validation check
2022-08-24 16:31:01 +02:00
Achin Gupta
4a8bfdb909 feat(tsp): add FF-A support to the TSP
This patch adds the FF-A programming model in the test
secure payload to ensure that it can be used to test
the following spec features.

1. SP initialisation on the primary and secondary cpus.
2. An event loop to receive direct requests and respond
   with direct responses.
3. Ability to receive messages that indicate power on
   and off of a cpu.
4. Ability to handle a secure interrupt.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Signed-off-by: Shruti <shruti.gupta@arm.com>
Change-Id: I81cf744904d5cdc0b27862b5e4bc6f2cfe58a13a
2022-08-24 14:46:30 +01:00
Bipin Ravi
51efe88344 Merge "feat(qemu): increase size of bl31" into integration 2022-08-24 02:01:02 +02:00
Lauren Wehrmeister
9d5069e72b Merge "build: fix syntax error in semantic ver generation" into integration 2022-08-23 18:33:47 +02:00
Harrison Mutai
d424b8e71a build: fix syntax error in semantic ver generation
Change-Id: I344aa5c779ec3f0a410d3b8bc42b6014a9b37314
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2022-08-23 16:51:13 +01:00
Joanna Farley
5936b5bedb Merge "build: fix semantic ver generation for windows" into integration 2022-08-23 17:01:34 +02:00
Joanna Farley
d97fc8de85 Merge "fix(zynqmp): fix for incorrect afi write mask value" into integration 2022-08-23 10:52:21 +02:00
Akshay Belsare
4264bd33e7 fix(zynqmp): fix for incorrect afi write mask value
Currently, the AFIFM6_WRCTRL bus-width configuration is not happening
correctly due to the wrong register write mask value. To fix this issue
updated the mask value handling logic.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Acked-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Change-Id: I8443c369a84339018310cfb6cd498d21474da3e4
2022-08-23 11:50:52 +05:30
Akram Ahmad
3280e5e655 fix(errata): workaround for Cortex-A710 erratum 2147715
Cortex-A710 erratum 2147715 is a Cat B erratum that applies
to revision r2p0 of the CPU, and is fixed in r2p1. The work-
around is to set CPUACTLR_EL1[22]=1. Setting this will cause
the CFP instruction to invalidate all branch predictor resources
regardless of the context.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1775101/latest

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: I94771bc1fc9b65a0c17d75200ec2b1df8a3279c6
2022-08-22 20:30:36 +02:00
Sandrine Bailleux
49b8b704f9 Merge "fix(lib/psa): update measured boot handle" into integration 2022-08-22 15:07:43 +02:00
Marc Bonnici
3cf080ed61 feat(fvp/tsp_manifest): add example manifest for TSP
Add an example manifest for the EL3 SPMC on the FVP Platform
that allows booting the TSP example partition.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: Ie7f40328e0313abb5b1a121dfdc22a5f7387587f
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
2022-08-21 23:33:58 +01:00
Marc Bonnici
b4c3621e0d fix(spmc): fix relinquish validation check
The current implementation expects that the endpoint IDs of all
participants of a memory transaction to be listed in the relinquish
descriptor. As per the FF-A spec, aside from the current partition
ID, only the IDs of stream endpoints whose behalf it is relinquishing
the memory region must be specified.

The current implementation does not currently support proxy endpoints
therefore ensure that the endpoint count is always equal to 1 and
no stream endpoint IDs are specified and instead just verify the
caller is a valid participant in the memory transaction.

Additionally reuse the updated check in the retrieve request flow
for additional verification.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I3b970196af8a16b2531607775398cb8a2473793b
2022-08-21 23:33:40 +01:00
Madhukar Pappireddy
6c15235526 Merge changes from topic "stm32mp13-updates" into integration
* changes:
  feat(stm32mp1): manage STM32MP13 rev.Y
  feat(stm32mp13-fdts): use STM32MP_DDR_S_SIZE in fw-config
  fix(stm32mp13-fdts): cleanup DT files
  fix(stm32mp13-fdts): update SDMMC max frequency
  fix(stm32mp13-fdts): align sdmmc pins with kernel
2022-08-19 17:20:50 +02:00
Bipin Ravi
3a41658864 Merge "feat(rng-trap): add EL3 support for FEAT_RNG_TRAP" into integration 2022-08-18 22:24:41 +02:00
Juan Pablo Conde
ff86e0b4e6 feat(rng-trap): add EL3 support for FEAT_RNG_TRAP
FEAT_RNG_TRAP introduces support for EL3 trapping of reads of the
RNDR and RNDRRS registers, which is enabled by setting the
SCR_EL3.TRNDR bit. This patch adds a new build flag
ENABLE_FEAT_RNG_TRAP that enables the feature.
This feature is supported only in AArch64 state from Armv8.5 onwards.

Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: Ia9f17aef3444d3822bf03809036a1f668c9f2d89
2022-08-18 15:53:54 -04:00
Bipin Ravi
25c9a4c820 Merge "fix(errata): workaround for Neoverse-N2 erratum 2376738" into integration 2022-08-18 01:04:51 +02:00
Yann Gautier
a3f97f66c3 feat(stm32mp1): manage STM32MP13 rev.Y
The new SoC version for STM32MP13 is the revision Y. The register
SYSCFG_IDC is updated for this new version with the value 0x1003.
The function stm32mp_get_soc_name() should also be updated to manage
this new SoC revision.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I4f2fa5f1503f17db93d8413c79c2b7a18d279f9b
2022-08-17 17:25:45 +02:00
Yann Gautier
936f29f6b5 feat(stm32mp13-fdts): use STM32MP_DDR_S_SIZE in fw-config
Align with STM32MP15 file, use the macro STM32MP_DDR_S_SIZE, instead of
an hard-coded value.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ib31bed1ffe89ff221fab1884a2db729ce1e21846
2022-08-17 17:25:45 +02:00
Yann Gautier
4c07deb53e fix(stm32mp13-fdts): cleanup DT files
Instead of adding all peripheral nodes in SoC DT files, and then
removing them with BL2 overlay file, just remove them from SoC files.
And remove peripherals that are not used in TF-A on STM32MP13.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I0c408d29b55cb94644c92539460fc62485781223
2022-08-17 17:24:30 +02:00
Yann Gautier
c9a4cb552c fix(stm32mp13-fdts): update SDMMC max frequency
On STM32MP13, the max frequency for IOs is 130MHz, update the SDMMC
max-frequency property with this value. This is an alignment with
Linux DT file.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: If4b364f53f87d4b5d276a976af486a3bf083f49b
2022-08-17 17:18:25 +02:00
Yann Gautier
c7ac7d65a7 fix(stm32mp13-fdts): align sdmmc pins with kernel
Update the pinctrl nodes for sdmmc instances in stm32mp13-pinctrl.dtsi
file to align with Linux. The boards DT files then need to be updated
accordingly.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I4e1f3cf78794bfb7bbe53cfc7e88623c7e79855d
2022-08-17 17:18:25 +02:00
Madhukar Pappireddy
afbb10abdc Merge changes from topic "st-mmc-updates" into integration
* changes:
  feat(st-sdmmc2): define FIFO size
  feat(st-sdmmc2): make reset property optional
  feat(st): enable MMC_FLAG_SD_CMD6 for SD-cards
  feat(st-sdmmc2): manage CMD6
  feat(mmc): manage SD Switch Function for high speed mode
2022-08-17 16:33:10 +02:00
Madhukar Pappireddy
51d52c7923 Merge changes from topic "st-etzpc-cleanup" into integration
* changes:
  refactor(stm32mp15-fdts): remove ETZPC status
  refactor(st-drivers): do not rely on DT in etzpc_init
2022-08-17 16:32:55 +02:00
Akram Ahmad
e6602d4b15 fix(errata): workaround for Neoverse-N2 erratum 2376738
Neoverse-N2 erratum 2376738 is a Cat B erratum that applies
to revision r0p0 of the CPU. It is fixed in r0p1. The workaround
is to set CPUACTLR2_EL1[0] to 1 to force PLDW/PFRM ST to
behave like PLD/PRFM LD and not cause invalidations to other
PE caches.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1982442/latest

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: I4ad4434f9b7210244e67046d9657d218857dced5
2022-08-17 11:11:26 +02:00
Yann Gautier
b46f74d4e6 feat(st-sdmmc2): define FIFO size
Instead of using hard-coded values in stm32_sdmmc2_read() function,
use a defined SDMMC_FIFO_SIZE, which is 64 on STM32MP1.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I1ace0a28fbddae474379f0187371b9c360ceb7b3
2022-08-16 15:58:22 +02:00
Yann Gautier
8324b16cd5 feat(st-sdmmc2): make reset property optional
Although not recommended, the reset property could be made optional.
This way the driver will probe even if no reset property is provided
in an sdmmc node in DT. This reset is already optional in Linux.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I6e63ff00118d9497f505d6379982334dd62686ca
2022-08-16 15:58:22 +02:00
Yann Gautier
53d5b8ff50 feat(st): enable MMC_FLAG_SD_CMD6 for SD-cards
This flag allows switching to High-Speed mode on SD-cards.
The gain is ~44ms when using SP_min, and ~55ms with OP-TEE.

Change-Id: Ic396c6a14201580b5e5627e6174b85b437b87cae
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-08-16 15:58:22 +02:00
Yann Gautier
3deebd4ccf feat(st-sdmmc2): manage CMD6
For SD-cards, CMD6 is used to switch functions, like setting high speed
mode. As it has another meaning for eMMC, and may not work on standard
capacity SD-cards, it must be checked with MMC_IS_SD_HC flag.
As ACMD6 is also used, and will have the same index, a check on
CMD/ACMD commands is done: a boolean is stored depending on previous
command. It is set to true if CMD55 is issued, for other commands
it is set to false.

Change-Id: I6c2b9c7637656f858601ec075de1cb5f57af271a
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-08-16 15:58:22 +02:00
Yann Gautier
e5b267bba1 feat(mmc): manage SD Switch Function for high speed mode
On SD-cards, Switch Function Command (CMD6) is used to switch
functions, like setting High Speed mode. It is useful for high capacity
cards to double frequency (from 25MHz by default to 50MHz).
If the SD-card is High Capacity, a CMD6 is issued after filling the
device information. If High Speed mode is supported and the switch is
OK, then the max_bus_freq can be set to 50MHz. The driver set_ios()
function should then be called to update peripheral configuration,
especially clock prescaler.

Change-Id: I2d6807aa7f9440d2b2f907a747cd3b47a2ba1545
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-08-16 15:58:22 +02:00
Harrison Mutai
3aa8fa77f2 build: fix semantic ver generation for windows
Fix syntax error when generating semantic versions on windows hosts.

Change-Id: Idba8827145b829a8ba07ff0540407dbfa1ca7984
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2022-08-16 13:49:35 +01:00
Jens Wiklander
0e6977eee1 feat(qemu): increase size of bl31
Increases the SRAM to a full 1MB and also increase BL31 size to have
room to spare for debugging.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: I584f9d409a1f653a3dfc7cf2b95706ada367c70e
2022-08-16 13:14:16 +02:00
Julius Werner
958b839664 Merge "refactor(bl31): introduce vendor extend rodata section" into integration 2022-08-16 02:12:01 +02:00
Madhukar Pappireddy
a36af977f0 Merge changes from topic "st-clk-cleanup" into integration
* changes:
  refactor(st-clock): code size optimization
  refactor(st-clock): remove unused PLL field
2022-08-15 22:38:59 +02:00
Madhukar Pappireddy
6a5022278b Merge "fix(errata): workaround for Neoverse-V1 erratum 1618635" into integration 2022-08-11 22:51:42 +02:00
Joanna Farley
53be5274ff Merge "fix(build): discard sections also with SEPARATE_NOBITS_REGION" into integration 2022-08-11 22:27:21 +02:00
Bipin Ravi
5d75d71570 Merge "fix(build): disable default PIE when linking" into integration 2022-08-11 19:08:51 +02:00
Madhukar Pappireddy
8f23476e39 Merge "feat(bl): add interface to query TF-A semantic ver" into integration 2022-08-11 18:02:30 +02:00
Samuel Holland
64207f858f fix(build): discard sections also with SEPARATE_NOBITS_REGION
Some linker sections are discarded since 511046eaa2 ("BL31: discard
.dynsym .dynstr .hash sections to make ENABLE_PIE work"). However, that
logic was placed inside a preprocessor condition, so it only applied to
the !SEPARATE_NOBITS_REGION case. Move the /DISCARD/ block down so it
applies in all cases.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I6604609f2321a2a9c32a25721a697c320108a974
2022-08-10 20:23:12 -05:00
Samuel Holland
7b59241845 fix(build): disable default PIE when linking
Commit f7ec31db2d ("Disable PIE compilation option") allowed building a
non-relocatable firmware with a default-PIE toolchain by disabling PIE
at compilation time. This prevents the compiler from generating
relocations against a GOT.

However, when a default-PIE GCC is used as the linker, the final binary
will still be a PIE, containing an (unused) GOT and dynamic symbol
table. These structures do not affect execution, but they waste space in
the firmware binary. Disable PIE at link time to recover this space.

Change-Id: I2be7ac9c1a957f6db8d75efe6e601e9a5760a925
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-08-10 20:23:12 -05:00
Bipin Ravi
f924258da7 Merge "fix(bl31): pass the EA bit to 'delegate_sync_ea'" into integration 2022-08-10 15:45:55 +02:00