]> git.baikalelectronics.ru Git - arm-tf.git/log
arm-tf.git
22 months agoMerge changes Ia748b6ae,Id8a48e14,Id25ab231,Ie26eed8a,Idf48f716, ... into integration
Sandrine Bailleux [Tue, 3 Jan 2023 16:48:09 +0000 (17:48 +0100)]
Merge changes Ia748b6ae,Id8a48e14,Id25ab231,Ie26eed8a,Idf48f716, ... into integration

* changes:
  refactor(auth): partially validate SubjectPublicKeyInfo early
  fix(auth): reject padding after BIT STRING in signatures
  fix(auth): reject invalid padding in digests
  fix(auth): require at least one extension to be present
  fix(auth): forbid junk after extensions
  fix(auth): only accept v3 X.509 certificates

22 months agoMerge changes from topic "st_fix_sparse_warnings" into integration
Manish Pandey [Tue, 3 Jan 2023 13:27:07 +0000 (14:27 +0100)]
Merge changes from topic "st_fix_sparse_warnings" into integration

* changes:
  fix(st-crypto): remove platdata functions
  fix(st-crypto): set get_plain_pk_from_asn1() static
  fix(stm32mp1): add missing platform.h include
  fix(st): make metadata_block_spec static

22 months agorefactor(auth): partially validate SubjectPublicKeyInfo early
Demi Marie Obenour [Thu, 8 Dec 2022 20:24:18 +0000 (15:24 -0500)]
refactor(auth): partially validate SubjectPublicKeyInfo early

This reduces the likelihood of future problems later.

Change-Id: Ia748b6ae31a7a48f17ec7f0fc08310a50cd1b135
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
22 months agofix(auth): reject padding after BIT STRING in signatures
Demi Marie Obenour [Thu, 8 Dec 2022 20:24:10 +0000 (15:24 -0500)]
fix(auth): reject padding after BIT STRING in signatures

It is forbidden by ASN.1 DER.

Change-Id: Id8a48e14bb8a1a17a6481ea3fde0803723c05e31
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
22 months agofix(auth): reject invalid padding in digests
Demi Marie Obenour [Thu, 8 Dec 2022 20:24:01 +0000 (15:24 -0500)]
fix(auth): reject invalid padding in digests

Digests must not have padding after the SEQUENCE or OCTET STRING.

Change-Id: Id25ab23111781f8c8a97c2c3c8edf1cc4a4384c0
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
22 months agofix(auth): require at least one extension to be present
Demi Marie Obenour [Thu, 8 Dec 2022 20:23:58 +0000 (15:23 -0500)]
fix(auth): require at least one extension to be present

X.509 and RFC5280 allow omitting the extensions entirely, but require
that if the extensions field is present at all, it must contain at least
one certificate.  TF-A already requires the extensions to be present,
but allows them to be empty.  However, a certificate with an empty
extensions field will always fail later on, as the extensions contain
the information needed to validate the next stage in the boot chain.
Therefore, it is simpler to require the extension field to be present
and contain at least one extension.  Also add a comment explaining why
the extensions field is required, even though it is OPTIONAL in the
ASN.1 syntax.

Change-Id: Ie26eed8a7924bf50937a6b27ccdf7cc9a390588d
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
22 months agofix(auth): forbid junk after extensions
Demi Marie Obenour [Thu, 8 Dec 2022 20:23:56 +0000 (15:23 -0500)]
fix(auth): forbid junk after extensions

The extensions must use all remaining bytes in the TBSCertificate.

Change-Id: Idf48f7168e146d050ba62dbc732638946fcd6c92
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
22 months agofix(auth): only accept v3 X.509 certificates
Demi Marie Obenour [Thu, 8 Dec 2022 20:23:50 +0000 (15:23 -0500)]
fix(auth): only accept v3 X.509 certificates

v1 and v2 are forbidden as at least one extension is required.  Instead
of actually parsing the version number, just compare it with a
hard-coded string.

Change-Id: Ib8fd34304a0049787db77ec8c2359d0930cd4ba1
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
23 months agoMerge "fix(qemu-sbsa): enable SVE and SME" into integration
Bipin Ravi [Thu, 22 Dec 2022 22:38:58 +0000 (23:38 +0100)]
Merge "fix(qemu-sbsa): enable SVE and SME" into integration

23 months agoMerge changes Ia14738de,I6f4cffdc into integration
Manish V Badarkhe [Thu, 22 Dec 2022 11:53:04 +0000 (12:53 +0100)]
Merge changes Ia14738de,I6f4cffdc into integration

* changes:
  fix(tc): change the properties of optee reserved memory
  feat(tc): use smmu 700

23 months agoMerge "fix(cpus): workaround for Neoverse N2 erratum 2743089" into integration
Madhukar Pappireddy [Wed, 21 Dec 2022 16:27:21 +0000 (17:27 +0100)]
Merge "fix(cpus): workaround for Neoverse N2 erratum 2743089" into integration

23 months agofix(cpus): workaround for Neoverse N2 erratum 2743089
Bipin Ravi [Wed, 7 Dec 2022 23:01:26 +0000 (17:01 -0600)]
fix(cpus): workaround for Neoverse N2 erratum 2743089

Neoverse N2 erratum 2743089 is a Cat B erratum that applies to
all revisions <=r0p2 and is fixed in r0p3. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1982442/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Idec862226bd32c91374a8bbd5d73d7ee480a34d9

23 months agoMerge changes I0362da46,I8ee7c16c into integration
Madhukar Pappireddy [Wed, 21 Dec 2022 15:01:16 +0000 (16:01 +0100)]
Merge changes I0362da46,I8ee7c16c into integration

* changes:
  fix(cpus): workaround for Cortex-A78 erratum 2772019
  fix(cpus): workaround for Neoverse V1 erratum 2743093

23 months agofix(cpus): workaround for Cortex-A78 erratum 2772019
Bipin Ravi [Thu, 15 Dec 2022 20:48:21 +0000 (14:48 -0600)]
fix(cpus): workaround for Cortex-A78 erratum 2772019

