Commit Graph

4693 Commits

Author SHA1 Message Date
Manish V Badarkhe cd3f0ae6f8 feat(plat/fvp): enable trace extension features by default
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I3e344b0abda7ab4e54ee918ec65ff39d40855fcd
2021-08-26 09:32:40 +01:00
Jiafei Pan 08695df91d refactor(plat/nxp): refine api to read SVR register
1. Refined struct soc_info_t definition.
2. Refined get_soc_info function.
3. Fixed some SVR persernality value.
4. Refined API to get cluster numbers and cores per cluster.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I3c20611a523516cc63330dce4c925e6cda1e93c4
2021-08-26 10:08:57 +08:00
Marcin Wojtas d01139f3b5 feat(plat/marvell): introduce t9130_cex7_eval
This patch adds the necessary files to support
the SolidRun CN913X CEx7 Evaluation Board.

Because the DRAM connectivity and SerDes settings
is shared with the CN913X DB - reuse relevant
board-specific files.

Change-Id: I75a4554a4373953ca3fdf3b04c4a29c2c4f8ea80
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
2021-08-26 04:08:50 +02:00
Marcin Wojtas 0b702afc3a feat(plat/marvell/a8k): allow overriding default paths
The common makefile used by every a8k/cn913x platform
(a8k_common.mk) assumed default paths in PLAT_INCLUDES,
BLE/BL31_PORTING_SOURCES. Allow overriding those
variables, in order to avoid code duplication.

It can be helpful in case using multiple board variants
or sharing common settings between different platforms.

Change-Id: Idce603e44ed04d99fb1e3e11a2bb395d552e2bf7
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
2021-08-26 04:07:11 +02:00
André Przywara abd63ed0c5 Merge changes from topic "allwinner-r329" into integration
* changes:
  feat(plat/allwinner): add R329 support
  refactor(plat/allwinner): allow custom BL31 offset
  refactor(plat/allwinner): allow new AA64nAA32 position
  fix(plat/allwinner): delay after enabling CPU power
2021-08-25 10:49:42 +02:00
Joanna Farley 6657c1e3cc Merge "cpu: add support for Demeter CPU" into integration 2021-08-25 10:30:29 +02:00
Jiafei Pan 1ca7229529 refactor(plat/nxp): each errata use a seperate source file
Don't mix erratas together in one file.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: Ib1671011b91a41b0653210e4706d62b7e946c642
2021-08-25 09:53:20 +08:00
Jiafei Pan 9616db154b refactor(plat/nxp): use a unified errata api
Use a unfied API soc_errata() for each platforms,
add print a INFO message for each enabled errata,
so that it will be easy to check which errata is
enabled on current platform.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I5eab3f338db6b46c57cbad475819043fc60ca6d3
2021-08-25 09:53:20 +08:00
Jiafei Pan 64cadc1637 refactor(plat/soc-lx2160): move errata to common directory
Will add more Erratas, some errata can be used for multiple
platforms, so move errata to be common code which can
be share between different platforms.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: Ib149b3eac365bdb593331e9f38f0b89d92c9c0d1
2021-08-25 09:53:20 +08:00
Icenowy Zheng 13bacd3bc3 feat(plat/allwinner): add R329 support
Allwinner R329 is a new dual-core Corte-A53 SoC. Add basical TF-A
support for it, to provide a PSCI implementation containing CPU
boot/shutdown and SoC reset.

Change-Id: I0fa37ee9b4a8e0e1137bf7cf7d614b6ca9624bfe
Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
2021-08-25 02:11:59 +08:00
Icenowy Zheng f04dfbb297 refactor(plat/allwinner): allow custom BL31 offset
Not all Allwinner SoCs have the same arrangement to SRAM A2.

Allow to specify a offset at which BL31 will stay in SRAM A2.

Change-Id: I574140ffd704a796fae0a5c2d0976e85c7fcbdf9
Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
2021-08-25 00:35:24 +08:00
Icenowy Zheng 080939f924 refactor(plat/allwinner): allow new AA64nAA32 position
In newer Allwiner SoCs, the AA64nAA32 wires are mapped to a new register
called "General Control Register0" in the manual rather than the
"Cluster 0 Control Register0" in older SoCs.

Now the position of AA64nAA32 (reg and bit offset) is defined in a few
macros instead assumed to be at bit offset 24 of
SUNXI_CPUCFG_CLS_CTRL_REG0.

Change-Id: I933d00b9a914bf7103e3a9dadbc6d7be1a409668
Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
2021-08-25 00:33:59 +08:00
Icenowy Zheng 86a7429e47 fix(plat/allwinner): delay after enabling CPU power
Adds a 1us delay after enabling power to a CPU core, to prevent
inrush-caused CPU crash before it's up.

