Commit Graph

3244 Commits

Author SHA1 Message Date
Roberto Vargas e230f4d54d Remove dtc warnings
DTC generates warnings when unit names begin with 0, or
when a node containing a reg or range property doesn't have a unit name
in the node name. This patch fixes those cases.

Change-Id: If24ec68ef3034fb3fcefb96c5625c47a0bbd8474
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-24 08:30:01 +01:00
Dimitris Papastamos 7f6d8f49aa
Merge pull request #1358 from omasab/sgi575_mt_flag
css/sgi575: enable ARM_PLAT_MT flag
2018-04-18 10:54:40 +01:00
Dimitris Papastamos 336ece6a87
Merge pull request #1357 from antonio-nino-diaz-arm/an/fix-misra
Fix some MISRA defects in SPM code
2018-04-18 10:54:26 +01:00
Sudipto Paul bb3a6f8c7e css/sgi575: enable ARM_PLAT_MT flag
SGI-575 platform is based on Cortex-A75 processor which has its MT bit
in the MPIDR register set to '1'. So the Arm platform layer code has
to be made aware of this.

Signed-off-by: Sudipto Paul <sudipto.paul@arm.com>
2018-04-18 14:19:52 +05:30
Antonio Nino Diaz b3323cd6bd Fix some MISRA defects in SPM code
Change-Id: I989c1f4aef8e3cb20d5d19e6347575e6449bb60b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-04-17 15:10:18 +01:00
Dimitris Papastamos bedf6f0b14
Merge pull request #1250 from jollysxilinx/zynqmp-new-eemi-api
plat/xilinx: Add support for new platform management APIs for ZynqMP
2018-04-17 12:08:34 +01:00
Dimitris Papastamos 4af16543b9
Merge pull request #1346 from samarthp/sp/support-multiple-mhu-gen
plat/arm: Add MHUv2 support to SCMI driver
2018-04-16 16:40:03 +01:00
Samarth Parikh a427785c83 plat/arm: Add MHUv2 support to SCMI driver
Currently the SCMI driver supports MHUv1, but Arm platforms may have
varied versions of MHU driver, with MHUv2 controllers being in the
latest Arm platforms.

This patch updates the SCMI driver to support MHUv2, specifically that
the sender must send the wake-up to the receiver before initiating any
data transfer.

Also, the existing mhu driver files, css_mhu.c and css_mhu.h, have been
moved from the scpi directory to a new directory, css/drivers/mhu.

Change-Id: I9b46b492a3e1d9e26db12d83a9773958a8c8402f
Signed-off-by: Samarth Parikh <samarth.parikh@arm.com>
2018-04-16 20:52:14 +05:30
Dimitris Papastamos 8b37120065
Merge pull request #1356 from robertovargas-arm/misra-changes
Misra changes
2018-04-16 15:04:28 +01:00
Roberto Vargas 3b94189a92 Fix MISRA rule 8.4 Part 4
Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined

Fixed for:
	make DEBUG=1 PLAT=fvp SPD=tspd TRUSTED_BOARD_BOOT=1 \
	     GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
	     ROT_KEY=arm_rotprivk_rsa.pem MBEDTLS_DIR=mbedtls all

Change-Id: Ie4cd6011b3e4fdcdd94ccb97a7e941f3b5b7aeb8
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas 735181b634 Fix MISRA rule 8.3 Part 4
Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers

Fixed for:
	make DEBUG=1 PLAT=fvp SPD=tspd TRUSTED_BOARD_BOOT=1 \
	     GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
	     ROT_KEY=arm_rotprivk_rsa.pem MBEDTLS_DIR=mbedtls all

Change-Id: Ia34fe1ae1f142e89c9a6c19831e3daf4d28f5831
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas 1a29f93815 Fix MISRA rule 8.4 Part 3
Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined

Fixed for:
	make DEBUG=1 PLAT=fvp SPD=tspd all

Change-Id: I0a16cf68fef29cf00ec0a52e47786f61d02ca4ae
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas a27163bc70 Fix MISRA rule 8.3 Part 3
Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers

Fixed for:
	make DEBUG=1 PLAT=fvp SPD=tspd all

Change-Id: I4e31c93d502d433806dfc521479d5d428468b37c
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas f37704bcfb Fix MISRA rule 8.3 Part 2
Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers.

