project/bcm63xx/atf.git
5 years agoSanitise includes across codebase
Antonio Nino Diaz [Fri, 14 Dec 2018 00:18:21 +0000 (00:18 +0000)]
Sanitise includes across codebase

Enforce full include path for includes. Deprecate old paths.

The following folders inside include/lib have been left unchanged:

- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}

The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).

For example, this patch had to be created because two headers were
called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca33988b9 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.

Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.

Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoReorganize architecture-dependent header files
Antonio Nino Diaz [Mon, 17 Dec 2018 17:20:57 +0000 (17:20 +0000)]
Reorganize architecture-dependent header files

The architecture dependant header files in include/lib/${ARCH} and
include/common/${ARCH} have been moved to /include/arch/${ARCH}.

Change-Id: I96f30fdb80b191a51448ddf11b1d4a0624c03394
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: Always define TSP memory region
Antonio Nino Diaz [Fri, 14 Dec 2018 01:27:19 +0000 (01:27 +0000)]
plat/arm: Always define TSP memory region

Even though this is not used unless SPD=tspd, only defining it when
SPD_tspd is defined doesn't have any advantage and it makes it harder to
read the code.

Change-Id: I3d93135e05f39be071d16f8a47394a9a3ff54bc8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1731 from miyatsu/doc-fix-20181225
Antonio Niño Díaz [Fri, 4 Jan 2019 09:14:22 +0000 (09:14 +0000)]
Merge pull request #1731 from miyatsu/doc-fix-20181225

docs: marvell: Fix typo in file build.txt

5 years agoMerge pull request #1728 from satheesbalya-arm/sb1/sb1_2497_v84_dit
Antonio Niño Díaz [Fri, 4 Jan 2019 09:13:32 +0000 (09:13 +0000)]
Merge pull request #1728 from satheesbalya-arm/sb1/sb1_2497_v84_dit

Enable DIT if supported

5 years agoEnable DIT if supported
Sathees Balya [Thu, 6 Dec 2018 13:33:24 +0000 (13:33 +0000)]
Enable DIT if supported

This patch enables the Data Independent Timing
functionality (DIT) in EL3 if supported
by the platform.

Change-Id: Ia527d6aa2ee88a9a9fe1c941220404b9ff5567e5
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
5 years agodocs: marvell: Fix typo in file build.txt
Ding Tao [Tue, 25 Dec 2018 06:42:08 +0000 (14:42 +0800)]
docs: marvell: Fix typo in file build.txt

Replace "SECURE=0" with "MARVELL_SECURE_BOOT=0".

Signed-off-by: Ding Tao <miyatsu@qq.com>
5 years agoMerge pull request #1730 from antonio-nino-diaz-arm/an/spdx
Antonio Niño Díaz [Wed, 19 Dec 2018 14:08:23 +0000 (15:08 +0100)]
Merge pull request #1730 from antonio-nino-diaz-arm/an/spdx

Use SPDX identifier in checkpatch config file

5 years agoUse SPDX identifier in checkpatch config file
Antonio Nino Diaz [Wed, 19 Dec 2018 13:13:33 +0000 (13:13 +0000)]
Use SPDX identifier in checkpatch config file

Change-Id: I4113604ac69ba07bd90d8268be65cae8aa43138e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1725 from Yann-lms/clang_aarch32
Antonio Niño Díaz [Wed, 19 Dec 2018 12:43:17 +0000 (13:43 +0100)]
Merge pull request #1725 from Yann-lms/clang_aarch32

clang: 32 bit compilation should include march32-directive

5 years agoMerge pull request #1727 from antonio-nino-diaz-arm/an/gitignore
Antonio Niño Díaz [Wed, 19 Dec 2018 09:52:27 +0000 (10:52 +0100)]
Merge pull request #1727 from antonio-nino-diaz-arm/an/gitignore

gitignore: Ignore sptool and doimage binaries

5 years agoMerge pull request #1729 from vwadekar/tegra-native-gicv2
Antonio Niño Díaz [Wed, 19 Dec 2018 09:51:28 +0000 (10:51 +0100)]
Merge pull request #1729 from vwadekar/tegra-native-gicv2

Tegra native gicv2

5 years agoTegra: support for native GICv2 drivers
Varun Wadekar [Fri, 19 Oct 2018 18:42:28 +0000 (11:42 -0700)]
Tegra: support for native GICv2 drivers

This patch converts Tegra platforms to support native
GICv2 drivers. This involves removes Tegra's GIC driver
port platforms to use interrupt_props

Change-Id: I83d8a690ff276dd97928dc60824a4fd36999bb30
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: support to compile native GICv2 drivers
Varun Wadekar [Fri, 19 Oct 2018 18:44:31 +0000 (11:44 -0700)]
Tegra: support to compile native GICv2 drivers

This patch adds a macro to allow platforms to compile native
GICv2 drivers along with Tegra handlers.

Change-Id: I8281796c09dae5704cff2daab831395d65e261b7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agogitignore: Ignore sptool and doimage binaries
Antonio Nino Diaz [Fri, 14 Dec 2018 10:47:52 +0000 (10:47 +0000)]
gitignore: Ignore sptool and doimage binaries