Change-Id: I8f4c1b0dc0d1d976b31ddc30efe7a77a1619b1b3
Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
2021-08-25 00:15:27 +08:00
André Przywara 19ebec9f66 Merge "fix(rpi4): drop /memreserve/ region" into integration 2021-08-24 17:52:37 +02:00
Vijayenthiran Subramaniam 3139270693 feat(board/rdn2): add tzc master source ids for soc dma
Add TZC master source id for DMA in the SoC space and for the DMAs
behind the I/O Virtualization block to allow the non-secure transactions
from these DMAs targeting DRAM.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I77a2947b01b4b49a7c1940f09cf62b7b5257657c
2021-08-24 11:07:43 +05:30
Pali Rohár 3017e93276 fix(plat/marvell/a3k): disable HANDLE_EA_EL3_FIRST by default
It was enabled in commit 3c7dcdac5c ("marvell/a3700: Prevent SError
accessing PCIe link while it is down") with a workaround for a bug found
in U-Boot and Linux kernel driver pci-aardvark.c (PCIe controller driver
for Armada 37xx SoC) which results in SError interrupt caused by AXI
SLVERR on external access (syndrome 0xbf000002) and immediate kernel
panic.

Now when proper patches are in both U-Boot and Linux kernel projects,
this workaround in TF-A should not have to be enabled by default
anymore as it has unwanted side effects like propagating all external
aborts, including non-fatal/correctable into EL3 and making them as
fatal which cause immediate abort.

Add documentation for HANDLE_EA_EL3_FIRST build option into Marvell
Armada build section.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Ic92b65bf9923505ab682830afb66c2f6cec70491
2021-08-24 01:00:52 +02:00
Pali Rohár 068fe91961 fix(plat/marvell/a3k): update information about PCIe abort hack
A3700 plat_ea_handler was introduced into TF-A codebase just because of
bugs in U-Boot and Linux kernel PCIe controller driver pci-aardvark.c.

These bugs were finally fixed in both U-Boot and Linux kernel drivers:
eccbd4ad8e
https://git.kernel.org/stable/c/f18139966d072dab8e4398c95ce955a9742e04f7

Add all these information into comments, including printing error
message into a3k plat_ea_handler. Also check that abort is really
asynchronous and comes from lower level than EL3.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I46318d221b39773d5e25b3a0221d7738736ffdf1
2021-08-23 23:59:53 +01:00
Madhukar Pappireddy acfe3be282 Merge changes I976aef15,I11ae679f into integration
* changes:
  feat(plat/xilinx/zynqmp): add support for runtime feature config
  feat(plat/xilinx/zynqmp): sync IOCTL IDs
2021-08-20 21:42:19 +02:00
Madhukar Pappireddy f8bcfa8b76 Merge "fix(plat/qemu): (NS_DRAM0_BASE + NS_DRAM0_SIZE) ADDR overflow 32bit" into integration 2021-08-20 18:07:24 +02:00
Madhukar Pappireddy 15405fccae Merge "fix(plat/st): apply security at the end of BL2" into integration 2021-08-20 16:33:57 +02:00
Andre Przywara 0c9f91cf69 refactor(gicv3): rename GIC Clayton to GIC-700
The GIC IP formerly known as "GIC Clayton" has been released under the
name of "GIC-700".

Rename occurences of Clayton in comments and macro names to reflect the
official name.

Change-Id: Ie8c55f7da7753127d58c8382b0033c1b486f7909
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-08-20 14:23:35 +01:00
André Przywara 9fcefe38d5 Merge "fix(plat/arm_fpga): enable AMU extension" into integration 2021-08-19 16:43:45 +02:00
Ronak Jain 578f468ac0 feat(plat/xilinx/zynqmp): add support for runtime feature config
Add support for runtime feature configuration which are running on the
 firmware. Add new IOCTL IDs like IOCTL_SET_FEATURE_CONFIG and
 IOCTL_GET_FEATURE_CONFIG for configuring the features.

Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
Change-Id: I976aef15932783a25396b2adeb4c8f140cc87e79
2021-08-18 22:27:05 -07:00
Ronak Jain 38c0b2521a feat(plat/xilinx/zynqmp): sync IOCTL IDs
Sync IOCTL IDs in order to avoid conflict with other components like,
 Linux and firmware. Hence assigning value to IDs to make it more
 specific.

Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
Change-Id: I11ae679fbd0a953290306b62d661cc142f50dc28
2021-08-18 22:23:29 -07:00
lwpDarren 325716c97b fix(plat/qemu): (NS_DRAM0_BASE + NS_DRAM0_SIZE) ADDR overflow 32bit
after this commit: If15cf3b9d3e2e7876c40ce888f22e887893fe696
plat/qemu/common/qemu_pm.c:116:	    (entrypoint < (NS_DRAM0_BASE + NS_DRAM0_SIZE)))
the above line (NS_DRAM0_BASE + NS_DRAM0_SIZE) = 0x100000000, which will
overflow 32bit and cause ERROR
SO add ULL to fix it

tested on compiler:
gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))

