project/bcm63xx/atf.git
6 years agodenver: use plat_my_core_pos() to get core position
Varun Wadekar [Wed, 28 Feb 2018 02:30:31 +0000 (18:30 -0800)]
denver: use plat_my_core_pos() to get core position

The current functions to disable and enable Dynamic Code Optimizer
(DCO) assume that all denver cores are in the same cluster. They
ignore AFF1 field of the mpidr_el1 register, which leads to
incorect logical core id calculation.

This patch calls the platform handler, plat_my_core_pos(), to get
the logical core id to disable/enable DCO for the core.

Original change by: Krishna Sitaraman <ksitaraman@nvidia.com>

Change-Id: I45fbd1f1eb032cc1db677a4fdecc554548b4a830
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
6 years agoMerge pull request #1548 from BayLibre/opteed
Soby Mathew [Tue, 4 Sep 2018 04:01:56 +0000 (05:01 +0100)]
Merge pull request #1548 from BayLibre/opteed

opteed: pass power level on suspend

6 years agoMerge pull request #1540 from MISL-EBU-System-SW/marvell-updates-18.09
Soby Mathew [Tue, 4 Sep 2018 02:35:54 +0000 (03:35 +0100)]
Merge pull request #1540 from MISL-EBU-System-SW/marvell-updates-18.09

Marvell updates 18.09

6 years agofix: tools: Fix doimage syntax breaking secure mode build
Konstantin Porotchkin [Thu, 16 Aug 2018 10:57:18 +0000 (13:57 +0300)]
fix: tools: Fix doimage syntax breaking secure mode build

Missing ")" in fprintf causing build break in secure boot mode.

Change-Id: Ice555571683b68bb0d81479e9fc8abc4296809ac
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agoplat: marvell: Update Marvell base code version to 18.09.1
Konstantin Porotchkin [Thu, 16 Aug 2018 07:25:24 +0000 (10:25 +0300)]
plat: marvell: Update Marvell base code version to 18.09.1

Change-Id: I908844364bf8080612aaa6d750d7d2441ecc2eb8
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agoplat: svc: ap807: add SVC configuration for AP807
Christine Gharzuzi [Thu, 2 Aug 2018 17:25:11 +0000 (20:25 +0300)]
plat: svc: ap807: add SVC configuration for AP807

- add svc configuration according to values burnt
  to the chip efuse

Change-Id: Icf5d7cc41bc09ac2244d0a126106e681afebb064
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agotools: doimage: Add secure image key file examples
Konstantin Porotchkin [Tue, 14 Aug 2018 12:25:07 +0000 (15:25 +0300)]
tools: doimage: Add secure image key file examples

Add example keys for building trusted flash images using
doimage tools.
Similar files can be generated using openssl or mbedtls.
Marvell platform make files are using trusted boot
configurations from this example etst vector.

Change-Id: I38a2e295171bee4c14005ce6f020b352c683496e
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agofix: marvell: Check the required libraries before building doimage
Konstantin Porotchkin [Tue, 14 Aug 2018 09:26:45 +0000 (12:26 +0300)]
fix: marvell: Check the required libraries before building doimage

Some customers are missing host libraries required for doimage
builds.
This patch requests for the library installation check for every
doimage build and suggest the required installation steps in case
of missing headers.

Change-Id: Icde18c3d4d6045f65e50d2dc9e6514971f40033e
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
6 years agoplat: a8k: enable PMU overflow interrupt handler
Marcin Wojtas [Wed, 21 Mar 2018 08:59:59 +0000 (09:59 +0100)]
plat: a8k: enable PMU overflow interrupt handler

This patch enables handling PMU overflow IRQ by GIC SPI's
directly in EL3. Also implement additional SMC routine,
which can disable the solution on demand in runtime.

Since it is possible to configure PMU interrupt trigger type
in the MADT ACPI table, it is enough to set it only once in EL3
during initialization.

Change-Id: Ie76aa62ccc4fd7cabfec9e3d5ed9970ada1c1b2a
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agomarvell: drivers: correct RTC init sequence
Marcin Wojtas [Mon, 30 Jul 2018 08:18:45 +0000 (10:18 +0200)]
marvell: drivers: correct RTC init sequence

It turned out that resetting the RTC time register is not
necessary during initial configuration. Safely remove it
from the sequence.

Change-Id: Id2b9c7db44a8c8dbe88a7f8a21695b72a7fd78ee
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agogicv2: enable configuring IRQ trigger type
Marcin Wojtas [Wed, 21 Mar 2018 08:55:47 +0000 (09:55 +0100)]
gicv2: enable configuring IRQ trigger type

This patch introduces new helper routines that allow
configuring the individual IRQs to be edge/level-triggered
via GICD_ICFGR registers. This is helpful to modify
the default configuration of the non-secure GIC SPI's, which
are all set during initialization to be level-sensitive.

