Commit graph

10804 commits

Author SHA1 Message Date
laurenw-arm
147f52f3e8 feat(fiptool): add cca, core_swd, plat cert in FIP
Added support for cca CoT in the fiptool by adding the cca,
core_swd, and plat key certificates.

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I1ba559e188ad8c33cb0e643d7a2fc6fb96736ab9
2022-06-14 09:47:37 -05:00
laurenw-arm
0a6bf811d7 feat(cert_create): define the cca chain of trust
Selection of the cca chain of trust is done through the COT build
option:

> make COT=cca

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I123c0a841f67434633a3123cc1fa3e2318585482
2022-06-14 09:47:37 -05:00
laurenw-arm
56b741d3e4 feat(cca): introduce new "cca" chain of trust
This chain of trust is targeted at Arm CCA solutions and defines 3
independent signing domains:

1) CCA signing domain. The Arm CCA Security Model (Arm DEN-0096.A.a) [1]
refers to the CCA signing domain as the provider of CCA components
running on the CCA platform. The CCA signing domain might be independent
from other signing domains providing other firmware blobs.

The CCA platform is a collective term used to identify all hardware and
firmware components involved in delivering the CCA security guarantee.
Hence, all hardware and firmware components on a CCA enabled system that
a Realm is required to trust.

In the context of TF-A, this corresponds to BL1, BL2, BL31, RMM and
associated configuration files.

The CCA signing domain is rooted in the Silicon ROTPK, just as in the
TBBR CoT.

2) Non-CCA Secure World signing domain. This includes SPMC (and
associated configuration file) as the expected BL32 image as well as
SiP-owned secure partitions. It is rooted in a new SiP-owned key called
Secure World ROTPK, or SWD_ROTPK for short.

3) Platform owner signing domain. This includes BL33 (and associated
configuration file) and the platform owner's secure partitions. It is
rooted in the Platform ROTPK, or PROTPK.

[1] https://developer.arm.com/documentation/DEN0096/A_a

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I6ffef3f53d710e6a2072fb4374401249122a2805
2022-06-14 09:47:37 -05:00
laurenw-arm
55ae7715ca build(changelog): add new scope for CCA
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: Iccba57a292e6668e6a6d93f1cb0e1633592a4009
2022-06-14 09:47:37 -05:00
laurenw-arm
25514123a6 refactor(fvp): increase bl2 size when bl31 in DRAM
Increase the space for BL2 by 0xC000 to accommodate the increase in size
of BL2 when ARM_BL31_IN_DRAM is set.

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: Ifc99da51f2de3c152bbed1c8269dcc8b9100797a
2022-06-14 09:47:32 -05:00
Madhukar Pappireddy
7460c41d27 Merge "fix(mmc): remove broken, unsecure, unused eMMC RPMB handling" into integration 2022-06-09 16:23:04 +02:00
Soby Mathew
65841e6660 Merge "fix(rme/fid): refactor RME fid macros" into integration 2022-06-08 13:37:33 +02:00
Ahmad Fatoum
86b015eb1b fix(mmc): remove broken, unsecure, unused eMMC RPMB handling
Replay-protected memory block access is enabled by writing 0x3
to PARTITION_ACCESS (bit[2:0]). Instead the driver is using the
first boot partition, which does not provide any playback protection.
Additionally, it unconditionally activates the first boot partition,
potentially breaking boot for SoCs that consult boot partitions,
require boot ack or downgrading to an old bootloader if the first
partition happens to be the inactive one.

Also, neither enabling or disabling the RPMB observes the
PARTITION_SWITCH_TIME. As there are no in-tree users for these
functions, drop them for now until a properly functional implementation
is added. That one will likely share most code with the existing boot
partition switch, which doesn't suffer from the described issues.

Change-Id: Ia4a3f738f60a0dbcc33782f868cfbb1e1c5b664a
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
2022-06-08 08:57:05 +02:00
Madhukar Pappireddy
925ce79136 Merge changes from topic "stm32mp-emmc-boot-fip" into integration
* changes:
  feat(stm32mp1): extend STM32MP_EMMC_BOOT support to FIP format
  refactor(mmc): replace magic value with new PART_CFG_BOOT_PARTITION_NO_ACCESS
  refactor(mmc): export user/boot partition switch functions