Signed-off-by: Darren Liang <lwp513@qq.com>
Change-Id: I1d769b0803142d37bd2968d765ab04a9c7c5c21a
2021-08-18 16:13:22 +01:00
Madhukar Pappireddy 459b24451a Merge "feat: enabling stack protector for diphda" into integration 2021-08-18 16:08:53 +02:00
johpow01 f4616efafb cpu: add support for Demeter CPU
This patch adds the basic CPU library code to support the Demeter
CPU.  This CPU is based on the Makalu-ELP core so that CPU lib code
was adapted to create this patch.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Ib5740b748008a72788c557f0654d8d5e9ec0bb7f
2021-08-17 13:14:58 -05:00
Tom Cosgrove d810e30dd6 fix(plat/arm_fpga): enable AMU extension
As done recently for plat/tc0 in b5863cab9, enable AMU explicitly.
This is necessary as the recent changes that enable SVE for the secure
world disable AMU by default in the CPTR_EL3 reset value.

Change-Id: Ie3abf1dee8a4e1c8c39f934da8e32d67891f5f09
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2021-08-17 08:50:53 +01:00
Yann Gautier 99080bd127 fix(plat/st): apply security at the end of BL2
Now that the DDR is mapped secured, the security settings (TZC400
firewall) have to be applied at the end of BL2 for the OP-TEE case.
This is required to avoid checskum computation error on U-Boot binary,
for which MMU and TZC400 would not be aligned.

Change-Id: I4a364f7117960e8fae1b579f341b9f140b766ea6
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-08-17 09:10:51 +02:00
Varun Wadekar d4ad3da06a refactor(tegra132): deprecate platform
The Tegra132 platforms have reached their end of life and are
no longer used in the field. Internally and externally, all
known programs have removed support for this legacy platform.

This change removes this platform from the Tegra tree as a result.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I72edb689293e23b63290cdcaef60468b90687a5a
2021-08-16 11:58:24 -07:00
Andre Przywara 5d2793a61a fix(rpi4): drop /memreserve/ region
Most DTBs used on the RaspberryPi contain a FDT /memreserve/ region,
that covers the original secondaries' spin table.
We need to reserve more memory than described there, to cover the whole
of the TF-A image, so we add a /reserved-memory node to the DTB.

However having the same memory region described by both methods upsets
the Linux kernel and U-Boot, so we have to make sure there is only one
instance describing this reserved memory.

Keep our currently used /reserved-memory node, since it's more capable
(it allows to mark the region as secure memory). Add some code to drop
the original /memreserve/ region, since we don't need this anymore,
because we take the secondaries out of their original spin loop.

We explicitly check for the currently used size of 4KB for this region,
to be alerted by any changes to this region in the upstream DTB.

Change-Id: Ia3105560deb3f939e026f6ed715a9bbe68b56230
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-08-16 17:29:59 +01:00
Madhukar Pappireddy 485d1f8003 Merge "refactor(plat/ea_handler): Use default ea handler implementation for panic" into integration 2021-08-16 18:04:10 +02:00
Madhukar Pappireddy be3a51ce18 Merge "feat(plat/versal): add support for SLS mitigation" into integration 2021-08-13 17:22:12 +02:00
Pali Rohár 30e8fa7e77 refactor(plat/ea_handler): Use default ea handler implementation for panic
Put default ea handler implementation into function plat_default_ea_handler()
which just print verbose information and panic, so it can be called also
from overwritten / weak function plat_ea_handler() implementation.

Replace every custom implementation of printing verbose error message of
external aborts in custom plat_ea_handler() functions by a common
implementation from plat_default_ea_handler() function.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I15897f61b62b4c3c29351e693f51d4df381f3b98
2021-08-13 11:12:11 +02:00
Joanna Farley c87f2c1dd3 Merge changes Id93c4573,Ib7fea862,I44b9e5a9,I9e0ef734,I94d550ce, ... into integration
* changes:
  feat(plat/rcar3): emit RPC status to DT fragment if RPC unlocked
  feat(plat/rcar3): add a DRAM size setting for M3N
  feat(plat/rcar3): update IPL and Secure Monitor Rev.3.0.0
  feat(plat/rcar3): add new board revision for Salvator-XS/H3ULCB
  feat(drivers/rcar3): ddr: add function to judge a DDR rank
  fix(drivers/rcar3): ddr: update DDR setting for H3, M3, M3N
  fix(drivers/rcar3): i2c_dvfs: fix I2C operation
  fix(drivers/rcar3): fix CPG registers redefinition
  fix(drivers/rcar3): emmc: remove CPG_CPGWPR redefinition
  fix(plat/rcar3): generate two memory nodes for larger than 2 GiB channel 0
  refactor(plat/rcar3): factor out DT memory node generation
  feat(plat/rcar3): add optional support for gzip-compressed BL33
2021-08-13 10:16:20 +02:00
Manish Pandey e528bc22eb Merge changes from topic "st_fip_fconf" into integration
* changes:
  feat(io_mtd): offset management for FIP usage
  feat(nand): count bad blocks before a given offset
  feat(plat/st): add helper to save boot interface
  fix(plat/st): improve DDR get size function
  refactor(plat/st): map DDR secure at boot
  refactor(plat/st): rework TZC400 configuration
2021-08-13 00:22:55 +02:00
Abdellatif El Khlifi c7e4f1cfb8 feat: enabling stack protector for diphda
This commit activates the stack protector feature for the diphda
platform.

