Commit graph

13392 commits

Author SHA1 Message Date
Madhukar Pappireddy
1f6bb41dd9 refactor(el3-runtime): plat_ic_has_interrupt_type returns bool
Rather than returning 0 or 1, the above function returns bool false
or true. No functional change.

Change-Id: Iea904ffc368568208fa8203e0d2e0cdaa500b1e0
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-09-25 17:09:15 -05:00
Madhukar Pappireddy
07f867b122 fix(el3-runtime): leverage generic interrupt controller helpers
Rather than validating the type of interrupts supported by the
platform interrupt controller, the interrupt management framework can
directly use helper utilities implemented by the generic interrupt
controller driver.

Change-Id: I735f8d2742a2c7974d11c0a5ddc771ad807c635c
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-09-25 17:09:15 -05:00
Madhukar Pappireddy
632e5ffeb8 fix(gicv3): map generic interrupt type to GICv3 group
The generic interrupt controller identifies an interrupt based on its
type whereas the GIC uses the notion of groups to identify an
interrupt.

Currently, they are used interchangeably in GICv3 driver. It did not
cause any functional issues since the matching type and group had the
same value for corresponding macros. This patch makes the necessary
fixes.

The generic interrupt controller APIs, such as
plat_ic_set_interrupt_type map interrupt type to interrupt group
supported by the GICv3 IP. Similarly, other generic interrupt
controller APIs map interrupt group to interrupt type as needed.

This patch also changes the name of the helper functions to use group
rather than type for handling interrupts.

Change-Id: Ie2d88a3260c71e4ab9c8baacde24cc21e551de3d
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-09-25 17:09:04 -05:00
Madhukar Pappireddy
ab80cf35e7 chore(gicv2): use interrupt group instead of type
The generic interrupt controller identifies an interrupt based on its
type whereas the GIC uses the notion of groups to identify an
interrupt.

This patch changes the name of the helper functions to use group
rather than type for handling interrupts. No functional change in this
patch.

Change-Id: If13ec65cc6c87c2da73a3d54b033f02635ff924a
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-09-25 17:06:35 -05:00
Sandrine Bailleux
9c44778818 Merge changes If9672598,I219c49d3 into integration
* changes:
  feat(cert-create): add pkcs11 engine support
  fix(cert-create): key: Avoid having a temporary value for pkey in key_load
2023-09-25 17:00:52 +02:00
Bipin Ravi
684532a965 Merge "fix(errata-abi): fix the rev-var for Cortex-A710" into integration 2023-09-22 20:23:54 +02:00
Lauren Wehrmeister
fcfa15d41c Merge changes from topic "errata" into integration
* changes:
  fix(cpus): workaround for Neoverse V2 erratum 2743011
  fix(cpus): workaround for Neoverse V2 erratum 2779510
  fix(cpus): workaround for Neoverse V2 erratum 2719105
  fix(cpus): workaround for Neoverse V2 erratum 2331132
2023-09-22 20:22:19 +02:00
Sona Mathew
5c8fcc0ca7 fix(errata-abi): fix the rev-var for Cortex-A710
Update the revision and variant information in the
errata ABI file for Cortex-A710, erratum ID - 2058056
to match the revision and variant in the cortex_a710.S
file.

Change-Id: I4b974ac1f94d770f3ae7c15c88f42380c944eb43
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-09-21 14:27:56 -05:00
Lauren Wehrmeister
1438a5e729 Merge "fix(cpus): update the fix for Cortex-A78AE erratum 1941500" into integration 2023-09-21 17:28:07 +02:00
Varun Wadekar
67a2ad171d fix(cpus): update the fix for Cortex-A78AE erratum 1941500
This patch fixes the mitigation for erratum 1941500 for the
Cortex-A78AE CPUs. The right fix is to set the bit 8, whereas
the current code clears it.

