Commit Graph

9436 Commits

Author SHA1 Message Date
Toshiyuki Ogasahara 053c134683 feat(plat/rcar3): modify SWDT counter setting for R-Car D3
Modified the SWDT counter setting for R-Car D3.

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>
Change-Id: If1fa12bf644486f3fad3c6b54cda6c4cbb604103
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 042d710d1d feat(plat/rcar3): update DDR setting for R-Car D3
Update R-Car D3 DDR setting rev.0.02.

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>
Change-Id: I3e3a202fbb0ff1f0f38a968ab5f8633604a46432
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 71f2239f53 feat(plat/rcar3): remove access to RMSTPCRn registers in R-Car D3
Because the Realtime module stop control register n (RMSTPCRn)
are not supported in R-Car D3. Therefore, remove access to these
registers in R-Car D3.

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>
Change-Id: I4647e28d0e176ff97151e9842019ba12cefe5c03
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 14f0a08172 feat(plat/rcar3): add process of SSCG setting for R-Car D3
- Added the condition where output the SSCG (MD12) setting
  to log for R-Car D3.
- Added the process to switching the bit rate of SCIF by the
  SSCG (MD12) setting value for R-Car D3.

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>
Change-Id: Iaf07fa4df12dc233af0b57569ee4fa9329f670a9
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 7d58aed3b0 feat(plat/rcar3): add process to back up X6 and X7 register's value
Because the x6 and x7 registers will be overwritten by the callee function,
added the processing the register's value push to/pop from stack memory.

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>
Change-Id: I5351a008d3b208a30a8bc8651b8d9b4d1a02a8e8
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara d10f87674e feat(plat/rcar3): modify operation register from SYSCISR to SYSCISCR
Modified the operation register to clearing the state bit of
the SYSCISR register from SYSCISR to SYSCISCR.

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>
Change-Id: I9a0820b6414425fa2f4197f60852137827414a4d
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 63a7a34706 feat(plat/rcar3): add SYSCEXTMASK bit set/clear in scu_power_up
Added the process of SYSECEXTMASK bit set/clear for following
power Resume/Shutoff flow.

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>
Change-Id: I71ed22840a42e7ab7d87bfd4241eec6f5ddb129b
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara a4d821a5a6 feat(plat/rcar3): change the memory map for OP-TEE
The memory area size of OP-TEE was changed from 1MB to 2MB
because the size of OP-TEE has increased.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: Ic8a165c83a3a9ef2829f68d5fabeed9ccb6da95e
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 42ffd279dd feat(plat/rcar3): use PRR cut to determine DRAM size on M3
The new M3 DRAM size can be determined by the PRR cut version.
Read the PRR cut version, and if it is older than cut 30, use
legacy DRAM size scheme, else report 8GB in 2GBx4 2ch split.

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> # Fix DRAM size judgment by PRR register, reword commit message
Change-Id: Ib83176d0d09cab5cae0119ba462e42c66c642798
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 2892fedaf2 feat(plat/rcar3): apply ERRATA_A53_1530924 and ERRATA_A57_1319537
Apply ERRATA_A53_1530924 and ERRATA_A57_1319537.

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> # Drop Makefile header change, reword commit message
Change-Id: I7d6e7e40bad6545a1d96470ce1a6e2d04e042670
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara a8c0c3e9d0 fix(plat/rcar3): fix disabling MFIS write protection for R-Car D3
Fix disabling MFIS write protection for R-Car D3.

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>
Change-Id: I8bb5787c09c53dff55d6de89adfcb71157533976
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara 77ab3661e5 fix(plat/rcar3): fix eMMC boot support for R-Car D3
Fix to support of booting from eMMC (50MHz x 8) on
Draak board for R-Car D3.

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>
Change-Id: I0ab2b5c7f8075acbf5f4a69694fb535dddc1a4c8
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara c3d192b8e5 fix(plat/rcar3): fix version judgment for R-Car D3
Added the process of judgment and logging for R-Car D3 Ver.1.1 and Ver.1.0.

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>
Change-Id: I326aa42374b70b6a4a71893561a7eaa0b6eddef0
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara fb3406b6b5 fix(plat/rcar3): fix source file to make about GICv2
Changed the plat/renesas/common/common.mk to change the source files
about GICv2 by include gicv2.mk, because gic_common.c has deprecated.

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>
Change-Id: Iaa7eae6b2c1dd79a05339325e6bc422d87bce49e
2021-09-12 01:13:48 +02:00
Toshiyuki Ogasahara bb273e3be1 fix(drivers/rcar3): console: fix a return value of console_rcar_init
This commit fixes a return value of console_rcar_init because it is
expected to return 1 on success but the function always returns 0.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I97a6800578e3c517c0c1e3c00dc75f0ef75e8778
2021-09-12 01:13:48 +02:00
André Przywara 0295079162 Merge changes from topic "gic-700-auto" into integration
* changes:
  feat(arm_fpga): support GICv4 images
  feat(gicv3): detect GICv4 feature at runtime
  feat(gicv3): multichip: detect GIC-700 at runtime
  refactor(gic): move GIC IIDR numbers
  refactor(gicv3): rename GIC Clayton to GIC-700