Change-Id: Ib16b74871c62b67e593a76ecc12cd3634d212614
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2021-08-12 16:49:52 +01:00
Madhukar Pappireddy 5360449b61 Merge "feat(plat/imx/imx8m/imx8mm): enlarge BL33 (U-boot) size in FIP" into integration 2021-08-12 15:47:53 +02:00
Usama Arif 6ec0c65b09
feat(plat/arm): Introduce TC1 platform
This renames tc0 platform folder and files to tc, and introduces
TARGET_PLATFORM variable to account for the differences between
TC0 and TC1.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I5b4a83f3453afd12542267091b3edab4c139c5cd
2021-08-11 11:36:50 +01:00
Madhukar Pappireddy 8ce073e420 Merge "feat(plat/mdeiatek/mt8192): add DFD control in SiP service" into integration 2021-08-11 00:46:12 +02:00
Madhukar Pappireddy e5c7a92b50 Merge "revert(plat/xilinx): add timeout while waiting for IPI Ack" into integration 2021-08-10 15:58:11 +02:00
Olivier Deprez abde216dc8 Merge "feat(ff-a): update FF-A version to v1.1" into integration 2021-08-10 11:14:44 +02:00
Venkatesh Yadav Abbarapu 62f9134de0 revert(plat/xilinx): add timeout while waiting for IPI Ack
This reverts commit 4d9b9b2352.

Timeout in IPI ack was added for functional safety reason.
Functional safety is not criteria for ATF. However, this
creates issues for APIs that take long or non-deterministic
duration like FPGA load. So revert this patch for now to fix
FPGA loading issue. Need to add support for non-blocking API
for FPGA loading with callback when API completes.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I940e798f1e2f7d0dfca1da5caaf8b94036d440c6
2021-08-09 23:20:39 -06:00
Rex-BC Chen 5183e637a0 feat(plat/mdeiatek/mt8192): add DFD control in SiP service
DFD (Design for Debug) is a debugging tool, which scans
flip-flops and dumps to internal RAM on the WDT reset.
After system reboots, those values could be showed for
debugging.

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I9c7af9a4f75216ed2c6b44458d121a352bef4b95
2021-08-10 09:41:15 +08:00
Manish V Badarkhe f34322c1ce fix: avoid redefinition of 'efi_guid' structure
Fixed the build error by removing the local definition of 'efi_guid'
structure in 'sgi_ras.c' file as this structure definition is already
populated in 'sgi_ras.c' file via 'uuid.h' header.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I57687336863f2a0761c09b6c1aa00b4aa82a6a12
2021-08-06 12:54:11 +01:00
J-Alves e1c732d46f feat(ff-a): update FF-A version to v1.1
Bump the required FF-A version in framework and manifests to v1.1 as
upstream feature development goes.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I89b2bd3828a13fc4344ccd53bc3ac9c0c22ab29f
2021-08-06 11:16:39 +02:00
Madhukar Pappireddy 5e4e13e173 Merge changes from topic "fw-update-2" into integration
* changes:
  feat(sw_crc32): add software CRC32 support
  refactor(hw_crc32): renamed hw_crc32 to tf_crc32
  feat(fwu): avoid booting with an alternate boot source
  docs(fwu): add firmware update documentation
  feat(fwu): avoid NV counter upgrade in trial run state
  feat(plat/arm): add FWU support in Arm platforms
  feat(fwu): initialize FWU driver in BL2
  feat(fwu): add FWU driver
  feat(fwu): introduce FWU platform-specific functions declarations
  docs(fwu_metadata): add FWU metadata build options
  feat(fwu_metadata): add FWU metadata header and build options
2021-08-02 22:53:50 +02:00
Manish V Badarkhe c885d5c84d refactor(hw_crc32): renamed hw_crc32 to tf_crc32
Renamed hw_crc32 to tf_crc32 to make the file and function
name more generic so that the same name can be used in upcoming
software CRC32 implementation.

Change-Id: Idff8f70c50ca700a4328a27b49d5e1f14d2095eb
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-08-02 17:15:41 +01:00
Manish V Badarkhe 2f1177b2b9 feat(plat/arm): add FWU support in Arm platforms
Added firmware update support in Arm platforms by using
FWU platform hooks and compiling FWU driver in BL2
component.

Change-Id: I71af06c09d95c2c58e3fd766c4a61c5652637151
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-08-02 17:15:40 +01:00
Olivier Deprez c7e39dcf68 Merge "feat(ff-a): change manifest messaging method" into integration 2021-08-02 18:14:54 +02:00
Madhukar Pappireddy 6881f7be46 Merge changes Ic7579b60,I05414ca1 into integration
* changes:
  fix(plat/ea_handler): print newline before fatal abort error message
  feat(common/debug): add new macro ERROR_NL() to print just a newline
