Commit Graph

8776 Commits

Author SHA1 Message Date
Alex Evraev 550a06dfd1 drivers: marvell: comphy: add rx training on 10G port
This patch forces rx training on 10G ports
as part of comphy_smc call from Linux.

Signed-off-by: Alex Evraev <alexev@marvell.com>
Change-Id: Iebe6ea7c8b21cbdce5c466c8a69b92e9d7c8a8ca
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/boot/atf/+/30763
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
2021-04-20 13:00:03 +02:00
Konstantin Porotchkin b5a0663771 plat/marvell/armada: postpone MSS CPU startup to BL31 stage
Normally the CP MSS CPU was started at the end of FW load to IRAM at BL2.
However, (especailly in secure boot mode), some bus attributes should be
changed from defaults before the MSS CPU tries to access shared resources.
This patch starts to use CP MSS SRAM for FW load in both secure and
non-secure boot modes.
The FW loader inserts a magic number into MSS SRAM as an indicator of
successfully loaded FS during the BL2 stage and skips releasing the MSS
CPU from the reset state.
Then, at BL31 stage, the MSS CPU is released from reset following the
call to cp110_init function that handles all the required bus attributes
configurations.

Change-Id: Idcf81cc350a086835abed365154051dd79f1ce2e
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/boot/atf/+/46890
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
2021-04-20 12:59:58 +02:00
Guo Yi ed1587d025 plat: marvell: armada: a8k: Fix LD selector mask
Fixed a bug that the actually bit number was used as a mask to
select LD0 or LD1 fuse

Signed-off-by: Guo Yi <yguo@cavium.com>
Change-Id: I4bec268c3dc2566350b4a73f655bce222707e25b
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/boot/atf/+/46146
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:54 +02:00
Konstantin Porotchkin 718dbcac9c plat/marvell/armada: allow builds without MSS support
Setting MSS_SUPPORT to 0 also removes requirement for SCP_BL2
definition.
Images build with MSS_SUPPORT=0 will not include service CPUs
FW and will not support PM, FC and other features implemented
in these FW images.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Change-Id: Idf301ebd218ce65a60f277f3876d0aeb6c72f105
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/boot/atf/+/37769
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-by: Ofer Heifetz <oferh@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
2021-04-20 12:59:49 +02:00
Grzegorz Jaszczyk 667893adb6 drivers: marvell: misc-dfx: extend dfx whitelist
Linux cpu clk driver requires access to some dfx registers. By adding
these registers to the white list, we enable access to them from
non-secure world.

Change-Id: Ic05c96b375121c025bfb41c2ac9474a530720155
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-on: https://sj1git1.cavium.com/25187
Tested-by: Kostya Porotchkin <kostap@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:45 +02:00
Grzegorz Jaszczyk 81c2a044e2 drivers: marvell: add support for secure read/write of dfx register-set
Since the dfx register set is going to be marked as secure expose dfx
secure read and write function via SiP services. In introduced misc_dfx
driver some registers are white-listed so non-secure software can still
access them.

This will allow non-secure word drivers access some white-listed
registers related to e.g.:  Sample at reset, efuses, SoC type and
revision ID accesses.

Change-Id: If9ae2da51ab2e6ca62b9a2c940819259bf25edc0
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-on: https://sj1git1.cavium.com/25055
Tested-by: Kostya Porotchkin <kostap@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:40 +02:00
Alex Leibovich b81444e843 ddr_phy: use smc calls to access ddr phy registers
Added smc calls support to access ddr phy registers.

Change-Id: Ibaa0a8e20b6398ab394c7e2e9ea61f9a28cdb870
Signed-off-by: Alex Leibovich <alexl@marvell.com>
Reviewed-on: https://sj1git1.cavium.com/20791
Tested-by: Kostya Porotchkin <kostap@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:34 +02:00
Grzegorz Jaszczyk 0cedca636f drivers: marvell: thermal: use dedicated function for thermal SiPs
Since more drivers which uses dfx register set need to be handled with
use of SiP services, use dedicated and more meaningful name for thermal
SiP services.