Reported-by: matthias.rosenfelder@nio.io
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: Ib7c3fddd567eeae6204756377e0f77a573c0a911
2023-09-21 14:23:27 +01:00
Robin van der Gracht
616b3ce27d feat(cert-create): add pkcs11 engine support
Add pkcs11 engine support which allows using keys that are securely
stored on a HSM or TPM. To use this feature the user has to supply
an RFC 7512 compliant PKCS11 URI to a key instead of a file as an
argument to one of the key options. This change is fully backwards
compatible.

This change makes use of the openssl engine API which is deprecated
since openssl 3.0 and will most likely be removed in version 4. So
pkcs11 support will have to be updated to the openssl provider API
in the near future.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Change-Id: If96725988ca62c5613ec59123943bf15922f5d1f
2023-09-21 13:27:25 +02:00
Yann Gautier
aadb759a5a Merge "fix(ufs): performs unsigned shift for doorbell" into integration 2023-09-21 11:48:09 +02:00
Robin van der Gracht
ea6f8452f6 fix(cert-create): key: Avoid having a temporary value for pkey in key_load
key->key and k will point to the same if PEM_read_PrivateKey
(pem_read_bio_key_decoder) succeeds. There is no need for the temporary
'k' pointer here.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Change-Id: I219c49d331eb6dd7200b49b75d47fd66da3d82dd
2023-09-20 16:54:46 +02:00
Manish Pandey
cd83a766d5 Merge "fix(st-ddr): express memory size with size_t type" into integration 2023-09-20 15:58:41 +02:00
Olivier Deprez
84de50c7d8 Merge "feat(ethos-n): update npu error handling" into integration 2023-09-19 18:15:12 +02:00
Olivier Deprez
1e038c94d8 Merge "fix(cpufeat): move nested virtualization support to optionals" into integration 2023-09-19 16:44:28 +02:00
Madhukar Pappireddy
83e79a39a7 Merge "fix(mmc): initialises response buffer with zeros" into integration 2023-09-19 15:47:20 +02:00
Govindraj Raja
8b2048c1c0 fix(cpufeat): move nested virtualization support to optionals
Commit(f5211420b refactor(cpufeat): refactor arch feature build
options) accidentally added nested virtualization support to mandatory
8.4 features move this to optional 8.4 features list.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I3eb84ea489b6a5cc419359bc056aaadcced0ad0e
2023-09-19 08:46:09 -05:00
Joanna Farley
455cd0d3b5 Merge "chore: remove MULTI_CONSOLE_API references" into integration 2023-09-19 14:48:43 +02:00
Sandrine Bailleux
c228daf5f0 Merge "fix(qemu_sbsa): align FIP base to BL1 size" into integration 2023-09-19 13:48:54 +02:00
Sandrine Bailleux
78b3792a48 Merge "feat(qemu): add "neoverse-n2" cpu support" into integration 2023-09-19 11:16:49 +02:00
Bipin Ravi
58dd153cc8 fix(cpus): workaround for Neoverse V2 erratum 2743011
Neoverse V2 erratum 2743011 is a Cat B erratum that applies to
all revisions <= r0p1 and is fixed in r0p2. The workaround is to
set CPUACTLR5_EL1[56:55] to 2'b01.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I0e06ca723a1cce51fb027b7160f3dd06a4c93e64
2023-09-18 19:54:41 -05:00
Bipin Ravi
ff342643bc fix(cpus): workaround for Neoverse V2 erratum 2779510
Neoverse V2 erratum 2779510 is a Cat B erratum that applies to
all revisions <= r0p1 and is fixed in r0p2. The workaround is to
set bit[47] of CPUACTLR3_EL1 which might have a small impact on
power and negligible impact on performance.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I6d937747bdcbf2913a64c4037f99918cbc466e80
2023-09-18 19:35:16 -05:00
Bipin Ravi
b01140256b fix(cpus): workaround for Neoverse V2 erratum 2719105
Neoverse V2 erratum 2719105 is a Cat B erratum that applies to all
revisions <= r0p1 and is fixed in r0p2.

