project/bcm63xx/atf.git
6 years agoMerge pull request #1338 from antonio-nino-diaz-arm/an/spm-flag-check
Dimitris Papastamos [Wed, 4 Apr 2018 08:58:24 +0000 (09:58 +0100)]
Merge pull request #1338 from antonio-nino-diaz-arm/an/spm-flag-check

SPM: Assert value of `ENABLE_SPM` build flag

6 years agoMerge pull request #1334 from michpappas/tf-issues#572_qemu_dont_use_C_for_crash_console
Dimitris Papastamos [Tue, 3 Apr 2018 10:59:55 +0000 (11:59 +0100)]
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

6 years agoSPM: Assert value of `ENABLE_SPM` build flag
Antonio Nino Diaz [Mon, 26 Mar 2018 14:57:17 +0000 (15:57 +0100)]
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>
6 years agoqemu: don't use C functions for the crash console callbacks
Michalis Pappas [Tue, 27 Mar 2018 04:32:31 +0000 (12:32 +0800)]
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>
6 years agoMerge pull request #1327 from npoushin/npoushin/sgi575
Dimitris Papastamos [Thu, 29 Mar 2018 13:20:42 +0000 (14:20 +0100)]
Merge pull request #1327 from npoushin/npoushin/sgi575

ARM platforms: Add support for SGI575

6 years agoMerge pull request #1313 from jonathanwright-ARM/jw/MISRA-switch-statements
Dimitris Papastamos [Thu, 29 Mar 2018 12:20:05 +0000 (13:20 +0100)]
Merge pull request #1313 from jonathanwright-ARM/jw/MISRA-switch-statements

Fix switch statements to comply with MISRA rules

6 years agoMerge pull request #1333 from jeenu-arm/icfg-fix
Dimitris Papastamos [Thu, 29 Mar 2018 12:19:04 +0000 (13:19 +0100)]
Merge pull request #1333 from jeenu-arm/icfg-fix

GIC: Fix interrupt setting interrupt configuration

6 years agoMerge pull request #1325 from michpappas/tf-issues#568_qemu_add_ENABLE_STACK_PROTECTOR
Dimitris Papastamos [Thu, 29 Mar 2018 10:27:36 +0000 (11:27 +0100)]
Merge pull request #1325 from michpappas/tf-issues#568_qemu_add_ENABLE_STACK_PROTECTOR

qemu: Add support for stack canary protection

6 years agoMerge pull request #1331 from hzhuang1/reboot_delay
Dimitris Papastamos [Thu, 29 Mar 2018 10:26:10 +0000 (11:26 +0100)]
Merge pull request #1331 from hzhuang1/reboot_delay

hikey960: add delay before reset

6 years agoMerge pull request #1329 from antonio-nino-diaz-arm/an/rpi3-multi-console
Dimitris Papastamos [Thu, 29 Mar 2018 09:04:06 +0000 (10:04 +0100)]
Merge pull request #1329 from antonio-nino-diaz-arm/an/rpi3-multi-console

rpi3: Migrate to the multi console API

6 years agoMerge pull request #1335 from JoelHutton/jh/cleanup_void_pointers
Dimitris Papastamos [Thu, 29 Mar 2018 08:59:52 +0000 (09:59 +0100)]
Merge pull request #1335 from JoelHutton/jh/cleanup_void_pointers

Clean usage of void pointers to access symbols

6 years agoMerge pull request #1336 from jonathanwright-ARM/jw/MISRA-init-arrays
Dimitris Papastamos [Thu, 29 Mar 2018 08:59:35 +0000 (09:59 +0100)]
Merge pull request #1336 from jonathanwright-ARM/jw/MISRA-init-arrays

psci: initialize array fully to comply with MISRA

6 years agoARM platforms: Add support for SGI575
Nariman Poushin [Mon, 26 Feb 2018 06:52:04 +0000 (06:52 +0000)]
ARM platforms: Add support for SGI575

Add support for System Guidance for Infrastructure platform SGI575.

Change-Id: I0125c2ed4469fbc8367dafcc8adce770b6b3147d
Signed-off-by: Nariman Poushin <nariman.poushin@linaro.org>
6 years agohikey960: add delay before reset
Haojian Zhuang [Mon, 26 Mar 2018 05:18:13 +0000 (13:18 +0800)]
hikey960: add delay before reset

If system is still accessing storage device, reboot operation
may cause data broken. So add the flush and delay operation
before system reset.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agopsci: initialize array fully to comply with MISRA
Jonathan Wright [Tue, 20 Mar 2018 14:34:01 +0000 (14:34 +0000)]
psci: initialize array fully to comply with MISRA

Initializes each element of the last_cpu_in_non_cpu_pd array in PSCI
stat implementation to -1, the reset value. This satisfies MISRA rule
9.3.

Previously, only the first element of the array was initialized to -1.

Change-Id: I666c71e6c073710c67c6d24c07a219b1feb5b773
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agoClean usage of void pointers to access symbols
Joel Hutton [Wed, 21 Mar 2018 11:40:57 +0000 (11:40 +0000)]
Clean usage of void pointers to access symbols