Fixed for:
	make DEBUG=1 PLAT=juno LOG_LEVEL=50 all

Change-Id: I0e4a03a0d2170cb1c632e079112a972091994a39
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas c28b765893 Fix MISRA rule 8.5 in common code
Rule 8.5: An external object or function shall be declared
          once in one and only one file.

Change-Id: I7c3d4ec7d3ba763fdb4600008ba10b4b93ecdfce
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas 35a3eeb6fd Fix MISRA rule 8.4 Part 1
Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined

Fixed for:
	make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all

Change-Id: I32b223251b8bf5924149d89431a65d3405a73d3e
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Roberto Vargas 8cb4762841 Fix MISRA rule 8.3 Part 1
Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers.

Fixed for:

	make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all

Change-Id: I32d6fbce03bb4830ed5bf521afe7063505c6ed79
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-04-13 14:01:56 +01:00
Dimitris Papastamos 9d82dd9b68
Merge pull request #1352 from hzhuang1/hikey_ddr
Hikey ddr
2018-04-13 09:54:29 +01:00
Dimitris Papastamos 22bcf51edb
Merge pull request #1355 from jonathanwright-ARM/jw/REVIDR-errata-workaround
Check presence of hardware fix for 2 errata on Cortex A53
2018-04-13 09:53:56 +01:00
Jonathan Wright fe634fa62f Check presence of fix for errata 835769 in Cortex-A53
A fix for errata 835769 may be available in revisions r0p2, r0p3 or r0p4
of the Cortex-A53 processor. The presence of the fix is determined by
checking bit 7 in the REVIDR register.

If the fix is present we report ERRATA_NOT_APPLIES which silences the
erroneous 'missing workaround' warning.

Change-Id: Ib75b008e755e9ac648554ca9398024fdbea4a91a
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
2018-04-12 12:12:56 +01:00
Jonathan Wright 9ec3921c02 Check presence of fix for errata 843419 in Cortex-A53
A fix for errata 843419 may be available in revision r0p4 of the
Cortex-A53 processor. The presence of the fix is determined by checking
bit 8 in the REVIDR register.

If the fix is present we report ERRATA_NOT_APPLIES which silences the
erroneous 'missing workaround' warning.

Change-Id: Ibd2a478df3e2a6325442a6a48a0bb0259dcfc1d7
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
2018-04-12 12:12:56 +01:00
Dimitris Papastamos 0f17a68324
Merge pull request #1347 from davidcunado-arm/dc/affinities
FVP: Fix function for translating MPIDR to linear index
2018-04-12 10:47:14 +01:00
Dimitris Papastamos aa2fcb4399
Merge pull request #1353 from JiafeiPan/upstream-platform-psci-bug
layerscape: fix integer handling issues
2018-04-12 09:20:12 +01:00
Jiafei Pan f7c5f30799 layerscape: fix integer handling issues
Assert before actually using.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2018-04-11 12:12:24 +00:00
Haojian Zhuang ed253f54da hikey: clean sram before mcu used
Clean cache to flush parameters into SRAM before MCU using them.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-04-11 19:06:14 +08:00
Haojian Zhuang 1d999558cf hikey: save ddr parameters into SRAM
Store those DDR parameters into SRAM. They may be used by MCU
firmware.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-04-11 19:05:59 +08:00
Haojian Zhuang 483dce7eef hikey: update ddr initialization
Fix that DDR can't work at 533MHz. Now step to set DDR frequency
from 150MHz to 800MHz. DDR could work among these frequency, 150MHz,
266MHz, 400MHz, 533MHz and 800MHz.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-04-11 19:05:32 +08:00
Dimitris Papastamos b47f941d50
Merge pull request #1342 from Summer-ARM/sq/support-tzmp1
support tzmp1
2018-04-11 09:39:21 +01:00
Dimitris Papastamos a234498314
Merge pull request #1348 from amitdanielkachhap/dmc500_single_if_v2
DMC500: Add platform support to set system interface count
2018-04-10 15:08:53 +01:00
Dimitris Papastamos be1a59cf19
Merge pull request #1349 from amitdanielkachhap/juno_fix_bl2_sizes
Juno: Increase bl2 max size to fix build when SPD=opteed
2018-04-10 15:08:42 +01:00
Dimitris Papastamos 0841d10095
Merge pull request #1341 from vwadekar/improve-mmap-efficiency
lib: xlat_tables_v2: reduce time required to add a mmap region
2018-04-10 13:17:16 +01:00
Dimitris Papastamos bc2910c19d
Merge pull request #1306 from JiafeiPan/master
layerscape: Initial ATF support for LS1043ardb
2018-04-10 13:04:38 +01:00
Summer Qin 60a23fd8de Juno: Add support for TrustZone Media Protection 1 (TZMP1)
Add TZMP1 support on Juno and increase the BL2 size accordingly due to the
extra data structures to describe the TZC regions and the additional code.

