Commit graph

14263 commits

Author SHA1 Message Date
Chris Kay
7944421ba4 build(npm): adhere to Husky deprecation notice
Husky v8 adds the `husky init` subcommand, and v9 changes how it handles
hooks. We no longer need the Husky preamble in our hooks, so update to
the new `init` subcommand and remove the preambles.

Change-Id: I18ea1bbaedbb4213cc04c21413d75c9757ff7986
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-03-07 16:13:15 +00:00
Mark Dykes
10eb851f92 Merge changes from topic "errata" into integration
* changes:
  fix(cpus): workaround for Cortex-A715 erratum 2331818
  fix(cpus): workaround for Cortex-A715 erratum 2420947
2024-03-06 22:12:41 +01:00
Bipin Ravi
7b02a57213 Merge "fix(gic600): workaround for Part 1 of GIC600 erratum 2384374" into integration 2024-03-06 21:24:20 +01:00
Arvind Ram Prakash
24a4a0a5ec fix(gic600): workaround for Part 1 of GIC600 erratum 2384374
GIC600 erratum 2384374 is a Category B erratum. Part 1 is fixed
in this patch, and the Part 1 failure mode is described as
'If the packet to be sent is a SET packet, then a higher priority SET
may not be sent when it should be until an unblocking event occurs.'

This is handled by calling gicv3_apply_errata_wa_2384374() in the
ehf_deactivate_priority() path, so that when EHF restores the priority
to the original priority, the interrupt packet buffered
in the GIC can be sent.

gicv3_apply_errata_wa_2384374() is the workaround for
the Part 2 of erratum 2384374 which flush packets from the GIC buffer
and is being used in this patch.

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

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I4bb6dcf86c94125cbc574e0dc5119abe43e84731
2024-03-06 14:16:35 -06:00
Bipin Ravi
53b3cd2532 fix(cpus): workaround for Cortex-A715 erratum 2331818
Cortex-A715 erratum 2331818 is a cat B erratum that applies to
revisions r0p0 and r1p0 and is fixed in r1p1. The workaround is to
set bit[20] of CPUACTLR2_EL1. Setting this bit is expected to have
a negligible performance impact.

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

Change-Id: If3b1ed78b145ab6515cdd41135314350ed556381
Signed-off-by: Bipin Ravi <biprav01@u203721.austin.arm.com>
2024-03-06 13:57:02 -06:00
Bipin Ravi
6e2e9747c4 Merge "fix(arm): move console flush/switch in common function" into integration 2024-03-06 20:22:50 +01:00
Manish Pandey
6bdc856bc9 fix(arm): move console flush/switch in common function
There are some CI configs which apply patch on the fly to test some
unusual test scenarios. After commit c864af989 there is one patch which
does not apply cleanly into arm_bl31_plat_runtime_setup().

To fix this issue move console flush/switch into the caller of this
function.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I4116044d53bef349a707c977cf26d1df65200045
2024-03-06 19:20:58 +00:00
Bipin Ravi
1f73247132 fix(cpus): workaround for Cortex-A715 erratum 2420947
Cortex-A715 erratum 2420947 is a cat B erratum that applies only
to revision r1p0 and is fixed in r1p1. The workaround is to set
bit[33] of CPUACTLR2_EL1. This will prevent store and store-release
to merge inside the write buffer, and it is not expected to have
much performance impacts.

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

Change-Id: I01a71b878cd958e742ff8357f8cdfbfc5625de47
Signed-off-by: Bipin Ravi <biprav01@u203721.austin.arm.com>
2024-03-06 13:10:31 -06:00
Manish V Badarkhe
9502a88b4f Merge changes from topic "drtm1.0-updates" into integration
* changes:
  feat(drtm): update DRTM version to 1.0
  feat(drtm): update references to DRTM beta0
  feat(drtm): for TPM features fw hash algorithm should be 16-bits
  feat(drtm): add ACPI table region size to the DLME header
  feat(drtm): update return code if secondary PE is not off
  feat(drtm): add additional return codes
2024-03-06 19:07:03 +01:00
Yann Gautier
4a8357fb4b Merge "docs(maintainers): add myself as SynQuacer platform co-maintainer" into integration 2024-03-06 16:52:16 +01:00
Lauren Wehrmeister
0cda4adae7 Merge changes from topic "sm/framework_optimize" into integration
* changes:
  chore: rearrange the fvp_cpu_errata.mk file
  fix(cpus): add erratum 2701951 to Cortex-X3's list
  refactor(errata-abi): workaround platforms non-arm interconnect
  refactor(errata-abi): optimize errata ABI using errata framework