Change-Id: I23deb4a0381691a686a3cda52405aa1dfd5e56f2
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agoMerge pull request #1484 from nathan-menhorn/tee-validate-header-603
Soby Mathew [Mon, 3 Sep 2018 10:29:11 +0000 (11:29 +0100)]
Merge pull request #1484 from nathan-menhorn/tee-validate-header-603

Update optee_utils.c to fix ARM-software/tf-issues#603

6 years agoMerge pull request #1541 from rajanv-xilinx/integration-num-clocks
Soby Mathew [Mon, 3 Sep 2018 07:56:19 +0000 (08:56 +0100)]
Merge pull request #1541 from rajanv-xilinx/integration-num-clocks

zynqmp: pm: Add API to get number of clocks

6 years agoMerge pull request #1551 from glneo/k3-pwr-down-psci
Soby Mathew [Mon, 3 Sep 2018 07:55:28 +0000 (08:55 +0100)]
Merge pull request #1551 from glneo/k3-pwr-down-psci

Add PSCI core power down for K3

6 years agomarvell: pm: do not panic by default in cpu_standby
Marcin Wojtas [Thu, 16 Nov 2017 17:19:02 +0000 (18:19 +0100)]
marvell: pm: do not panic by default in cpu_standby

Current default behavior of cpu_standby callback
is problematic during the SBSA test, which is
unable to run due to EL3 panic. Make it dependent on
the PM firmware running.

Change-Id: I7a53de8c880bd23b157dd65ce14bb48b5a5c76c8
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agomvebu: cp110: fix spelling in register definition
Grzegorz Jaszczyk [Mon, 16 Jul 2018 10:18:03 +0000 (12:18 +0200)]
mvebu: cp110: fix spelling in register definition

Use PF instead of PP post-fix, since it is referring to "Phase Final"
(only G3 related register had correct spelling for relevant bit).

Change-Id: Ia5a9c9c78b74b15f7f8adde2c3ef4784c513da2c
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agomvebu: cp110: align all comphy_index arguments type
Grzegorz Jaszczyk [Thu, 12 Jul 2018 05:40:34 +0000 (07:40 +0200)]
mvebu: cp110: align all comphy_index arguments type

The biggest comphy index can be equal to 6 so there is no need to use
uint64_t for storing it.

Change-Id: I14c2b68e51678a560815963c72aed0c37068f926
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agoplat: marvell: a80x0: reconfigure CP0 PCIE0 windows
Marcin Wojtas [Tue, 17 Jul 2018 13:26:21 +0000 (15:26 +0200)]
plat: marvell: a80x0: reconfigure CP0 PCIE0 windows

In order to allow the use of PCIe cards such as graphics cards, whose
demands for BAR space are typically much higher than those of network
or SATA/USB cards, reconfigure the I/O windows so we can declare two
MMIO PCI regions: a 512 MB MMIO32 one at 0xc000_0000 and a 4 GB MMIO64
one at 0x8_0000_0000. In addition, this will leave ample room for an
ECAM config space at 0xe000_0000 (up to the ECAM maximum of 256 MB)

For compatibility with older kernels or firmware, leave the original
16 MB window in place as well.

Change-Id: Ia8177194e542078772f90941eced81b231c16887
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agoplat: marvell: a70x0: reconfigure CP0 PCIE2 windows
Marcin Wojtas [Tue, 17 Jul 2018 13:20:08 +0000 (15:20 +0200)]
plat: marvell: a70x0: reconfigure CP0 PCIE2 windows

In order to allow the use of PCIe cards such as graphics cards, whose
demands for BAR space are typically much higher than those of network
or SATA/USB cards, reconfigure the I/O windows so we can declare two
MMIO PCI regions: a 512 MB MMIO32 one at 0xc000_0000 and a 4 GB MMIO64
one at 0x8_0000_0000. In addition, this will leave ample room for an
ECAM config space at 0xe000_0000 (up to the ECAM maximum of 256 MB)

For compatibility with older kernels or firmware, leave the original
16 MB window in place as well.

Change-Id: I80b00691ae8d0a3f3f7285b8e0bfc21c0a095e94
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agoa8k: use the memory controller feature to protect the RT service region
Grzegorz Jaszczyk [Wed, 13 Jun 2018 14:00:48 +0000 (16:00 +0200)]
a8k: use the memory controller feature to protect the RT service region

Define the RT service space as secure with use of memory controller
trustzone feature. Thanks to this protection, any NS-Bootloader nor NS-OS,
won't be able to access RT services (e.g. accidentally overwrite it,
which will at best result in RT services unavailability).

Change-Id: Ie5b6cbe9a1b77879d6d8f8eac5d4e41e468496ce
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agodrivers: marvell: mc_trustzone: add driver for mc trustzone
Grzegorz Jaszczyk [Wed, 13 Jun 2018 13:27:10 +0000 (15:27 +0200)]
drivers: marvell: mc_trustzone: add driver for mc trustzone

Add simple driver which allows to configure the memory controller trust
zones. It is responsible for opening mc trustzone window, with
appropriate base address, size and attributes.

Example of usage in upcoming commits.