2022-06-08 00:14:59 +02:00
Madhukar Pappireddy
60942bc9d5 Merge changes from topic "st-pinctrl" into integration
* changes:
  feat(stm32mp1-fdts): change pin-controller to pinctrl
  feat(st): search pinctrl node by compatible
2022-06-07 16:47:12 +02:00
Yann Gautier
44fea93bf7 feat(stm32mp1-fdts): change pin-controller to pinctrl
Due to commit updating kernel yaml file [1], we need to align TF-A DT
files to what is done in kernel.

[1] c09acbc499e8 ("dt-bindings: pinctrl: use pinctrl.yaml")

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id717162e42d3959339d6c01883e87a9d4399f5d9
2022-06-07 15:36:37 +02:00
Yann Gautier
b14d3e22b4 feat(st): search pinctrl node by compatible
Instead of searching pinctrl node with its name, search with its
compatible. This will be necessary before pin-controller name changes
to pinctrl due to kernel yaml changes.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I00590414fa65e193c6a72941a372bcecac673f60
2022-06-07 15:36:24 +02:00
Manish Pandey
65a5e1c04d Merge "fix(changelog): fix the broken link to commitlintrc.js" into integration 2022-06-07 14:05:42 +02:00
Jayanth Dodderi Chidanand
c1284a7f93 fix(changelog): fix the broken link to commitlintrc.js
The link to commitlintrc.js file in the v2.7 changelog
is updated.

Change-Id: I24ee736180d8df72b2d831e110a9a3a80a6d9862
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-06-07 12:06:18 +01:00
Subhasish Ghosh
fb00dc4a7b fix(rme/fid): refactor RME fid macros
Refactored RME FID macros to simplify usage.

Signed-off-by: Subhasish Ghosh <subhasish.ghosh@arm.com>
Change-Id: I68f51f43d6c100d90069577412c2e495fe7b7e40
2022-06-06 17:15:15 +02:00
Madhukar Pappireddy
938dfa2968 Merge "feat(imx8mq): add 100us delay after USB OTG SRC bit 0 clear" into integration 2022-06-06 16:18:20 +02:00
Madhukar Pappireddy
8634793e97 Merge "fix(imx8mq): correct architected counter frequency" into integration 2022-06-06 16:17:00 +02:00
Madhukar Pappireddy
5e529e32ee Merge "fix(plat/zynqmp): fix coverity scan warnings" into integration 2022-06-03 19:44:00 +02:00
Madhukar Pappireddy
950dc3a191 Merge "feat(plat/xilinx/zynqmp): optimization on pinctrl_functions" into integration 2022-06-02 19:33:24 +02:00
Madhukar Pappireddy
6765635178 Merge changes Idafbe02d,Ib01eb5ce into integration
* changes:
  fix(scmi-msg): base: fix protocol list querying
  fix(scmi-msg): base: fix protocol list response size
2022-06-02 17:39:57 +02:00
Ahmad Fatoum
95e4908e17 feat(stm32mp1): extend STM32MP_EMMC_BOOT support to FIP format
STM32MP_EMMC_BOOT allowed placing SSBL into the eMMC boot
partition along with FSBL. This allows atomic update of both
FSBL and SSBL at the same time. Previously, this was only
possible for the FSBL, as the eMMC layout expected by TF-A
had a single SSBL GPT partition in the eMMC user area.
TEE binaries remained in dedicated GPT partitions whether
STM32MP_EMMC_BOOT was on or off.

The new FIP format collects SSBL and TEE partitions into
a single binary placed into a GPT partition.
Extend STM32MP_EMMC_BOOT, so eMMC-booted TF-A first uses
a FIP image placed at offset 256K into the active eMMC boot
partition. If no FIP magic is detected at that offset or if
STM32MP_EMMC_BOOT is disabled, the GPT on the eMMC user area
will be consulted as before.