2024-03-05 23:38:17 +01:00
Stuart Yoder
9c36b900f9 feat(drtm): update DRTM version to 1.0
Update DRTM version from 0.1 to 1.0.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Ic37fd29e4c2de1a29c2808870addba049d488773
2024-03-05 14:24:13 -06:00
Stuart Yoder
b94d59099f feat(drtm): update references to DRTM beta0
Update all references to DRTM beta0 to be 1.0 instead.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Ieda70f26f3be42f4705e9b267706674c94f120f2
2024-03-05 14:17:15 -06:00
Stuart Yoder
c86cfa3597 feat(drtm): for TPM features fw hash algorithm should be 16-bits
The DRTM 1.0 spec changed the Firmware hash algorithm field
size from 32-bits to 16-bits.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: I713e32e01b1983bf21d97c93bbb28c77dc94a541
2024-03-05 14:17:04 -06:00
Stuart Yoder
5dde96b024 feat(drtm): add ACPI table region size to the DLME header
The DRTM 1.0 spec defines an additional field in the DLME
header for an optional region in the DLME to hold ACPI tables.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Idba7fa6bd0fb4ef2bdffc24f4588720e1661e58c
2024-03-05 14:13:08 -06:00
Stuart Yoder
bc9064ae5c feat(drtm): update return code if secondary PE is not off
DRTM 1.0 specifies that if any secondary PEs are not off
during a dynamic launch the return code must be
SECONDARY_PE_NOT_OFF.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: Idcb1f3c60daa63a5bc994bdeacca8aab7066f628
2024-03-05 14:10:32 -06:00
Stuart Yoder
89f5c753af feat(drtm): add additional return codes
Add additional return codes defined in the DRTM 1.0 spec.

Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
Change-Id: I1620e098edf4f070ac759a26ce3c7272faf2d8b2
2024-03-05 14:09:48 -06:00
Madhukar Pappireddy
e8eb44182d Merge "fix(el3-spmc): add datastore linker script markers" into integration 2024-03-05 19:41:02 +01:00
Sona Mathew
1ba369a5e0 chore: rearrange the fvp_cpu_errata.mk file
Change-Id: I3959bdf5852c5714f2238f61493a931b3c857a20
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
106c4283a5 fix(cpus): add erratum 2701951 to Cortex-X3's list
Erratum ID 2701951 is an erratum that could affect platforms that
do not use an Arm interconnect IP. This was originally added to the list
of Cortex-A715 in the errata ABI files.
Fixed this by adding it to the Cortex-X3 list.

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

Change-Id: I6ffaf4360a4a2d0a23c253a2326c178e010c8e45
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
aceb9c9e54 refactor(errata-abi): workaround platforms non-arm interconnect
The workarounds for these below mentioned errata are not implemented
in EL3, but the flags can be enabled/disabled at a platform level
based on arm/non-arm interconnect IP flag. The ABI helps assist the
Kernel in the process of mitigation for the following errata:

Cortex-A715:   erratum 2701951
Neoverse V2:   erratum 2719103
Cortex-A710:   erratum 2701952
Cortex-X2:     erratum 2701952
Neoverse N2:   erratum 2728475
Neoverse V1:   erratum 2701953
Cortex-A78:    erratum 2712571
Cortex-A78AE:  erratum 2712574
Cortex-A78C:   erratum 2712575

Change-Id: Ie86b7212d731a79e2a0c07649e69234e733cd78d
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:09:01 -06:00
Sona Mathew
c9f2634387 refactor(errata-abi): optimize errata ABI using errata framework
Errata ABI feature introduced per CPU based errata structures
in the errata_abi_main.c, these can be removed by re-using
the structures created by the errata framework.

Change-Id: I1a60d3e4f116b6254fb45426f43ff1b21771af89
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-03-05 10:08:58 -06:00
Lauren Wehrmeister
aee3757f17 Merge "fix(cpus): workaround for Cortex-A715 erratum 2429384" into integration 2024-03-05 16:31:54 +01:00
Bipin Ravi
58843f25d3 Merge "build: allow platform makefiles to configure ENABLE_LTO" into integration 2024-03-05 16:31:28 +01:00
Chris Kay
fa402f38b2 build: allow platform makefiles to configure ENABLE_LTO
This change introduces a lazily-evaluated condition on `ENABLE_LTO` to
the `LTO_CFLAGS` variable as opposed to evaluating the condition
eagerly.