Change-Id: I119b85179f68148e128cc194f11d2cccb1e33d6d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1721 from marex/arm/master/memsize-passing-v2
Antonio Niño Díaz [Tue, 18 Dec 2018 14:24:52 +0000 (15:24 +0100)]
Merge pull request #1721 from marex/arm/master/memsize-passing-v2

plat: rcar: Move FDT from x3 to x1

5 years agoMerge pull request #1717 from satheesbalya-arm/sb1/sb1_2629_romlib_ifc
Antonio Niño Díaz [Tue, 18 Dec 2018 14:22:49 +0000 (15:22 +0100)]
Merge pull request #1717 from satheesbalya-arm/sb1/sb1_2629_romlib_ifc

romlib: Add platform specific jump table list

5 years agoromlib: Add platform specific jump table list
Sathees Balya [Wed, 31 Oct 2018 14:05:08 +0000 (14:05 +0000)]
romlib: Add platform specific jump table list

This patch allows platforms to define their
own jump table list for library at ROM. The
file has the list of functions to be used
from library at ROM. It can also include
other list files.

Change-Id: I721c35d7dad3dcadbb3a7f3277bfd5d3e1f6e00a
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
5 years agoMerge pull request #1722 from antonio-nino-diaz-arm/an/arch
Antonio Niño Díaz [Tue, 18 Dec 2018 12:50:38 +0000 (13:50 +0100)]
Merge pull request #1722 from antonio-nino-diaz-arm/an/arch

Synchronize architectural headers with TF-A-Tests

5 years agoImport exception helpers from TF-A-Tests
Antonio Nino Diaz [Fri, 23 Nov 2018 15:04:01 +0000 (15:04 +0000)]
Import exception helpers from TF-A-Tests

This is done in order to keep the files in both repositories in sync.

Change-Id: Ie1a9f321cbcfe8d7d14f206883fa718872271218
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoDeprecate some unused AArch64 assembly functions
Antonio Nino Diaz [Fri, 23 Nov 2018 13:54:41 +0000 (13:54 +0000)]
Deprecate some unused AArch64 assembly functions

Change-Id: I8a0be21783a0c12325e6ab22e9e53ab5466ed9e0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMove helpers from arch.h to arch_helpers.h
Antonio Nino Diaz [Fri, 23 Nov 2018 13:54:00 +0000 (13:54 +0000)]
Move helpers from arch.h to arch_helpers.h

Some of the affected macros can only be used from C code. In general, we
use arch_helpers.h for any C helpers to access registers. For
consistency, the other macros have been moved as well.

Also, import some AArch32 helpers from TF-A-Tests.

Change-Id: Ie8fe1ddeadba5336c12971ddc39a7883121386b1
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1718 from vwadekar/cc-variable-findstring
Antonio Niño Díaz [Tue, 18 Dec 2018 10:55:45 +0000 (11:55 +0100)]
Merge pull request #1718 from vwadekar/cc-variable-findstring

build: find "armclang" string in the 'CC' variable

5 years agoMerge pull request #1719 from Yann-lms/useless_flags
Antonio Niño Díaz [Tue, 18 Dec 2018 10:55:11 +0000 (11:55 +0100)]
Merge pull request #1719 from Yann-lms/useless_flags

stm32mp1: remove useless compilation flags

5 years agoclang: 32 bit compilation should include march32-directive
Yann Gautier [Tue, 18 Dec 2018 09:46:34 +0000 (10:46 +0100)]
clang: 32 bit compilation should include march32-directive

This is done for other compilers, and without this some code does not
compile, like inline assembly code.

Fixes ARM-software/tf-issues#657.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoMerge pull request #1720 from jeenu-arm/gic-priority
Antonio Niño Díaz [Tue, 18 Dec 2018 09:05:22 +0000 (10:05 +0100)]
Merge pull request #1720 from jeenu-arm/gic-priority

GIC: Remove lowest priority constants

5 years agoMerge pull request #1723 from soby-mathew/sm/reset_bl31_fix
Antonio Niño Díaz [Tue, 18 Dec 2018 09:04:57 +0000 (10:04 +0100)]
Merge pull request #1723 from soby-mathew/sm/reset_bl31_fix

FVP: Fixes for RESET_TO_BL31

5 years agodocs: User-guide corrections for RESET_TO_BL31
Soby Mathew [Wed, 12 Dec 2018 14:54:23 +0000 (14:54 +0000)]
docs: User-guide corrections for RESET_TO_BL31

This patch updates the user guide instructions for
RESET_TO_SP_MIN and RESET_TO_BL31 cases. The load
address for BL31 had to be updated because of increase
in code size. Also, information about PIE support when
RESET_TO_BL31=1 for FVP is added.

In the case of RESET_TO_SP_MIN, the RVBAR address
was wrong in the instruction. This is also corrected
in the patch.

Change-Id: I65fe6d28c5cf79bee0a11fbde320d49fcc1aacf5
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
5 years agoBL31: correct GOT section omission
Soby Mathew [Wed, 12 Dec 2018 14:33:11 +0000 (14:33 +0000)]
BL31: correct GOT section omission

When the patch SHA 931f7c6 introduced PIE support for BL31,
adding the GOT section when the SEPARATE_CODE_AND_RODATA=0
to the linker script was erroneously omitted. This patch corrects
the same.