Change-Id: I8bea17754d31451b305040ee7de331fb8db0c63f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
6 years agoplat: marvell: rename common include file
Konstantin Porotchkin [Sun, 29 Jul 2018 10:30:51 +0000 (13:30 +0300)]
plat: marvell: rename common include file

Rename a8k_common.h to armada_common.h to keep the same header
name across all other Marvell Armada platforms.
This is especially useful since various Marvell platforms may
use common platform files and share the driver modules.

Change-Id: I7262105201123d54ccddef9aad4097518f1e38ef
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agodocs: marvell: Update build manual
Konstantin Porotchkin [Sun, 29 Jul 2018 08:53:32 +0000 (11:53 +0300)]
docs: marvell: Update build manual

Update build manual
- remove irrelevant platforms and environemnt variables
- add links to BLE and mv_ddr Github repositories

Change-Id: Ie389c61f014751cdc0459b3f78c70ede694d27b8
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agoti: k3: common: Add basic PSCI core off support
Andrew F. Davis [Thu, 9 Aug 2018 15:01:53 +0000 (10:01 -0500)]
ti: k3: common: Add basic PSCI core off support

Use TI-SCI messages to request core power down from system controller
firmware.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoopteed: pass power level on suspend
Jorge Ramirez-Ortiz [Thu, 30 Aug 2018 14:12:12 +0000 (16:12 +0200)]
opteed: pass power level on suspend

Some platforms might chose to take different actions depending on this
value; this is precisely the case for rcar-gen3.

Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
6 years agoMerge pull request #1552 from glneo/build-fix
Dimitris Papastamos [Fri, 31 Aug 2018 13:24:27 +0000 (14:24 +0100)]
Merge pull request #1552 from glneo/build-fix

GIC: Fix build error

6 years agoMerge pull request #1547 from semihalf-dabros-jan/semihalf-dabros-jan/fix_errmisc
Dimitris Papastamos [Fri, 31 Aug 2018 12:18:30 +0000 (13:18 +0100)]
Merge pull request #1547 from semihalf-dabros-jan/semihalf-dabros-jan/fix_errmisc

AARCH64: Fix credentials for ERXMISC0_EL1 and ERXMISC1_EL1

6 years agoMerge pull request #1550 from danielboulby-arm/db/weakdefs
Dimitris Papastamos [Fri, 31 Aug 2018 12:18:18 +0000 (13:18 +0100)]
Merge pull request #1550 from danielboulby-arm/db/weakdefs

Prevent two weak definitions of the same function

6 years agoMerge pull request #1549 from danielboulby-arm/db/pointer
Dimitris Papastamos [Fri, 31 Aug 2018 08:53:03 +0000 (09:53 +0100)]
Merge pull request #1549 from danielboulby-arm/db/pointer

Remove rt_svc_descs pointer from global scope

6 years agoGIC: Fix build error
Andrew F. Davis [Thu, 30 Aug 2018 19:30:54 +0000 (14:30 -0500)]
GIC: Fix build error

Pointers should be comparied to NULL.

Fixes: 3fea9c8b8e8e ("gic: Fix types")
Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoPrevent two weak definitions of the same function
Daniel Boulby [Wed, 27 Jun 2018 15:45:48 +0000 (16:45 +0100)]
Prevent two weak definitions of the same function

Add another level of abstraction of weak defs for
arm_bl2_handle_post_image_load to prevent two weak definitions
of the same function

Change-Id: Ie953786f43b0f88257c82956ffaa5fe0d19603db
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
6 years agoRemove rt_svc_descs pointer from global scope
Daniel Boulby [Wed, 27 Jun 2018 15:18:48 +0000 (16:18 +0100)]
Remove rt_svc_descs pointer from global scope

A pointer to rt_svc_desc_t is defined both in the function
handle_runtime_svc() and globally. Since the value of the
pointer RT_SVC_DESCS_START is defined by the linker and
never changes make this definition local in both
handle_runtime_svc() and runtime_svc_init() to reduce the
number of loads

Change-Id: Iea42c778d8599a26c87700009163b5a8d7d60be2
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
6 years agoMerge pull request #1546 from antonio-nino-diaz-arm/an/log-misra
Dimitris Papastamos [Thu, 30 Aug 2018 15:55:05 +0000 (16:55 +0100)]
Merge pull request #1546 from antonio-nino-diaz-arm/an/log-misra

Fix some MISRA defect in log helpers

6 years agoFix MISRA defects in log helpers
Antonio Nino Diaz [Tue, 28 Aug 2018 10:44:44 +0000 (11:44 +0100)]
Fix MISRA defects in log helpers

No functional changes.

Change-Id: I850f08718abb69d5d58856b0e3de036266d8c2f4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Fix some MISRA defects
Antonio Nino Diaz [Thu, 23 Aug 2018 14:11:46 +0000 (15:11 +0100)]
libc: Fix some MISRA defects

No functional changes.