This concludes a recent request on the mailing list:

    https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/EU3XR4VB3RP2NQB372QPZ4VRP57ANNLC/

Change-Id: Ie1f73352eb51fb2ceb2385232336312216ef87fc
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-03-05 16:30:02 +01:00
Masahisa Kojima
f9f1b4d989 docs(maintainers): add myself as SynQuacer platform co-maintainer
Add myself as co-maintainer for SynQuacer platform,
as I'm currently working on it.

Change-Id: I149830bf7f635f72df808214e8fd23730fde7212
Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
2024-03-05 10:38:17 +01:00
Manish Pandey
77ca4f7935 Merge "docs(auth): align TBBR CoT names to match the code" into integration 2024-03-04 21:59:30 +01:00
Manish Pandey
4d5dcff08e Merge changes from topic "css_refactor_arm" into integration
* changes:
  refactor(allwinner): console runtime switch on bl31 exit
  refactor(arm): console runtime switch on bl31 exit
  refactor(console): flush before console_switch_state
2024-03-04 21:53:25 +01:00
Bipin Ravi
9a79c9e431 Merge changes from topic "fix-lto-build-all" into integration
* changes:
  build(fpga): correctly handle gcc as linker for LTO
  fix(build): enforce single partition for LTO build
  fix(rockchip): add support for building with LTO enabled
2024-03-04 20:22:42 +01:00
Salman Nabi
bcfc29766d refactor(allwinner): console runtime switch on bl31 exit
Flush the FIFO before switching to runtime. This is so that there are
no lingering chars in the FIFO when we move to the runtime console.

TF-A plans to refactor the console_Switch_state(CONSOLE_FLAG_RUNTIME)
and console_flush() calls and make them the last calls in bl31_main()
(before BL31 exits). Until then they are being left as the last calls
in bl31_plat_runtime_setup() for testing before refactoring.

This patch only affects the Allwinner platform.

Change-Id: I15b4a459a280822a01c60e3b0c856b530db6efab
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2024-03-04 20:11:25 +01:00
Salman Nabi
c864af9891 refactor(arm): console runtime switch on bl31 exit
Any BL31 setup and Runtime initialization within BL31 is still part of
the BOOT process. As such, the console flush and switch must be the
last calls before BL31 exit. Flush the console print buffer before
switching to runtime. This is so that there is no lingering chars in
the print buffer when we move to the runtime console.

This patch adds console flush before switching to runtime in
bl31_plat_runtime_setup() function (before BL31 exits). The plan is to
move flush and switch calls to bl31_main before BL31 exits, until then
console_flush() in bl31_main.c has been left as is.

This patch affects the Arm platform only.

Change-Id: I4d367b9e9640686ac15246ad24318ae4685c12c5
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2024-03-04 20:11:25 +01:00
Salman Nabi
b90bbd1af4 refactor(console): flush before console_switch_state
TF-A plans to move console_flush() and
console_switch_state(CONSOLE_FLAG_RUNTIME) to the end of bl31_main()
before BL31 exits.

Add console_flush() in the generic implementation of
bl31_plat_runtime_setup() call so that platforms can implement or
follow the generic pattern to test this implementation before
console_flush() and console_switch_state() move to bl31_main().

This patch affects the generic implementation of
bl31_plat_runtime_setup()

Change-Id: I92b4176022bfb84558dec5a83386e8ecef49516a
Signed-off-by: Salman Nabi <salman.nabi@arm.com>
2024-03-04 20:11:25 +01:00
Madhukar Pappireddy
6c7a0394f3 Merge "fix(spm): reduce verbosity on passing tf-a-tests" into integration 2024-03-04 17:00:48 +01:00
Manish V Badarkhe
bd435c525e Merge changes from topic "topics/fwu_metadata_v2_migration" into integration
* changes:
  style(fwu): change the metadata fields to align with specification
  style(partition): use GUID values for GPT partition fields
  feat(st): add logic to boot the platform from an alternate bank
  feat(st): add a function to clear the FWU trial state counter
  feat(fwu): add a function to obtain an alternate FWU bank to boot
  feat(fwu): add some sanity checks for the FWU metadata
  feat(fwu): modify the check for getting the FWU bank's state
  feat(st): get the state of the active bank directly
  feat(fwu): add a config flag for including image info in the FWU metadata
  feat(fwu): migrate FWU metadata structure to version 2
  feat(fwu): document the config flag for including image info in the FWU metadata
  feat(fwu): update the URL links for the FWU specification