Also the patch reduces the alignment requirement for GOT and RELA
sections from 16 bytes to 8. Comments are added explain the
intent for alignment.

Change-Id: I8035cbf75f346f99bd56b13f32e0b3b70dd2fe6c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
5 years agoFVP: Change BL31_BASE when RESET_TO_BL31=1
Soby Mathew [Wed, 12 Dec 2018 14:13:52 +0000 (14:13 +0000)]
FVP: Change BL31_BASE when RESET_TO_BL31=1

This patch defines BL31_BASE to 0x0 when RESET_TO_BL31=1 as the
executable is built with PIE support and can be loaded anywhere
in SRAM for execution.

Change-Id: I4007f4626322f1200a6304c9c565987d3357986c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
5 years agoMerge pull request #1716 from miyatsu/marvell-doc-fix-20181210
Antonio Niño Díaz [Mon, 17 Dec 2018 10:54:16 +0000 (11:54 +0100)]
Merge pull request #1716 from miyatsu/marvell-doc-fix-20181210

docs: marvell: Fix typo in file build.txt

5 years agoGIC: Remove lowest priority constants
Jeenu Viswambharan [Wed, 7 Nov 2018 11:46:36 +0000 (11:46 +0000)]
GIC: Remove lowest priority constants

The GIC lowest priority values for each world depends on the number of
priority values implemented in hardware. These constants currently
defined in gic_common.h only meant to enumerate lowest possible
architectural values. Since these values are not used in generic code or
upstream platforms, and that general use of these constants can be
wrong, remove these. Platforms should either define and use these as
appropriate, or determine correct values at run time.

Change-Id: I3805cea8ceb8a592b9eff681ea1b63b7496cec5f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
5 years agoplat: rcar: Move FDT from x3 to x1
Marek Vasut [Thu, 13 Dec 2018 21:08:24 +0000 (22:08 +0100)]
plat: rcar: Move FDT from x3 to x1

As suggested, pass the FDT to BL 33 via x1 instead of x3 , to be
consistent with the other platforms.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agostm32mp1: remove useless compilation flags
Yann Gautier [Thu, 13 Dec 2018 14:01:53 +0000 (15:01 +0100)]
stm32mp1: remove useless compilation flags

On AARCH32, thumb is used by default, no need to redefine it.
As all our binaries are compiled with thumb, interwork is not needed.
The binaries compiled with or without those flags are the same,
except of course for the date.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agobuild: find "armclang" string in the 'CC' variable
Varun Wadekar [Wed, 12 Dec 2018 23:22:27 +0000 (15:22 -0800)]
build: find "armclang" string in the 'CC' variable

This patch modifies the search criteria to see if we are using 'armclang'
as the compiler. Switch over to using 'findstring' which enables platforms
to do fancy stuff using scripts e.g. check if armclang timed out and retry
compilation.

Change-Id: If2162ebadb9033f6457a4e8d4243345e711defe6
Signed-off-by: Kalyani Chidambaram Vaidyanathan <kalyanic@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoMerge pull request #1708 from Yann-lms/warnings
Soby Mathew [Wed, 12 Dec 2018 15:54:47 +0000 (15:54 +0000)]
Merge pull request #1708 from Yann-lms/warnings

Add possibility to add compilation warnings

5 years agoMerge pull request #1715 from pangupta/master
Soby Mathew [Wed, 12 Dec 2018 15:54:09 +0000 (15:54 +0000)]
Merge pull request #1715 from pangupta/master

ccn: for RN-I, used node id instead of node postion

5 years agoMerge pull request #1712 from jeenu-arm/ssbs
Soby Mathew [Wed, 12 Dec 2018 09:43:49 +0000 (09:43 +0000)]
Merge pull request #1712 from jeenu-arm/ssbs

AArch64: Use SSBS for CVE_2018_3639 mitigation

5 years agoccn: for RN-I, used node id instead of node postion
Pankaj Gupta [Fri, 7 Dec 2018 07:35:36 +0000 (13:05 +0530)]
ccn: for RN-I, used node id instead of node postion

For RN-I, node id is used instead of node postion in the bitmap
to calculate the region id.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
5 years agoMerge pull request #1707 from antonio-nino-diaz-arm/an/spm
Antonio Niño Díaz [Tue, 11 Dec 2018 16:48:17 +0000 (17:48 +0100)]
Merge pull request #1707 from antonio-nino-diaz-arm/an/spm

SPM: Initial prototype based on SPCI and SPRT

5 years agoSPM: Rename files for consistency
Antonio Nino Diaz [Thu, 15 Nov 2018 08:57:18 +0000 (08:57 +0000)]
SPM: Rename files for consistency

Rename files prefixed by sp_ to spm_.

Change-Id: Ie3016a4c4ac5987fe6fdd734c6b470c60954e23d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Remove remaining SMC interfaces
Antonio Nino Diaz [Fri, 30 Nov 2018 10:53:26 +0000 (10:53 +0000)]
SPM: Remove remaining SMC interfaces

Also, add a disclaimer to explain that the current implementation of SPM
is a prototype that is going to undergo a lot of rework.