Change-Id: I907aa47565af2a6c435a5560041fd2b59e65c25c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1542 from antonio-nino-diaz-arm/an/bl31-misra
Dimitris Papastamos [Thu, 30 Aug 2018 15:18:49 +0000 (16:18 +0100)]
Merge pull request #1542 from antonio-nino-diaz-arm/an/bl31-misra

Some MISRA fixes in BL31, cci and smmu

6 years agoMerge pull request #1544 from jwerner-chromium/JW_handle_ea
Dimitris Papastamos [Thu, 30 Aug 2018 15:09:30 +0000 (16:09 +0100)]
Merge pull request #1544 from jwerner-chromium/JW_handle_ea

context_mgmt: Fix HANDLE_EA_EL3_FIRST implementation

6 years agoMerge pull request #1539 from antonio-nino-diaz-arm/an/gic-misra
Dimitris Papastamos [Thu, 30 Aug 2018 15:08:25 +0000 (16:08 +0100)]
Merge pull request #1539 from antonio-nino-diaz-arm/an/gic-misra

MISRA fixes for the GIC driver

6 years agoMerge pull request #1535 from antonio-nino-diaz-arm/an/backtrace
Dimitris Papastamos [Thu, 30 Aug 2018 15:08:12 +0000 (16:08 +0100)]
Merge pull request #1535 from antonio-nino-diaz-arm/an/backtrace

Introduce backtrace function

6 years agoAARCH64: Fix credentials for ERXMISC0_EL1 and ERXMISC1_EL1
Jan Dabros [Thu, 30 Aug 2018 11:52:23 +0000 (13:52 +0200)]
AARCH64: Fix credentials for ERXMISC0_EL1 and ERXMISC1_EL1

fixes arm-software/tf-issues#620

Signed-off-by: Jan Dabros <jsd@semihalf.com>
6 years agodrivers: cci: Fix MISRA defects
Antonio Nino Diaz [Thu, 23 Aug 2018 09:19:23 +0000 (10:19 +0100)]
drivers: cci: Fix MISRA defects

Change-Id: Ifdb0ceec19d267b14d796b5d31f08f7342190484
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agodrivers: smmu: Fix MISRA defects
Antonio Nino Diaz [Tue, 21 Aug 2018 15:12:29 +0000 (16:12 +0100)]
drivers: smmu: Fix MISRA defects

Change-Id: I2954a99d5b72069bcb7bac9d6926c6209d6ba881
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoFix MISRA defects in some common headers
Antonio Nino Diaz [Tue, 21 Aug 2018 13:14:31 +0000 (14:14 +0100)]
Fix MISRA defects in some common headers

Change-Id: I8fbb4c785e7e07c7241e0c399a9b65161985c9df
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoFix MISRA defects in BL31 common code
Antonio Nino Diaz [Fri, 24 Aug 2018 15:30:29 +0000 (16:30 +0100)]
Fix MISRA defects in BL31 common code

Change-Id: I5993b425445ee794e6d2a792c244c0af53640655
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoplat/arm: gic: Fix macros
Antonio Nino Diaz [Tue, 21 Aug 2018 08:42:26 +0000 (09:42 +0100)]
plat/arm: gic: Fix macros

Change-Id: I130e35d55c474ecd80f9a825be23620d5bc1a715
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoplat/common: gic: MISRA fixes
Antonio Nino Diaz [Tue, 21 Aug 2018 08:44:43 +0000 (09:44 +0100)]
plat/common: gic: MISRA fixes

Change-Id: I11509a3271d7608048d49e7dd5192be0c2a313f0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agogic v3: Fix width of types of helper functions
Antonio Nino Diaz [Tue, 21 Aug 2018 09:03:07 +0000 (10:03 +0100)]
gic v3: Fix width of types of helper functions

Change-Id: I08447b44fffb6e54f9fab957eee369ccbda4247a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agogic: Fix types
Antonio Nino Diaz [Tue, 21 Aug 2018 09:02:33 +0000 (10:02 +0100)]
gic: Fix types

Change-Id: I6a2adef87c20f9279446a54b7e69618fba3d2a25
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agogic: Fix definitions
Antonio Nino Diaz [Fri, 24 Aug 2018 10:46:33 +0000 (11:46 +0100)]
gic: Fix definitions

Change-Id: I945029ca26ea2e63f0d92c5f33019b882f23bd72
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agogic v3: Turn macros into static inline functions
Antonio Nino Diaz [Mon, 13 Aug 2018 14:29:29 +0000 (15:29 +0100)]
gic v3: Turn macros into static inline functions

Change-Id: Ib587f12f36810fc7d4f4b8f575195554299b8ed4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agobacktrace: Print backtrace in assert() and panic()
Antonio Nino Diaz [Thu, 23 Aug 2018 14:13:58 +0000 (15:13 +0100)]
backtrace: Print backtrace in assert() and panic()

When any of these functions is called the backtrace will be printed to
the console.

Change-Id: Id60842df824b320c485a9323ed6b80600f4ebe35
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agobacktrace: Introduce backtrace function
Douglas Raillard [Tue, 21 Aug 2018 11:54:45 +0000 (12:54 +0100)]
backtrace: Introduce backtrace function