Change-Id: Ic2ac27535a4902477df8edc4c86df3e34cb2344f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-on: https://sj1git1.cavium.com/25054
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:23 +02:00
Grzegorz Jaszczyk ad416958d9 drivers: marvell: add thermal sensor driver and expose it via SIP service
Since the dfx register set is going to be marked as secure (in order to
protect efuse registers for non secure access), accessing thermal
registers which are part of dfx register set, will not be possible from
lower exception levels. Due to above expose thermal driver as a SiP
service.  This will allow Linux and U-Boot thermal driver to initialise
and perform various operations on thermal sensor.

The thermal sensor driver is based on Linux
drivers/thermal/armada_thermal.c.

Change-Id: I4763a3bf5c43750c724c86b1dcadad3cb729e93e
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-on: https://sj1git1.cavium.com/20581
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Tested-by: Kostya Porotchkin <kostap@marvell.com>
2021-04-20 12:59:18 +02:00
Konstantin Porotchkin dceac436f6 fix: plat: marvell: fix MSS loader for A8K family
Wrong brakets caused MSS FW load timeout error:
ERROR:   MSS DMA failed (timeout)
ERROR:   MSS FW chunk 0 load failed
ERROR:   SCP Image load failed

This patch fixes the operator precedence in MSS FW load.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Change-Id: I78c215606bde112f40429926c51f5fa1e4334c13
2021-04-20 12:59:13 +02:00
Nina Wu 6b822d494f mediatek: mt8192: devapc: Add devapc driver
Add devapc driver for setting default permission.

Change-Id: I103f27ae090fbed76ce9319606ac082d78b74566
Signed-off-by: Nina Wu <nina-cm.wu@mediatek.com>
2021-04-20 13:16:28 +08:00
Manish Pandey 52c24e3077 Merge "services: spm_mm: Use sp_boot_info to set SP context" into integration 2021-04-19 23:14:40 +02:00
Madhukar Pappireddy 4ec3ccb459 Add documentation for SMMUv3 driver in Hafnium(SPM)
Change-Id: I0b38c114fd2958d2b4040585611cafa132ccfd9c
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-04-19 14:25:51 -05:00
Mayur Gudmeti 21583a315a services: spm_mm: Use sp_boot_info to set SP context
The current SPM_MM implementations expects the SP image addresses
as static macros. This means platforms wanting to use dynamically
allocated memory addresses are left out. This patch gets sp_boot_info
at the beginning of spm_sp_setup function and uses member variables
of sp_boot_info to setup the context. So member variables of
struct sp_boot_info and consequently the context can be initialized
by static macros or dynamiclly allocated memory address..

Change-Id: I1cb75190ab8026b845ae20a9c6cc416945b5d7b9
Signed-off-by: Mayur Gudmeti <mgudmeti@nvidia.com>
2021-04-19 18:28:07 +02:00
Chris Kay d97bade107 build(hooks): add commitlint hook
This change adds a configuration for commitlint - a tool designed to
enforce a particular commit message style - and run it as part of Git's
commit-msg hook. This validates commits immediately after the editor has
been exited, and the configuration is derived from the configuration we
provide to Commitizen.

While the configuration provided suggests a maximum header and body
length, neither of these are hard errors. This is to accommodate the
occasional commit where it may be difficult or impossible to comply
with the length requirements (for example, with a particularly long
scope, or a long URL in the message body).

Change-Id: Ib5e90472fd1f1da9c2bff47703c9682232ee5679
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-04-19 14:06:25 +01:00
Chris Kay c75ce067aa build(hooks): add Commitizen hook
This change adds Commitizen, an interactive tool for writing commit
messages, to the package.json file. This installs Commitizen within the
`node_modules` directory automatically when developers invoke
`npm install` from the root repository directory.

Additionally, this change adds a prepare-commit-msg Git hook which
invokes Commitizen prior to generation of the default commit message.
It may be exited with the standard ^C signal without terminating the
commit process for those who desperately want to avoid using it, but
otherwise should encourage developers to conform to the new commit style
without running into post-commit linting errors.

Change-Id: I8a1e268ed40b61af38519d13d62b116fce76a494
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-04-19 14:06:25 +01:00
Chris Kay 4b7eee81e3 build(hooks): add Gerrit hook
This change adds the Gerrit commit-msg hook to Husky, such that it now
no longer requires manual installation by the developer.