Cortex-A78 erratum 2772019 is a Cat B erratum that applies to
all revisions <=r1p2 and is still open. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1401784/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I0362da463eca777aa7a385bcdeb39b8549799f02

23 months agofix(cpus): workaround for Neoverse V1 erratum 2743093
Bipin Ravi [Thu, 15 Dec 2022 17:57:53 +0000 (11:57 -0600)]
fix(cpus): workaround for Neoverse V1 erratum 2743093

Neoverse V1 erratum 2743093 is a Cat B erratum that applies to
all revisions <=r1p2 and is still open. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1401781/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I8ee7c16c14c4fd6ee35d20c855273ecfce0d1b32

23 months agoMerge "fix(el3-spmc): report execution state in partition info get" into integration
Olivier Deprez [Tue, 20 Dec 2022 16:30:16 +0000 (17:30 +0100)]
Merge "fix(el3-spmc): report execution state in partition info get" into integration

23 months agoMerge "feat(tc): add delegated attest and measurement tests" into integration
Sandrine Bailleux [Tue, 20 Dec 2022 14:58:06 +0000 (15:58 +0100)]
Merge "feat(tc): add delegated attest and measurement tests" into integration

23 months agofix(tc): change the properties of optee reserved memory
Davidson K [Wed, 14 Dec 2022 12:08:14 +0000 (17:38 +0530)]
fix(tc): change the properties of optee reserved memory

make it part of the restricted dma pool to ensure it is not used for
general dma operations.

Change-Id: Ia14738de70b4d7719d7460ed8d16e727aea8d8c4
Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
23 months agofeat(tc): use smmu 700
Davidson K [Mon, 21 Nov 2022 12:19:51 +0000 (17:49 +0530)]
feat(tc): use smmu 700

Enable smmu for gpu and dpu

Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
Change-Id: I6f4cffdc835dc542904b0a15b1db9a3382b78c08

23 months agoMerge "fix(gic): wrap cache enabled assert under plat_can_cmo" into integration
Manish Pandey [Mon, 19 Dec 2022 10:44:45 +0000 (11:44 +0100)]
Merge "fix(gic): wrap cache enabled assert under plat_can_cmo" into integration

23 months agoMerge "fix(intel): add mailbox error return status for FCS_DECRYPTION" into integration
Sandrine Bailleux [Mon, 19 Dec 2022 07:37:23 +0000 (08:37 +0100)]
Merge "fix(intel): add mailbox error return status for FCS_DECRYPTION" into integration

23 months agoMerge "fix(arm): arm_rotpk_header undefined reference" into integration
Manish V Badarkhe [Sat, 17 Dec 2022 10:44:21 +0000 (11:44 +0100)]
Merge "fix(arm): arm_rotpk_header undefined reference" into integration

23 months agofix(arm): arm_rotpk_header undefined reference
laurenw-arm [Tue, 13 Dec 2022 15:42:40 +0000 (09:42 -0600)]
fix(arm): arm_rotpk_header undefined reference

Moving ARM_ROTPK_S to default to arm_dev_rotpk.S as it was not being
set for Juno cryptocell and this should be the value in most cases.

Change-Id: I56a5a4e61f1ca728b87322b0b09a0d73ed1d5ee0
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
23 months agofeat(tc): add delegated attest and measurement tests
Mate Toth-Pal [Fri, 21 Oct 2022 12:24:49 +0000 (14:24 +0200)]
feat(tc): add delegated attest and measurement tests

This patch adds Delegated Attestation and Measured Boot tests to the
plat/arm/board/tc platform.
The test suite can be activated by adding the build time option
`PLATFORM_TEST=1` to the make command. In this case the boot sequence is
not finished, plat_error_handler is called after the tests are run
(regardless of the test result.)

The actual test code is coming from the Trusted-Firmware-M project. Some
of the files of the tf-m-tests and tf-m-extras repo are linked to the
BL31 image.

Versions used for testing:
https://git.trustedfirmware.org/TF-M/tf-m-tests
    614e8c358377e4146e8ee13d1246e59d01b4bf1b

https: //git.trustedfirmware.org/TF-M/tf-m-extras
    3be9fdd557e6df449de93c2101973fb011699b3d

Change-Id: I98f0f5f760a39d2d7e0dd11d33663ddb75f0b6fc
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
23 months agoMerge "fix(xilinx): resolve integer handling issue" into integration
Joanna Farley [Fri, 16 Dec 2022 15:59:44 +0000 (16:59 +0100)]
Merge "fix(xilinx): resolve integer handling issue" into integration

23 months agoMerge "fix(intel): missing NCORE CCU snoop filter fix in BL2" into integration
Sandrine Bailleux [Fri, 16 Dec 2022 14:37:07 +0000 (15:37 +0100)]
Merge "fix(intel): missing NCORE CCU snoop filter fix in BL2" into integration

23 months agofix(xilinx): resolve integer handling issue
Akshay Belsare [Thu, 15 Dec 2022 10:26:23 +0000 (15:56 +0530)]
fix(xilinx): resolve integer handling issue

OEN Number 48 to 63 is for Trusted App and OS.
GET_SMC_OEN limits the return value of OEN number to 63 by bitwise AND
operation with 0x3F. Thus the upper limit check for OEN value returned
by GET_SMC_OEN is not required.
Removing the upper limit check for the OEN value returned by GET_SMC_OEN
resolves integer handling issue CONSTANT_EXPRESSION_RESULT

Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Change-Id: Ie04a4e2fb7cc85ec6055a5662736a805a89f7085

23 months agoMerge changes Ibb593369,I9cc984dd into integration
Bipin Ravi [Thu, 15 Dec 2022 15:51:32 +0000 (16:51 +0100)]
Merge changes Ibb593369,I9cc984dd into integration