This function diplays the backtrace, the current EL and security state
to allow a post-processing tool to choose the right binary to interpret
the dump.

The output can be fed to GNU addr2line to resolve function names given
an ELF binary compiled with debug information. The "-i" flag is
recommended to improve display in case of inlined functions. The *.dump
files generated during the build process can also be used.

The function works in AArch64 and AArch32. In AArch32 it only works in
A32 mode (without T32 interworking), which is enforced in the Makefile.

Sample output of a backtrace at EL3:

    BACKTRACE: START: function_name
    0: EL3: 0x798
    1: EL3: 0x538
    2: EL3: 0x550
    3: EL3: 0x55c
    4: EL3: 0x568
    5: EL3: 0x5a8
    6: EL3: 0xf4
    BACKTRACE: END: function_name

In order to enable it the new option ENABLE_BACKTRACE must be set to 1.
This option is set to 1 by default only in AArch64 debug builds. As
usual, it can be overridden by the platform makefile and in the build
command line.

Change-Id: Icaff39b0e5188329728be2f3c72b868b2368e794
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
6 years agoAllow manually setting the AArch32 instruction set
Antonio Nino Diaz [Wed, 8 Aug 2018 15:28:43 +0000 (16:28 +0100)]
Allow manually setting the AArch32 instruction set

At the moment the AArch32 instruction set isn't specified in the command
line, which means that the compiler is free to choose the one it sees
fit. This decision may change between compiler versions, so it is better
to specify it manually.

The build option AARCH32_INSTRUCTION_SET has been introduced for this
reason. This option can be set to T32 or A32 to pass the correct flags
to the compiler.

The current behaviour is to default to T32 due to it's smaller size.

Change-Id: I02297eb1d9404b5868ff7c054fbff9b3cda7fdb6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1545 from npoushin/integration
Soby Mathew [Thu, 30 Aug 2018 04:37:32 +0000 (05:37 +0100)]
Merge pull request #1545 from npoushin/integration

maintainers: Update maintainer for sgi/sgm platforms

6 years agoMerge pull request #1514 from glneo/for-upstream-psci
Soby Mathew [Thu, 30 Aug 2018 04:37:13 +0000 (05:37 +0100)]
Merge pull request #1514 from glneo/for-upstream-psci

K3 PSCI Support

6 years agocontext_mgmt: Fix HANDLE_EA_EL3_FIRST implementation
Julius Werner [Tue, 28 Aug 2018 21:45:43 +0000 (14:45 -0700)]
context_mgmt: Fix HANDLE_EA_EL3_FIRST implementation

This patch fixes a bug in the context management code that causes it to
ignore the HANDLE_EA_EL3_FIRST compile-time option and instead always
configure SCR_EL3 to force all external aborts to trap into EL3. The
code used #ifdef to read compile-time option declared with add_define in
the Makefile... however, those options are always defined, they're just
defined to either 0 or 1, so #if is the correct syntax to check for
them. Also update the documentation to match.

This bug has existed since the Nov 2017 commit 76454abf4 (AArch64:
Introduce External Abort handling), which changed the
HANDLE_EA_EL3_FIRST option to use add_define.

Change-Id: I7189f41d0daee78fa2fcf4066323e663e1e04d3d
Signed-off-by: Julius Werner <jwerner@chromium.org>
6 years agomaintainers: Update maintainer for sgi/sgm platforms
Nariman Poushin [Wed, 29 Aug 2018 15:27:52 +0000 (16:27 +0100)]
maintainers: Update maintainer for sgi/sgm platforms

6 years agoMerge pull request #1543 from Yann-lms/drivers_st
Dimitris Papastamos [Tue, 28 Aug 2018 09:18:17 +0000 (10:18 +0100)]
Merge pull request #1543 from Yann-lms/drivers_st

maintainers: add drivers folders for STM32MP1

6 years agoMerge pull request #1538 from jts-arm/typos
Dimitris Papastamos [Tue, 28 Aug 2018 09:07:21 +0000 (10:07 +0100)]
Merge pull request #1538 from jts-arm/typos

Remove unnecessary casts

6 years agoMerge pull request #1536 from jts-arm/dsu
Dimitris Papastamos [Tue, 28 Aug 2018 09:07:02 +0000 (10:07 +0100)]
Merge pull request #1536 from jts-arm/dsu

DSU erratum 936184 workaround: bug fix

6 years agoMerge pull request #1531 from MISL-EBU-System-SW/marvell-plat-updates
Dimitris Papastamos [Tue, 28 Aug 2018 09:06:00 +0000 (10:06 +0100)]
Merge pull request #1531 from MISL-EBU-System-SW/marvell-plat-updates

plat: marvell: bl31: Update the early platform setup API

6 years agomaintainers: add drivers folders for STM32MP1
Yann Gautier [Tue, 28 Aug 2018 09:01:59 +0000 (11:01 +0200)]
maintainers: add drivers folders for STM32MP1