The erratum is avoided by setting CPUACTLR2_EL1[0] to 1 to force
PLDW/PFRM ST to behave like PLD/PRFM LD and not cause invalidations
to other PE caches. There might be a small performance degradation
to this workaround for certain workloads that share data.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Id026edcb7ee1ca93371ce0001d18f5a8282c49ba
2023-09-18 17:43:51 -05:00
Bipin Ravi
8852fb5b7d fix(cpus): workaround for Neoverse V2 erratum 2331132
Neoverse V2 erratum 2331132 is a Cat B erratum that applies to all
revisions <= r0p2 and is still open. The workaround is to write the
value 4'b1001 to the PF_MODE bits in the IMP_CPUECTLR2_EL1 register
which will place the data prefetcher in the most conservative mode
instead of disabling it.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Ic6c76375df465a4ad2e20dd7add7037477d973c1
2023-09-18 17:42:07 -05:00
Mark Dykes
57b557d038 Merge "refactor(cpufeat): refactor arch feature build options" into integration 2023-09-18 16:29:12 +02:00
Marcin Juszkiewicz
408cde8a59 fix(qemu_sbsa): align FIP base to BL1 size
RME patch series shown that we can build larger BL1 than we can run:

NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.9(debug):v2.9.0-736-g08548888a
NOTICE:  BL1: Built : 12:10:39, Sep 18 2023
INFO:    BL1: RAM 0x3ffee000 - 0x3fffb000
INFO:    BL1: Loading BL2
WARNING: Firmware Image Package header check failed.

RME pushed debug build BL1 over 0x8000 in size.
This exposed an error where FIP_BASE (supposed to be at BL1_SIZE offset
from start of flash) was actually 0x8000 and not 0x12000.
Make sure we have space for BL1 by deriving FIP_BASE from it.

Note: this is a breaking change for edk2 FD image generation, which had
similarly hardcoded a 0x8000 offset. These images must be updated in
lock-step.

Change-Id: I8a1a85e82319945a4412c424467d818d5b6e4ecd
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2023-09-18 13:00:40 +01:00
Manish Pandey
6ab8bb76cb Merge "docs(maintainers): update corstone1000 maintainers" into integration 2023-09-18 12:57:58 +02:00
Xueliang Zhong
140d890954 docs(maintainers): update corstone1000 maintainers
Update maintainers list for corstone1000 platform.

Signed-off-by: Xueliang Zhong <xueliang.zhong@arm.com>
Change-Id: I779e3717f6a6e19d32e8568eda05204cd46f35ea
2023-09-18 12:09:47 +02:00
Sandrine Bailleux
dbfafc5e7e Merge "fix(auth): don't overwrite pk with converted pk when rotpk is hash" into integration 2023-09-18 11:30:18 +02:00
Yann Gautier
b4e1e8fbf0 fix(st-ddr): express memory size with size_t type
Express memory size with size_t type in structures.
Retrieve value as uint32_t from device tree and then cast it to size_t.
Combined with uintptr_t use, it ensures a generic algorithm whatever
the platform architecture, notably within systematic tests. Adapt also
their prototypes.

Move memory size print outside stm32mp_ddr_check_size() to adapt it to
related platform.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Change-Id: Ic6e1a62d7a5e23cef49909a658098c800e7dae3f
2023-09-18 09:58:00 +02:00
Anand Saminathan
e47d8a58b0 fix(ufs): performs unsigned shift for doorbell
slot ranges from 0 to 31, left shifting 1 by slot is undefined when slot
is 31

Change-Id: I0c2e6d278ff593cee07736627cd87692f45e2da9
Signed-off-by: Anand Saminathan <anans@google.com>
2023-09-16 10:53:09 +00:00
Anand Saminathan
b1a2c51a08 fix(mmc): initialises response buffer with zeros
if ops->send_cmd in mmc_send_cmd returns a non-zero value, r_data
(resp_data in mmc_device_state) is never populated, so the while
condition in mmc_device_state would end up reading the uninitialized
resp_data buffer