This allows power fail-safe update of all firmware using the
built-in eMMC boot selector mechanism, provided it fits into
the boot partition - SZ_256K. SZ_256K was chosen because it's
the same offset used with the legacy format and because it's
the size of the on-chip SRAM, where the STM32MP15x BootROM
loads TF-A into. As such, TF-A may not exceed this size limit
for existing SoCs.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Change-Id: Id7bec45652b3a289ca632d38d4b51316c5efdf8d
2022-06-02 17:28:33 +02:00
Ahmad Fatoum
01c5dd5e59 refactor(mmc): replace magic value with new PART_CFG_BOOT_PARTITION_NO_ACCESS
Disabling access to the boot partition reverts the MMC to read from the
user area. Add a macro to make this clearer.

Suggested-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Change-Id: I34a5a987980bb4690d08d255f465b11a4697ed5a
2022-06-02 17:28:33 +02:00
Ahmad Fatoum
f85041a657 refactor(mmc): export user/boot partition switch functions
At the moment, mmc_boot_part_read_blocks() takes care to switch
to the boot partition before transfer and back afterwards.
This can introduce large overhead when reading small chunks.
Give consumers of the API more control by exporting
mmc_part_switch_current_boot() and mmc_part_switch_user().

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Change-Id: Ib641f188071bb8e0196f4af495ec9ad4a292284f
2022-06-02 17:28:03 +02:00
Madhukar Pappireddy
ed96c5322f Merge "fix(lib/psa): fix Null pointer dereference error" into integration 2022-06-02 17:26:53 +02:00
Madhukar Pappireddy
87f76d3140 Merge "fix(stm32mp1): fdts: stm32mp1: align DDR regulators with new driver" into integration 2022-06-02 17:12:24 +02:00
Ahmad Fatoum
9eed71b722 fix(stm32mp1): fdts: stm32mp1: align DDR regulators with new driver
With recent changes, TF-A now panics on MC-1, Avenger96 and Odyssey:

  NOTICE:  CPU: STM32MP157C?? Rev.B
  NOTICE:  Model: Linux Automation MC-1 board
  ERROR:   regul ldo3: max value 750 is invalid
  PANIC at PC : 0x2ffeebb7

as the driver takes great offense at the content of the device
tree. The parts in question were copy-pasted from ST DTs, but
those ST DTs were fixed by commit 67d95409ba
("refactor(stm32mp1-fdts): update regulator description").

Fix the breakage by transplanting the same changes into all
remaining STM32MP1 DTs.

Change was boot-tested on MC-1, but only build tested for the
other two.

Fixes: bba9fdee58 ("feat(stm32mp1): add regulator framework compilation")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Change-Id: I143d0091625f62c313b3b71449c9ad99583d01c8
2022-06-02 06:47:20 +02:00
Joanna Farley
35f4c7295b Merge "docs(changelog): changelog for v2.7 release" into integration 2022-06-01 17:02:46 +02:00
Jayanth Dodderi Chidanand
24c5d206f1 docs(changelog): changelog for v2.7 release
Change-Id: I573e5eb3c7fad097892292c8a967dc02d72d12e6
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-06-01 15:19:37 +01:00
Joanna Farley
ae9853490b Merge changes from topic "sb/threat-model" into integration
* changes:
  docs(threat-model): broaden the scope of threat #05
  docs(threat-model): emphasize whether mitigations are implemented
2022-06-01 14:37:30 +02:00
Joanna Farley
7048400a79 Merge changes from topic "od/spm-doc-update" into integration
* changes:
  docs(spm): refresh FF-A SPM design doc
  docs(spm): update FF-A manifest binding