* changes:
  fix(el3_runtime): allow SErrors when executing in EL3
  fix(el3_runtime): do not save scr_el3 during EL3 entry

23 months agoMerge changes I2b23e7c8,I779587af,Ic46de7a4,If753e987,I00171b05, ... into integration
Madhukar Pappireddy [Thu, 15 Dec 2022 15:38:07 +0000 (16:38 +0100)]
Merge changes I2b23e7c8,I779587af,Ic46de7a4,If753e987,I00171b05, ... into integration

* changes:
  fix(layerscape): unlock write access SMMU_CBn_ACTLR
  fix(nxp-ddr): add checking return value
  feat(lx2): enable OCRAM ECC
  fix(nxp-tools): fix coverity issue
  fix(nxp-ddr): fix coverity issue
  fix(nxp-ddr): fix underrun coverity issue
  fix(nxp-drivers): fix sd secure boot failure
  feat(lx2): support more variants
  fix(lx2): init global data before using it
  fix(ls1046a): 4 keys secureboot failure resolved
  fix(nxp-crypto): fix secure boot assert inclusion
  fix(nxp-crypto): fix coverity issue
  fix(nxp-drivers): fix fspi coverity issue
  fix(nxp-drivers): fix tzc380 memory regions config
  fix(layerscape): fix nv_storage assert checking
  fix(nxp-ddr): apply Max CDD values for warm boot
  fix(nxp-ddr): use CDDWW for write to read delay
  fix(layerscape): fix errata a008850

23 months agoMerge "fix(gpt_rme): fix compilation error for gpt_rme.c" into integration
Soby Mathew [Thu, 15 Dec 2022 14:52:42 +0000 (15:52 +0100)]
Merge "fix(gpt_rme): fix compilation error for gpt_rme.c" into integration

23 months agoMerge changes from topic "qemu_sel2" into integration
Olivier Deprez [Thu, 15 Dec 2022 13:25:16 +0000 (14:25 +0100)]
Merge changes from topic "qemu_sel2" into integration

* changes:
  docs(build): describes the SPMC_OPTEE build option
  feat(qemu): support el3 spmc
  feat(el3-spmc): make platform logical partition optional
  feat(qemu): support s-el2 spmc
  feat(qemu): update abi between spmd and spmc
  fix(sptool): add dependency to SP image

23 months agofix(intel): add mailbox error return status for FCS_DECRYPTION
Sieu Mun Tang [Sat, 3 Dec 2022 17:43:35 +0000 (01:43 +0800)]
fix(intel): add mailbox error return status for FCS_DECRYPTION

Add 2 more mailbox error return status for FCS_DECRYPTION when sending
mailbox command to SDM

Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: Ifff4faa397232cc0080f9fca6f6948ac305915c4

23 months agofix(intel): missing NCORE CCU snoop filter fix in BL2
Jit Loon Lim [Thu, 10 Nov 2022 14:08:13 +0000 (22:08 +0800)]
fix(intel): missing NCORE CCU snoop filter fix in BL2

Clear Ncore CCU snoop filter. There is hardware bug in NCORE CCU IP
and it is causing an issue in the coherent directory tracking of
outstanding cache lines.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I9ee67c94e6379d318516ae8f660a62323ce8d563

23 months agoMerge changes Ib02688f7,If17fe04d into integration
Madhukar Pappireddy [Wed, 14 Dec 2022 16:44:00 +0000 (17:44 +0100)]
Merge changes Ib02688f7,If17fe04d into integration

* changes:
  fix(cpus): workaround for Cortex-X2 erratum 2768515
  fix(cpus): workaround for Cortex-A710 erratum 2768515

23 months agodocs(build): describes the SPMC_OPTEE build option
Jens Wiklander [Wed, 14 Dec 2022 16:02:16 +0000 (17:02 +0100)]
docs(build): describes the SPMC_OPTEE build option

Explains that the SPMC_OPTEE build option is used to load the SPMC at
S-EL1 using an OP-TEE specific mechanism.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: I71757d2d9ac98caf0ac6d8e64b221adaa0f70846

23 months agofix(el3_runtime): allow SErrors when executing in EL3
Manish Pandey [Thu, 17 Nov 2022 15:47:05 +0000 (15:47 +0000)]
fix(el3_runtime): allow SErrors when executing in EL3

SCR_EL3.EA is set to 1 in BL31 initialization and is cleared before
entering to lower ELs(except for RAS FFH case "HANDLE_EA_EL3_FIRST_NS").
The cleared value persist even during run time when execution comes
back to EL3.

When SCR_EL3.EA is 0 and execution state is EL3, Async EAs(delivered
as SErrors) are implicitly masked and hence any Async EA by EL3 will
remain pending and will trap at the exception level EA is targeted
to and unmasked when entering lower EL.
This causes unexpected EA at lower EL. This is a very rare
to get SError in EL3 until unless there is any programming error.

This patch sets SCR_EL3.EA to 1 when entering EL3 from lower EL.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ibb593369edb034f670fd85ee79adc9829b900a83

23 months agofix(el3_runtime): do not save scr_el3 during EL3 entry
Manish Pandey [Wed, 7 Dec 2022 13:04:20 +0000 (13:04 +0000)]
fix(el3_runtime): do not save scr_el3 during EL3 entry

scr_el3 registers cannot be modified in lower ELs which means it retains
the same value which is stored in the EL3 cpu context structure for the
given world. So, we should not save the register when entering to EL3
from lower EL as we have the copy of it present in cpu context.

During EL3 execution SCR_EL3 value can be modifed for following cases
 1. Changes which is required for EL3 execution, this change is temp
    and do not need to be saved.
 2. Changes which affects lower EL execution, these changes need to be
    written to cpu context as well and will be retrieved when scr_el3
    is restored as part of exiting EL3

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I9cc984ddf50e27d09e361bd83b1b3c9f068cf2fd