Change-Id: I303c1e61c51d9f286cc599fea565fc9ba5a996bf
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Migrate mem attr get/set helpers to SPRT
Antonio Nino Diaz [Fri, 30 Nov 2018 10:52:09 +0000 (10:52 +0000)]
SPM: Migrate mem attr get/set helpers to SPRT

The old SMCs SP_MEMORY_ATTRIBUTES_{GET,SET}_AARCH64 have been removed in
favour of SPRT_MEMORY_PERM_ATTR_{GET,SET}_AARCH64.

Change-Id: Idb93cfa5461d0098df941037c5653f7c44b65227
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Allow preemption in non-blocking requests
Antonio Nino Diaz [Tue, 3 Jul 2018 15:54:33 +0000 (16:54 +0100)]
SPM: Allow preemption in non-blocking requests

Change-Id: I1fdc2285a3f6517a715ad6159322543fd5a37a37
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Support non-blocking calls
Antonio Nino Diaz [Thu, 8 Nov 2018 14:22:51 +0000 (14:22 +0000)]
SPM: Support non-blocking calls

Note that the arguments passed during the SMC call don't comply with the
SPCI specifications. This will be fixed in following patches, but it is
needed to implement a few more SPCI SMCs to be able to do it. The
current code allows us to start testing it.

Change-Id: Ic13dcc54c40327df03be1b0f52e8a44f468f06b4
Co-authored-by: Jean-Paul Etienne <jean-paul.etienne@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Implement global response buffer helpers
Antonio Nino Diaz [Thu, 18 Oct 2018 13:54:57 +0000 (14:54 +0100)]
SPM: Implement global response buffer helpers

This buffer is where all the responses from Secure Partitions are stored
until they are requested.

Change-Id: Iafeb8f0848c5ff6f3e187060cd3a47702484dc45
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Prevent simultaneous blocking calls
Antonio Nino Diaz [Tue, 3 Jul 2018 18:54:59 +0000 (19:54 +0100)]
SPM: Prevent simultaneous blocking calls

Blocking calls can only succeed if the target Secure Partition is idle.

Change-Id: Iabeaa0b8d3e653fd8581fa086758936abfc1c772
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Support blocking calls
Antonio Nino Diaz [Thu, 8 Nov 2018 14:21:19 +0000 (14:21 +0000)]
SPM: Support blocking calls

Note that the arguments passed during the SMC call don't comply with the
SPCI specifications. This will be fixed in following patches, but it is
needed to implement a few more SPCI SMCs to be able to do it. The
current code allows us to start testing it.

Change-Id: Ief0e75d072b311737fcdb0c6a60ba5b7406a9ee5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Introduce SPRT C host library
Antonio Nino Diaz [Thu, 8 Nov 2018 09:21:48 +0000 (09:21 +0000)]
SPM: Introduce SPRT C host library

Change-Id: If57ec9cc0791f49d9ade83dff9d24ef9047963a8
Co-authored-by: Jean-Paul Etienne <jean-paul.etienne@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Implement SPCI open/close handle SMCs
Antonio Nino Diaz [Thu, 8 Nov 2018 14:20:07 +0000 (14:20 +0000)]
SPM: Implement SPCI open/close handle SMCs

Introduce SMCs that open and close handles according to the SPCI
specification.

Change-Id: I65f365f15612e01aa445e783e96e48ae275c39fd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Introduce SMC handlers for SPCI and SPRT
Antonio Nino Diaz [Thu, 8 Nov 2018 14:12:40 +0000 (14:12 +0000)]
SPM: Introduce SMC handlers for SPCI and SPRT

Change-Id: I2ae9b3bb686c41b2e138132a7bed107925ac861e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Support multiple xlat tables contexts
Antonio Nino Diaz [Tue, 30 Oct 2018 11:36:47 +0000 (11:36 +0000)]
SPM: Support multiple xlat tables contexts

Change-Id: Ib7c2529b85bb5930d44907edfc8ead13d3b1ef4d
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Support multiple partitions
Antonio Nino Diaz [Tue, 30 Oct 2018 11:35:30 +0000 (11:35 +0000)]
SPM: Support multiple partitions

Change-Id: I6673a5f8c2f6afa7780483e0ce8d4dad4c8dc8ea
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Remove old SMC interfaces
Antonio Nino Diaz [Tue, 30 Oct 2018 12:50:41 +0000 (12:50 +0000)]
SPM: Remove old SMC interfaces

Remove interfaces based on MM_COMMUNICATE.

Change-Id: I628c884b91d9f4758269ea2c4dedc37a66bb93cf
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Map memory regions from RD
Antonio Nino Diaz [Tue, 30 Oct 2018 11:34:23 +0000 (11:34 +0000)]
SPM: Map memory regions from RD

SPM needs to map a number of regions on behalf of the secure partition.
Previously, it used to get a list of them from platform code using the
plat_get_secure_partition_mmap() API. Now it gets them from the resource
description structure.

The SPM<->SP shared buffer is mapped dynamically at EL3. This buffer is
used to pass information between SPM and SP, so it must be mapped at EL3
as well in order to be used by SPM.

Dynamic translation tables have been enabled when the Trusted Firmware
is compiled with SPM support.