Signed-off-by: Anand Saminathan <anans@google.com>
Change-Id: I72d752867c537d49e111e6d149c3cca122f7dc9f
2023-09-16 10:42:39 +00:00
Marcin Juszkiewicz
408f9cb485 feat(qemu): add "neoverse-n2" cpu support
Add support to qemu "neoverse-n2" cpu for "qemu" platform.
This one has 2^48 address space so will be used by both systems.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: I9f0fa23a4934d9464379495225e08adc121325b4
2023-09-15 22:44:04 +02:00
Govindraj Raja
f5211420b5 refactor(cpufeat): refactor arch feature build options
Current build infra defaults all cpufeats in defaults.mk and some
mandatory features are enabled in arch_features.mk and optional
arch features are enabled in platform specific makefile.
This fragmentation is sometime confusing to figure out which feature
is tied to which ARCH_MAJOR.ARCH_MINOR.

So, consolidating and grouping them for tracking and enabling makes
more sense. With this change we consolidate all ARCH feature handling
within arch_features.mk and disable all optional features that need
to be enabled to platform makefile.

This is an ongoing series of effort to consolidate and going forward
platform makefile should just specify ARCH_MAJOR and ARCH MINOR and
all mandatory feature should be selected based on arch_features.mk
any optional feature needed by the platform support can be enabled
by platform makefile.

It also makes it easier for platform ports to look upto arch_features.mk
and enable any optional feature that platform may need which are
supported from TF-A.

Change-Id: I18764008856d81414256b6cbabdfa42a16b8040d
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-09-15 14:53:08 +02:00
Manish V Badarkhe
cc933e1d12 Merge changes from topic "stm32mp2" into integration
* changes:
  feat(stm32mp2): generate stm32 file
  feat(stm32mp2-fdts): add stm32mp257f-ev1 board
  feat(stm32mp2-fdts): introduce stm32mp25 pinctrl files
  feat(stm32mp2-fdts): introduce stm32mp25 SoCs family
  feat(stm32mp2): add console configuration
  feat(st): add RCC registers list
  feat(st-uart): add AARCH64 stm32_console driver
  feat(st): introduce new platform STM32MP2
  feat(dt-bindings): add the STM32MP2 clock and reset bindings
  docs(changelog): add scopes for STM32MP2
  feat(docs): introduce STM32MP2 doc
  refactor(docs): add a sub-menu for ST platforms
  refactor(st): move plat_image_load.c
  refactor(st): rename PLAT_NB_FIXED_REGS
  refactor(st): move some storage definitions to common part
  refactor(st): move SDMMC definitions to driver
  feat(st-clock): stub fdt_get_rcc_secure_state
  feat(st-clock): allow aarch64 compilation of STGEN functions
  feat(st): allow AARCH64 compilation for common code
  refactor(st): rename QSPI macros
2023-09-15 09:41:44 +02:00
Manish V Badarkhe
44a267b59e Merge changes from topic "xlnx_mmap_dynamic_dtb" into integration
* changes:
  fix(xilinx): dcache flush for dtb region
  fix(xilinx): dynamic mmap region for dtb
2023-09-15 08:44:42 +02:00
Sandrine Bailleux
d4635e9998 Merge "feat(qemu): add A55 cpu support for virt" into integration 2023-09-15 08:20:15 +02:00
Olivier Deprez
4bb6bd1e5b Merge "fix(plat/arm): do not program DSU CLUSTERPWRDN register" into integration 2023-09-14 18:10:29 +02:00
Madhukar Pappireddy
75bfc18d6c Merge "fix: bl2 start address for RESET_TO_BL2+ENABLE_PIE" into integration 2023-09-14 17:49:54 +02:00
Manish Pandey
3209b35d2a fix(plat/arm): do not program DSU CLUSTERPWRDN register
This reverts commit 9cf7f355ce.

Above mentioned commit was writing to cluster power required bit of
CLUSTERPWRDN register, which provides an advisory status to the power
controller.
Bit definition indication:
0 : Cluster power is not required when all cores are powered down
1 : Cluster power is required even when all cores are powered down
RESET value of this bit is 0

The current implementation in TF-A just programs this bit to 0 when
cluster power down is done but it never sets it to 1. Which actully
does not change any behaviour as the value of this bit always remains 0.