23 months agoMerge changes from topic "ffa_el3_spmc_fixes" into integration
Olivier Deprez [Tue, 13 Dec 2022 17:53:57 +0000 (18:53 +0100)]
Merge changes from topic "ffa_el3_spmc_fixes" into integration

* changes:
  fix(tsp): use verbose for power logs
  fix(el3-spmc): fix coverity scan warnings
  fix(el3-spmc): improve bound check for descriptor

23 months agoMerge changes Ie6a13e4a,I517074b8,Ifd29b748,I1279d9cb,I3b78e0c5, ... into integration
Madhukar Pappireddy [Tue, 13 Dec 2022 14:13:48 +0000 (15:13 +0100)]
Merge changes Ie6a13e4a,I517074b8,Ifd29b748,I1279d9cb,I3b78e0c5, ... into integration

* changes:
  feat(imx8mq): add BL31 PIE support
  refactor(imx8mq): introduce BL31_SIZE
  refactor(imx8mq): make use of setup_page_tables()
  feat(imx8mq): always set up console
  feat(imx8mq): remove empty bl31_plat_runtime_setup
  feat(imx8mq): make IMX_BOOT_UART_BASE configurable via build parameter

23 months agofeat(imx8mq): add BL31 PIE support
Lucas Stach [Thu, 8 Dec 2022 15:44:00 +0000 (16:44 +0100)]
feat(imx8mq): 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: Lucas Stach <l.stach@pengutronix.de>
Change-Id: Ie6a13e4ae0fdc6627a94798d7a86df7d5b310896

23 months agorefactor(imx8mq): introduce BL31_SIZE
Lucas Stach [Thu, 8 Dec 2022 15:37:44 +0000 (16:37 +0100)]
refactor(imx8mq): introduce BL31_SIZE

No functional change.

Introduce BL31_SIZE define and calculate the limits based on the
BL31_BASE and the BL31_SIZE define. Also make use of SZ_64K 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: Lucas Stach <l.stach@pengutronix.de>
Change-Id: I517074b866b5bf11841b51777f87c926b304488d

23 months agorefactor(imx8mq): make use of setup_page_tables()
Lucas Stach [Thu, 8 Dec 2022 15:35:11 +0000 (16:35 +0100)]
refactor(imx8mq): make use of setup_page_tables()

Improve code readability and align with other i.MX8M* platforms.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Change-Id: Ifd29b74872e3a567288d208de4827403078164e9

23 months agofeat(imx8mq): always set up console
Lucas Stach [Thu, 8 Dec 2022 15:00:04 +0000 (16:00 +0100)]
feat(imx8mq): always set up console

This aligns the i.MX8MQ platform behaviour with the other i.MX8M*
platforms by always setting up the console UART.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Change-Id: I1279d9cb4feb6e789422b9844cab711b8daae74e

23 months agofeat(imx8mq): remove empty bl31_plat_runtime_setup
Lucas Stach [Thu, 8 Dec 2022 16:51:17 +0000 (17:51 +0100)]
feat(imx8mq): remove empty bl31_plat_runtime_setup

Having this empty definition is actively harmful, as it prevents the
default weak function to be used, which does a switch of the console
state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Change-Id: I3b78e0c524c4907714036dba573a44d8f9c48b09

23 months agofeat(imx8mq): make IMX_BOOT_UART_BASE configurable via build parameter
Lucas Stach [Thu, 8 Dec 2022 14:54:26 +0000 (15:54 +0100)]
feat(imx8mq): make IMX_BOOT_UART_BASE configurable via build parameter

This aligns the i.MX8MQ build with the other i.MX8M platforms by
allowing to override the default IMX_BOOT_UART_BASE value via a make
parameter.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Change-Id: Iad9b844517209fc7d051c61767f71ac9fa2b55c7

23 months agofix(st-crypto): remove platdata functions
Yann Gautier [Tue, 13 Dec 2022 09:51:56 +0000 (10:51 +0100)]
fix(st-crypto): remove platdata functions

The functions stm32_pka_get_platdata() and stm32_saes_get_platdata()
are not used. They can be removed as we always use DT to retrieve
the device configuration.
This issue was triggered by sparse tool or when enabling warning
-Wmissing-prototypes.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I5cce9a0765144d694e8ddece37361ccbb85d1734

23 months agofix(st-crypto): set get_plain_pk_from_asn1() static
Yann Gautier [Mon, 12 Dec 2022 13:56:39 +0000 (14:56 +0100)]
fix(st-crypto): set get_plain_pk_from_asn1() static