Change-Id: I64ad335e931661812a0a60558e60372e1e5e6b72
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Read entrypoint from resource descriptor
Antonio Nino Diaz [Tue, 26 Jun 2018 09:34:25 +0000 (10:34 +0100)]
SPM: Read entrypoint from resource descriptor

Read entrypoint of the Secure Partition from the resource description
struct.

Change-Id: Ie693c7b4d4fecafd85b6934d9d8c4232efb1dc55
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Load image and RD from SP package
Antonio Nino Diaz [Tue, 27 Nov 2018 08:36:02 +0000 (08:36 +0000)]
SPM: Load image and RD from SP package

Load SP and RD from package instead of relying on RD being already
loaded in memory and the SP being loaded as a BL32 image.

Change-Id: I18d4fbf4597656c6a7e878e1d7c01a8a324f3f8a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: sptool: Introduce tool to package SP and RD
Antonio Nino Diaz [Tue, 27 Nov 2018 14:58:04 +0000 (14:58 +0000)]
SPM: sptool: Introduce tool to package SP and RD

This tool packages Secure Partitions and Resource Descriptor blobs into
a simple file that can be loaded by SPM.

Change-Id: If3800064f30bdc3d7fc6a15ffbb3007ef632bcaa
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1714 from chandnich/sgiclark-helios
Soby Mathew [Tue, 11 Dec 2018 10:53:36 +0000 (10:53 +0000)]
Merge pull request #1714 from chandnich/sgiclark-helios

SGI-Clark.Helios platform support patches

5 years agoMakefile: add a possibility to disable -Werror
Yann Gautier [Mon, 10 Dec 2018 17:08:53 +0000 (18:08 +0100)]
Makefile: add a possibility to disable -Werror

Setting E=0 in the make command line disables -Werror in CPPFLAGS.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agocorrect some missing-prototype warnings
Yann Gautier [Mon, 10 Dec 2018 09:41:03 +0000 (10:41 +0100)]
correct some missing-prototype warnings

This avoids the following warnings:
no previous prototype for 'bl2_arch_setup' [-Wmissing-prototypes]
no previous prototype for 'plat_log_get_prefix' [-Wmissing-prototypes]

Also correct a compilation issue if BL2_IN_XIP_MEM is enabled:
uintptr_t is not defined.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoio_block: define MAX_IO_BLOCK_DEVICES as unsigned
Yann Gautier [Mon, 3 Dec 2018 12:38:06 +0000 (13:38 +0100)]
io_block: define MAX_IO_BLOCK_DEVICES as unsigned

This is used as a table index, and already compared with an unsigned int:
block_dev_count.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoAdd the possibility to compile TF-A with more warnings
Yann Gautier [Mon, 10 Dec 2018 17:00:26 +0000 (18:00 +0100)]
Add the possibility to compile TF-A with more warnings

The list of warning is taken from kernel and also divided in 3.
The option to activate that is W=x, with x=1, 2 or 3.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoSPM: Remove SP memory mappings definitions
Antonio Nino Diaz [Tue, 30 Oct 2018 11:54:20 +0000 (11:54 +0000)]
SPM: Remove SP memory mappings definitions

This information is retrieved from the resource description now.

Change-Id: Iaae23945eb2c45305cdc6442853e42f4e04fe094
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Deprecate boot info struct
Antonio Nino Diaz [Tue, 30 Oct 2018 11:52:45 +0000 (11:52 +0000)]
SPM: Deprecate boot info struct

This information is defined by the Secure Partition in the resource
description.

Change-Id: Ia7db90c5de8360a596106880d3f6a632a88d3ea8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Introduce functions to load DTB files
Antonio Nino Diaz [Tue, 30 Oct 2018 11:12:42 +0000 (11:12 +0000)]
SPM: Introduce functions to load DTB files

Introduce helpers to create resource description struct, as well as code
to load the information from DTB files.

Change-Id: I0f5bb94eb8b01c6cb53fe807a9db0c05a70d7a43
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Define resource description data structures
Antonio Nino Diaz [Tue, 27 Nov 2018 09:36:22 +0000 (09:36 +0000)]
SPM: Define resource description data structures

The structures and associated definitions are in different files so that
the definitions can be used inside DTS files while the structs are
private to SPM. They follow the SPRT specification.

Change-Id: Id6a629040a086c482b9d9fa1883b8aa6bbee619f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Deprecate the current implementation
Antonio Nino Diaz [Tue, 30 Oct 2018 11:08:08 +0000 (11:08 +0000)]
SPM: Deprecate the current implementation

The current SPM is a prototype that only supports one secure partition
in EL0. The objective of SPM is to have multiple partitions. The current
MM interface isn't adequate for this, so it is needed to modify heavily
the code to add proper support for it.

However, there are platforms which are already using this (like SGI) and
removing the code would break it.  For this reason, the current SPM code
has been duplicated in order to temporarily preserve compatibility. All
new improvements/changes to SPM will be done in the non-deprecated copy,
that may change without notice.

The new build option SPM_DEPRECATED has been introduced to select the SPM
implementation. It defaults to 1, that selects the deprecated SPM.