2021-09-10 17:17:46 +02:00
Madhukar Pappireddy a4ea205025 Merge "fix(plat/marvell/a3k): enable workaround for erratum 1530924" into integration 2021-09-10 01:02:56 +02:00
Madhukar Pappireddy 0a948cd2aa Merge "fix(docs-contributing.rst): fix formatting for code snippet" into integration 2021-09-09 20:48:04 +02:00
Mark Dykes 9ecf943889 Merge "docs(stm32mp1): update doc for FIP/FCONF" into integration 2021-09-09 17:49:44 +02:00
Mark Dykes 2ed0c59bd0 Merge "feat(plat/st): add a new DDR firewall management" into integration 2021-09-09 17:49:27 +02:00
Mark Dykes d3f91e242a Merge "feat(tzc400): update filters by region" into integration 2021-09-09 17:49:06 +02:00
Mark Dykes 20a20538f8 Merge "feat(fdts): add firewall regions into STM32MP1 DT" into integration 2021-09-09 17:48:48 +02:00
Mark Dykes d114a382c7 Merge changes from topic "st_fip_fconf" into integration
* changes:
  refactor(plat/st): use TZC400 bindings
  feat(dt-bindings): add STM32MP1 TZC400 bindings
2021-09-09 17:48:29 +02:00
Mark Dykes 282da3c323 Merge changes from topic "st_fip_fconf" into integration
* changes:
  feat(plat/st): manage io_policies with FCONF
  feat(fdts): add IO policies for STM32MP1
2021-09-09 17:46:38 +02:00
Mark Dykes ded5979c79 Merge changes from topic "st_fip_fconf" into integration
* changes:
  feat(plat/st): use FCONF to configure platform
  feat(fdts): add STM32MP1 fw-config DT files
2021-09-09 17:46:22 +02:00
Mark Dykes 4b431230e5 Merge "feat(plat/st): improve FIP image loading from MMC" into integration 2021-09-09 17:46:03 +02:00
Mark Dykes 6c7cc938f1 Merge changes from topic "st_fip_fconf" into integration
* changes:
  feat(plat/st): use FIP to load images
  refactor(plat/st): updates for OP-TEE
  feat(lib/optee): introduce optee_header_is_valid()
2021-09-09 17:45:44 +02:00
Olivier Deprez f2dcf41826 refactor(spmd): boot interface and pass core id
This change refactors the SPMD to setup SPMC CPU contexts once and early
from spmd_spmc_init (single call to cm_setup_context rather than on each
and every warm boot).
Pass the core linear ID through a GP register as an implementation
defined behavior helping FF-A adoption to legacy TOSes (essentially
when secure virtualization is not used).

A first version of this change was originally submitted by Lukas [1].
Pasting below the original justification:

Our TEE, Kinibi, is used to receive the core linear ID in the x3
register of booting secondary cores.
This patch is necessary to bring up secondary cores with Kinibi as an
SPMC in SEL1.

In Kinibi, the TEE is mostly platform-independent and all platform-
specifics like topology is concentrated in TF-A of our customers.
That is why we don't have the MPIDR - linear ID mapping in Kinibi.
We need the correct linear ID to program the GICv2 target register,
for example in power management case.
It is not needed on GICv3/v4, because of using a fixed mapping from
MPIDR to ICDIPTR/GICD_ITARGETSRn register.