The issue is triggered when enabling -Wmissing-prototypes warning:
plat/st/common/stm32mp_crypto_lib.c:81:5: warning:
 no previous prototype for 'get_plain_pk_from_asn1'
 [-Wmissing-prototypes]
   81 | int get_plain_pk_from_asn1(void *pk_ptr, unsigned int pk_len,
      |     ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ia36bbaba6e187ab47c203ddf0d7d017b210545cf

23 months agofix(stm32mp1): add missing platform.h include
Yann Gautier [Fri, 18 Nov 2022 13:08:10 +0000 (14:08 +0100)]
fix(stm32mp1): add missing platform.h include

This includes the functions definitions, and avoids sparse warnings:
plat/st/stm32mp1/plat_image_load.c:13:6: warning:
 symbol 'plat_flush_next_bl_params' was not declared.
 Should it be static?
plat/st/stm32mp1/plat_image_load.c:21:16: warning:
 symbol 'plat_get_bl_image_load_info' was not declared.
 Should it be static?
plat/st/stm32mp1/plat_image_load.c:29:13: warning:
 symbol 'plat_get_next_bl_params' was not declared.
 Should it be static?

The issue was also found when enabling -Wmissing-prototypes warning:
plat/st/stm32mp1/plat_image_load.c:13:6: error:
 no previous prototype for 'plat_flush_next_bl_params'
 [-Werror=missing-prototypes]
   13 | void plat_flush_next_bl_params(void)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
plat/st/stm32mp1/plat_image_load.c:21:17: error:
 no previous prototype for 'plat_get_bl_image_load_info'
 [-Werror=missing-prototypes]
   21 | bl_load_info_t *plat_get_bl_image_load_info(void)
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
plat/st/stm32mp1/plat_image_load.c:29:14: error:
 no previous prototype for 'plat_get_next_bl_params'
 [-Werror=missing-prototypes]
   29 | bl_params_t *plat_get_next_bl_params(void)
      |              ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I0bb3052f6efd888462eab2fd8f18862e7fbf02b9

23 months agofix(st): make metadata_block_spec static
Yann Gautier [Fri, 18 Nov 2022 13:05:10 +0000 (14:05 +0100)]
fix(st): make metadata_block_spec static

This issue was triggered by sparse tool:
plat/st/common/stm32mp_fconf_io.c:31:17: warning:
 symbol 'metadata_block_spec' was not declared. Should it be static?

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I283d15792ed0e7ac5181e18aaf54010a0e61b370

23 months agoMerge changes from topic "full_dev_rsa_key" into integration
Lauren Wehrmeister [Mon, 12 Dec 2022 21:18:26 +0000 (22:18 +0100)]
Merge changes from topic "full_dev_rsa_key" into integration

* changes:
  docs(arm): add ARM_ROTPK_LOCATION variant full key
  feat(arm): add ARM_ROTPK_LOCATION variant full key

23 months agofix(gic): wrap cache enabled assert under plat_can_cmo
Channagoud kadabi [Wed, 30 Nov 2022 00:03:47 +0000 (16:03 -0800)]
fix(gic): wrap cache enabled assert under plat_can_cmo

with reference to feature 04c730 (feat(cpus): make cache ops conditional),
booting with caches in debug recovery means SCTLR_C_BIT will be 0.
Wrap the assert for the d-cache enabled check in CONDITIONAL_CMO and
plat_can_cmo calls to allow booting with d-cache disabled.

Signed-off-by: Channagoud kadabi <kadabi@google.com>
Change-Id: I80153df493d1ec9e5e354c7c2e6a14322d22c446

23 months agoMerge changes from topic "fix_misra_st_drivers" into integration
Manish Pandey [Mon, 12 Dec 2022 16:03:23 +0000 (17:03 +0100)]
Merge changes from topic "fix_misra_st_drivers" into integration

* changes:
  fix(st-gpio): define shift as uint32_t
  fix(st-sdmmc): check transfer size before filling register

23 months agoMerge "fix(st): include utils.h to solve compilation error" into integration
Manish Pandey [Mon, 12 Dec 2022 15:58:58 +0000 (16:58 +0100)]
Merge "fix(st): include utils.h to solve compilation error" into integration

23 months agofix(st): include utils.h to solve compilation error
Yann Gautier [Mon, 12 Dec 2022 13:53:45 +0000 (14:53 +0100)]
fix(st): include utils.h to solve compilation error

If compiling with STM32MP13 with DECRYPTION_SUPPORT != none, there is
a compilation error:
plat/st/common/stm32mp_crypto_lib.c:
 In function 'plat_get_enc_key_info':
plat/st/common/stm32mp_crypto_lib.c:532:25:
 error: implicit declaration of function 'zeromem'
 [-Werror=implicit-function-declaration]
  532 |                         zeromem(key, *key_len);
      |                         ^~~~~~~

Adding #include <lib/utils.h> solves the error.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I0a20c5632f0379612149333e69875369d4cfca15

23 months agoMerge "fix(xilinx): use lib/smccc.h macros instead of trusty spd" into integration
Joanna Farley [Mon, 12 Dec 2022 10:21:01 +0000 (11:21 +0100)]
Merge "fix(xilinx): use lib/smccc.h macros instead of trusty spd" into integration

23 months agofix(xilinx): use lib/smccc.h macros instead of trusty spd
Akshay Belsare [Mon, 12 Dec 2022 06:43:14 +0000 (12:13 +0530)]
fix(xilinx): use lib/smccc.h macros instead of trusty spd

There is no reason to use macros from trusty spd header and creating
dependency on it. Use directly macros from lib/smccc.h

Co-developed-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Change-Id: I7cf1f76a5358ffc297c914f41c437469f5a42411

23 months agodocs(arm): add ARM_ROTPK_LOCATION variant full key
laurenw-arm [Thu, 1 Dec 2022 22:54:50 +0000 (16:54 -0600)]
docs(arm): add ARM_ROTPK_LOCATION variant full key

Updating documentation to reflect the new ARM_ROTPK_LOCATION variant of
the full ROTPK, as opposed to the hash of it.

Change-Id: I0f83c519bd607ef1270c7d30ee9bc55451ce4ae2
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
23 months agofeat(arm): add ARM_ROTPK_LOCATION variant full key
laurenw-arm [Fri, 28 Oct 2022 16:26:32 +0000 (11:26 -0500)]
feat(arm): add ARM_ROTPK_LOCATION variant full key

Add support for ARM_ROTPK_LOCATION=devel_full_dev_rsa_key, which
implements the scenario where the platform provides the full ROTPK, as
opposed to the hash of it. This returns a 2kB development RSA key
embedded into the firmware.

The motivation for this patch is to extend our test coverage in the CI.
Right now, the authentication framework allows platforms to return
either the full ROTPK or a hash of it (*). However, the FVP platform
only supports returning a hash currently so we cannot easily exercise
the full key scenario. This patch adds that capability.

(*) Or even no key at all if it's not deployed on the platform yet, as
is typically the case on pre-production/developement platforms.

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: Ie869cca1082410e63894e2b7dea2d31155684105

23 months agoMerge changes from topic "fix_misra_st_drivers" into integration
Manish Pandey [Fri, 9 Dec 2022 12:04:05 +0000 (13:04 +0100)]
Merge changes from topic "fix_misra_st_drivers" into integration

* changes:
  fix(st-clock): avoid arithmetics on pointers
  fix(st-clock): give the size for parent_mp13 and dividers_mp13 tables
  fix(st-clock): remove useless switch
  fix(st-clock): use Boolean type for tests
  fix(st-regulator): use Boolean type for tests
  fix(st-regulator): enclose macro parameters in parentheses
  fix(st-regulator): rework for_each_*rdev macros
  fix(st-regulator): explicitly check operators precedence
  fix(st-pmic): define pmic_regs table size
  fix(st-pmic): enclose macro parameter in parentheses

23 months agoMerge changes from topic "fix_misra_st_platform" into integration
Manish Pandey [Fri, 9 Dec 2022 11:54:13 +0000 (12:54 +0100)]
Merge changes from topic "fix_misra_st_platform" into integration

* changes:
  fix(stm32mp1): rework DWL buffer cache invalidation
  fix(stm32mp1): add const for strings in stm32mp_get_soc_name()
  fix(st): use Boolean type for tests
  fix(st): rework secure-status check in fdt_get_status()
  fix(st): use indices when counting GPIOs in DT
  fix(st): add U suffix for unsigned numbers
  fix(st): explicitly check operators precedence

23 months agofix(gpt_rme): fix compilation error for gpt_rme.c
AlexeiFedorov [Fri, 9 Dec 2022 11:27:14 +0000 (11:27 +0000)]
fix(gpt_rme): fix compilation error for gpt_rme.c

This patch fixes compilation error for gpt_init_l0_tables()
function in lib/gpt_rme/gpt_rme.c reported by GCC 13.0.0:

"gpt_rme/gpt_rme.c:765:5: error: conflicting types for
'gpt_init_l0_tables' due to enum/integer mismatch;
have 'int(unsigned int,  uintptr_t,  size_t)'
{aka 'int(unsigned int,  long unsigned int,  long unsigned int)'}"

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I38f28be290337e7d37d59b52cad7bde5b96b8d51

23 months agoMerge changes from topic "tonnad01/gcc_warn_fix" into integration
Manish V Badarkhe [Fri, 9 Dec 2022 11:09:57 +0000 (12:09 +0100)]
Merge changes from topic "tonnad01/gcc_warn_fix" into integration

* changes:
  fix(scmi): change function prototype to fix gcc error
  fix(rdn1edge): change variable type to fix gcc sign conversion error

23 months agoMerge "docs: add threat model for AP-RSS interface" into integration
Sandrine Bailleux [Fri, 9 Dec 2022 09:15:12 +0000 (10:15 +0100)]
Merge "docs: add threat model for AP-RSS interface" into integration

23 months agodocs: add threat model for AP-RSS interface
Tamas Ban [Wed, 30 Nov 2022 16:09:43 +0000 (17:09 +0100)]
docs: add threat model for AP-RSS interface

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ic818da12584503e1a96396c4b55a8db14ae7584a

23 months agofeat(qemu): support el3 spmc
Jens Wiklander [Mon, 17 Jan 2022 08:48:28 +0000 (09:48 +0100)]
feat(qemu): support el3 spmc

Introduce additional defines needed when compiling the QEMU platform
with SPMC at EL3.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: If6dbe41fa8761637e39579a1f6818dabc769c139

23 months agofeat(el3-spmc): make platform logical partition optional
Jens Wiklander [Thu, 19 May 2022 13:17:43 +0000 (15:17 +0200)]
feat(el3-spmc): make platform logical partition optional

Prior to this commit a logical platform specific partition is added when
compiling with SPMC at EL3. Not all platform need to add a logical
platform so make this optional.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: I3bdd2a91350330c1637e8d84765974bfb6b225d7

23 months agofeat(qemu): support s-el2 spmc
Jens Wiklander [Tue, 22 Nov 2022 13:39:26 +0000 (14:39 +0100)]
feat(qemu): support s-el2 spmc

Supports S-EL2 SPMC + S-EL1 SP on qemu. S-EL1 SPs packaged in .pkg files
are added to the FIP as blob with an UUID. BL2 parses TB_FW_CONFIG to
know which SP blobs to load into memory.

Co-developed-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: I4b61c4c048f31540d4f1ef9e05f0b12deb341e06

23 months agofeat(qemu): update abi between spmd and spmc
Jens Wiklander [Fri, 18 Nov 2022 14:40:04 +0000 (15:40 +0100)]
feat(qemu): update abi between spmd and spmc

Updates the ABI between SPMD and the SPMC at S-EL1 so that the hard
coded SPMC manifest can be replaced by a proper manifest via TOS FW
Config. TOS FW Config is provided via QEMU_TOS_FW_CONFIG_DTS as a DTS
file when building.  The DTS is turned into a DTB which is added to the
FIP.

Note that this is an incompatible change and requires corresponding
change in OP-TEE ("core: sel1 spmc: boot abi update").

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: Ibabe78ef50a24f775492854ce5ac54e4d471e369

23 months agoMerge "fix(rmmd): add missing padding to RMM Boot Manifest and initialize it" into...
Alexei Fedorov [Thu, 8 Dec 2022 13:53:50 +0000 (14:53 +0100)]
Merge "fix(rmmd): add missing padding to RMM Boot Manifest and initialize it" into integration

23 months agofix(scmi): change function prototype to fix gcc error
Tony K Nadackal [Wed, 7 Dec 2022 20:44:05 +0000 (20:44 +0000)]
fix(scmi): change function prototype to fix gcc error

Change function prototype of plat_css_get_scmi_info() to fix the GCC
sign conversion error "comparison between signed and unsigned integer
expressions". Changing channel_id type to unsigned int since it can
never be a negative value.

Signed-off-by: Tony K Nadackal <tony.nadackal@arm.com>
Change-Id: I579b21497329db40897c10d86c8fc68e4877f3db

23 months agofix(rdn1edge): change variable type to fix gcc sign conversion error
Tony K Nadackal [Wed, 7 Dec 2022 20:30:33 +0000 (20:30 +0000)]
fix(rdn1edge): change variable type to fix gcc sign conversion error

Change variable type in function bl31_platform_setup() to fix the GCC
sign conversion error "comparison between signed and unsigned integer
expressions".

Signed-off-by: Tony K Nadackal <tony.nadackal@arm.com>
Change-Id: Iff914bd7ad521883723c8fb34dd893412cce7fc5

23 months agofix(tsp): use verbose for power logs
Shruti Gupta [Thu, 8 Dec 2022 11:40:20 +0000 (11:40 +0000)]
fix(tsp): use verbose for power logs

TSP use verbose for cpu suspend resume logs

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: Ic1d3706feec6361946dd5c0d2bea90a2dd7a2d02

23 months agofix(el3-spmc): fix coverity scan warnings
Shruti Gupta [Thu, 25 Aug 2022 13:22:53 +0000 (14:22 +0100)]
fix(el3-spmc): fix coverity scan warnings

Validate emad descriptor integrity before accessing.
Check for NULL pointer access.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: Id4ff3e5d88be95ca8d067378e344947880ec984b

23 months agofix(el3-spmc): improve bound check for descriptor
Marc Bonnici [Tue, 18 Oct 2022 17:01:44 +0000 (18:01 +0100)]
fix(el3-spmc): improve bound check for descriptor

Ensure that there is sufficient space in the memory
descriptor to accommodate the size of the composite memory
struct as part of the descriptor.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: Iea646b144c59a2a1a171298cabb5f31040a8af31

23 months agoMerge "docs: extend generic tf-a threat model" into integration
Sandrine Bailleux [Thu, 8 Dec 2022 08:29:49 +0000 (09:29 +0100)]
Merge "docs: extend generic tf-a threat model" into integration

23 months agofix(cpus): workaround for Cortex-X2 erratum 2768515
Bipin Ravi [Wed, 7 Dec 2022 19:54:02 +0000 (13:54 -0600)]
fix(cpus): workaround for Cortex-X2 erratum 2768515

Cortex-X2 erratum 2768515 is a Cat B erratum that applies to
all revisions <=r2p1 and is still open. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1775100/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Ib02688f7b6dc7f6ec305e68e8895174f6fd577a0

23 months agofix(cpus): workaround for Cortex-A710 erratum 2768515
Bipin Ravi [Wed, 7 Dec 2022 19:32:35 +0000 (13:32 -0600)]
fix(cpus): workaround for Cortex-A710 erratum 2768515

Cortex-A710 erratum 2768515 is a Cat B erratum that applies to
all revisions <=r2p1 and is still open. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1775101/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: If17fe04d3fda0dba6b8aabdd837a1c53e1830ed5

23 months agofix(rmmd): add missing padding to RMM Boot Manifest and initialize it
Javier Almansa Sobrino [Thu, 1 Dec 2022 17:20:45 +0000 (17:20 +0000)]
fix(rmmd): add missing padding to RMM Boot Manifest and initialize it

This patch also:
     * Enforces the check of RES0 fields on EL3-RMM boot interface
       and manifest
     * Fixes a couple of nits on the EL3-RMM Boot Interface
       documentation.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Idb9e38f9fcda2ba0655646a1e2c4fdbabd5cdc40

23 months agofix(st-gpio): define shift as uint32_t
Yann Gautier [Fri, 25 Nov 2022 09:56:25 +0000 (10:56 +0100)]
fix(st-gpio): define shift as uint32_t

This corrects MISRA C2012-10.6:
The value of a composite expression shall not be assigned to an object
with wider essential type.
While at it change all the shift values to unsigned.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Idf9915313af965db2106095df7cb48a84f50c519

23 months agofix(st-sdmmc): check transfer size before filling register
Yann Gautier [Mon, 21 Nov 2022 12:36:53 +0000 (13:36 +0100)]
fix(st-sdmmc): check transfer size before filling register

Fix MISRA C2012-10.3:
The value of an expression shall not be assigned to an object with
a narrower essential type or of a different essential type category.

Check buffer size is less than 4GB before casting the command argument.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Iac1afcfe905c99b22cb39dc4104d351b0e647e5d

23 months agofix(stm32mp1): rework DWL buffer cache invalidation
Yann Gautier [Fri, 25 Nov 2022 14:33:09 +0000 (15:33 +0100)]
fix(stm32mp1): rework DWL buffer cache invalidation

As the default part do nothing, all the code managing DWL buffer cache
invalidation can be under programmer flags.
This avoids running unneeded code if the flags are not enabled, and
corrects MISRA C2012-16.6:
Every switch statement shall have at least two switch-clauses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I90d2951f9518509b3380295fb1a6ad6b9c5e551e

23 months agofix(stm32mp1): add const for strings in stm32mp_get_soc_name()
Yann Gautier [Thu, 24 Nov 2022 18:02:23 +0000 (19:02 +0100)]
fix(stm32mp1): add const for strings in stm32mp_get_soc_name()

This corrects MISRA C2012-7.4:
A string literal shall not be assigned to an object unless the object's
type is "pointer to const-qualified char".

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I0c9f483dce9abd32647d5f5e2df72047cdd376dd

23 months agofix(st): use Boolean type for tests
Yann Gautier [Mon, 21 Nov 2022 12:26:37 +0000 (13:26 +0100)]
fix(st): use Boolean type for tests

This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ibed7b87b50959f03dc5550dfaffacafd1d79feee

23 months agofix(st): rework secure-status check in fdt_get_status()
Yann Gautier [Thu, 24 Nov 2022 18:16:46 +0000 (19:16 +0100)]
fix(st): rework secure-status check in fdt_get_status()

This corrects MISRA C2012-15.7:
All if...else if constructs shall be terminated with an else statement.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I3d893d0db0a448323270086923563147008c59b9

23 months agofix(st): use indices when counting GPIOs in DT
Yann Gautier [Mon, 21 Nov 2022 10:45:04 +0000 (11:45 +0100)]
fix(st): use indices when counting GPIOs in DT

Fix MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.
While at it, avoid computing twice the same value, by removing the
initial value computation outside the loop.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Iabfe587bf72535541c94bfa341de10148aa58030

23 months agofix(st): add U suffix for unsigned numbers
Yann Gautier [Fri, 18 Nov 2022 12:43:48 +0000 (13:43 +0100)]
fix(st): add U suffix for unsigned numbers

This corrects MISRA c2012-7.2 violation:
A "u" or "U" suffix shall be applied to all integer constants that are
represented in an unsigned type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I92b394572528e7179a314bbad4a032fd65053861

23 months agofix(st): explicitly check operators precedence
Yann Gautier [Fri, 18 Nov 2022 14:03:22 +0000 (15:03 +0100)]
fix(st): explicitly check operators precedence

This corrects the MISRA violation C2012-12.1:
The precedence of operators within expressions should be made explicit.
This is done either by adding parentheses, or by creating dedicated
variables to ease readability.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I5e3f191ee38eca7ef634bd7542e615ab625271f6

23 months agofix(st-clock): avoid arithmetics on pointers
Yann Gautier [Fri, 25 Nov 2022 13:34:52 +0000 (14:34 +0100)]
fix(st-clock): avoid arithmetics on pointers

This corrects MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I9128f567a7c83d8e3381428b07e6bd785be2703b

23 months agofix(st-clock): give the size for parent_mp13 and dividers_mp13 tables
Yann Gautier [Fri, 25 Nov 2022 10:37:00 +0000 (11:37 +0100)]
fix(st-clock): give the size for parent_mp13 and dividers_mp13 tables

This corrects MISRA C2012-9.5:
Where designated initializers are used to initialize an array object
the size of the array shall be specified explicitly.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4c331b0225af975fd022ffe9e5fd1d536ed59879

23 months agofix(st-clock): remove useless switch
Yann Gautier [Fri, 25 Nov 2022 09:42:52 +0000 (10:42 +0100)]
fix(st-clock): remove useless switch

This corrects MISRA C2012-16.6:
Every switch statement shall have at least two switch-clauses.
While at it, remove useless rate variable.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I123784e7184dbf4146fd0d7faeffd6a0382fc6a1

23 months agofix(st-clock): use Boolean type for tests
Yann Gautier [Mon, 28 Nov 2022 13:56:58 +0000 (14:56 +0100)]
fix(st-clock): use Boolean type for tests

This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id217d3da223caf75cd0439d7ce11c9efab87b4d2

23 months agofix(st-regulator): use Boolean type for tests
Yann Gautier [Mon, 28 Nov 2022 13:57:06 +0000 (14:57 +0100)]
fix(st-regulator): use Boolean type for tests

This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Iacc58349cc3ab558fb4ffe0605a623e84e21e035

23 months agofix(st-regulator): enclose macro parameters in parentheses
Yann Gautier [Fri, 25 Nov 2022 15:25:46 +0000 (16:25 +0100)]
fix(st-regulator): enclose macro parameters in parentheses

This corrects MISRA C2012-20.7:
Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I9989a5aaacf17f6f7a65381c8d41f21a35f6ddd9

23 months agofix(st-regulator): rework for_each_*rdev macros
Yann Gautier [Fri, 25 Nov 2022 14:29:38 +0000 (15:29 +0100)]
fix(st-regulator): rework for_each_*rdev macros

This corrects MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ie1a196b875eae2eff9242cf83abfc1a79bdee6f3

23 months agofix(st-regulator): explicitly check operators precedence
Yann Gautier [Mon, 28 Nov 2022 13:55:14 +0000 (14:55 +0100)]
fix(st-regulator): explicitly check operators precedence

This corrects the MISRA violation C2012-12.1:
The precedence of operators within expressions should be made explicit.
This is done either by adding parentheses, or by creating dedicated
variables.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: If8312442222ba848ac1f5e38df1bed0a367646a7

23 months agofix(st-pmic): define pmic_regs table size
Yann Gautier [Thu, 24 Nov 2022 17:17:02 +0000 (18:17 +0100)]
fix(st-pmic): define pmic_regs table size

This corrects MISRA C2012-9.5:
Where designated initializers are used to initialize an array object
the size of the array shall be specified explicitly.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4f8da6b0ce73df65b2b45ba10d4ca16ed8b70113

23 months agofix(st-pmic): enclose macro parameter in parentheses
Yann Gautier [Thu, 24 Nov 2022 17:14:26 +0000 (18:14 +0100)]
fix(st-pmic): enclose macro parameter in parentheses

This corrects MISRA C2012-20.7
Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I9269d7a5b6aa4573bc0ca55b3054c3475dc4b6b2

23 months agoMerge changes Ida9abfd5,Iec447d97 into integration
Sandrine Bailleux [Wed, 7 Dec 2022 12:51:57 +0000 (13:51 +0100)]
Merge changes Ida9abfd5,Iec447d97 into integration

* changes:
  build: enable adding MbedTLS files for platform
  feat(lib/psa): add read_measurement API

23 months agoMerge "fix(trp): preserve RMI SMC X4 when not used as return" into integration
Soby Mathew [Wed, 7 Dec 2022 11:14:56 +0000 (12:14 +0100)]
Merge "fix(trp): preserve RMI SMC X4 when not used as return" into integration

23 months agofix(trp): preserve RMI SMC X4 when not used as return
AlexeiFedorov [Thu, 24 Nov 2022 13:42:44 +0000 (13:42 +0000)]
fix(trp): preserve RMI SMC X4 when not used as return

This patch adds X2-X6 and 'smc_ret' parameters to trp_rmi_handler().
The last 'smc_ret' parameter passed in X7 contains address of
'trp_smc_result' structure on stack to return result of RMI SMC call.

This allows to preserve X4 if not used as a return argument as per
SMCCCv1.2. The patch also removes use of trp_args_t in RMI handling.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I9e3387a7380b37863eeccc53d13e92e0ac5cffbd