Folders drivers/st/ and include/drivers/st/ are added in maintainers.rst,
under STM32MP1 platform port.
This will allow notifications for the files modified there.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agozynqmp: pm: Add API to get number of clocks
Rajan Vaja [Fri, 20 Jul 2018 10:16:27 +0000 (03:16 -0700)]
zynqmp: pm: Add API to get number of clocks

Currently in Linux maximum number of clocks is hard-coded and
so it needs to allocate static memory. It can get actual clock
number after querying all clock names by special clock name
string. Add new query data parameter to get actual number of
clocks so Linux can get actual clock numbers in advance.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
6 years agoFixed ARM-software/tf-issues#603
nathan-menhorn [Tue, 17 Jul 2018 15:08:30 +0000 (09:08 -0600)]
Fixed ARM-software/tf-issues#603

Updated optee_utils.c to fix ARM-software/tf-issues#603 related to the
tee-validate-header bug.

Minor updates to the header valid checking logic. It would never make
sense to have less than 1 image to load so this is now checked.

Changed OPTEE_MAX_IMAGE_NUM to OPTEE_MAX_NUM_IMAGES to clarify its
definition. OPTEE_MAX_IMAGE_NUM sounds like an ID assigned to the last
image to load. OPTEE_MAX_NUM_IMAGES sounds like the maximum number of
images to load.

Signed-off-by: Nathan Menhorn <nathan.menhorn@xilinx.com>
6 years agoDSU erratum 936184 workaround: bug fix
John Tsichritzis [Wed, 22 Aug 2018 09:40:33 +0000 (10:40 +0100)]
DSU erratum 936184 workaround: bug fix

The initial implementation was corrupting registers that it shouldn't.
Now this is fixed.

Change-Id: Iaa407c18e668b2d9381391bf10d6876fe936aded
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agoRemove unnecessary casts
John Tsichritzis [Thu, 23 Aug 2018 08:57:54 +0000 (09:57 +0100)]
Remove unnecessary casts

Small patch which removes some redundant casts to (void *).

Change-Id: If1cfd68f2989bac1d39dbb3d1c31d4119badbc21
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agoti: k3: common: Add basic PSCI reset support
Andrew F. Davis [Thu, 24 May 2018 16:15:42 +0000 (11:15 -0500)]
ti: k3: common: Add basic PSCI reset support

Use TI-SCI messages to request reset from system controller firmware.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoti: k3: common: Add basic PSCI core on support
Andrew F. Davis [Thu, 24 May 2018 16:15:42 +0000 (11:15 -0500)]
ti: k3: common: Add basic PSCI core on support

Use TI-SCI messages to request core start from system controller
firmware.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoti: k3: drivers: ti_sci: Add support for Processor control
Andrew F. Davis [Fri, 4 May 2018 19:06:13 +0000 (19:06 +0000)]
ti: k3: drivers: ti_sci: Add support for Processor control

TI-SCI message protocol provides support for controlling of various
physical cores available in the SoC. In order to control which host is
capable of controlling a physical processor core, there is a processor
access control list that needs to be populated as part of the board
configuration data.

Introduce support for the set of TI-SCI message protocol APIs that
provide us with this capability of controlling physical cores.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
6 years agoti: k3: drivers: ti_sci: Add support for Core control
Andrew F. Davis [Fri, 4 May 2018 19:06:12 +0000 (19:06 +0000)]
ti: k3: drivers: ti_sci: Add support for Core control

Since system controller now has control over SoC power management, core
operation such as reset need to be explicitly requested to reboot the SoC.
Add support for this here.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
6 years agoti: k3: drivers: ti_sci: Add support for Clock control
Andrew F. Davis [Fri, 4 May 2018 19:06:11 +0000 (19:06 +0000)]
ti: k3: drivers: ti_sci: Add support for Clock control

TI-SCI message protocol provides support for management of various
hardware entities within the SoC.

In general, we expect to function at a device level of abstraction,
however, for proper operation of hardware blocks, many clocks directly
supplying the hardware block needs to be queried or configured.

Introduce support for the set of TI-SCI message protocol support that
provide us with this capability.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
6 years agoti: k3: drivers: ti_sci: Add support for Device control
Andrew F. Davis [Fri, 4 May 2018 19:06:10 +0000 (19:06 +0000)]
ti: k3: drivers: ti_sci: Add support for Device control

TI-SCI message protocol provides support for management of various
hardware entitites within the SoC.

We introduce the fundamental device management capability support to
the driver protocol as part of this change.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
6 years agoti: k3: drivers: Add support for TI System Control Interface protocol
Andrew F. Davis [Fri, 4 May 2018 19:06:09 +0000 (19:06 +0000)]
ti: k3: drivers: Add support for TI System Control Interface protocol

Texas Instrument's System Control Interface (TI-SCI) Message Protocol
is used in Texas Instrument's System on Chip (SoC) such as those
in K3 family AM654x SoCs to communicate between various compute
processors with a central system controller entity.