Void pointers have been used to access linker symbols, by declaring an
extern pointer, then taking the address of it. This limits symbols
values to aligned pointer values. To remove this restriction an
IMPORT_SYM macro has been introduced, which declares it as a char
pointer and casts it to the required type.

Change-Id: I89877fc3b13ed311817bb8ba79d4872b89bfd3b0
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
6 years agorpi3: Use new console APIs
Antonio Nino Diaz [Tue, 27 Mar 2018 08:39:47 +0000 (09:39 +0100)]
rpi3: Use new console APIs

Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1.

The crash console doesn't use this API, it uses internally the core
functions of the 16550 console.

`bl31_plat_runtime_setup` is no longer needed. When this platform port
was introduced, that function used to disable the console. It was needed
to override that behaviour. The new behaviour is to switch to the
runtime console. The console is registered for all scopes (boot, crash
and runtime) in `rpi3_console_init` so it is not needed to override the
default behaviour anymore.

Update documentation.

Change-Id: If2ee8f91044216183b7ef142e5c05ad6220ae92f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoservices: fix switch statements to comply with MISRA rules
Jonathan Wright [Wed, 14 Mar 2018 15:56:21 +0000 (15:56 +0000)]
services: fix switch statements to comply with MISRA rules

Ensure (where possible) that switch statements in services comply with
MISRA rules 16.1 - 16.7.

Change-Id: I47bf6ed4a026201e6fe125ce51842482e99e8bb0
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agoplat: fix switch statements to comply with MISRA rules
Jonathan Wright [Wed, 14 Mar 2018 15:24:00 +0000 (15:24 +0000)]
plat: fix switch statements to comply with MISRA rules

Ensure (where possible) that switch statements in plat comply with MISRA
rules 16.1 - 16.7.

Change-Id: Ie4a7d2fd10f6141c0cfb89317ea28a755391622f
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agolib: fix switch statements to comply with MISRA rules
Jonathan Wright [Tue, 13 Mar 2018 17:45:42 +0000 (17:45 +0000)]
lib: fix switch statements to comply with MISRA rules

Ensure (where possible) that switch statements in lib comply with MISRA
rules 16.1 - 16.7.

Change-Id: I52bc896fb7094d2b7569285686ee89f39f1ddd84
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agodrivers: fix switch statements to comply with MISRA rules
Jonathan Wright [Tue, 13 Mar 2018 15:24:29 +0000 (15:24 +0000)]
drivers: fix switch statements to comply with MISRA rules

Ensure (where possible) that switch statements in drivers comply with
MISRA rules 16.1 - 16.7.

Change-Id: I7a91e04b02af80fbc4673a52293386c0f81a0f7a
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agobl1: fix switch statements to comply with MISRA rules
Jonathan Wright [Tue, 13 Mar 2018 13:54:03 +0000 (13:54 +0000)]
bl1: fix switch statements to comply with MISRA rules

Ensure (where possible) that switch statements in bl1 comply with MISRA
rules 16.1 - 16.7

Return statements inside switch clauses mean that we do not comply with
rule 16.3.

Change-Id: I8342389ba525dfc68b88e67dbb3690a529abfeb1
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agoplat/common: remove fall-through on release build
Jonathan Wright [Wed, 14 Mar 2018 17:55:32 +0000 (17:55 +0000)]
plat/common: remove fall-through on release build

Removes fall-through in switch statement on unknown interrupt type in
release builds.

Previous behaviour was to assert(0) on default case in debug builds but
fall through and interpret the unknown interrupt type as
INTR_TYPE_EL3 in release builds.

Change-Id: I05fb0299608efda0f9eda2288d3e56e5625e05c9
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agoMerge pull request #1323 from rockchip-linux/Fixes-rk3399-watchdog
Dimitris Papastamos [Mon, 26 Mar 2018 09:53:24 +0000 (10:53 +0100)]
Merge pull request #1323 from rockchip-linux/Fixes-rk3399-watchdog

rockchip/rk3399: save/restore watchdog register correctly

6 years agoGIC: Fix setting interrupt configuration
Jeenu Viswambharan [Thu, 22 Mar 2018 08:57:52 +0000 (08:57 +0000)]
GIC: Fix setting interrupt configuration

  - Interrupt configuration is a 2-bit field, so the field shift has to
    be double that of the bit number.

  - Interrupt configuration (level- or edge-trigger) is specified in the
    MSB of the field, not LSB.

Fixes applied to both GICv2 and GICv3 drivers.

Fixes ARM-software/tf-issues#570

Change-Id: Ia6ae6ed9ba9fb0e3eb0f921a833af48e365ba359
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoMerge pull request #1330 from michpappas/tf-issues#571_qemu_fix_MULTI_CONSOLE=0
davidcunado-arm [Sun, 25 Mar 2018 03:20:40 +0000 (04:20 +0100)]
Merge pull request #1330 from michpappas/tf-issues#571_qemu_fix_MULTI_CONSOLE=0

qemu: MULTI_CONSOLE_API=0 causes build error

6 years agoqemu: MULTI_CONSOLE_API=0 causes build error
Michalis Pappas [Sat, 24 Mar 2018 04:38:31 +0000 (12:38 +0800)]
qemu: MULTI_CONSOLE_API=0 causes build error