Signed-off-by: Summer Qin <summer.qin@arm.com>
2018-04-10 14:30:03 +08:00
Summer Qin 23411d2c4a plat/arm: Allow override of default TZC regions
This patch allows the ARM Platforms to specify the TZC regions to be
specified to the ARM TZC helpers in arm_tzc400.c and arm_tzc_dmc500.c.
If the regions are not specified then the default TZC region will be
configured by these helpers.

This override mechanism allows specifying special regions for TZMP1
usecase.

Signed-off-by: Summer Qin <summer.qin@arm.com>
2018-04-10 14:30:03 +08:00
Jiafei Pan 364e134242 Add NXP to contributor list
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2018-04-10 01:24:40 +00:00
Jiafei Pan 33d4af47b0 layerscape: Initial TF-A support for LS1043ardb
This patch introduce TF-A support for NXP's ls1043a platform.
more details information of ls1043a chip and ls1043ardb board
can be found at docs/plat/ls1043a.rst.

Boot sequence on ls1043a is: bootrom loads bl1 firstly, then bl1
loads bl2, bl2 will load bl31, bl32 and bl33, bl31 will boot
bl32(tee os) and bl33(u-boot or uefi), bl33 boot Linux kernel.

Now TF-A on ls1043ardb platform has the following features in this patch:
	* Support boot from Nor flash.
	* TF-A can boot bl33 which runs in el2 of non-secure world.
	* TF-A boot OPTee OS.
	* Support PSCI

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Chenyin.Ha <Chenyin.Ha@nxp.com>
Signed-off-by: Chenhui Zhao <chenhui.zhao@nxp.com>
Signed-off-by: jiaheng.fan <jiaheng.fan@nxp.com>
Signed-off-by: Wen He <wen.he_1@nxp.com>
2018-04-10 01:24:40 +00:00
Varun Wadekar 0ed3223293 lib: xlat_tables_v2: reduce time required to add a mmap region
The last entry in the mapping table is not necessarily the same as the
end of the table. This patch loops through the table to find the last
entry marker, on every new mmap addition. The memove operation then
has to only move the memory between current entry and the last entry.
For platforms that arrange their MMIO map properly, this opearation
turns out to be a NOP.

The previous implementation added significant overhead per mmap
addition as the memmove operation always moved the difference between
the current mmap entry and the end of the table.

Tested on Tegra platforms and this new approach improves the memory
mapping time by ~75%, thus significantly reducing boot time on some
platforms.

Change-Id: Ie3478fa5942379282ef58bee2085da799137e2ca
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2018-04-09 16:37:23 -07:00
Dimitris Papastamos c39afeadb5
Merge pull request #1328 from JiafeiPan/upstream-bl2-rom
Add support for BL2 in XIP memory
2018-04-09 13:36:42 +01:00
Amit Daniel Kachhap 83a2376e18 Juno: Increase bl2 max size to fix build when SPD=opteed
Building TBBR(SPD=opteed) and non-TBBR TF-A images is breaking for
Juno for different configurations listed below:

* Overflow error of 4096 bytes for rsa algorithm.
* Overflow error of 8192 bytes for ecdsa algorithm.
* Overflow error of 4096 bytes for rsa+ecdsa algorithm.
* Overflow error of 4096 bytes for non-TBBR case.

So this patch increments macro PLAT_ARM_MAX_BL2_SIZE for all the above
cases accordingly.