2022-06-01 14:29:45 +02:00
Olivier Deprez
9eea92a1f2 docs(spm): refresh FF-A SPM design doc
- Move manifest binding doc as a dedicated SPM doc section.
- Highlight introduction of an EL3 FF-A SPM solution.
- Refresh TF-A build options.
- Refresh PE MMU configuration section.
- Add arch extensions for security hardening section.
- Minor corrections, typos fixes and rephrasing.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I2db06c140ef5871a812ce00a4398c663d5433bb4
2022-06-01 13:27:17 +02:00
Olivier Deprez
79a913812f docs(spm): update FF-A manifest binding
- Add security state attribute to memory and device regions.
- Rename device region reg attribution to base-address aligned with
  memory regions.
- Add pages-count field to device regions.
- Refresh interrupt attributes description in device regions.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I901f48d410edb8b10f65bb35398b80f18105e427
2022-06-01 10:58:32 +02:00
Sandrine Bailleux
0677796cb6 docs(threat-model): broaden the scope of threat #05
- Cite crash reports as an example of sensitive
   information. Previously, it might have sounded like this was the
   focus of the threat.

 - Warn about logging high-precision timing information, as well as
   conditionally logging (potentially nonsensitive) information
   depending on sensitive information.

Change-Id: I33232dcb1e4b5c81efd4cd621b24ab5ac7b58685
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-05-31 08:41:31 +02:00
Sandrine Bailleux
7e32cdb21e docs(threat-model): emphasize whether mitigations are implemented
For each threat, we now separate:
 - how to mitigate against it;
 - whether TF-A currently implements these mitigations.

A new "Mitigations implemented?" box is added to each threat to
provide the implementation status. For threats that are partially
mitigated from platform code, the original text is improved to make
these expectations clearer. The hope is that platform integrators will
have an easier time identifying what they need to carefully implement
in order to follow the security recommendations from the threat model.

Change-Id: I8473d75946daf6c91a0e15e61758c183603e195b
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-05-31 08:35:15 +02:00
Olivier Deprez
ccfa411bcd Merge changes from topic "ja/boot_protocol" into integration
* changes:
  docs(spm): update ff-a boot protocol documentation
  docs(maintainers): add code owner to sptool
2022-05-30 16:50:10 +02:00
Manish Pandey
1664692106 Merge "fix(include/aarch64): fix encodings for MPAMVPM* registers" into integration 2022-05-26 11:30:34 +02:00
J-Alves
573ac37373 docs(spm): update ff-a boot protocol documentation
Updated following sections to document implementation of the FF-A boot
information protocol:
- Describing secure partitions.
- Secure Partition Packages.
- Passing boot data to the SP.
Also updated description of the manifest field 'gp-register-num'.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I5c856437b60cdf05566dd636a01207c9b9f42e61
2022-05-25 16:58:28 +01:00
Varun Wadekar
b9e2c7738c Merge "fix(cpus/denver): use CPU_NO_EXTRA3_FUNC for all variants" into integration 2022-05-25 13:52:40 +02:00
Varun Wadekar
e92655849d fix(include/aarch64): fix encodings for MPAMVPM* registers
This patch fixes the following encodings in the System register
encoding space for the MPAM registers. The encodings now match
with the Arm® Architecture Reference Manual Supplement for MPAM.

* MPAMVPM0_EL2
* MPAMVPM1_EL2
* MPAMVPM2_EL2
* MPAMVPM3_EL2
* MPAMVPM4_EL2
* MPAMVPM5_EL2
* MPAMVPM6_EL2
* MPAMVPM7_EL2
* MPAMVPMV_EL2

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: Ib339412de6a9c945a3307f3f347fe7b2efabdc18
2022-05-25 13:51:55 +02:00
Jacky Bai
66345b8b13 feat(imx8mq): add 100us delay after USB OTG SRC bit 0 clear
After the SRC bit clear, we must wait for a while to make sure
the operation is finished. And don't enable all the PU domains
by default.

for USB OTG, the limitations are:
1. before system clock configuration. ipg clock runs at 12.5MHz.
delay time should longer than 82us.

2. after system clock configuration. ipg clock runs at 66.5MHz.
delay time should longer than 15.3us.