TI-SCI message protocol provides support for management of various
hardware entities within the SoC. Add support driver to allow
communication with system controller entity within the SoC.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
6 years agoti: k3: drivers: Add Secure Proxy driver
Andrew F. Davis [Fri, 4 May 2018 19:06:08 +0000 (19:06 +0000)]
ti: k3: drivers: Add Secure Proxy driver

Secure Proxy module manages hardware threads that are meant
for communication between the processor entities. Add support
for this here.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoMerge pull request #1528 from antonio-nino-diaz-arm/an/libc
Dimitris Papastamos [Wed, 22 Aug 2018 13:40:50 +0000 (14:40 +0100)]
Merge pull request #1528 from antonio-nino-diaz-arm/an/libc

libc: Cleanup library

6 years agolibc: armclang: Implement compiler printf symbols
Antonio Nino Diaz [Thu, 16 Aug 2018 14:42:44 +0000 (15:42 +0100)]
libc: armclang: Implement compiler printf symbols

armclang replaces calls to printf by calls to one of the symbols
__0printf, __1printf or __2printf. This patch adds new functions with
these names that internally call printf so that the Trusted Firmware can
be compiled with this compiler.

Change-Id: I06a0e3e5001232fe5b2577615666ddd66e81eef0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Use printf and snprintf across codebase
Antonio Nino Diaz [Thu, 16 Aug 2018 15:46:06 +0000 (16:46 +0100)]
libc: Use printf and snprintf across codebase

tf_printf and tf_snprintf are now called printf and snprintf, so the
code needs to be updated.

Change-Id: Iffeee97afcd6328c4c2d30830d4923b964682d71
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Move tf_printf and tf_snprintf to libc
Antonio Nino Diaz [Wed, 15 Aug 2018 16:02:28 +0000 (17:02 +0100)]
libc: Move tf_printf and tf_snprintf to libc

Change their names to printf and snprintf. They are much smaller than
the previous versions we had, which makes them better suited for the
Trusted Firmware.

Change-Id: Ia872af91b7b967c47fce012eccecede7873a3daf
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agotf_printf: Return number of printed characters
Antonio Nino Diaz [Wed, 15 Aug 2018 15:52:32 +0000 (16:52 +0100)]
tf_printf: Return number of printed characters

The C standard says that printf() has to return the number of characters
it has printed.

Change-Id: I0ef50b1d6766d140724ac0a2fa2c5d023431f984
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Fix all includes in codebase
Antonio Nino Diaz [Thu, 16 Aug 2018 15:52:57 +0000 (16:52 +0100)]
libc: Fix all includes in codebase

The codebase was using non-standard headers. It is needed to replace
them by the correct ones so that we can use the new libc headers.

Change-Id: I530f71d9510cb036e69fe79823c8230afe890b9d
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Cleanup SCC headers
Antonio Nino Diaz [Tue, 14 Aug 2018 12:39:29 +0000 (13:39 +0100)]
libc: Cleanup SCC headers

Only leave the parts relevant to the Trusted Firmware.

Change-Id: I0444c16e402f6c1629211d03bf6cb32ca3dbcf59
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Add AArch32 and AArch64 headers
Antonio Nino Diaz [Wed, 15 Aug 2018 18:51:09 +0000 (19:51 +0100)]
libc: Add AArch32 and AArch64 headers

Change-Id: I4f58bb4660078c9bc76d2826c90b2fa711719a3e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Introduce files from SCC
Antonio Nino Diaz [Fri, 17 Aug 2018 09:45:47 +0000 (10:45 +0100)]
libc: Introduce files from SCC

Taken from http://git.simple-cc.org/scc/ from the following commit:

67508ad14af314cea2229783d3c084f28c41daf0

Permission has been granted from the author to use them under the
license BSD-3-Clause instead of ISC.

Change-Id: I65c0ce3ab60c49d34a57533af12a74bd7bde88e5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Cleanup FreeBSD files
Antonio Nino Diaz [Mon, 13 Aug 2018 18:41:17 +0000 (19:41 +0100)]
libc: Cleanup FreeBSD files

Remove code specific to FreeBSD so that they can be used in this
repository.

Change-Id: I5c11eb5b3c05a7fb91aed08371a1f7a0e6122a94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Import files from FreeBSD
Antonio Nino Diaz [Mon, 13 Aug 2018 18:39:40 +0000 (19:39 +0100)]
libc: Import files from FreeBSD

From commit aafd1cf4235d78ce85b76d7da63e9589039344b3:

- sys/sys/endian.h
- sys/arm/include/endian.h
- sys/arm64/include/endian.h
- sys/sys/errno.h
- lib/libc/strchr.c
- lib/libc/strcmp.c
- lib/libc/strncmp.c
- lib/libc/strnlen.c

strcasecmp() hasn't been imported.

Change-Id: I8a0787aec9ba8960a008fb5c66f7a73c84919b93
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Introduce cdefs.h, assert.h and strlen.c
Antonio Nino Diaz [Mon, 13 Aug 2018 18:51:26 +0000 (19:51 +0100)]
libc: Introduce cdefs.h, assert.h and strlen.c