2021-07-30 17:58:22 +02:00
Pali Rohár a5fea81058 fix(plat/ea_handler): print newline before fatal abort error message
External Abort may happen also during printing of some messages by
U-Boot or kernel. So print newline before fatal abort error message.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Ic7579b605e695c2e4cb9a4f5cdc2d0b3e5083e49
2021-07-29 16:30:40 +01:00
Stas Sergeev 749d0fa80d fix(plat/fvp): provide boot files via semihosting
These files are needed during boot, but they were missing
for semihosting.
With this patch, the list of files is complete enough to
boot on ATF platform via semihosting.

Change-Id: I2f0ca25983a6e18096f040780776f19f8040ea79
Signed-off-by: stsp@users.sourceforge.net
2021-07-28 14:16:55 +03:00
Manish Pandey fe1021f1a1 Merge "rpi4: enable RPi4 PCI SMC conduit" into integration 2021-07-28 13:01:35 +02:00
Jeremy Linton ab061eb732 rpi4: SMCCC PCI implementation
The rpi4 has a single nonstandard ECAM. It is broken
into two pieces, the root port registers, and a window
to a single device's config space which can be moved
between devices. Now that we have widened the page
tables/MMIO window, we can create a read/write acces
functions that are called by the SMCCC/PCI API.

As an example platform, the rpi4 single device ECAM
region quirk is pretty straightforward. The assumption
here is that a lower level (uefi) has configured and
initialized the PCI root to match the values we are
using here.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: Ie1ffa8fe9aa1d3c62e6aa84746a949c1009162e0
2021-07-28 09:41:55 +02:00
Jeremy Linton 6e63cdc55e rpi4: enable RPi4 PCI SMC conduit
Now that we have adjusted the address map, added the
SMC conduit code, and the RPi4 PCI callbacks, lets
add the flags to enable everything in the build.

By default this service is disabled because the
expectation is that its only useful in a UEFI+ACPI
environment.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: I2a3cac6d63ba8119d3b711db121185816b89f8a2
2021-07-28 09:41:05 +02:00
Madhukar Pappireddy 743e3b4147 Merge "plat/sgi: tag dmc620 MM communicate messages with a guid" into integration 2021-07-27 21:35:11 +02:00
Madhukar Pappireddy 7fb82d8286 Merge "fix(rk3399/suspend): correct LPDDR4 resume sequence" into integration 2021-07-27 17:01:40 +02:00
Madhukar Pappireddy d31f319492 Merge "fix(plat/imx): do not keep mmc_device_info in stack" into integration 2021-07-26 17:39:59 +02:00
André Przywara 81e63f25ff Merge changes from topic "allwinner_mmap" into integration
* changes:
  refactor(plat/allwinner): clean up platform definitions
  refactor(plat/allwinner): do not map BL32 DRAM at EL3
  refactor(plat/allwinner): map SRAM as device memory by default
  refactor(plat/allwinner): rename static mmap region constant
  feat(bl_common): import BL_NOBITS_{BASE,END} when defined
2021-07-26 17:29:30 +02:00
Manish Pandey a52c52477a Merge changes from topic "sve+amu" into integration
* changes:
  fix(plat/tc0): enable AMU extension
  fix(el3_runtime): fix SVE and AMU extension enablement flags
2021-07-26 11:05:39 +02:00
Arunachalam Ganapathy b5863cab9a fix(plat/tc0): enable AMU extension
Recent changes to enable SVE for the secure world have disabled AMU
extension by default in the reset value of CPTR_EL3 register. So the
platform has to enable this extension explicitly.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I7d930d96ec22d7c3db961411370564bece0ce272
2021-07-23 10:33:59 +01:00
Samuel Holland 0e54a7899d refactor(plat/allwinner): clean up platform definitions
Group the SCP base/size definitions in a more logical location.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Id43f9b468d7d855a2413173d674a5ee666527808
2021-07-22 20:50:30 -05:00
Samuel Holland 8d9efdf8a8 refactor(plat/allwinner): do not map BL32 DRAM at EL3
BL31 does not appear to ever access the DRAM allocated to BL32,
so there is no need to map it at EL3.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Ie8727b793e53ea14517894942266f6da0333eb74
2021-07-22 20:50:27 -05:00
Samuel Holland ab74206b60 refactor(plat/allwinner): map SRAM as device memory by default
The SRAM on Allwinner platforms is shared between BL31 and coprocessor
firmware. Previously, SRAM was mapped as normal memory by default.
This scheme requires carveouts and cache maintenance code for proper
synchronization with the coprocessor.

A better scheme is to only map pages owned by BL31 as normal memory,
and leave everything else as device memory. This removes the need for
cache maintenance, and it makes the mapping for BL31 RW data explicit
instead of magic.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I820ddeba2dfa2396361c2322308c0db51b55c348
2021-07-22 20:50:24 -05:00
Samuel Holland bc135624ef refactor(plat/allwinner): rename static mmap region constant
This constant specifically refers to the number of static mmap regions.
Rename it to make that clear.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I475c037777ce2a10db2631ec0e7446bb73590a36
2021-07-22 20:50:21 -05:00
Abdellatif El Khlifi 7f70cd2923 feat: disabling non volatile counters in diphda
At this stage of development Non Volatile counters are not implemented
in the Diphda platform.

This commit disables their use during the Trusted Board Boot by
overriding the NV counters get/set functions.