so add udelay 100 to safely clear the SRC bit 0.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: I52e8e7739fdaaf86442bcd148e768b6af38bcdb7
2022-05-25 10:37:41 +08:00
J-Alves
77b73416d3 docs(maintainers): add code owner to sptool
Add Joao Alves as code owner to the sptool.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I9e44e322ba1cce62308bf16c4a6253f7b0117fe0
2022-05-24 16:27:21 +01:00
Varun Wadekar
b2ed99894d fix(cpus/denver): use CPU_NO_EXTRA3_FUNC for all variants
Denver CPUs use the same workaround for CVE-2017-5715 and CVE-2022-23960
vulnerabilities. The workaround for CVE-2017-5715 is always enabled, so
all Denver variants use CPU_NO_EXTRA3_FUNC as a placeholder for the
mitigation for CVE-2022-23960. This patch implements the approach.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I0863541ce19b6b3b6d1b2f901d3fb6a77f315189
2022-05-24 15:32:33 +01:00
Manish Pandey
10534b3eda Merge "fix(build): use DWARF 4 when building debug" into integration 2022-05-24 15:30:27 +02:00
Olivier Deprez
f7ad743470 Merge changes from topic "ffa_el3_spmc" into integration
* changes:
  fix(spmc): fix incorrect FF-A version usage
  fix(spmc): fix FF-A memory transaction validation
2022-05-24 15:04:16 +02:00
Lucas Stach
21189b8e21 fix(imx8mq): correct architected counter frequency
Different from other i.MX SoCs, which typically use a 24MHz reference clock,
the i.MX8MQ uses a 25MHz reference clock. As the architected timer clock
frequency is directly sourced from the reference clock via a /3 divider this
SoC runs the timers at 8.33MHz.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Change-Id: Ief36af9ffebce7cb75a200124134828d3963e744
2022-05-23 12:31:53 +02:00
Ronak Jain
314f9f7957 feat(plat/xilinx/zynqmp): optimization on pinctrl_functions
Optimizing the pinctrl_functions structure. Remove the pointer to
array of u16 type which consumes a lot of memory (64bits pointer to
array + 16B for END_OF_GROUPS + almost useless 8bits on every entry
which is the same for every group) and add two new members of type
u16 and u8 with the name called group_base and group_size
respectively.

The group_base member contains the base value of pinctrl group whereas
the group_size member contains the total number of groups requested
from the pinctrl function.

Overall, it saves around ~2KB of RAM and ~0.7KB of code memory.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
Change-Id: I79b761b45df350d390fa344d411b340d9b2f13ac
2022-05-23 01:03:53 -07:00
David Vincze
c32ab75c41 fix(lib/psa): fix Null pointer dereference error
Fixing possible Null pointer dereference error, found
by Coverity scan.

Change-Id: If60b7f7e13ecbc3c01e3a9c5005c480260bbabdd
Signed-off-by: David Vincze <david.vincze@arm.com>
2022-05-23 08:57:28 +02:00
Marc Bonnici
25eb2d41a6 fix(spmc): fix incorrect FF-A version usage
Fix the wrong FF-A version being used for retrieving existing memory
descriptors for v1.0 clients. Internally these should always be stored
using the latest version rather than client version.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: Ibee1b2452c8d6ebd23bbd9d703c96ca185444093
2022-05-20 14:45:58 +01:00
Marc Bonnici
3954bc3c03 fix(spmc): fix FF-A memory transaction validation
Fix an incorrect bound check for overlapping memory regions which can
give false positives if the two regions are consecutive to each other.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I997dc4d1ef2014660cc964aff0a73e348c44eff0
2022-05-20 14:34:56 +01:00
Daniel Boulby
4466cf8255 fix(build): use DWARF 4 when building debug
GCC 11 and Clang 14 now use the DWARF 5 standard by default however
Arm-DS currently only supports up to version 4. Therefore, for debug
builds, ensure the DWARF 4 standard is used.
Also update references for Arm DS-5 to it's successor Arm-DS (Arm
Development Studio).

Change-Id: Ica59588de3d121c1b795b3699f42c31f032cee49
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2022-05-20 14:32:56 +01:00