Change-Id: Ic9f80b53b450e97b4d3f47e4ef4a138ee8d87443
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agofvp: Increase stack size when SPM is enabled
Antonio Nino Diaz [Thu, 18 Oct 2018 13:02:39 +0000 (14:02 +0100)]
fvp: Increase stack size when SPM is enabled

Change-Id: Iec265dc85d44f35048d1fbcfbe55960d45570027
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoAArch64: Use SSBS for CVE_2018_3639 mitigation
Jeenu Viswambharan [Thu, 15 Nov 2018 11:38:03 +0000 (11:38 +0000)]
AArch64: Use SSBS for CVE_2018_3639 mitigation

The Armv8.5 extensions introduces PSTATE.SSBS (Speculation Store Bypass
Safe) bit to mitigate against Variant 4 vulnerabilities. Although an
Armv8.5 feature, this can be implemented by CPUs implementing earlier
version of the architecture.

With this patch, when both PSTATE.SSBS is implemented and
DYNAMIC_WORKAROUND_CVE_2018_3639 is active, querying for
SMCCC_ARCH_WORKAROUND_2 via. SMCCC_ARCH_FEATURES call would return 1 to
indicate that mitigation on the PE is either permanently enabled or not
required.

When SSBS is implemented, SCTLR_EL3.DSSBS is initialized to 0 at reset
of every BL stage. This means that EL3 always executes with mitigation
applied.

For Cortex A76, if the PE implements SSBS, the existing mitigation (by
using a different vector table, and tweaking CPU ACTLR2) is not used.

Change-Id: Ib0386c5714184144d4747951751c2fc6ba4242b6
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
5 years agoMerge pull request #1704 from marex/arm/master/memsize-passing-v1
Antonio Niño Díaz [Mon, 10 Dec 2018 14:18:23 +0000 (15:18 +0100)]
Merge pull request #1704 from marex/arm/master/memsize-passing-v1

Arm/master/memsize passing v1

5 years agoMerge pull request #1700 from jwerner-chromium/JW_crashfix
Soby Mathew [Mon, 10 Dec 2018 14:00:01 +0000 (14:00 +0000)]
Merge pull request #1700 from jwerner-chromium/JW_crashfix

MULTI_CONSOLE_API fixes and cleanups

5 years agodocs: marvell: Fix typo in file build.txt
Ding Tao [Mon, 10 Dec 2018 09:31:23 +0000 (09:31 +0000)]
docs: marvell: Fix typo in file build.txt

Replace "Uboot" with "Ubuntu".

Signed-off-by: Ding Tao <miyatsu@qq.com>
5 years agomaintainers: Add Julius Werner for coreboot and console API
Julius Werner [Wed, 28 Nov 2018 22:00:33 +0000 (14:00 -0800)]
maintainers: Add Julius Werner for coreboot and console API

I wrote most of this code and have a vested interest in keeping it
healthy, so adding myself as a maintainer.

Change-Id: I0edeebbc8336b6976dfaf393b3cfc7bc94089ac6
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agodrivers/console: Reimplement MUTLI_CONSOLE_API framework in C
Julius Werner [Wed, 28 Nov 2018 06:10:56 +0000 (22:10 -0800)]
drivers/console: Reimplement MUTLI_CONSOLE_API framework in C

Now that we have switched to using the stack in MULTI_CONSOLE_API
framework functions and have factored all code involved in crash
reporting out into a separate file, there's really no reason to keep the
main framework code in assembly anymore. This patch rewrites it in C
which allows us to have a single implementation across aarch32/64 and
should be much easier to maintain going forward.

Change-Id: I6c85a01e89a79e8b233f3f8bee812f0dbd026221
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agodrivers/console: Link console framework code by default
Julius Werner [Wed, 28 Nov 2018 01:50:28 +0000 (17:50 -0800)]
drivers/console: Link console framework code by default

This patch makes the build system link the console framework code by
default, like it already does with other common libraries (e.g. cache
helpers). This should not make a difference in practice since TF is
linked with --gc-sections, so the linker will garbage collect all
functions and data that are not referenced by any other code. Thus, if a
platform doesn't want to include console code for size reasons and
doesn't make any references to console functions, the code will not be
included in the final binary.

To avoid compatibility issues with older platform ports, only make this
change for the MULTI_CONSOLE_API.

Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agoconsole: Fix console_unregister() signature
Julius Werner [Tue, 4 Dec 2018 01:01:30 +0000 (17:01 -0800)]
console: Fix console_unregister() signature

console_unregister() has always returned a pointer to the console that
was removed on success, not just an integer. Fix the C prototype to
match the assembly implementation.

Change-Id: Iafc43de0767a5c87c9ae5c3aba53761dd28d51e6
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agoplat/common/crash_console_helpers.S: Fix MULTI_CONSOLE_API support
Julius Werner [Mon, 19 Nov 2018 22:25:55 +0000 (14:25 -0800)]
plat/common/crash_console_helpers.S: Fix MULTI_CONSOLE_API support

Crash reporting via the default consoles registered by MULTI_CONSOLE_API
has been broken since commit d35cc34 (Console: Use callee-saved
registers), which was introduced to allow console drivers written in C.
It's not really possible with the current crash reporting framework to
support console drivers in C, however we should make sure that the
existing assembly drivers that do support crash reporting continue to
work through the MULTI_CONSOLE_API.