Add crash_console_init declaration to console.h
Only enable MULTI_CONSOLE_API for AArch64

Fixes ARM-software/tf-issues#571

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agoMerge pull request #1280 from gitfineon/master
davidcunado-arm [Fri, 23 Mar 2018 03:43:29 +0000 (03:43 +0000)]
Merge pull request #1280 from gitfineon/master

plat/hikey: split boot memory layout to dedicated file

6 years agodrivers: ti: 16550: Implement console flush
Antonio Nino Diaz [Thu, 22 Mar 2018 20:13:44 +0000 (20:13 +0000)]
drivers: ti: 16550: Implement console flush

Replace placeholder by actual implementation.

Change-Id: I0861b1ac5304b0d2d7c32d7d9a48bd985e258e92
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1324 from michpappas/tf-issues#567Platforms_cannot_override_ENABL...
Dimitris Papastamos [Thu, 22 Mar 2018 14:47:15 +0000 (14:47 +0000)]
Merge pull request #1324 from michpappas/tf-issues#567Platforms_cannot_override_ENABLE_STACK_PROTECTOR

Platforms cannot override ENABLE_STACK_PROTECTOR

6 years agoMerge pull request #1321 from sandrine-bailleux-arm/topics/sb/fix-trusty-setup
davidcunado-arm [Thu, 22 Mar 2018 09:22:13 +0000 (09:22 +0000)]
Merge pull request #1321 from sandrine-bailleux-arm/topics/sb/fix-trusty-setup

Trusty: Fix sanity check on NS entry point

6 years agoMerge pull request #1299 from michpappas/tf-issues#561_qemu_support_MULTI_CONSOLE
davidcunado-arm [Thu, 22 Mar 2018 07:57:55 +0000 (07:57 +0000)]
Merge pull request #1299 from michpappas/tf-issues#561_qemu_support_MULTI_CONSOLE

qemu: Support MULTI_CONSOLE_API

6 years agoMerge pull request #1307 from wangfeng-64/master
davidcunado-arm [Thu, 22 Mar 2018 07:57:19 +0000 (07:57 +0000)]
Merge pull request #1307 from wangfeng-64/master

FVP: change the method for translating MPIDR values to a linear indices

6 years agoMerge pull request #1311 from jonathanwright-ARM/jw/MISRA-EOF-usage
davidcunado-arm [Thu, 22 Mar 2018 06:17:37 +0000 (06:17 +0000)]
Merge pull request #1311 from jonathanwright-ARM/jw/MISRA-EOF-usage

stdlib: remove comparison with EOF macro to comply with MISRA

6 years ago[PATCH 2/2] qemu: Support MULTI_CONSOLE_API
Michalis Pappas [Sun, 4 Mar 2018 07:43:38 +0000 (15:43 +0800)]
[PATCH 2/2] qemu: Support MULTI_CONSOLE_API

Add support for the new MULTI_CONSOLE_API

Crash information is now displayed in both the runtime and crash consoles,
if a crash occurs after the runtime console has been enabled

Enable MULTI_CONSOLE_API by default on qemu builds

Fixes ARM-software/tf-issues#561

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agoMerge pull request #1293 from swarren/issue-551-followup
davidcunado-arm [Wed, 21 Mar 2018 20:11:19 +0000 (20:11 +0000)]
Merge pull request #1293 from swarren/issue-551-followup

Don't make build results depend on dependency files

6 years agoMerge pull request #1294 from iwishguo/master
davidcunado-arm [Wed, 21 Mar 2018 19:20:43 +0000 (19:20 +0000)]
Merge pull request #1294 from iwishguo/master

Change PLATFORM_ROOT to TF_PLATFORM_ROOT

6 years agoMerge pull request #1314 from antonio-nino-diaz-arm/an/smccc-header
davidcunado-arm [Wed, 21 Mar 2018 19:18:29 +0000 (19:18 +0000)]
Merge pull request #1314 from antonio-nino-diaz-arm/an/smccc-header

Rename 'smcc' to 'smccc'

6 years agoMerge pull request #1304 from antonio-nino-diaz-arm/an/fix-copyright
davidcunado-arm [Wed, 21 Mar 2018 19:15:40 +0000 (19:15 +0000)]
Merge pull request #1304 from antonio-nino-diaz-arm/an/fix-copyright

tegra: Use SPDX license identifier

6 years agoRename 'smcc' to 'smccc'
Antonio Nino Diaz [Wed, 21 Mar 2018 10:49:27 +0000 (10:49 +0000)]
Rename 'smcc' to 'smccc'

When the source code says 'SMCC' it is talking about the SMC Calling
Convention. The correct acronym is SMCCC. This affects a few definitions
and file names.

Some files have been renamed (smcc.h, smcc_helpers.h and smcc_macros.S)
but the old files have been kept for compatibility, they include the
new ones with an ERROR_DEPRECATED guard.

Change-Id: I78f94052a502436fdd97ca32c0fe86bd58173f2f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoTrusty: Fix sanity check on NS entry point
Sandrine Bailleux [Mon, 19 Mar 2018 09:41:06 +0000 (10:41 +0100)]
Trusty: Fix sanity check on NS entry point