This hook was pulled directly from the TF-A Gerrit review server.

Change-Id: I79c9b0ce78fd326fda6db7a930b7277690177f28
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-04-19 14:06:25 +01:00
Chris Kay ba39362f21 build(hooks): add Husky configuration
Husky is a tool for managing Git hooks within the repository itself.
Traditionally, commit hooks need to be manually installed on a per-user
basis, but Husky allows us to install these hooks either automatically
when `npm install` is invoked within the repository, or manually with
`npx husky install`.

This will become useful for us in the next few patches when we begin
introducing tools for enforcing a commit message style.

Change-Id: I64cae147e9ea910347416cfe0bcc4652ec9b4830
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-04-19 14:06:25 +01:00
Sandrine Bailleux 5eea019378 Arm: Fix error message printing in board makefile
Remove an incorrect tabulation in front of an $(error) function call
outside of a recipe, which caused the following text to be displayed:

  plat/arm/board/common/board_common.mk:36: *** recipe commences before first target.  Stop.

instead of:

  plat/arm/board/common/board_common.mk:36: *** "Unsupported ARM_ROTPK_LOCATION value".  Stop.

Change-Id: I8592948e7de8ab0c4abbc56eb65a53eb1875a83c
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2021-04-16 16:09:44 +02:00
Sandrine Bailleux 38b7c9c651 Merge "docs: Update Mbed TLS supported version" into integration 2021-04-16 10:57:24 +02:00
Madhukar Pappireddy 866e6721f3 Merge changes from topic "scmi_v2_0" into integration
* changes:
  drivers/arm/css/scmi: Update power domain protocol version to 2.0
  tc0: update GICR base address
2021-04-15 23:39:31 +02:00
Yidi Lin 7e78300fc1 mediatek: move uart.h to common folder
UART register definition is the same on MediaTek platforms.
Move uart.h to common folder and remove the duplicate file.

Signed-off-by: Yidi Lin <yidi.lin@mediatek.com>
Change-Id: Iea0931dfd606ae4a7ab475b9cb3a08dc6de68b36
2021-04-15 19:48:58 +08:00
Nicola Mazzucato b67e9880fc drivers/arm/css/scmi: Update power domain protocol version to 2.0
The SCMI power domain protocol in firmware has been updated to v2.0,
thus update the corresponding version in TF-A too.

Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Change-Id: If3920ff71136dce94b2780e29a47f24aa09876c0
2021-04-14 12:13:26 +01:00
Usama Arif 69f2ace106 tc0: update GICR base address
The number of ITS have changed from 4 to 1, resulting
in GICR base address change.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I28101f0d1faf9f3c58591b642033c3fd49a275e7
2021-04-14 12:13:26 +01:00
Manish V Badarkhe 641c5ff69c docs: Update Mbed TLS supported version
Updated the documentation with latest Mbed TLS supported
version i.e. Mbed TLS v2.26.0

Fixes available in this version of Mbed TLS mainly affect
key generation/writing and certificates writing, which
are features used in the cert_create tool.

Release notes of Mbed TLSv2.26.0 are available here:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.26.0

Change-Id: Ie15ee45d878b7681e15ec4bf64d54b416a31aa2f
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-04-14 12:07:13 +01:00
Madhukar Pappireddy 511c7f3a9d Merge changes from topic "dcc_console" into integration
* changes:
  plat:xilinx:versal: Add JTAG DCC support
  plat:xilinx:zynqmp: Add JTAG DCC support
  drivers: dcc: Support JTAG DCC console
2021-04-13 21:42:55 +02:00
Olivier Deprez 3b9e06a6dd Merge "plat/arm: don't provide NT_FW_CONFIG when booting hafnium" into integration 2021-04-13 14:16:08 +02:00
Leif Lindholm 103ee1b1c3 plat/qemu: add cortex-a72 support to 'virt' platform
Cortex-A72 support is already enabled for sbsa-ref platform,
so add it also to virt platform for parity.

Change-Id: Ib0a2ce81ef7c0a71ef8dc66dbec179191bf2e6cc
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
2021-04-13 12:28:43 +01:00
Leif Lindholm d799d168e4 plat/qemu: include gicv2.mk
The build now gives deprecation warnings for including
drivers/arm/gic/common/gic_common.c directly. Move to including the
common gicv2 sources via gicv2.mk instead - which also matches the
pattern already used for gicv3.