Change-Id: I8dcbebe0281cc4d0837c283ff637e20b850988ef
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2021-07-22 18:01:43 +01:00
Abdellatif El Khlifi bf3ce99371 feat: adding the diphda platform
This commit enables trusted-firmware-a with Trusted Board Boot support
for the Diphda 64-bit platform.

Diphda uses a FIP image located in the flash. The FIP contains the
following components:

- BL2
- BL31
- BL32
- BL32 SPMC manifest
- BL33
- The TBB certificates

The board boot relies on CoT (chain of trust). The trusted-firmware-a
BL2 is extracted from the FIP and verified by the Secure Enclave
processor. BL2 verification relies on the signature area at the
beginning of the BL2 image. This area is needed by the SecureEnclave
bootloader.

Then, the application processor is released from reset and starts by
executing BL2.

BL2 performs the actions described in the trusted-firmware-a TBB design
document.

Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Change-Id: Iddb1cb9c2a0324a9635e23821c210ac81dfc305d
2021-07-22 18:01:39 +01:00
Maksims Svecovs bb320dbc47 feat(ff-a): change manifest messaging method
Align documentation with changes of messaging method for partition
manifest:
      - Bit[0]: support for receiving direct message requests
      - Bit[1]: support for sending direct messages
      - Bit[2]: support for indirect messaging
      - Bit[3]: support for managed exit
Change the optee_sp_manifest to align with the new messaging method
description.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I333e82c546c03698c95f0c77293018f8dca5ba9c
2021-07-22 14:21:41 +01:00
Venkatesh Yadav Abbarapu 302b4dfb8f feat(plat/versal): add support for SLS mitigation
This patch adds the option HARDEN_SLS_ALL that can be used to enable
the -mharden-sls=all, which mitigates the straight-line speculation
vulnerability. Enable this by adding the option HARDEN_SLS_ALL=1,
default this will be disabled.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I0d498d9e96903fcb879993ad491949f6f17769b2
2021-07-20 22:33:47 -06:00
Roger Lu 310c3a26e1 fix(mediatek/mt8192/spm): add missing bit define for debug purpose
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Change-Id: I6dbf6d4ea6310c3371ca15d1e7cce249a05af2fb
2021-07-21 03:36:14 +02:00
Ying-Chun Liu (PaulLiu) d53c9dbf9f feat(plat/imx/imx8m/imx8mm): enlarge BL33 (U-boot) size in FIP
When enabling U-boot with UEFI and secure boot, the size of U-boot
becomes more than 1MB. So we enlarge BL33 to 2MB.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Change-Id: I9d9d24132bb1ec17ef6080dc72e93c7f531c97b5
2021-07-21 05:51:36 +08:00
Madhukar Pappireddy e2a16044ad Merge "fix(plat/mediatek/me8195): fix error setting for SPM" into integration 2021-07-20 18:00:28 +02:00
Manish Pandey 3d88d1136d Merge changes from topic "fwu-refactor" into integration
* changes:
  refactor(plat/arm): use mmio* functions to read/write NVFLAGS registers
  refactor(plat/arm): mark the flash region as read-only
  refactor(plat/arm): update NV flags on image load/authentication failure
2021-07-20 17:24:18 +02:00
Manish Pandey e18f4aaf5e Merge changes from topic "marvell-a3k-a8k-updates" into integration
* changes:
  fix(plat/marvell/a3k): Fix building uart-images.tgz.bin archive
  refactor(plat/marvell/a3k): Rename *_CFG and *_SIG variables
  refactor(plat/marvell/a3k): Rename DOIMAGETOOL to TBB
  refactor(plat/marvell/a3k): Remove useless DOIMAGEPATH variable
  fix(plat/marvell/a3k): Fix check for external dependences
  fix(plat/marvell/a8k): Add missing build dependency for BLE target
  fix(plat/marvell/a8k): Correctly set include directories for individual targets
  fix(plat/marvell/a8k): Require that MV_DDR_PATH is correctly set
2021-07-20 16:27:16 +02:00
Garmin Chang 1f81cccedd fix(plat/mediatek/me8195): fix error setting for SPM
There is a error setting for SPM, so we need to fix this issue.

Signed-off-by: Garmin Chang <garmin.chang@mediatek.com>
Change-Id: I741a5dc1505a831fe48fd5bc3da9904db14c8a57
2021-07-20 02:55:46 +01:00
Jimmy Brisson 2c4b0c05c6 fix(rk3399/suspend): correct LPDDR4 resume sequence
This change adds 208 bytes to PMUSRAM, pushing the end of text from
0xff3b0de0 to 0xff3b0eb0, which is still shy of the maximum
0xff3b1000.

Further, this skips enabling the watchdog when it's not being used
elsewhere, as you can't turn the watchdog off.

Change-Id: I2e6fa3c7e01f2be6b32ce04ce479edf64e278554
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2021-07-19 23:06:33 +02:00
Madhukar Pappireddy c8861f9f42 Merge changes Iebb86a0b,I7fe63311 into integration
* changes:
  refactor(plat/nxp/lx216x): refine variable definition
  refactor(plat/nxp/lx216x): use common make variables