This patch fixes the problem by creating custom console_putc() and
console_flush() implementations for the crash reporting case that do not
use the stack. Platforms that want to use this feature will have to link
plat/common/aarch64/crash_console_helpers.S explicitly.

Also update the documentation to better reflect the new reality (of this
being an option rather than the expected default for most platforms).

Change-Id: Id0c761e5e2fddaf25c277bc7b8ab603946ca73cb
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agoplat/common: Remove duplication of plat_crash_console functions/stubs
Julius Werner [Tue, 20 Nov 2018 21:02:27 +0000 (13:02 -0800)]
plat/common: Remove duplication of plat_crash_console functions/stubs

Commit e74afb652 (Deprecate weak crash console functions) deprecated the
default inclusion of weak definitions for plat_crash_console functions
in plat/common/aarch64/platform_helpers.S. The code was later copied out
to plat/common/aarch64/crash_console_helpers.S so platforms can link it
explicitly if they want to. However, since deprecation does not mean
removal, the same code is also still duplicated in platform_helpers.S.

The duplicated code contains both empty stubs for the !MULTI_CONSOLE_API
case, and a real implementation that used to work but was broken by
commit d35cc34 (Console: Use callee-saved registers) for
MULTI_CONSOLE_API. It's not great to have both of these duplicated in
two files, so this patch splits them up: in platform_helpers.S we'll
only keep the empty stubs (guarded by !ERROR_DEPRECATED), which should
not regress functionality since the MULTI_CONSOLE_API implementation was
already broken anyway. In crash_console_helpers.S, we'll only keep the
MULTI_CONSOLE_API version, which is enough both as an implementation in
itself and as a sample for how to reimplement these functions in a
platform-specific file.

Change-Id: I83d95a90ab6aac597dc2ea2f2797ac2c8ed075d4
Signed-off-by: Julius Werner <jwerner@chromium.org>
5 years agoMerge pull request #1713 from chandnich/nt-fw-config
Soby Mathew [Thu, 6 Dec 2018 15:07:44 +0000 (15:07 +0000)]
Merge pull request #1713 from chandnich/nt-fw-config

plat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG

5 years agoMerge pull request #1710 from soby-mathew/sm/smc_save_x0_x3
Soby Mathew [Thu, 6 Dec 2018 11:13:38 +0000 (11:13 +0000)]
Merge pull request #1710 from soby-mathew/sm/smc_save_x0_x3

BL31: Use helper function to save registers in SMC handler

5 years agoMerge pull request #1709 from joannafarley-arm/jf/copyrights-updates
Antonio Niño Díaz [Thu, 6 Dec 2018 10:29:29 +0000 (11:29 +0100)]
Merge pull request #1709 from joannafarley-arm/jf/copyrights-updates

Change copyright guidelines

5 years agoMerge pull request #1706 from Yann-lms/mmc_init_check
Antonio Niño Díaz [Thu, 6 Dec 2018 10:28:53 +0000 (11:28 +0100)]
Merge pull request #1706 from Yann-lms/mmc_init_check

MMC init check and STM32MP1 MMC driver improvements

5 years agoplat/arm/sgi: Add board support for SGI-Clark.Helios platform
Chandni Cherukuri [Thu, 16 Aug 2018 08:13:23 +0000 (13:43 +0530)]
plat/arm/sgi: Add board support for SGI-Clark.Helios platform

SGI-Clark.Helios platform is similar to SGI-Clark.Ares platform.
The difference between these two platforms is the CPU type and
the number of CPUs. Add the base support for SGI-Clark.Helios platform.

Change-Id: I2b04cb3fb953907848b4fab016e3648899ca4256
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
5 years agoplat/arm/sgi: override 'plat_psci_ops_t' for SGI-Clark.Helios platform
Chandni Cherukuri [Thu, 22 Nov 2018 04:45:25 +0000 (10:15 +0530)]
plat/arm/sgi: override 'plat_psci_ops_t' for SGI-Clark.Helios platform

For SGI-Clark.Helios platform, at present, only the CPU power ON/OFF
ops are supported. So override the PSCI ops to allow callbacks only
for CPU power ON/OFF operations.

Change-Id: Idc0a3deb78cb850310cbe849d77604fa9881579c
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
5 years agoplat/arm/sgi: add platform support for SGI-Clark.Helios platform
Chandni Cherukuri [Tue, 16 Oct 2018 08:45:31 +0000 (14:15 +0530)]
plat/arm/sgi: add platform support for SGI-Clark.Helios platform

SGI-Clark.Helios platform is based on multi-threaded CPUs and uses an
additional thread power domain level as well.

Define a power domain tree descriptor 'sgi_clark_helios_pd_tree_desc'
for SGI-Clark.Helios platform and let the function
'plat_get_power_domain_tree_desc' pick up the correct power
domain tree descriptor based on the platform.

Change-Id: Ibc6d551b570bc740053316a3608c455679d9155b
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
5 years agoplat: rcar: Generate FCNL reserved memory node
Marek Vasut [Thu, 11 Oct 2018 14:53:58 +0000 (16:53 +0200)]
plat: rcar: Generate FCNL reserved memory node