Change-Id: I5332fb52c5801272e5e2bb6111f96087b4894325
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
2021-04-13 12:28:43 +01:00
Madhukar Pappireddy c55497a207 Merge "fiptool: Do not print duplicate verbose lines about building fiptool" into integration 2021-04-13 01:07:52 +02:00
Madhukar Pappireddy 29e11bb299 Merge "driver: brcm: add USB driver" into integration 2021-04-12 16:44:11 +02:00
Madhukar Pappireddy bab737d397 Merge "driver: brcm: add mdio driver" into integration 2021-04-12 16:43:48 +02:00
Olivier Deprez 9fa849d36e Merge "arch: Enable `FEAT_SB` for supported non-Armv8.5-A platforms" into integration 2021-04-12 15:37:14 +02:00
Manish Pandey 2b6fc53584 plat/arm: don't provide NT_FW_CONFIG when booting hafnium
NT_FW_CONFIG file is meant to be passed from BL31 to be consumed by
BL33, fvp platforms use this to pass measured boot configuration and
the x0 register is used to pass the base address of it.

In case of hafnium used as hypervisor in normal world, hypervisor
manifest is expected to be passed from BL31 and its base address is
passed in x0 register.

As only one of NT_FW_CONFIG or hypervisor manifest base address can be
passed in x0 register and also measured boot is not required for SPM so
disable passing NT_FW_CONFIG.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ifad9d3658f55ba7d70f468a88997d5272339e53e
2021-04-09 16:40:47 +01:00
Pali Rohár 4fe571b838 docs: marvell: Add information about CZ.NIC Armada 3720 Secure Firmware
CZ.NIC as part of Turris project released free and open source WTMI
application firmware 'wtmi_app.bin' for all Armada 3720 devices. This
firmware includes additional features like access to Hardware Random
Number Generator of Armada 3720 SoC which original Marvell's 'fuse.bin'
image does not have.

CZ.NIC's Armada 3720 Secure Firmware is available at website:

    https://gitlab.nic.cz/turris/mox-boot-builder/

This change updates documentation to include steps how to build Marvell
firmware image for Espressobin with this firmware to enable Hardware
Random Number Generator on Espressobin.

In this change is fixed also URL to TF-A and U-Boot git repositories in
Espressobin build example. And as Marvell github repositories switched
default branch to master, explicit branch via -b parameter is redundant
and therefore from examples removed.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I59ee29cb6ed149264c5e4202f2af8f9ab3859418
2021-04-09 10:21:26 +02:00
Madhukar Pappireddy 160bfb278e Merge changes from topic "mmc_device_info" into integration
* changes:
  plat/st: do not keep mmc_device_info in stack
  plat/intel: do not keep mmc_device_info in stack
  plat/hisilicon: do not keep mmc_device_info in stack
2021-04-09 00:28:47 +02:00
Madhukar Pappireddy cc031fbe42 Merge changes from topic "mmc_device_info" into integration
* changes:
  mmc: remove useless extra semicolons
  Revert "mmc:prevent accessing to the released space in case of wrong usage"