2021-07-19 18:51:27 +02:00
Madhukar Pappireddy 8cf5afafd7 Merge changes I2b3aa9bd,I3237199b into integration
* changes:
  docs: add mt6795 to deprecated list
  feat(plat/mediatek/mt8195): add DCM driver
2021-07-19 18:38:59 +02:00
Madhukar Pappireddy 447e93eb81 Merge "fix(plat/marvell/a3k): fix printing info messages on output" into integration 2021-07-19 02:58:05 +02:00
Madhukar Pappireddy 384953df68 Merge "fix(rockchip/rk3399): fix dram section placement" into integration 2021-07-19 02:57:48 +02:00
Pali Rohár 9f6d154083 fix(plat/marvell/a3k): fix printing info messages on output
INFO() macro for every call prepends "INFO:   " string. Therefore
current code prints unreadable debug messages:

    "INFO:    set_io_addr_dec 0 result: ctrl(0x3fff3d01) base(0x0)INFO:    "
    "INFO:    Set IO decode window successfully, base(0xc000)INFO:     win_attr(3d) max_dram_win(2) max_remap(0)INFO:     win_offset(8)"

Fix it by calling exactly one INFO() call for one line. After this
change output is:

    "INFO:    set_io_addr_dec 0 result: ctrl(0x3fff3d01) base(0x0) remap(0x0)"
    "INFO:    Set IO decode window successfully, base(0xc000) win_attr(3d) max_dram_win(2) max_remap(0) win_offset(8)"

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I6084e64c6f4da6c1929e5300588e4ba2608ca745
2021-07-16 19:07:44 +01:00
Yann Gautier 7e87ba2598 feat(plat/st): add helper to save boot interface
Some parameters from BootROM boot context can be required after boot.
To save space in SYSRAM, this context can be overwritten during images
load sequence. The needed information (here the boot interface) is
then saved in a local variable.

Change-Id: I5e1ad4630ccf78480f415a0a83939005ae67729e
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-07-13 18:16:55 +02:00
Lionel Debieve 91ffc1deff fix(plat/st): improve DDR get size function
Avoid parsing device tree every time when returning
the DDR size.
A cache flush on this size is also added because TZC400 configuration
is applied at the end of BL2 after MMU and data cache being turned off.
Configuration needs to retrieve the DDR size to generate the correct
region. Access to the size fails because the value is still in the data
cache. Flushing the size is mandatory.

Change-Id: I3dd1958f37d806f9c15a5d4151968935f6fe642e
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-07-13 18:16:55 +02:00
Yann Gautier c1ad41fbf7 refactor(plat/st): map DDR secure at boot
In BL2, the DDR can be mapped as secured in MMU, as no other SW
has access to it during its execution.
The TZC400 configuration is also updated to reflect this. When using
OP-TEE, the TZC400 is reconfigured at the end of BL2, to match OP-TEE
mapping. Else, SP_min will be in charge to reconfigure TZC400 to set
DDR non-secure.

Change-Id: Ic5ec614b218f733796feeab1cdc425d28cc7c103
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-07-13 18:16:55 +02:00
Yann Gautier b230b3f2dd refactor(plat/st): rework TZC400 configuration
Add new static functions to factorize code in stm32mp1_security.c.

Change-Id: Ifa5a1aaf7c56c25dba9a0ab8e985496d7cb06990
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-07-13 18:16:55 +02:00
Manish Pandey 3d47046712 Merge "refactor(plat/qemu): increase the non-secure DRAM size" into integration 2021-07-12 12:54:05 +02:00
Pali Rohár d3f8db07b6 fix(plat/marvell/a3k): Fix building uart-images.tgz.bin archive
For UART secure boot it is required also TIMN image, so pack it into
uart-images.tgz.bin archive which is created by mrvl_uart target.

$(TIMN_IMAGE) and $(TIM_IMAGE) variables are used only for UART images
so their content needs to be initialized from $(TIMN_UART_CFG) and
$(TIM_UART_CFG) config files. And not from $(TIMN_CFG) and $(TIM_CFG) as
it is now because they are not generated during mrvl_uart target. Fix it
to allow building mrvl_uart target before mrvl_flash target.

To match usage of these variables, rename them to $(TIMN_UART_IMAGE) and
$(TIM_UART_IMAGE).

To not complicate rule for building uart-images.tgz.bin archive, set
list of image files into a new $(UART_IMAGES) variable.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I83b980abb4047a3afb3ce3026842e1d873c490bf
2021-07-11 17:35:35 +02:00
Pali Rohár 618287dac6 refactor(plat/marvell/a3k): Rename *_CFG and *_SIG variables
For TIM config file use TIM name instead of DOIMAGE and use underscores
to make variable names more readable.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I1282ce11f1431c15458a143ae7bfcee85eed2432
2021-07-11 17:02:15 +02:00
Marek Vasut 12c75c8886 feat(plat/rcar3): emit RPC status to DT fragment if RPC unlocked
In case the RCAR_RPC_HYPERFLASH_LOCKED is 0, emit DT node /soc/rpc@ee200000
with property status = "okay" into the DT fragment passed to subsequent
software, to indicate the RPC is unlocked.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Id93c4573ab1c62cf13fa5a803dc5818584a2c13a
2021-07-10 18:50:17 +02:00
Pali Rohár 7937b3c70c refactor(plat/marvell/a3k): Rename DOIMAGETOOL to TBB
Armada 3700 uses external TBB tool for creating images and does not use
internal TF-A doimage tool from tools/marvell/doimage/

