Commit graph

13399 commits

Author SHA1 Message Date
Christophe Kerello
f4d765a128 fix(nand): reset the SLC NAND
The reset command should be the first command sent to the SLC NAND.
Resetting the SLC NAND should not be done only if NAND_ONFI_DETECT
is enabled.

Change-Id: If225a1b1a7e04181cc5839e282c435c5c8958bd7
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
2023-09-27 16:21:58 +02:00
Gatien Chevallier
53092a7780 fix(st-crypto): do not read RNG data if it's not ready
Having RNG_SR_DRDY bit in RNG_SR register does not mean that there are 4
RNG words ready to be read. Add a check on RNG_SR_DRDY between each word
reading.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Change-Id: I46af7ca6c0ddbe19540b248365a5016b15b9a707
2023-09-27 16:21:58 +02:00
Joanna Farley
4593e7cbe8 Merge changes from topic "xilinx-crash" into integration
* changes:
  feat(xilinx): used console also as crash console
  feat(versal-net): remove empty crash console setup
2023-09-27 09:49:01 +02:00
Olivier Deprez
0ef4103eb9 Merge "feat(mt8188): update return value in mtk_emi_mpu_sip_handler" into integration 2023-09-27 09:31:59 +02:00
Dawei Chien
d07eee245b feat(mt8188): update return value in mtk_emi_mpu_sip_handler
Remove the use of SMC_RET2 in the mtk_emi_mpu_sip_handler function. The
current smc driver in the atf driver has switched to using SMC_RET4 for
smc call clients. This change aligns the return value handling with the
updated driver behavior that ensures consistency and avoids potential
issues with the old return value.

Change-Id: I87f25b438d2119837c45bed80a8224fcfd141fb6
Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
Signed-off-by: Jason Chen <Jason-ch.Chen@mediatek.com>
2023-09-27 09:55:13 +08:00
Manish V Badarkhe
7c3ff62d22 Merge "feat(fiptool): add ability to build statically" into integration 2023-09-26 17:46:18 +02:00
Yann Gautier
1b2667bf66 Merge "fix(corstone-1000): add cpu_helpers.S to platform.mk" into integration 2023-09-26 11:32:11 +02:00
Olivier Deprez
4d4fec2818 feat(fiptool): add ability to build statically
Provide a STATIC command line build option for platforms willing to
build fiptool statically and remove dependency to toolchain and OpenSSL
libraries.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I1d1b6676df50081828170e2b0ab7b71c4ec19d6e
2023-09-25 18:13:10 +02: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
Michal Simek
3e6b96e869 feat(xilinx): used console also as crash console
CONSOLE_FLAG_CRASH should be also setup to get crash logs on
the same console. Both platforms are using crash console
implementation from plat/common/aarch64/crash_console_helpers.S
that's why there is necessary to setup CONSOLE_FLAG_CRASH.
plat_crash_console_putc() implementation is saying:
"int plat_crash_console_putc(char c)
Prints the character on all consoles registered with the console
framework that have CONSOLE_FLAG_CRASH set. Note that this is only
helpful for crashes that occur after the platform intialization code
has registered a console. Platforms using this implementation need to
ensure that all console drivers they use that have the CRASH flag set
support this (i.e. are written in assembly and comply to the register
clobber requirements of plat_crash_console_putc()."

Change-Id: I314cacbcb0bfcc85fe734882e38718f2763cdbf4
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-09-20 14:58:50 +02:00
Michal Simek
6a14246ad4 feat(versal-net): remove empty crash console setup
Private plat_crash_console_init() has all the setup commented
that's why it was never been tested.
pl011 uart is supposed to be used as crash console and it should be
enought to add CONSOLE_FLAG_CRASH and remove platform specific
implementation and use generic one.
Early console can't be used for early ASM debugging but that's
expected and not required.

Change-Id: I1267fd78c0d6532a0baddbcad8a5b2a7dfc7750b
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-09-20 14:58:50 +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