Commit Graph

11359 Commits

Author SHA1 Message Date
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
Venkatesh Yadav Abbarapu
86869f99d0 feat(zynqmp): add support for xck24 silicon
Add support for new xck24 device.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I913a34d5a48ea665aaa4348f573fc59566dd5a9b
2022-06-07 10:03:34 +05:30
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
Jayanth Dodderi Chidanand
47c681b7d7 feat(trbe): add trbe under feature detection mechanism
This change adds "FEAT_TRBE" to be part of feature detection mechanism.

Previously feature enablement flags were of boolean type, containing
either 0 or 1. With the introduction of feature detection procedure
we now support three states for feature enablement build flags(0 to 2).

Accordingly, "ENABLE_TRBE_FOR_NS" flag is now modified from boolean
to numeric type to align with the feature detection.

Change-Id: I53d3bc8dc2f6eac63feef22dfd627f3a48480afc
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-06-06 11:43:14 +01:00
Jayanth Dodderi Chidanand
1298f2f13d feat(brbe): add brbe under feature detection mechanism
This change adds "FEAT_BRBE" to be part of feature detection mechanism.

Previously feature enablement flags were of boolean type, possessing
either 0 or 1. With the introduction of feature detection procedure
we now support three states for feature enablement build flags(0 to 2).

Accordingly, "ENABLE_BRBE_FOR_NS" flag is now modified from boolean
to numeric type to align with the feature detection.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I1eb52863b4afb10b808e2f0b6584a8a210d0f38c
2022-06-06 11:43:03 +01:00
Venkatesh Yadav Abbarapu
7b1a6a08cc fix(zynqmp): resolve the misra 8.6 warnings
MISRA Violation: MISRA-C:2012 R.8.6
- Function is declared but never defined.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I0df53ef4b2c91fa8ec3bf3e5491bf37dd7400685
2022-06-06 11:19:44 +05:30
Venkatesh Yadav Abbarapu
ffa910312c fix(zynqmp): resolve the misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I9fb686e7aa2b85af6dfcb7bb5f87eddf469fb85c
2022-06-06 11:18:03 +05:30
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
Yann Gautier
96f5861258 build(changelog): add stm32mp13 and stm32mp15 scopes
The STM32MP1 series includes STM32MP13 and STM32MP15. As some features
may be dedicated to one SoC variant, add the 2 entries in the scopes
list.
While at it, correct the title for STM32MP1.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I521d0e1dfdda0638ab9970c93821cf08efbd183a
2022-06-02 09:43:28 +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
Imre Kis
e637a5e19d fix(measured-boot): add SP entries to event_log_metadata
Add SP entries to event_log_metadata if SPD_spmd is enabled. Otherwise
the platform cannot boot with measured boot enabled.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I525eb50e7bb60796b63a8c7f81962983017bbf87
2022-05-25 13:04:37 +02:00
Venkatesh Yadav Abbarapu
1117a16e03 fix(versal): resolve misra 15.6 warnings
MISRA Violation: MISRA-C:2012 R.15.6
- The body of an iteration-statement or a selection-statement shall be
a compound statement.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ia1d6fcabd36d18ff2dab6c22579ffafd5211fc1f
2022-05-25 15:18:24 +05:30
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
Venkatesh Yadav Abbarapu
8695ffcfcb fix(zynqmp): resolve misra 8.13 warnings
MISRA Violation: MISRA-C:2012 R.8.13
- The pointer variable points to a non-constant type
but does not modify the object it points to. Consider
adding const qualifier to the points-to type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ifd06c789cfd3babe1f5c0a17aff1ce8e70c87b05
2022-05-24 14:05:57 +05:30
Venkatesh Yadav Abbarapu
3d2ebe756a fix(versal): resolve misra 8.13 warnings
MISRA Violation: MISRA-C:2012 R.8.13
- The pointer variable points to a non-constant type
but does not modify the object it points to. Consider
adding const qualifier to the points-to type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I74e1b69290e081645bec8bb380128936190b5e24
2022-05-24 14:02:52 +05:30
Venkatesh Yadav Abbarapu
912b7a6fe4 fix(versal): resolve the misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I4eccce7e238f283348a5013e2e45c91435b4ae4e
2022-05-24 11:11:12 +05:30
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