Change-Id: I76091d52571f1950111c4b1670d5fc3883607715
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Cleanup remaining files
Antonio Nino Diaz [Thu, 16 Aug 2018 13:53:05 +0000 (14:53 +0100)]
libc: Cleanup remaining files

The existing files had some style problems that this patch fixes.

Change-Id: I794e0d96e52f8da0ffa0d70a41f36c4432b4e563
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Remove printf-like functions
Antonio Nino Diaz [Wed, 15 Aug 2018 15:54:55 +0000 (16:54 +0100)]
libc: Remove printf-like functions

They are too big for the Trusted Firmware, and it can be confusing to
have two versions of the same functions with different names. tf_printf
and tf_snprintf will replace them in the next patch.

Change-Id: I978414ac169cc3156e249549ef101a70eb31a295
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Remove sscanf() and timingsafe_bcmp()
Antonio Nino Diaz [Fri, 17 Aug 2018 08:46:43 +0000 (09:46 +0100)]
libc: Remove sscanf() and timingsafe_bcmp()

sscanf() is unused and it doesn't work, so it doesn't make sense to
keep it.

timingsafe_bcmp() isn't used anywhere.

Change-Id: Ib5d28ff21d0f3ccc36c5c0fb5474b3384105cf80
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Remove non-Arm files
Antonio Nino Diaz [Tue, 14 Aug 2018 12:17:41 +0000 (13:17 +0100)]
libc: Remove non-Arm files

Remove all files that don't have only Arm copyright. This is the first
step to cleanup the C library in this repository. They will be re-added
in the following patches.

Change-Id: I72c40a1620d1df3228fc397ec695d569a20245fd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1532 from jeenu-arm/misra-fixes
Dimitris Papastamos [Wed, 22 Aug 2018 09:25:41 +0000 (10:25 +0100)]
Merge pull request #1532 from jeenu-arm/misra-fixes

MISRA fixes

6 years agoMerge pull request #1533 from jeenu-arm/mpam
Dimitris Papastamos [Wed, 22 Aug 2018 09:24:24 +0000 (10:24 +0100)]
Merge pull request #1533 from jeenu-arm/mpam

AArch64: Enable MPAM for lower ELs

6 years agoMerge pull request #1530 from antonio-nino-diaz-arm/an/rpi3-deprecated
Dimitris Papastamos [Wed, 22 Aug 2018 09:24:06 +0000 (10:24 +0100)]
Merge pull request #1530 from antonio-nino-diaz-arm/an/rpi3-deprecated

rpi3: Migrate from deprecated APIs

6 years agoMerge pull request #1526 from robertovargas-arm/arm-memprotect
Dimitris Papastamos [Wed, 22 Aug 2018 09:23:52 +0000 (10:23 +0100)]
Merge pull request #1526 from robertovargas-arm/arm-memprotect

memprotect: Move files to specific platform makefiles

6 years agomemprotect: Move files to specific platform makefiles
Roberto Vargas [Mon, 6 Aug 2018 12:35:31 +0000 (13:35 +0100)]
memprotect: Move files to specific platform makefiles

All the arm platforms were including the files related to
mem-protect. This configuration generates some problems
with new platforms that don't support such functionality,
and for that reason this patch moves these files to the
platform specific makefiles.

Change-Id: I6923e5224668b76667795d8e11723cede7979b1e
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoMerge pull request #1388 from vwadekar/report-cve-2017-5715
Dimitris Papastamos [Mon, 20 Aug 2018 13:57:39 +0000 (14:57 +0100)]
Merge pull request #1388 from vwadekar/report-cve-2017-5715

cpus: denver: report CVE_2017_5715 mitigation to higher layers

6 years agoMerge pull request #1524 from danielboulby-arm/db/ReclaimInit
Dimitris Papastamos [Mon, 20 Aug 2018 08:38:17 +0000 (09:38 +0100)]
Merge pull request #1524 from danielboulby-arm/db/ReclaimInit

rockchip: Add plat_is_my_cpu_primary function

6 years agoMerge pull request #1523 from jts-arm/dsu
Dimitris Papastamos [Mon, 20 Aug 2018 08:37:16 +0000 (09:37 +0100)]
Merge pull request #1523 from jts-arm/dsu

DSU erratum 936184 workaround

6 years agoSiP: MISRA fixes for execution state switch
Jeenu Viswambharan [Thu, 2 Aug 2018 09:14:12 +0000 (10:14 +0100)]
SiP: MISRA fixes for execution state switch

These changes address most of the required MISRA rules. In the process,
some from generic code is also fixed.

No functional changes.

Change-Id: I707dbec9b34b802397e99da2f5ae738165d6feba
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoRAS: MISRA fixes
Jeenu Viswambharan [Thu, 2 Aug 2018 09:14:12 +0000 (10:14 +0100)]
RAS: MISRA fixes

These changes address most of the required MISRA rules. In the process,
some from generic code is also fixed.

No functional changes.

Change-Id: I76cacf6e1d73b09510561b5090c2bb66d81bec88
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>