2024-03-04 15:53:31 +01:00
Manish Pandey
27b0440a8f Merge changes from topic "sgi_to_nrd" into integration
* changes:
  refactor(sgi): replace references to "SGI"/"sgi" for neoverse_rd
  refactor(sgi): rename "CSS_SGI"" macro prefixes to "NRD"
  refactor(sgi): move apis and types to "nrd" prefix
  refactor(sgi): replace build-option prefix to "NRD"
  refactor(sgi): move neoverse_rd out of css
  refactor(sgi): move from "sgi" to "neoverse_rd"
  feat(sgi): remove unused SGI_PLAT build-option
  fix(sgi): align to misra rule for braces
  feat(rde1edge): remove support for RD-E1-Edge
  fix(rdn2): populate TOS_CONFIG only when SPMC_AT_EL3 is enabled
  fix(board): update spi_id max for sgi multichip platforms
2024-03-02 12:28:37 +01:00
Bipin Ravi
262dc9f760 fix(cpus): workaround for Cortex-A715 erratum 2429384
Cortex-A715 erratum 2429384 is a cat B erratum that applies to
revision r1p0 and is fixed in r1p1. The workaround is to set
bit[27] of CPUACTLR2_EL1. There is no workaround for revision
r0p0.

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

Change-Id: I3cdb1b71567542174759f6946e9c81f77d0d993d
Signed-off-by: Bipin Ravi <biprav01@u203721.austin.arm.com>
2024-03-01 10:22:20 -06:00
Mark Dykes
d0decb0254 Merge "fix(cpus): workaround for Cortex-X3 erratum 2372204" into integration 2024-03-01 16:33:36 +01:00
Manish V Badarkhe
b2bca9ebb1 Merge changes from topic "smmuv3_fix" into integration
* changes:
  feat(smmu): separate out smmuv3_security_init from smmuv3_init
  feat(smmu): fix to perform INV_ALL before enabling GPC
2024-03-01 13:28:14 +01:00
Manish Pandey
c6e74540f1 Merge "refactor(qemu): console runtime switch on bl31 exit" into integration 2024-03-01 12:57:10 +01:00
Manish Pandey
1c408d3c40 Merge changes from topic "imx8ulp_support" into integration
* changes:
  docs(maintainers): add the maintainers for imx8ulp
  docs(imx8ulp): add imx8ulp platform
  fix(imx8ulp): increase the mmap region num
  feat(imx8ulp): adjust the dram mapped region
  feat(imx8ulp): ddrc switch auto low power and software interface
  feat(imx8ulp): add some delay before cmc1 access
  feat(imx8ulp): add a flag check for the ddr status
  fix(imx8ulp): add sw workaround for csi/hotplug test hang
  feat(imx8ulp): adjust the voltage when sys dvfs enabled
  feat(imx8ulp): enable the DDR frequency scaling support
  fix(imx8ulp): fix suspend/resume issue when DBD owner is s400 only
  feat(imx8ulp): update XRDC for ELE to access DDR with CA35 DID
  feat(imx8ulp): add memory region policy
  feat(imx8ulp): protect TEE region for secure access only
  feat(imx8ulp): add trusty support
  feat(imx8ulp): add OPTEE support
  feat(imx8ulp): update the upower config for power optimization
  feat(imx8ulp): allow RTD to reset APD through MU
  feat(imx8ulp): not power off LPAV PD when LPAV owner is RTD
  feat(imx8ulp): add system power off support
  feat(imx8ulp): add APD power down mode(PD) support in system suspend
  feat(imx8ulp): add the basic support for idle & system suspned
  feat(imx8ulp): enable 512KB cache after resume on imx8ulp
  feat(imx8ulp): add the initial XRDC support
  feat(imx8ulp): allocated caam did for the non secure world
  feat(imx8ulp): add i.MX8ULP basic support
  build(changelog): add new scopes for nxp imx8ulp platform
  feat(scmi): add scmi sensor support
2024-03-01 12:37:14 +01:00
Sughosh Ganu
8d08a1df1e style(fwu): change the metadata fields to align with specification
Change the names of some FWU metadata structure members to have them
align with the wording used in the corresponding specification. Use
the GUID type instead of UUID as the fields described in the
specification are GUIDs. Make corresponding changes to the code that
accesses these fields. No functional changes are introduced by the
patch.