2021-04-08 17:32:02 +02:00
Pali Rohár bda4e03016 fiptool: Do not print duplicate verbose lines about building fiptool
Makefile for fiptool already prints verbose line when is (re)building
fiptool, so there is no need to print it also from top level Makefile.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I6936a508702f1bf796d17578bb1f043f06365319
2021-04-08 15:20:41 +02:00
Manish Pandey cf59a1d12c Merge "fiptool: Do not call 'make clean' in 'all' target" into integration 2021-04-08 13:15:21 +02:00
Yann Gautier cddf1bd765 plat/st: do not keep mmc_device_info in stack
Create a dedicated static struct mmc_device_info mmc_info mmc_info
instead of having this in stack.
A boot issue has been seen on some platform when applying patch [1].

 [1] 13f3c5166f ("mmc:prevent accessing to the released space in case of wrong usage")

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I73a079715253699d903721c865d6470d58f6bd30
2021-04-08 08:44:57 +02:00
Yann Gautier 4ecd2417c8 mmc: remove useless extra semicolons
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: If1d6b2040e482577292890e3554449096648c2ae
2021-04-08 08:44:57 +02:00
Yann Gautier 5cb7fc8263 plat/intel: do not keep mmc_device_info in stack
Create a dedicated static struct mmc_device_info mmc_info mmc_info
instead of having this in stack.
A boot issue has been seen on some platform when applying patch [1].

 [1] 13f3c5166f ("mmc:prevent accessing to the released space in case of wrong usage")

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Id52c0be61a30f453a551385883eaf3cbe32b04b9
2021-04-08 08:44:57 +02:00
Yann Gautier 70eb88b7d9 Revert "mmc:prevent accessing to the released space in case of wrong usage"
This reverts commit 13f3c5166f.
The STM32MP1 platform can no more boot qwith this change.
The driver will not be aware when the static struct in framework is updated.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Icc544e243136ee3b0067f316b71dff7dfd6526d6
2021-04-08 08:44:57 +02:00
Yann Gautier 9171ced341 plat/hisilicon: do not keep mmc_device_info in stack
Create a dedicated static struct mmc_device_info mmc_info mmc_info
instead of having this in stack.
A boot issue has been seen on some platform when applying patch [1].

 [1] 13f3c5166f ("mmc:prevent accessing to the released space in case of wrong usage")

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: If5db8857cccec2e677b16a38eb3eeb41628a264c
2021-04-08 08:44:57 +02:00
Madhukar Pappireddy de2dd4e70a Merge "lib/cpu: Workaround for Cortex A77 erratum 1946167" into integration 2021-04-07 23:12:00 +02:00
Olivier Deprez e729595fa9 Merge "Fix: Remove save/restore of EL2 timer registers" into integration 2021-04-07 21:25:26 +02:00
Pali Rohár dbeab0da96 fiptool: Do not call 'make clean' in 'all' target
Calling 'make clean' in 'all' target is causing recompilation of binary
at every 'make' call, which is wrong.

Also building a new target via 'make TARGET' can cause infinite loop as
it is not defined as explicit make dependency. Dependent targets must be
specified after colon when defining target, which also prevents infinite
loops as make is able to detect these circular dependencies.

Moreover calling 'make clean' is supposed to be done by user when
configuration is changing.

So remove calling 'make clean' in 'all' target and define dependency for
'${PROJECT}' at correct place.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I70e7fd2b04b02f6a0650c82df91d58c9a4cb24d9
2021-04-07 19:36:20 +02:00
Madhukar Pappireddy f0d84287b4 Merge changes Id2a538c3,Ifa0339e7,I8b09fab8 into integration
* changes:
  drivers: marvell: comphy-a3700: Set TXDCLK_2X_SEL bit during PCIe initialization
  drivers: marvell: comphy-a3700: Set mask parameter for every reg_set call
  drivers: marvell: comphy-a3700: Fix configuring polarity invert bits
2021-04-07 18:58:55 +02:00
Madhukar Pappireddy 51672950ee Merge changes from topic "my-topic-name" into integration
* changes:
  plat: imx8mm: Add image load logic for TBBR FIP booting
  plat: imx8mm: Add initial defintions to facilitate FIP layout
  plat: imx8mm: Add image io-storage logic for TBBR FIP booting
  plat: imx8mm: Add imx8mm_private.h to the build
2021-04-07 17:59:43 +02:00
Max Shvetsov a7cf2743f3 Fix: Remove save/restore of EL2 timer registers
Since there is a secure and non-secure version of the timer registers
there is no need to preserve their context in EL3.
With that, following registers were removed from EL3 save/restore
routine:
	cnthps_ctl_el2
	cnthps_tval_el2
	cnthps_cval_el2
	cnthvs_ctl_el2
	cnthvs_tval_el2
	cnthvs_cval_el2
	cnthp_ctl_el2
	cnthp_cval_el2
	cnthp_tval_el2
	cnthv_ctl_el2
	cnthv_cval_el2
	cnthv_tval_el2

Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Change-Id: I6e2fc09c74a7375c4fccc11f12af4e39e6dc616b
2021-04-07 11:18:23 +01:00