This patch fixes the sanity check on the non-secure entrypoint value
returned by bl31_plat_get_next_image_ep_info(). This issue has been
reported by Coverity Scan Online:

  CID 264893 (#1 of 1): Dereference null return value (NULL_RETURNS)
  Dereferencing a null pointer ns_ep_info.

Change-Id: Ia0f64d8c8b005f042608f1422ecbd42bc90b2fb4
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
6 years agoFix SDEI link in readme.rst
danh-arm [Tue, 20 Mar 2018 17:01:39 +0000 (17:01 +0000)]
Fix SDEI link in readme.rst

6 years agoMerge pull request #1316 from davidcunado-arm/dc/version_update
danh-arm [Tue, 20 Mar 2018 16:50:44 +0000 (16:50 +0000)]
Merge pull request #1316 from davidcunado-arm/dc/version_update

Release v1.5: Update minor version number to 5

6 years agoMerge pull request #1322 from danh-arm/dh/v1.5-readme
danh-arm [Tue, 20 Mar 2018 16:50:29 +0000 (16:50 +0000)]
Merge pull request #1322 from danh-arm/dh/v1.5-readme

Update readme.rst for v1.5 release

6 years agoMerge pull request #1326 from JoelHutton/jh/user_guide_updates
danh-arm [Tue, 20 Mar 2018 15:19:48 +0000 (15:19 +0000)]
Merge pull request #1326 from JoelHutton/jh/user_guide_updates

Update user guide

6 years agoUpdate user guide
Joel Hutton [Mon, 19 Mar 2018 11:59:57 +0000 (11:59 +0000)]
Update user guide

Following Out of Box testing for v1.5 release:

    Update host OS version to Ubuntu 16.04
    Clarify configuration files needed for checkpatch
    Add note on using Linaro precompiled binaries

Change-Id: Ia4ae61e01128ddff1a288972ddf84b79370fa52c
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
6 years agoqemu: Add support for stack canary protection
Michalis Pappas [Tue, 20 Mar 2018 06:30:00 +0000 (14:30 +0800)]
qemu: Add support for stack canary protection

Allow qemu users to enable stack protection. Since the virt platform
does not provide an RNG, use a basic, timer-based, canary generation,
similarly to FVP.

Increase SRAM size and BL2 size to fit images when stack protection is
enabled.

Notice that stack protection is not enabled by default in qemu.

Fixes ARM-software/tf-issues#568

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agoPlatforms cannot override ENABLE_STACK_PROTECTOR
Michalis Pappas [Tue, 20 Mar 2018 05:01:27 +0000 (13:01 +0800)]
Platforms cannot override ENABLE_STACK_PROTECTOR

Include stack_protector's makefile after including platform.mk
to allow platforms override ENABLE_STACK_PROTECTOR

Fixes ARM-software/tf-issues#567

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agorockchip/rk3399: save/restore watchdog register correctly
Lin Huang [Tue, 20 Mar 2018 01:37:21 +0000 (09:37 +0800)]
rockchip/rk3399: save/restore watchdog register correctly

there are two fix for save/restore watchdog register:
1. watchdog plck will shutdown after secure_watchdog_disable(), so need
   to save register before it and restore after secure_watchdog_enable().
2. need write 0x76 to cnt_restart to keep watchdog alive when restore
   watchdog register.

Change-Id: I1f6fbceae22186e3b72a87df6332a110adf37479
Signed-off-by: Lin Huang <hl@rock-chips.com>
6 years agoUpdate readme.rst for v1.5 release
Dan Handley [Wed, 14 Mar 2018 13:01:39 +0000 (13:01 +0000)]
Update readme.rst for v1.5 release

Change-Id: Id9bd0c20a5af4f41269a51a675018dcc59e93f6c
Signed-off-by: Dan Handley <dan.handley@arm.com>
6 years agoFVP: change the method for translating MPIDR values to a linear indices
Wang Feng [Thu, 15 Mar 2018 07:32:41 +0000 (15:32 +0800)]
FVP: change the method for translating MPIDR values to a linear indices

x3 will be assigned by the folloing instructions.
So the first instruction is not needed any more.

old method:
  (ClusterId * FVP_MAX_CPUS_PER_CLUSTER)
+ (CPUId * FVP_MAX_PE_PER_CPU)
+ ThreadId

it should be
  (ClusterId * FVP_MAX_CPUS_PER_CLUSTER) * FVP_MAX_PE_PER_CPU
+ (CPUId * FVP_MAX_PE_PER_CPU)
+ ThreadId

which can be simplified as:
(ClusterId * FVP_MAX_CPUS_PER_CLUSTER + CPUId) * FVP_MAX_PE_PER_CPU + ThreadId

Signed-off-by: Wang Feng <feng_feng.wang@spreadtrum.com>
6 years agoRelease v1.5: Update minor version number to 5
David Cunado [Mon, 12 Mar 2018 09:56:56 +0000 (09:56 +0000)]
Release v1.5: Update minor version number to 5

Change-Id: Ib215150272acc2ecec43f9b69624ebbbd5d7492d
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoMerge pull request #1312 from davidcunado-arm/dc/update_docs
davidcunado-arm [Thu, 15 Mar 2018 20:41:16 +0000 (20:41 +0000)]
Merge pull request #1312 from davidcunado-arm/dc/update_docs

Docs: Update various for v1.5 release

6 years agoUpdate model support in User Guide
David Cunado [Mon, 12 Mar 2018 18:47:05 +0000 (18:47 +0000)]
Update model support in User Guide

The CI has been updated to run tests against the AEMv8-A RevC
model, FVP_Base_RevC-2xAEMv8A, which is available from the Fast
Model releases on Connected Community [1].

Additionally, the CI now also includes the Cortex-A55x4, Cortex-A75x4
and Cortex-A55x4-A75x4 Base models.

[1] https://developer.arm.com/products/system-design/fixed-virtual-platforms

Change-Id: I57806f3b2a8121211490a7aa0089dcae566d8635
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoUpdate change-log.rst for v1.5
David Cunado [Wed, 14 Mar 2018 17:57:31 +0000 (17:57 +0000)]
Update change-log.rst for v1.5

Updated change-log.rst with summary of changes since
release v1.4.

Change-Id: I56b5a30d13a5a7099942535cbaeff0e2a5c5804e
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoUpdate Arm TF references to TF-A
Dan Handley [Thu, 1 Mar 2018 18:44:00 +0000 (18:44 +0000)]
Update Arm TF references to TF-A

Update Arm Trusted Firmware references in the upstream documents to
Trusted Firmware-A (TF-A). This is for consistency with and
disambiguation from Trusted Firmware-M (TF-M).

Also update other Arm trademarks, e.g. ARM->Arm, ARMv8->Armv8-A.

Change-Id: I8bb0e18af29c6744eeea2dc6c08f2c10b20ede22
Signed-off-by: Dan Handley <dan.handley@arm.com>
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoMerge pull request #1308 from soby-mathew/sm/doc_dyn_cfg
davidcunado-arm [Thu, 15 Mar 2018 15:27:08 +0000 (15:27 +0000)]
Merge pull request #1308 from soby-mathew/sm/doc_dyn_cfg

Docs: Update design guide for dynamic config

6 years agoMerge pull request #1310 from JoelHutton/jh/aarch32_mem_protect_fix
davidcunado-arm [Thu, 15 Mar 2018 15:24:37 +0000 (15:24 +0000)]
Merge pull request #1310 from JoelHutton/jh/aarch32_mem_protect_fix

FVP AArch32: Fix flash access in BL32 for mem_protect

6 years agostdlib: remove comparison with EOF macro to comply with MISRA
Jonathan Wright [Tue, 6 Mar 2018 16:23:28 +0000 (16:23 +0000)]
stdlib: remove comparison with EOF macro to comply with MISRA

Ensures compliance with MISRA C-2012 Rule 22.7

Change-Id: Ifbe0926a24ba0dca18174e1aa87313a63bba50fb
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
6 years agoFVP AArch32: Fix flash access in BL32 for mem_protect
Joel Hutton [Thu, 15 Mar 2018 11:33:44 +0000 (11:33 +0000)]
FVP AArch32: Fix flash access in BL32 for mem_protect

The FVP platform port for SP_MIN (BL32) didn't map the flash memory
in BL32 for stroring the mem_protect enable state information leading
to synchronous exception. The patch fixes it by adding the region to
the BL32 mmap tables.

Change-Id: I37eec83c3e1ea43d1b5504d3683eebc32a57eadf
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
6 years agoMerge pull request #1305 from dp-arm/dp/smccc
davidcunado-arm [Wed, 14 Mar 2018 14:24:25 +0000 (14:24 +0000)]
Merge pull request #1305 from dp-arm/dp/smccc

Implement support for v1.2 of firmware interfaces spec (ARM DEN 0070A)

6 years agoFixup `SMCCC_ARCH_FEATURES` semantics
Dimitris Papastamos [Mon, 12 Mar 2018 14:47:09 +0000 (14:47 +0000)]
Fixup `SMCCC_ARCH_FEATURES` semantics

When querying `SMCCC_ARCH_WORKAROUND_1` through `SMCCC_ARCH_FEATURES`,
return either:
  * -1 to indicate the PE on which `SMCCC_ARCH_FEATURES` is called
    requires firmware mitigation for CVE-2017-5715 but the mitigation
    is not compiled in.
  * 0 to indicate that firmware mitigation is required, or
  * 1 to indicate that no firmware mitigation is required.

This patch complies with v1.2 of the firmware interfaces
specification (ARM DEN 0070A).

Change-Id: Ibc32d6620efdac6c340758ec502d95554a55f02a
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoUse PFR0 to identify need for mitigation of CVE-2017-5715
Dimitris Papastamos [Mon, 12 Mar 2018 13:27:02 +0000 (13:27 +0000)]
Use PFR0 to identify need for mitigation of CVE-2017-5715

If the CSV2 field reads as 1 then branch targets trained in one
context cannot affect speculative execution in a different context.
In that case skip the workaround on Cortex A72 and A73.

Change-Id: Ide24fb6efc77c548e4296295adc38dca87d042ee
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoDocs: Update design guide for dynamic config
Soby Mathew [Fri, 16 Feb 2018 14:52:52 +0000 (14:52 +0000)]
Docs: Update design guide for dynamic config

This patch updates the `firmware-design.rst` document for
changes in ARM-TF for supporting dynamic configuration features
as presented in `Secure Firmware BoF SFO'17`[1].

The patch also updates the user-guide for 2 build options for FVP
pertaining to dynamic config.

[1] https://www.slideshare.net/linaroorg/bof-device-tree-and-secure-firmware-bof-sfo17310

Change-Id: Ic099cf41e7f1a98718c39854e6286d884011d445
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoplat/hikey: boot memory layout to dedicated file
Michael Brandl [Thu, 22 Feb 2018 15:30:30 +0000 (16:30 +0100)]
plat/hikey: boot memory layout to dedicated file

Boot memory layout is specific for a platform, but should not be
mixed up with other platform specific attributes. A separate file is
much cleaner and better to compare with other platforms. Take a look
at plat/poplar where it is done the same way.

Moved hikey_def.h to system include folder and moved includes from
hikey_def.h to more general platform_def.h.

Signed-off-by: Michael Brandl <git@fineon.pw>
6 years agoMerge pull request #1303 from soby-mathew/sm/fix_juno_fwu
davidcunado-arm [Thu, 8 Mar 2018 11:33:41 +0000 (11:33 +0000)]
Merge pull request #1303 from soby-mathew/sm/fix_juno_fwu

Juno: Fixes for firmware update

6 years agotegra: Use SPDX license identifier
Antonio Nino Diaz [Thu, 8 Mar 2018 10:57:43 +0000 (10:57 +0000)]
tegra: Use SPDX license identifier

Change-Id: I770b2db68c8d115d10067bb557e32b5e269c94a5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1277 from hzhuang1/testing/bl2_el3_v0.6
davidcunado-arm [Thu, 8 Mar 2018 10:39:52 +0000 (10:39 +0000)]
Merge pull request #1277 from hzhuang1/testing/bl2_el3_v0.6

hikey: migrate to BL2_EL3

6 years agoJuno: Change the Firmware update detect mechanism
Soby Mathew [Wed, 7 Mar 2018 11:32:04 +0000 (11:32 +0000)]
Juno: Change the Firmware update detect mechanism

Previously, Juno used to depend on the SSC_GPRETN register to inform
about the reset syndrome. This method was removed when SCP migrated
to the SDS framework. But even the SDS framework doesn't report the
reset syndrome correctly and hence Juno failed to enter Firmware
update mode if BL2 authentication failed.

In addition to that, the error code populated in V2M_SYS_NVFLAGS register
does not seem to be retained any more on Juno across resets. This could
be down to the motherboard firmware not doing the necessary to preserve
the value.

Hence this patch modifies the Juno platform to use the same mechanism to
trigger firmware update as FVP which is to corrupt the FIP TOC on
authentication failure. The implementation in `fvp_err.c` is made common
for ARM platforms and is moved to the new `arm_err.c` file in
plat/arm/common folder. The BL1 and BL2 mmap table entries for Juno
are modified to allow write to the Flash memory address.

Change-Id: Ica7d49a3e8a46a90efd4cf340f19fda3b549e945
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMerge pull request #1302 from hzhuang1/fix_build
davidcunado-arm [Wed, 7 Mar 2018 22:49:59 +0000 (22:49 +0000)]
Merge pull request #1302 from hzhuang1/fix_build

Fix build with clang on hikey

6 years agoBL2U: Fix ARM platform timer initilization
Soby Mathew [Tue, 6 Mar 2018 15:22:55 +0000 (15:22 +0000)]
BL2U: Fix ARM platform timer initilization

This issue was detected when testing FWU on Juno. The Timer
`timer_ops` was not being initialized before being used by
the SDS driver on Juno. This patch adds the call to
`generic_delay_timer_init()` during bl2u_early_platform_setup().
This is done generically for all ARM platforms because the
cost involved is minimal.

Change-Id: I349cf0bd1db68406eb2298b65f9c729f792cabdc
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMerge pull request #1239 from arve-android/trusty-fixes
davidcunado-arm [Wed, 7 Mar 2018 10:43:56 +0000 (10:43 +0000)]
Merge pull request #1239 from arve-android/trusty-fixes

Trusty fixes

6 years agoMerge pull request #1301 from ldebieve/lde/issue-tf#562
davidcunado-arm [Tue, 6 Mar 2018 19:39:48 +0000 (19:39 +0000)]
Merge pull request #1301 from ldebieve/lde/issue-tf#562

bl2-el3: Fix bl32 lr_svc used for bl33 entry address

6 years agohikey: fix build issue with CLANG
Haojian Zhuang [Fri, 2 Mar 2018 06:25:41 +0000 (14:25 +0800)]
hikey: fix build issue with CLANG

plat/hisilicon/hikey/hikey_bl1_setup.c:565:47:
error: value size does not match register size specified by the
constraint and modifier [-Werror,-Wasm-operand-widths]
        __asm__ volatile ("mrs  %0, cpacr_el1" : "=r"(data));

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: fix build issue with CLANG
Haojian Zhuang [Fri, 2 Mar 2018 06:23:55 +0000 (14:23 +0800)]
hikey960: fix build issue with CLANG

plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c:290:20:
error: unused function 'hisi_pdc_set_intmask' [-Werror,-Wunused-function]
static inline void hisi_pdc_set_intmask(void *pdc_base_addr,
                   ^
1 error generated.
Makefile:605: recipe for target 'build/hikey960/release/bl31/hisi_pwrc.o' failed
make: *** [build/hikey960/release/bl31/hisi_pwrc.o] Error 1

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agotrusty: Add boot parameter documentation
Arve Hjønnevåg [Mon, 5 Mar 2018 20:13:22 +0000 (12:13 -0800)]
trusty: Add boot parameter documentation

Change-Id: Ibfb75145e3a31ae2106eedfbe4a91c2e31bb9f2a

6 years agobl2-el3: Fix bl32 lr_svc used for bl33 entry address
Lionel Debieve [Mon, 5 Mar 2018 14:21:59 +0000 (15:21 +0100)]
bl2-el3: Fix bl32 lr_svc used for bl33 entry address

When using BL2_EL3, we need to ensure that lr_svc is
properly given to bl32 as it was previously made by bl1.

Fixes ARM-Software/tf-issues#562

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
6 years agoMerge pull request #1300 from davidcunado-arm/ak/fix_args
davidcunado-arm [Mon, 5 Mar 2018 12:35:32 +0000 (12:35 +0000)]
Merge pull request #1300 from davidcunado-arm/ak/fix_args

Dynamic cfg: Do not populate args if already initialized

6 years ago[PATCH 1/2] qemu: Support MULTI_CONSOLE_API
Michalis Pappas [Sun, 4 Mar 2018 06:16:01 +0000 (14:16 +0800)]
[PATCH 1/2] qemu: Support MULTI_CONSOLE_API

Include missing plat_helpers.S into pl011_console.S, to build successfully
when MULTI_CONSOLE_API is enabled.

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agoDynamic cfg: Do not populate args if already initialized
Amit Daniel Kachhap [Fri, 2 Mar 2018 13:17:55 +0000 (18:47 +0530)]
Dynamic cfg: Do not populate args if already initialized

This patch modifies the common utility function
`populate_next_bl_params_config()` to only modify the entrypoint arguments
to an executable image only if they are not initialized earlier.
This issue was detected while testing Optee on ARM platforms which needed
the current arguments to be preserved in the absence of corresponding
config files.

Change-Id: I1e3fb4be8176fc173959e72442396dd33a99a316
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoMerge pull request #1288 from michpappas/tf-issues#558_qemu_separate_code_and_data
davidcunado-arm [Mon, 5 Mar 2018 10:52:41 +0000 (10:52 +0000)]
Merge pull request #1288 from michpappas/tf-issues#558_qemu_separate_code_and_data

qemu: Support SEPARATE_CODE_AND_RODATA

6 years agoMerge pull request #1298 from michpappas/tf-issues#560_qemu_UART1_data_abort
davidcunado-arm [Mon, 5 Mar 2018 09:51:25 +0000 (09:51 +0000)]
Merge pull request #1298 from michpappas/tf-issues#560_qemu_UART1_data_abort

qemu: Accessing UART1 causes a data abort

6 years agoChange PLATFORM_ROOT to TF_PLATFORM_ROOT
Heyi Guo [Thu, 1 Mar 2018 10:57:58 +0000 (18:57 +0800)]
Change PLATFORM_ROOT to TF_PLATFORM_ROOT

Since we use "?=" to set PLATFORM_ROOT, it is better to change the
name to be more special, or else it may be overridden by some
environment variables, such as in some CI build environments.

Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
6 years agohikey960: move out duplicated code
Haojian Zhuang [Mon, 5 Mar 2018 05:20:33 +0000 (13:20 +0800)]
hikey960: move out duplicated code

Create hikey960_bl_common.c to store duplication initialization
code in both BL1 and BL2.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: fix invoking driver init in image load driver
Haojian Zhuang [Tue, 30 Jan 2018 02:35:17 +0000 (10:35 +0800)]
hikey960: fix invoking driver init in image load driver

It's unnecessary to call platform driver initialization in image
load driver. We could make bl2_platform_setup() to executing
just before SCP_BL2 by setting flag IMAGE_ATTRIB_PLAT_SETUP.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: migrate to bl2_el3
Haojian Zhuang [Thu, 25 Jan 2018 08:13:05 +0000 (16:13 +0800)]
hikey960: migrate to bl2_el3

Since non-TF ROM is used in HiKey960 platform (Hisilicon Hi3660 SoC),
replace BL1 by BL2_EL3 in normal boot mode.

When flush images in recovery mode, keep to use BL1.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: drop LOAD_IMAGE v1
Haojian Zhuang [Mon, 29 Jan 2018 04:45:28 +0000 (12:45 +0800)]
hikey960: drop LOAD_IMAGE v1

Since LOAD_IMAGE_V2 is always enabled in HiKey960 platform. Drop
LOAD_IMAGE v1 to simplify code.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: fix memory overlapped in memory map
Haojian Zhuang [Mon, 29 Jan 2018 04:36:03 +0000 (12:36 +0800)]
hikey960: fix memory overlapped in memory map

MAP_TSP_MEM could be either in SRAM or DRAM. When MAP_TSP_MEM is in
DRAM, it's overlapped with MAP_DDR.

Since TSP_MEM is always configured in DRAM case, it means
MAP_OPTEE_PAGEABLE is always disabled. Just remove it.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey960: avoid to dump message when fetch boardid
Haojian Zhuang [Sat, 27 Jan 2018 11:29:36 +0000 (19:29 +0800)]
hikey960: avoid to dump message when fetch boardid

The main difference between HiKey960 v1 hardware and HiKey960 v2
hardware is on UART console.

But the function of detecting boardid dumps message before console
ready. So fix it by removing those messages.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey: move out duplicated code
Haojian Zhuang [Mon, 5 Mar 2018 05:03:53 +0000 (13:03 +0800)]
hikey: move out duplicated code

Create hikey_bl_common.c to store duplicated initialization
code in BL1 and BL2.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey: migrate to bl2_el3
Haojian Zhuang [Thu, 25 Jan 2018 08:10:14 +0000 (16:10 +0800)]
hikey: migrate to bl2_el3

Since non-TF ROM is used in HiKey platform (Hisilicon Hi6220 SoC),
replace BL1 by BL2_EL3 in normal boot mode.

When we recovery images in recovery mode, keep to use BL1.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey: clean dcache for SRAM after initialized
Haojian Zhuang [Mon, 29 Jan 2018 03:42:42 +0000 (11:42 +0800)]
hikey: clean dcache for SRAM after initialized

Although SRAM is initialized, DCACHE should be cleaned too.
Because MCU is a parrallel core to access SRAM. We need to make
sure that initialized value is really written to SRAM before
MCU using it.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agohikey: drop LOAD_IMAGE v1
Haojian Zhuang [Sun, 28 Jan 2018 15:33:02 +0000 (23:33 +0800)]
hikey: drop LOAD_IMAGE v1

Since LOAD_IMAGE_V2 is always enabled in HiKey platform. Drop
LOAD_IMAGE v1 to simplify code.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agoqemu: Accessing UART1 causes a data abort
Michalis Pappas [Sat, 3 Mar 2018 10:26:11 +0000 (18:26 +0800)]
qemu: Accessing UART1 causes a data abort

The register address range of UART1 (crash console) are outside the
address ranges mapped for MMIO, resulting to an MMU abort when the
device registers are accessed.

Increase the size of DEVICE1 memory to include the range of UART1.

Fixes ARM-software/tf-issues#560

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
6 years agoMerge pull request #1292 from danh-arm/dh/spurious-dep-warn
davidcunado-arm [Sat, 3 Mar 2018 13:26:18 +0000 (13:26 +0000)]
Merge pull request #1292 from danh-arm/dh/spurious-dep-warn

 Suppress spurious deprecated declaration warnings

6 years agoMerge pull request #1297 from soby-mathew/sm/fix_aarch32_plat_cmn
davidcunado-arm [Sat, 3 Mar 2018 00:25:19 +0000 (00:25 +0000)]
Merge pull request #1297 from soby-mathew/sm/fix_aarch32_plat_cmn

Remove sp_min functions from plat_common.c

6 years agoMerge pull request #1296 from robertovargas-arm/fix-dram2-size
davidcunado-arm [Sat, 3 Mar 2018 00:23:34 +0000 (00:23 +0000)]
Merge pull request #1296 from robertovargas-arm/fix-dram2-size

Fix FVP DRAM2 size

6 years agotrusty: Fix another reported misra violation
Arve Hjønnevåg [Fri, 2 Mar 2018 18:10:00 +0000 (10:10 -0800)]
trusty: Fix another reported misra violation

Change-Id: I822ccf5852dce4c01f98382cc393331f29e1e256

6 years agoRemove sp_min functions from plat_common.c
Soby Mathew [Thu, 1 Mar 2018 10:53:33 +0000 (10:53 +0000)]
Remove sp_min functions from plat_common.c

This patch removes default platform implementations of sp_min
platform APIs from plat/common/aarch32/plat_common.c. The APIs
are now implemented in `plat_sp_min_common.c` file within the
same folder.

The ARM platform layer had a weak definition of sp_min_platform_setup2()
which conflicted with the weak definition in the common file. Hence this
patch fixes that by introducing a `plat_arm_` version of the API thus
allowing individual boards within ARM platforms to override it if they
wish to.

Fixes ARM-software/tf-issues#559

Change-Id: I11a74ecae8191878ccc7ea03f12bdd5ae88faba5
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoFix FVP DRAM2 size
Roberto Vargas [Thu, 1 Feb 2018 15:19:00 +0000 (15:19 +0000)]
Fix FVP DRAM2 size

This was correct according to the model specifications , but it seems
that FVP doesn't implement it. It is safer to use the size exposed by
the DTB which is currently used by Linux.

Change-Id: I9aabe3284a50ec2a36ed94966eb7e4ddf37cec3b
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>