Generate a /reserved-memory node for FCNL in the DT passed to
subsequent stages, so they will know how the FCNL is configured.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Generate platform compatible string
Marek Vasut [Thu, 11 Oct 2018 14:15:41 +0000 (16:15 +0200)]
plat: rcar: Generate platform compatible string

Generate /compatible string for the platform, so that the subsequent
stages know which platform they are running on. This could be useful
when ie. building U-Boot that contains DTs for multiple platforms and
can thus decide on which platform it is running. This would ultimately
allow single bootloader binary for all Gen3 platforms.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Pass DTB with DRAM layout from BL2 to next stages
Marek Vasut [Tue, 2 Oct 2018 18:45:18 +0000 (20:45 +0200)]
plat: rcar: Pass DTB with DRAM layout from BL2 to next stages

Pass DTB containing DRAM layout from BL2 to BL33 via register x3, so
that the BL33 can simply consume it and get accurate DRAM layout info.
BL33 is in most usecases U-Boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Use array in the DRAM size reporting
Marek Vasut [Tue, 2 Oct 2018 18:43:09 +0000 (20:43 +0200)]
plat: rcar: Use array in the DRAM size reporting

Use array of start-size tuples for the DRAM banks and call single
function which iterates over this array to report the DRAM info.
This is in preparation for expanding this to generate FDT for the
next stage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Print DRAM configuration after init
Marek Vasut [Tue, 2 Oct 2018 13:12:15 +0000 (15:12 +0200)]
plat: rcar: Print DRAM configuration after init

Print the DRAM configuration only after the DRAM was initialized. This
will be useful when deduplicating code populating FDT passed to U-Boot,
since it will contain the same macros as bl2_advertise_dram_size().

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Fill in memory information for M3W, M3N
Marek Vasut [Tue, 2 Oct 2018 13:09:04 +0000 (15:09 +0200)]
plat: rcar: Fill in memory information for M3W, M3N

Make the DRAM configuration debug print consistent for all supported SoCs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Drop H3 v3.0 check on DRAM debug print
Marek Vasut [Tue, 2 Oct 2018 12:53:27 +0000 (14:53 +0200)]
plat: rcar: Drop H3 v3.0 check on DRAM debug print

There is nothing preventing H3 older than v3.0 from printing the
DRAM configuration, just like v3.0 and newer. Drop the check and
let all H3 revisions print DRAM configuration in BL2.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Add E3 1GBx4 debug print
Marek Vasut [Tue, 2 Oct 2018 11:51:19 +0000 (13:51 +0200)]
plat: rcar: Add E3 1GBx4 debug print

RCAR_DRAM_DDR3L_MEMCONF = 2 means E3 with 1GBx4 memory configuration.
Add debug print for this configuration for completeness sake.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat: rcar: Move DRAM layout print to separate function
Marek Vasut [Tue, 2 Oct 2018 11:33:32 +0000 (13:33 +0200)]
plat: rcar: Move DRAM layout print to separate function

Just move the DRAM layout information into separate function,
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoplat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG
Chandni Cherukuri [Wed, 28 Nov 2018 05:56:19 +0000 (11:26 +0530)]
plat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG

With the two new APIs 'plat_arm_sgi_get_platform_id' and
'plat_arm_sgi_get_config_id' that are available now, BL31 need not
depend on hw_config device tree to identify the platform. In addition
to this, the existing hardware description in hw_config can be limited
to use by BL33 and not by the operating system.

So the hardware description from hw_config dts can be moved into
nt_fw_config dts and the use of hw_config dts can be removed.

Change-Id: I873b7e1e72823d3ec5d253a848e85ae724f09e49
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
5 years agoMerge pull request #1711 from antonio-nino-diaz-arm/an/fix-imx
Antonio Niño Díaz [Wed, 5 Dec 2018 11:24:01 +0000 (12:24 +0100)]
Merge pull request #1711 from antonio-nino-diaz-arm/an/fix-imx

tzc380: Fix some asserts

5 years agotzc380: Fix some asserts
Antonio Nino Diaz [Wed, 5 Dec 2018 11:01:17 +0000 (11:01 +0000)]
tzc380: Fix some asserts

This driver can be compiled in release builds, but GCC generates warnings
for some comparisons and that prevents the firmware from being built in
debug builds.

Change-Id: Ic52e1b4a11896ecf086864fbe2b5bfc143ec9b1b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoBL31: Use helper function to save registers in SMC handler
Soby Mathew [Fri, 16 Nov 2018 15:43:34 +0000 (15:43 +0000)]
BL31: Use helper function to save registers in SMC handler

Use the helper function `save_gp_registers` to save the register
state to cpu_context on entry to EL3 in SMC handler. This has the
effect of saving x0 - x3 as well into the cpu_context which was
not done previously but it unifies the register save sequence
in BL31.

Change-Id: I5753c942263a5f9178deda3dba896e3220f3dd83
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
5 years agoMerge pull request #1653 from JackyBai/master
Antonio Niño Díaz [Wed, 5 Dec 2018 10:22:55 +0000 (11:22 +0100)]
Merge pull request #1653 from JackyBai/master

Add NXP i.MX8MQ basic support