For debug and power management purpose, we also want a unified view to
linear id between Linux and the TEE.
E.g. to disable a core, to see what cores are printing a trace /
an event.

In the past, Kinibi had several other designs, but the complexity was
getting out of control:
* Platform-specific assembler macros in the kernel.
* A per-core SMC from Linux to tell the linear ID after the boot.
* With DynamiQ, it seems SIPs were playing with MPIDR register values,
  reusing them between cores and changing them during boot.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/10235

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
Change-Id: Ifa8fa208e9b8eb1642c80b5f7b54152dadafa75e
2021-09-09 16:51:17 +02:00
Jayanth Dodderi Chidanand d0bbe8150e fix(docs-contributing.rst): fix formatting for code snippet
This patch will fix the formatting errors concerning code snippet,
lines 245 and 256 respectively.
The code snippet is updated to 'shell' to lex it appropriately.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I53aefd81da350b6511e7a97b5fee7b0d6f9dde2d
2021-09-09 14:25:16 +01:00
Madhukar Pappireddy 5a7b2584db Merge "fix(drivers/marvell/comphy): fix name of 3.125G SerDes mode" into integration 2021-09-09 00:32:08 +02:00
Marek Behún 975563dbfc fix(plat/marvell/a3k): enable workaround for erratum 1530924
Erratum 1530924 affects Armada 37xx CPU, since it affects all Cortex-A53
revisions from r0p0 to r0p4.

Enable the workaround for this erratum.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Change-Id: I753225040e49e956788d5617cd7ce76d5e6ea8e8
2021-09-08 14:05:43 +02:00
Yann Gautier 07f81627ab docs(stm32mp1): update doc for FIP/FCONF
Describe the boot using FIP, and how to compile it.
The STM32IMAGE boot chain is still available but it is not recommended.
Update the build command lines, for FIP.
The memory mapping is also updated.

Change-Id: I2b1e0df5500b6213d33dc558b0e0da38340a4d79
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-08 09:05:16 +02:00
Lionel Debieve 4584e01dc6 feat(plat/st): add a new DDR firewall management
Based on FCONF framework, define DDR firewall regions
from firmware config file instead of static defines.

Change-Id: I471e15410ca286d9079a86e3dc3474f66d37b5ab
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-08 09:05:16 +02:00
Lionel Debieve ce7ef9d146 feat(tzc400): update filters by region
Add a new function that allows to enable or disabled filters on
configured regions dynamically. This will avoid the need to
reconfigure the entire attribute and just manage to
enable/disable filters.

Change-Id: If0937ca755bec6c45d3649718147108459682fff
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-08 09:05:16 +02:00
Madhukar Pappireddy ab0c8151bc Merge "docs(contribution-guidelines): add coverity build configuration section" into integration 2021-09-08 01:05:41 +02:00
Madhukar Pappireddy a138717d9e Merge changes from topic "advk-serror" into integration
* changes:
  fix(plat/marvell/a3k): disable HANDLE_EA_EL3_FIRST by default
  fix(plat/marvell/a3k): update information about PCIe abort hack
2021-09-08 00:04:15 +02:00
Jayanth Dodderi Chidanand 6c3d92e33f docs(contribution-guidelines): add coverity build configuration section
Added a sub-section in the "Processes and Policies" chapter under
Contributor's guide on how to add new build configurations when new
source files are added to the TF-A repository. This will help the patch
contributor to update their files to get analysed by Coverity Scan.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I71f410a061028f89bd0e984e48e61e5935616d71
2021-09-08 00:02:46 +02:00
Saurabh Gorecha cc35a3771d fix(plat/qti/sc7180): qti smc addition
Adding QTI SIP SMC CALL to detect qti platform supporting ARM 64 SMC
calls or not.

Signed-off-by: Saurabh Gorecha <sgorecha@codeaurora.org>
Change-Id: I3231325a6ffe5aa69856dd25ac2c0a2004484e4b
2021-09-08 01:19:47 +05:30
Olivier Deprez dc8b361c78 Merge changes I0ae8a6ea,I0b4fc83e into integration
* changes:
  feat(tc): Enable SVE for both secure and non-secure world
  feat(tc): populate HW_CONFIG in BL31
