Commit Graph

9943 Commits

Author SHA1 Message Date
Gary Morrison dc669220d5 feat(plat/fvp_r): Threat Model for TF-A v8-R64 Support
Threat model for the current, BL1-only R-class support.

Signed-off-by: Gary Morrison <gary.morrison@arm.com>
Change-Id: I8479d5cb30f3cf3919281cc8dc1f21cada9511e0
2021-12-16 08:10:35 -06:00
Jayanth Dodderi Chidanand 820371b130 fix(amu): add default value for ENABLE_FEAT_FGT and ENABLE_FEAT_ECV flags
ENABLE_FEAT_FGT and ENABLE_FEAT_ECV macros are used to access
HDFGRTR_EL2 and CNTPOFF_EL2 registers respectively. These flags are set
to true for v8.6 and upwards and are not handled explicitly for lower
architecture versions.

This patch adds definitive default value to these build macros, so that
for v8.5 and below, they are not overridden and set to true by the gcc.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Ic300194c8ad77558be9a0e00153e42185bf2c58c
2021-12-16 09:26:05 +00:00
J-Alves c1ff1791f7 docs(ff-a): boot order field of SPs manifest
Document `boot-order` field from FF-A partitions manifest, in accordance
to Hafnium's (SPM) implementation.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I9fd070100ee52e0d465d2cce830cc91d78bddfc0
2021-12-16 09:24:56 +00:00
Manoj Kumar 572c8ce255 feat(morello): add DTS for Morello SoC platform
Added Morello SoC specific DTS file.

Change-Id: I099e74ec95ed9e1b47f7d5a68b0dd1e251439e11
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:52:31 +05:30
Chandni Cherukuri 9b8c431e2b feat(morello): configure DMC-Bing mode
Based on the SCC configuration value obtained from the SDS
platform information structure configure DMC-Bing Server or
Client mode after zeroing out the memory.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I0555fa06c9c1906264848f4e32ca413b4742cdee
2021-12-15 11:52:10 +05:30
Manoj Kumar 2d39b39704 feat(morello): zero out the DDR memory space
For Morello SoC, we use ECC capability for the RDIMMs
which require the entire DDR memory space to be zeroed
out before it can be accessed.

Change-Id: Icbe9916f9a2d3c4ce839d8bf7f867efa18f33e23
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:50:29 +05:30
Manoj Kumar 8840711f33 feat(morello): add TARGET_PLATFORM flag
The same folder "plat/arm/board/morello" is going to be
used by both Morello FVP and Morello SoC platforms.

TARGET_PLATFORM build flag has been introduced to
differentiate between the two platforms

Change-Id: I3e94da372a3f1ba810b4259b85dd4c204306c359
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:50:11 +05:30
Anurag Koul e8b7a80436 fix(morello): fix SoC reference clock frequency
Morello Specification specifies the system
reference clock frequency as 50MHz so the frequency
has been changed from 100MHz to 50MHz.

Change-Id: I25577b04aa54ed82b7e9df69ac8e40ac54a9b111
Signed-off-by: Anurag Koul <anurag.koul@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:49:50 +05:30
Chandni Cherukuri c5f3de8dab fix(arm): use PLAT instead of TARGET_PLATFORM
There might be several platforms which use the
TARGET_PLATFORM build option to differentiate the code
between the platform variants.

Use of TARGET_PLATFORM in the common code leads to build
failures instead use PLAT build option.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I9724caf875bd56225e035ecffa8b9ca1a50d3401
2021-12-15 11:49:21 +05:30
Madhukar Pappireddy 7468be1274 Merge changes from topic "fconf_get_index" into integration
* changes:
  feat(stm32mp1): skip TOS_FW_CONFIG if not in FIP
  feat(fconf): add a helper to get image index