Therefore set correct name of variable.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I38a94dca78d483de4c79da597c032e1e5d06d92d
2021-07-10 18:24:43 +02:00
Pali Rohár 7b209717d9 refactor(plat/marvell/a3k): Remove useless DOIMAGEPATH variable
Armada 3700 uses WTP so use WTP variable directly.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I216b40ffee1f3f8abba4677f050ab376c2224ede
2021-07-10 18:24:43 +02:00
Pali Rohár 2baf50385b fix(plat/marvell/a3k): Fix check for external dependences
Old Marvell a3700_utils and mv-ddr tarballs do not have to work with
latest TF-A code base. Marvell do not provide these old tarballs on
Extranet anymore. Public version on github repository contains all
patches and is working fine, so for public TF-A builds use only public
external dependencies from git.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Iee5ac6daa9a1826a5b80a8d54968bdbb8fe72f61
2021-07-10 18:24:43 +02:00
Pali Rohár 04738e6991 fix(plat/marvell/a8k): Add missing build dependency for BLE target
BLE source files depend on external Marvell mv-ddr-marvell tree
(specified in $(MV_DDR_PATH) variable) and its header files. Add
dependency on $(MV_DDR_LIB) target which checks that variable
$(MV_DDR_PATH) is correctly set and ensures that make completes
compilation of mv-ddr-marvell tree.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I73968b24c45d9af1e3500b8db7a24bb4eb2bfa47
2021-07-10 18:24:43 +02:00
Pali Rohár 559ab2df4a fix(plat/marvell/a8k): Correctly set include directories for individual targets
Do not set all include directories, including those for external targets
in one PLAT_INCLUDES variable.

Instead split them into variables:
* $(PLAT_INCLUDES) for all TF-A BL images
* BLE target specific $(PLAT_INCLUDES) only for Marvell BLE image
* $(MV_DDR_INCLUDES) for targets in external Marvell mv-ddr-marvell tree

Include directory $(CURDIR)/drivers/marvell is required by TF-A BL
images, so move it from ble.mk to a8k_common.mk.

Include directory $(MV_DDR_PATH) is needed only by Marvell BLE image, so
move it into BLE target specific $(PLAT_INCLUDES) variable.

And remaining include directories specified in ble.mk are needed only
for building external dependences from Marvell mv-ddr tree, so move them
into $(MV_DDR_INCLUDES) variable and correctly use it in $(MV_DDR_LIB)
target.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I331f7de675dca2bc70733d56b768f00d56ae4a67
2021-07-10 18:24:43 +02:00
Pali Rohár 528dafc367 fix(plat/marvell/a8k): Require that MV_DDR_PATH is correctly set
Target mrvl_flash depends on external mv_ddr source code which is not
part of TF-A project. Do not expect that it is pre-downloaded at some
specific location and require user to specify correct path to mv_ddr
source code via MV_DDR_PATH build option.

TF-A code for Armada 37x0 platform also depends on mv_ddr source code
and already requires passing correct MV_DDR_PATH build option.

So for A8K implement same checks for validity of MV_DDR_PATH option as
are already used by TF-A code for Armada 37x0 platform.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I792f2bfeab0cec89b1b64e88d7b2c456e22de43a
2021-07-10 18:24:43 +02:00
Toshiyuki Ogasahara f95d551217 feat(plat/rcar3): add a DRAM size setting for M3N
This commit adds a DRAM size setting when building with
RCAR_DRAM_LPDDR4_MEMCONF=2 for M3N Ver.1.1 4GB DRAM.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: Ib7fea862ab2e0bcafaf39ec030384f0fddda9b96
2021-07-10 17:35:43 +02:00
Toshiyuki Ogasahara c5f5bb17ab feat(plat/rcar3): update IPL and Secure Monitor Rev.3.0.0
Update the revision number in the revision management file.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I44b9e5a992e8a44cfeafad6d2c1a97aa59baca4e
2021-07-10 17:35:39 +02:00
Toshiyuki Ogasahara 4379a3e974 feat(plat/rcar3): add new board revision for Salvator-XS/H3ULCB
Add new board revision for 8GB 1rank of Salvator-XS/H3ULCB

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I9e0ef7340d92de9c892fc5bd04abe24ad6ee4286
2021-07-10 17:35:36 +02:00
Toshiyuki Ogasahara 0dae56bb2f fix(drivers/rcar3): fix CPG registers redefinition
This commit deletes the value of the redefined CPG register.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I05cf4a449ae28adb2ddd59593971a7d0cbcb21de
2021-07-10 17:35:20 +02:00