2021-09-07 18:00:44 +02:00
Usama Arif 10198eab3a
feat(tc): Enable SVE for both secure and non-secure world
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I0ae8a6ea3245373a17af76c9b7dc3f38f3711091
2021-09-07 14:38:02 +01:00
Usama Arif 34a87d74d9
feat(tc): populate HW_CONFIG in BL31
BL2 passes FW_CONFIG to BL31 which contains information
about different DTBs present. BL31 then uses FW_CONFIG
to get the base address of HW_CONFIG and populate fconf.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I0b4fc83e6e0a0b9401f692516654eb9a3b037616
2021-09-07 14:37:53 +01:00
Madhukar Pappireddy e843fb0a74 Merge "docs: nxp soc-lx2160a based platforms" into integration 2021-09-07 15:19:33 +02:00
Yann Gautier 86b43c58a4 feat(fdts): add firewall regions into STM32MP1 DT
Add the corresponding firewall memory regions
into fw-config device tree.

Change-Id: Ie39b0339f3c42b3dd756354138a872500c64f84c
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Yann Gautier 3cc5155c84 refactor(plat/st): use TZC400 bindings
This avoids duplicate define of TZC_REGION_NSEC_ALL_ACCESS_RDWR.
And remove the previous TZC400 definitions from stm32mp1_def.h.

Change-Id: I6c72c2a18731f69d855fbce8ce822a21da9364fa
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Yann Gautier d5a84eeaac feat(plat/st): manage io_policies with FCONF
Introduced IO policies management through the trusted
boot firmware config device tree for UUID references.

Change-Id: Ibeeabede51b0514ebba26dbbdae587363b2aa0a7
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Yann Gautier 29332bcd68 feat(plat/st): use FCONF to configure platform
Add required code to support FCONF on STM32MP1 platform.
The new FW_CONFIG DT file will be inside the FIP, and loaded by BL2.
It will be used to configure the addresses where to load other binaries.
BL2 should be agnostic of which BL32 is in the FIP (OP-TEE or SP_min),
so optee_utils.c is always compiled, and some OP-TEE flags are removed.

Change-Id: Id957b49b0117864136250bfc416664f815043ada
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Yann Gautier 18b415be9d feat(plat/st): improve FIP image loading from MMC
Instead of using a scratch buffer of 512 bytes, we can directly use the
image address and max size. The mmc_block_dev_spec struct info is then
overwritten for each image with this info, except FW_CONFIG and GPT
table which will still use the scratch buffer.
This allows using multiple blocks read on MMC, and so improves the boot
time.
A cache invalidate is required for the remaining data not used from the
first and last blocks read. It is not required for FW_CONFIG_ID,
as it is in scratch buffer in SYSRAM, and also because bl_mem_params
struct is overwritten in this case. This should also not be done if
the image is not found (OP-TEE extra binaries when using SP_min).

Change-Id: If3ecfdfe35bb9db66284036ca49c4bd1be4fd121
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Yann Gautier 1d204ee4ab feat(plat/st): use FIP to load images
BL2 still uses the STM32 header binary format to be loaded from ROM code.
BL32 and BL33 and their respective device tree files are now put together
in a FIP file.
One DTB is created for each BL. To reduce their sizes, 2 new dtsi file are
in charge of removing useless nodes for a given BL. This is done because
BL2 and BL32 share the same device tree files base.

The previous way of booting is still available, the compilation flag
STM32MP_USE_STM32IMAGE has to be set to 1 in the make command. Some files
are duplicated and their names modified with _stm32_ to avoid too much
switches in the code.

Change-Id: I1ffada0af58486d4cf6044511b51e56b52269817
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Lionel Debieve 43de546b90 feat(dt-bindings): add STM32MP1 TZC400 bindings
Add bindings that will be used to define DDR regions
and their access rights.

Change-Id: I745a7e580ef2b9e251d53db12c5a0a86dfe34463
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00
Lionel Debieve 21e002fb77 feat(fdts): add IO policies for STM32MP1
Add the UUID into the io policies node that are retrieved
by BL2 using stm32mp_fconf_io.c populate function.

Change-Id: I595d5a41a1e0a27fcc02ea2ab5495d9dbf0e6773
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-09-07 09:14:05 +02:00