2021-12-14 20:58:09 +01:00
johpow01 d0ec1cc437 feat(ccidx): update the do_dcsw_op function to support FEAT_CCIDX
FEAT_CCIDX modifies the register fields in CCSIDR/CCSIDR2 (aarch32)
and CCSIDR_EL1 (aarch64). This patch adds a check to the do_dcsw_op
function to use the right register format rather than assuming
that FEAT_CCIDX is not implemented.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I12cd00cd7b5889525d4d2750281a751dd74ef5dc
2021-12-14 12:48:08 -06:00
Madhukar Pappireddy 4abb0db11b Merge changes from topic "st_uart_update" into integration
* changes:
  feat(st): protect UART during platform init
  feat(stm32mp1): update console management for SP_min
  refactor(stm32mp1): improve console management in BL2
  feat(plat/st): add a function to configure console
  feat(stm32mp1): add stm32_get_boot_interface function
  refactor(stm32mp1): move stm32_save_boot_interface()
  fix(stm32mp1): deconfigure UART RX pins
  feat(stm32_gpio): add a function to reset a pin
  refactor(stm32mp1): sort compilation flags
  feat(stm32mp1): add sign-compare warning
2021-12-14 18:25:39 +01:00
Mark Dykes 00e8113145 fix(trp): Distinguish between cold and warm boot
The original design prevented the primary CPU from doing a
warm boot sequence. This patch allows the primary to do warm
boot as well.