Change-Id: Id3544ed1633811b0eeee2bf99477f9b7e6667044
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:40:05 +05:30
Sughosh Ganu
37e81a603d style(partition): use GUID values for GPT partition fields
The GPT partition uses GUID values for identification of partition
types and partitions. Change the relevant functions to use GUID values
instead of UUID's.

Change-Id: I30df66a8a02fb502e04b0285f34131b65977988e
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:40:05 +05:30
Sughosh Ganu
6166051426 feat(st): add logic to boot the platform from an alternate bank
In a few scenarios, there is a need to boot the platform from an
alernate bank which is not the active bank. Call the API
fwu_get_alernate_boot_bank() to select an alternate bank to boot the
platform from. Calling this API function might be required in a couple
of cases. One, in the unlikely scenario of the active bank being in an
invalid state, or if the number of times the platform boots in trial
state exceeds a pre-set count.

Also add a debug print that indicates the bank that
the platform is booting from.

Change-Id: I688406540e64d1719af8d5c121821f5bb6335c06
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:40:05 +05:30
Sughosh Ganu
6e99fee43e feat(st): add a function to clear the FWU trial state counter
Add an API stm32_clear_fwu_trial_boot_cnt() function to clear the
trial state counter. This is called in the corner case scenario when
the active index is in an Invalid state, thus needing a reset of the
trial state counter.

Change-Id: I2980135da88d0d947c222655c7958b51eb572d69
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:40:05 +05:30
Sughosh Ganu
26aab79560 feat(fwu): add a function to obtain an alternate FWU bank to boot
Add a function fwu_get_alternate_boot_bank() to return a valid bank to
boot from. This function can be called by a platform to get an
alternate bank to try to boot the platform in the unlikely scenario of
the active bank being in an invalid state, or if the number of times
the platform boots in trial state exceeds a pre-set count.

Change-Id: I4bcd88e68e334c452882255bf028e01b090369d1
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:40:05 +05:30
Sughosh Ganu
d2566cfb89 feat(fwu): add some sanity checks for the FWU metadata
Add some sanity checks on the values read from the FWU metadata
structure. This ensures that values in the metadata structure are
inline with certain config symbol values.

Change-Id: Ic4415da9048ac3980f8f811ed7852beb90683f7d
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:39:59 +05:30
Sughosh Ganu
56724d09c2 feat(fwu): modify the check for getting the FWU bank's state
The version 2 of the FWU metadata structure has a field bank_state in
the top level of the structure which can be used to check if a given
bank is in the either of Trial State, Accepted State, or in an Invalid
State. This is different from the binary states of Valid/Accepted
States that the bank could be in, as defined in the earlier version of
the specification.

Replace the fwu_is_trial_run_state() API with
fwu_get_active_bank_state() to get the state the current active bank
is in. The value returned by this API is then used by the caller to
take appropriate action.

Change-Id: I764f486840a3713bfe5f8e03d0634bfe09b23590
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:19:56 +05:30
Sughosh Ganu
588b01b5e4 feat(st): get the state of the active bank directly
With version 2 of the FWU metadata structure, the state that a bank is
in can be obtained from the bank_state field in the top level
structure. Read the state of the active bank by referencing this field
directly, instead of making an API call.

Change-Id: Ib22c56acbe172923b1323c544801ded81f1598ec
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:19:56 +05:30
Sughosh Ganu
11d05a7729 feat(fwu): add a config flag for including image info in the FWU metadata
The version 2 of the FWU metadata structure is designed such that the
information on the updatable images can be omitted from the metadata
structure. Add a configuration flag, PSA_FWU_METADATA_FW_STORE_DESC,
which is used to select whether the metadata structure has this
information included or not. It's value is set to 1 by default.

Change-Id: I4463a20c94d2c745ddb0b2cc8932c12d418fbd42
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:19:56 +05:30
Sughosh Ganu
a89d58bb20 feat(fwu): migrate FWU metadata structure to version 2
The latest version of the FWU specification [1] has changes to the
metadata structure. This is version 2 of the structure.

Primary changes include
 - bank_state field in the top level structure
 - Total metadata size in the top level structure
 - Image description structures now optional
 - Number of banks and images per bank values part of the structure

Make changes to the structure to align with version 2 of the structure
defined in the specification. These changes also remove support for
version 1 of the metadata structure.

[1] - https://developer.arm.com/documentation/den0118/latest/

Change-Id: I84b4e742e463cae92375dde8b4603b4a581d62d8
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:19:56 +05:30