Ideally this bit has to be set to 1 when a core powers up (as RESET
value is 0) and set it to 0 for any core power down except if its last
man standing, in that case we need to ensure the target power level
from OS is cluster then we can do set it to 0.
There also are some investigation needs to be done to find that whether
we need a explicit message to power controller for turning cluster OFF
or it will happen automatically.

Considering this needs a bit of analysis as well as a platform to test
it on, revert the changes which impact the programming during cluster
power down and just keep register defnition.

Change-Id: I4c4ebedae7ca9cd081fb1e0605b9d906d77614d9
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
2023-09-14 11:42:14 +01:00
Olivier Deprez
61412f799f Merge "fix(fvp): conditionally increase XLAT and MMAP table entries" into integration 2023-09-14 09:15:45 +02:00
Amit Nagal
93ed138006 fix(xilinx): dcache flush for dtb region
flush dcache region for dtb so that dtb cache entries are first written
to disk and are invalidated afterwards to avoid presence of any stale
dtb related entry in the dcache.

Change-Id: Ide0ed58f799b35b690ed790c7498ecdc334e02f5
Signed-off-by: Amit Nagal <amit.nagal@amd.com>
2023-09-13 18:37:39 +02:00
Amit Nagal
7ca7fb1bf0 fix(xilinx): dynamic mmap region for dtb
mmap dtb region before usage and unmap it after usage.
overall size(text,data,bss) of dtb gets reduced by
16 bytes in normal flow and 80 bytes in ddr flow.

Signed-off-by: Amit Nagal <amit.nagal@amd.com>
Change-Id: I411deff57ab141fc2978a2e916aec2d988cb8f9c
2023-09-13 18:36:00 +02:00
Sandrine Bailleux
512e0be0d4 Merge "feat(qemu): add "cortex-a710" cpu support" into integration 2023-09-13 16:03:26 +02:00
Manish V Badarkhe
03cf4e9aad fix(fvp): conditionally increase XLAT and MMAP table entries
The XLAT and MMAP table entries are increased as a part of this
patch: 12fe591 , but this is causing failures for some builds,
so conditionally increased the XLAT and MMAP table entries

Change-Id: I31e8c811bebc767d7187e045a35c9db0eef13ae0
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-09-13 15:02:18 +01:00
Mark-PK Tsai
409c20c84d feat(qemu): add A55 cpu support for virt
Add support to "cortex-a55" cpu for "qemu" ('virt') platform.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Change-Id: I2693892be735eda91494b767322935ddb63c9f48
2023-09-13 20:08:32 +08:00
Robin van der Gracht
1046b41808 fix(auth): don't overwrite pk with converted pk when rotpk is hash
crypto_mod_verify_signature() expects a pointer to the full pk.

In case of stm32mp1 crypto_verify_signature() will call
get_plain_pk_from_asn1() on the converted pk which fails.

Fixes: f1e693a775

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Change-Id: Ia9bdaa10e1b09f9758e5fa608a063b5212c428c3
2023-09-13 11:45:22 +01:00
Marcin Juszkiewicz
4734a62d2c feat(qemu): add "cortex-a710" cpu support
Add support to qemu "cortex-a710" cpu for "qemu" platform.

CPU is supported by qemu/virt only as qemu/sbsa-ref memory starts at
2^40 which is limit for Cortex-A710.

Switched 'qemu' platform to be built as armv8.5 to cover features of
new cpu core.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Change-Id: I035790eac41b2caf7f13167e53f48c16f0827754
2023-09-13 10:18:15 +01:00
Olivier Deprez
d478ac16c9 fix: bl2 start address for RESET_TO_BL2+ENABLE_PIE
BL31 image has grown with feature addition over time. In particular the
RESET_TO_BL2 + ENABLE_PIE + DEBUG combination of options lead to BL31
image overlap head of BL2 image. In this configuration BL2 is meant to
stay resident as PE reset occurs from BL2. Apply changes similar to [1]
such that BL2 start address is pushed forward and leaves more room for
BL31 end of image.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/15486/9/include/plat/arm/common/arm_def.h#530

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I027e23780fb77ca9fe81aa47231da649c7a030ee
2023-09-12 18:01:37 +02:00