Signed-off-by: Mark Dykes <mark.dykes@arm.com>
Change-Id: I6baa50c3dff3051ff8b3e5a922d340634f651867
2021-12-14 10:24:24 -06:00
Yann Gautier acf28c267b feat(st): protect UART during platform init
Protect the UART instance used for serial boot
with UART used for console.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ieee1557b34e7baa81594c3fbf0513191737027bf
2021-12-14 11:34:16 +01:00
Yann Gautier aafff04354 feat(stm32mp1): update console management for SP_min
Use stm32mp_uart_console_setup() in SP_min setup.
Adapt the function stm32mp_uart_console_setup() for BL32 (no reset, add
CONSOLE_FLAG_RUNTIME under DEBUG.

Change-Id: Ib2d35c8d285dafb680aa218872ad679cbf43d0ed
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 86240942fa refactor(stm32mp1): improve console management in BL2
Use newly created function stm32mp_uart_console_setup().
And remove now useless code.

Change-Id: Ib8d0319d3f4f54309848bc225b58608cea73bad9
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 53612f7293 feat(plat/st): add a function to configure console
To ease console configuration, a dedicated function is created:
stm32mp_uart_console_setup(). The code will also be common for the
different BLs.

Change-Id: Idf3cad756f125ca2313cf30b1311637a9df8f27f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier a6bfa75cf2 feat(stm32mp1): add stm32_get_boot_interface function
Add function stm32_get_boot_interface to get the current boot interface
from information saved in the TAMP register.

Change-Id: I23af43c68eeaebe4c45920a57d739117aea3fbb1
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 4dc77a35e3 refactor(stm32mp1): move stm32_save_boot_interface()
The function stm32_save_boot_interface()is moved to stm32mp1_private.c
file. The files stm32mp1_context.{c,h} are removed.
As return is always 0, change the function to return void.
Call it earlier, to be able to use it when configuring console.

Change-Id: I8986e1257dc8e8708eab044a51ea1f2426b16597
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier d7176f0319 fix(stm32mp1): deconfigure UART RX pins
Those pins are configured by ROM code, for serial boot use cases.
Their configs are reset if the boot is done on UART, but not on USB.
This should then be done in TF-A. This has to be done after clock
init, and before console is configured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I29a9694e25fcf1665360dd71f73937f769c43b52
2021-12-14 09:25:19 +01:00
Yann Gautier 737ad29bf9 feat(stm32_gpio): add a function to reset a pin
Add set_gpio_reset_cfg() to set a pin in its reset configuration:
analog, no-pull, speed low, and its secure configuration, thanks to
stm32_gpio_is_secure_at_reset().

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I7b73c3636859f97fcc57f81cf68b42efc727922e
2021-12-14 09:25:19 +01:00
Yann Gautier ce21ee89d4 refactor(stm32mp1): sort compilation flags
Sort the compilation flags in platform.mk when checking and defining
them for C files.

Change-Id: I5a08399c89ede4c0bd8697045706122732205db5
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier c10f3a4559 feat(stm32mp1): add sign-compare warning
Add -Wsign-compare to TF_CFLAGS to check signedness comparison during
STM32MP1 platform compilation.

Change-Id: I4cada49622f44258d3e0da4560a566de9c7d54b3
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Madhukar Pappireddy 20c8c230c8 Merge "fix(scmi): make msg_header variable volatile" into integration 2021-12-13 20:12:02 +01:00
Yann Gautier b706608642 feat(stm32mp1): skip TOS_FW_CONFIG if not in FIP
Thanks to dyn_cfg_dtb_info_get_index(), we can check if TOS_FW_CONFIG
is inside the FIP partition. If not we can skip its treatment when
populating FIP images.

Change-Id: If5623eabd1ba484549d4a908d4a6f43325b36875
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-13 17:37:57 +01:00
Yann Gautier 9e3f409398 feat(fconf): add a helper to get image index
A new function dyn_cfg_dtb_info_get_index() is created to get the index
of the given image config_id in the dtb_infos pool.
This allows checking if an image with a specific ID is in the FIP.

Change-Id: Ib300ed08e5b8a683dc7980a90221c305fb3f457d
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-13 17:37:53 +01:00
Manish Pandey a5645148a6 Merge changes from topic "jc/AMUv1" into integration
* changes:
  docs(build-options): add build macros for features FGT,AMUv1 and ECV
  fix(amu): fault handling on EL2 context switch
2021-12-13 13:52:37 +01:00
Edward-JW Yang ab45305062 feat(plat/mediatek/mt8195): improve SPM wakeup log
To enhance debug efficiency, modify wakeup log:
1. Redefine strings of wakeup reason for readability.
2. Indicate 26M clock on/off state of previous suspend.
3. Add warning log if SPM cannot get wakeup reason.

BUG=b:205201535
TEST=build pass

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.corp-partner.google.com>
Change-Id: Icb14ebb08958da225969abd3cdd9e471d232c7eb
2021-12-13 17:20:37 +08:00
Takuya Sakata 14d9727e33 feat(plat/rcar3): update IPL and Secure Monitor Rev.3.0.3
Update the revision number in the revision management file.

Signed-off-by: Hideyuki Nitta <hideyuki.nitta.jf@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I19f713de68e62a2ed3f4ec08c31b35af6a4014ef
2021-12-12 13:07:09 +01:00
Takuya Sakata ffb725be98 feat(plat/rcar3): modify type for Internal function argument
Modify the type of the variable that stores the value for MPIDR
in the internal function from uint64_t to u_register_t.

Signed-off-by: Koichi Yamaguchi <koichi.yamaguchi.zb@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ib5bda93d5432e0412132bddf41ead8ee3fcf9e46
2021-12-12 13:07:06 +01:00
Takuya Sakata d9912cf3d1 feat(plat/rcar3): modify sequence for update value for WUPMSKCA57/53
Add new function so that the value of bit at WUPMSKCA57/53,
which points to CPU other than the BOOT CPU, is 1 at initialization.
Modify sequence so that value of each bit for CPU at WUPMSKCA57/53 is
basically 0 and target bit value is changed to 1 only when CPU_OFF.

Signed-off-by: Koichi Yamaguchi <koichi.yamaguchi.zb@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Id5dafc04e1dbaf265c8b67b903c335bb1af49914
2021-12-12 13:07:02 +01:00
Takuya Sakata 82bb6c2e88 fix(plat/rcar3): fix to bit operation for WUPMSKCA57/53
Change internal function to call when updating value for WUPMSKCA57/53.

Signed-off-by: Koichi Yamaguchi <koichi.yamaguchi.zb@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Id20e65e27861dd73a149ff487123859581a9b5c5
2021-12-12 13:06:59 +01:00
Madhukar Pappireddy 714ca37dc7 Merge "feat(plat/zynqmp): disable the -mbranch-protection flag" into integration 2021-12-10 19:07:40 +01:00
Madhukar Pappireddy 9554a186a7 Merge changes from topic "a3700-comphy-fixes-1" into integration
* changes:
  refactor(drivers/marvell/comphy-3700): rename Clock Source Low value constants
  refactor(drivers/marvell/comphy-3700): rename Clock Source Low register constants
  refactor(drivers/marvell/comphy-3700): rename Reset and Clock Control register constants
  refactor(drivers/marvell/comphy-3700): rename Lane Status 1 register constants
  refactor(drivers/marvell/comphy-3700): rename Miscellaneous Control register constants
  refactor(drivers/marvell/comphy-3700): rename Idle Sync Enable register constants
  refactor(drivers/marvell/comphy-3700): unify Generation Settings register values
  refactor(drivers/marvell/comphy-3700): unify Generation Settings register names
  refactor(drivers/marvell/comphy-3700): drop _ADDR suffixes
  refactor(drivers/marvell/comphy-3700): drop _REG prefixes and suffixes
  refactor(drivers/marvell/comphy-3700): move and add comment for COMPHY_RESERVED_REG
  refactor(drivers/marvell/comphy-3700): move Miscellaneous Control 0 register definition
  refactor(drivers/marvell/comphy-3700): rename PHY_GEN_USB3_5G to PHY_GEN_MAX_USB3_5G
  refactor(drivers/marvell/comphy-3700): rename Digital Loopback Enable register constant
  fix(drivers/marvell/comphy): change reg_set() / reg_set16() to update semantics
  fix(drivers/marvell/comphy-3700): use reg_set() according to update semantics
  fix(drivers/marvell/comphy-3700): fix comments about selector register values
  fix(drivers/marvell/comphy-3700): fix comment about COMPHY status register
  fix(drivers/marvell/comphy-3700): fix reference clock selection value names
  fix(drivers/marvell/comphy-3700): drop MODE_REFDIV constant
  fix(drivers/marvell/comphy-3700): fix SerDes frequency register value name
  fix(drivers/marvell/comphy-3700): fix Generation Setting registers names
  fix(drivers/marvell/comphy-3700): fix PIN_PU_IVREF register name
2021-12-10 16:06:16 +01:00
Manish Pandey c6b2919834 Merge changes from topic "mb_critical_data" into integration
* changes:
  docs(measured-boot): add a platform function for critical data
  feat(fvp): measure critical data
2021-12-10 14:37:06 +01:00
Manish Pandey be1d8b24f5 Merge "feat(stm32mp1): preserve the PLL4 settings for USB boot" into integration 2021-12-10 14:19:15 +01:00
Jayanth Dodderi Chidanand 6401776747 docs(build-options): add build macros for features FGT,AMUv1 and ECV
This patch adds macros explicit to the features - FEAT_FGT,FEAT_AMUv1
and FEAT_ECV respectively. It assists in controlled access to the set
of registers (HDFGRTR_EL2, HAFGRTR_EL2 and CNTPOFF_EL2) under the
influence of these features during context save and restore routines.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I5082ea6687a686d8c5af3fe8bf769957cf3078b0
2021-12-10 12:36:02 +00:00
Jayanth Dodderi Chidanand f74cb0be8a fix(amu): fault handling on EL2 context switch
The HAFGRTR_EL2 register is UNDEFINED unless the CPU supports both
FEAT_FGT and FEAT_AMUv1. FEAT_FGT is mandatory for v8.6-A and upwards,
but FEAT_AMUv1 is optional (from v8.4-A upwards), and as such any
8.6-A cores today without support for FEAT_AMUv1 will trigger an
undefined instruction exception on accessing this register.

Currently ARM_ARCH_AT_LEAST macro has been used to associate with an
architecture extension allowing to access HAFGRTR_EL2 register. This
condition should be replaced with macros specific to individual
features. This patch adds a new set of macros "ENABLE_FEAT_FGT,
ENABLE_FEAT_AMUv1, ENABLE_FEAT_ECV" under build options to provide
controlled access to the HAFGRTR_EL2 register.

Further to ensure that the the build options passed comply
with the given hardware implementation, a feature detection mechanism,
checking whether build options match with the architecture is required
at bootime. This will be implemented and pushed later in a separate
patch.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Ie390f4babe233b8b09455290277edbddecd33ead
2021-12-10 12:33:51 +00:00
Alexei Fedorov 3082a33017 Merge "fix(rmmd/sve): enable/disable SVE/FPU for Realms" into integration 2021-12-10 13:28:48 +01:00
Venkatesh Yadav Abbarapu 67abd4762b feat(plat/zynqmp): disable the -mbranch-protection flag
With new gcc11.2 by default the -mbranch-protection is
set to "standard" which is leading to increase the text
section by 4Kb. As the ZynqMP uses the ARMv8 architecture,
so there is no impact when we disable the branch protection.
These instructions do not provide the branch protection in
architectures before Armv8.3-A.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Change-Id: I36f7a55abf99f50df2ee265255598d83b1f480c6
2021-12-10 05:16:07 -07:00
Alexei Fedorov b09b150add Merge "fix(rmmd): align RMI and GTSI FIDs with SMCCC" into integration 2021-12-10 12:20:36 +01:00
Madhukar Pappireddy 97af8baf0a Merge "refactor(measured-boot): add generic macros for using Crypto library" into integration 2021-12-10 01:25:26 +01:00
Subhasish Ghosh a4cc85c129 fix(rmmd/sve): enable/disable SVE/FPU for Realms
This patch enable/disable SVE/FPU for Realms depending
upon it's state in NS.

When this feature is enabled, traps to EL3 on SVE/FPU access from
Realms are disabled. However, RMM must ensure that the Realm <-> NS
SVE/FPU registers are not corrupted by each other and Realms do
not leak information to NS.

Change-Id: I0a27a055787976507017b72879ba6458f066624e
Signed-off-by: Subhasish Ghosh <subhasish.ghosh@arm.com>
2021-12-09 15:56:55 +00:00
Madhukar Pappireddy 4f53c1301c Merge "fix(plat/socionext/synquacer): initialise CNTFRQ in Non Secure CNTBaseN" into integration 2021-12-09 15:03:19 +01:00
Madhukar Pappireddy 590fd53d61 Merge "refactor(plat/synquacer): update PSCI system_off handling" into integration 2021-12-09 15:03:06 +01:00
Marek Behún e62ae2e27d refactor(drivers/marvell/comphy-3700): rename Clock Source Low value constants
The constants BUNDLE_PERIOD_SCALE and PLL_READY_DLY refer to two
multi-bit registers within the Clock Source Low register. These
constants are used as masks for those registers (and values are not
defined since we are writing zeros to them).

Give them the _MASK suffix.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: Id469d0ab4c755d2d6a0150a1ade33dd9d0293667
2021-12-09 01:29:13 +01:00
Marek Behún e585c84ce5 refactor(drivers/marvell/comphy-3700): rename Clock Source Low register constants
The register at offset 0x1C3 is called Clock Source Low in functional
specification, but we use constant name GLOB_CLK_SRC_LO. Rename it to
RST_CLK_CTRL instead.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: If7ca460cb166f3828678e1e09c4e6caf5bb77770
2021-12-09 01:29:13 +01:00
Marek Behún 6a14ac780f refactor(drivers/marvell/comphy-3700): rename Reset and Clock Control register constants
The register at offset 0x1C1 is called Reset and Clock Control in
functional specification, but we use constant name GLOB_PHY_CTRL0.
Rename it to RST_CLK_CTRL instead.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: I5dac8913bd0686d4f5bd74b91cb7d07ba06df72b
2021-12-09 01:29:13 +01:00
Marek Behún 6eb043791e refactor(drivers/marvell/comphy-3700): rename Lane Status 1 register constants
Rename the Lane Status 1 register constants from LANE_STATUS1 to
LANE_STAT1, to use an abbreviation similar to that for Lane
Configuration registers (where we use LANE_CFGx instead of LANE_CONFIGx
or LANE_CONFIGURATIONx).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: Ie329d5a93615efe261802a2f027475b602a5c840
2021-12-09 01:29:13 +01:00
Marek Behún 9cf978c6c4 refactor(drivers/marvell/comphy-3700): rename Miscellaneous Control register constants
Rename the Miscellaneous Control register constants from MISC_REGx to
MISC_CTRLx.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: I4d43bbda44b090de4ecf2d52cfc468f9683cc3b5
2021-12-09 01:29:13 +01:00