Change-Id: I75ec6c0a718181d34553fe55437f0496f467683f
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
2018-04-09 17:34:11 +05:30
Amit Daniel Kachhap d12afc8e73 DMC500: Add platform support to set system interface count
Some low end platforms using DMC500 memory controller do not have
CCI(Cache Coherent Interconnect) interface and only have non-coherent
system interface support. Hence this patch makes the system interface
count configurable from the platforms.

Change-Id: I6d54c90eb72fd18026c6470c1f7fd26c59dc4b9a
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
2018-04-09 17:06:52 +05:30
Dimitris Papastamos 02956560a2
Merge pull request #1339 from dp-arm/dp/smccc
Fixup SMCCC_FEATURES return value for SMCCC_ARCH_WORKAROUND_1
2018-04-09 11:15:08 +01:00
Jiafei Pan b4ad976844 fix instruction address range limitation
For the adr instruction, it require the label's offset from the
address of this instruction must be in the range +/-1MB. If the
option "BL2_IN_XIP_MEM" is set to '1', in some cases, BL2's RW
memory will not in the range of +/-1MB from BL2's RO memory region.
so we need to use ldr instruction to cover this case.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2018-04-07 10:13:59 +08:00
Jiafei Pan 7d173fc594 Add support for BL2 in XIP memory
In some use-cases BL2 will be stored in eXecute In Place (XIP) memory,
like BL1. In these use-cases, it is necessary to initialize the RW sections
in RAM, while leaving the RO sections in place. This patch enable this
use-case with a new build option, BL2_IN_XIP_MEM. For now, this option
is only supported when BL2_AT_EL3 is 1.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2018-04-07 10:12:21 +08:00
David Cunado 468bea4128 FVP: Fix function for translating MPIDR to linear index
The current AArch32 version of plat_arm_calc_core_pos uses an incorrect
algorithm to calculate the linear position of a core / PE from its
MPIDR.

This patch corrects the algorithm to:

(ClusterId * FVP_MAX_CPUS_PER_CLUSTER) * FVP_MAX_PE_PER_CPU
+ (CPUId * FVP_MAX_PE_PER_CPU)
+ ThreadId

which supports cores where there are more than 1 PE per CPU.

NOTE: the AArch64 version was fixed in 39b21d1

Change-Id: I72aea89d8f72f8b1fef54e2177a0fa6fef0f5513
Signed-off-by: David Cunado <david.cunado@arm.com>
2018-04-06 18:07:12 +01:00
Dimitris Papastamos 93883a2931
Merge pull request #1338 from antonio-nino-diaz-arm/an/spm-flag-check
SPM: Assert value of `ENABLE_SPM` build flag
2018-04-04 09:58:24 +01:00
Dimitris Papastamos 59dc4ef487 Fixup SMCCC_FEATURES return value for SMCCC_ARCH_WORKAROUND_1
Only return -1 if the workaround for CVE-2017-5715 is not compiled in.

Change-Id: I1bd07c57d22b4a13cf51b35be141a1f1ffb065ff
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2018-04-03 16:34:12 +01:00
Dimitris Papastamos f11916bf1d
Merge pull request #1334 from michpappas/tf-issues#572_qemu_dont_use_C_for_crash_console
qemu: don't use C functions for the crash console callbacks
2018-04-03 11:59:55 +01:00
Antonio Nino Diaz aafd8e1c9f SPM: Assert value of `ENABLE_SPM` build flag
The Makefile was missing a check to verify that the value of
`ENABLE_SPM` is boolean.

Change-Id: I97222e4df9ae2fbd89cdb3263956dca52d360993
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-04-03 11:39:15 +01:00
Michalis Pappas 0e24ea8156 qemu: don't use C functions for the crash console callbacks
Use the console_pl011_core_* functions directly in the crash console
callbacks.

This bypasses the MULTI_CONSOLE_API for the crash console (UART1), but
allows using the crash console before the C runtime has been initialized
(eg to call ASM_ASSERT). This retains backwards compatibility with respect
to functionality when the old API is used.

Use the MULTI_CONSOLE_API to register UART0 as the boot and runtime
console.

Fixes ARM-software/tf-issues#572

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
2018-03-31 16:26:18 +08:00
Dimitris Papastamos 02f8c03884
Merge pull request #1327 from npoushin/npoushin/sgi575
ARM platforms: Add support for SGI575
2018-03-29 14:20:42 +01:00