project/bcm63xx/atf.git
6 years agoMerge pull request #1636 from antonio-nino-diaz-arm/an/console
Antonio Niño Díaz [Thu, 25 Oct 2018 09:54:57 +0000 (11:54 +0200)]
Merge pull request #1636 from antonio-nino-diaz-arm/an/console

 Deprecate weak crash console functions

6 years agoMerge pull request #1640 from soby-mathew/sm/fin_con_reg
Antonio Niño Díaz [Thu, 25 Oct 2018 09:54:22 +0000 (11:54 +0200)]
Merge pull request #1640 from soby-mathew/sm/fin_con_reg

Multi-console: Deprecate the `finish_console_register` macro

6 years agoDeprecate weak crash console functions
Antonio Nino Diaz [Wed, 17 Oct 2018 15:49:26 +0000 (16:49 +0100)]
Deprecate weak crash console functions

The default behaviour of the plat_crash_console_xxx functions isn't
obvious to someone that hasn't read all the documentation. As they are
not mandatory, it is unlikely that the code will be checked when doing a
platform port, which may mean that some platforms may not have crash
console support at all.

The idea of this patch is to force platform maintainers to decide how
the crash console has to behave so that the final behaviour isn't
unexpected.

Change-Id: I40b2a7b56c5530c1dcd63eace5bd37ae6335056e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agorockchip: Use common crash console functions
Antonio Nino Diaz [Tue, 16 Oct 2018 15:39:12 +0000 (16:39 +0100)]
rockchip: Use common crash console functions

This platform depends on weak functions defined in
``plat/common/aarch64/platform_helpers.S`` that are going to be removed.

Change-Id: I5104d091c32271d77ed9690e9dc257c061289def
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoAdd sample crash console functions
Antonio Nino Diaz [Tue, 16 Oct 2018 13:32:34 +0000 (14:32 +0100)]
Add sample crash console functions

Platforms that wish to use the sample functions have to add the file to
their Makefile. It is not included by default.

Change-Id: I713617bb58dc218967199248f68da86241d7ec40
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoplat/arm: Make crash console functions strong
Antonio Nino Diaz [Tue, 16 Oct 2018 13:10:15 +0000 (14:10 +0100)]
plat/arm: Make crash console functions strong

In Arm platforms the crash console doesn't print anything if the crash
happens early enough. This happens in all images, not only BL1. The
reason is that they the files ``plat/common/aarch64/platform_helpers.S``
and ``plat/arm/common/aarch64/arm_helpers.S``, and the crash console
functions are defined as weak in both files. In practice, the linker
can pick the one in ``plat/common``, which simply switches the multi
console to crash mode when it wants to initialize the crash console.
In the case of Arm platforms, there are no console drivers registered
at that point, so nothing is printed.

This patch makes the functions in plat/arm strong so that they override
the weak functions in plat/common.

Change-Id: Id358db7d2567d7df0951790a695636cf6c9ac57f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoAdd plat_crash_console_flush to platforms without it
Antonio Nino Diaz [Wed, 17 Oct 2018 14:29:34 +0000 (15:29 +0100)]
Add plat_crash_console_flush to platforms without it

Even though at this point plat_crash_console_flush is optional, it will
stop being optional in a following patch.

The console driver of warp7 doesn't support flush, so the implementation
is a placeholder.

TI had ``plat_crash_console_init`` and ``plat_crash_console_putc``, but
they weren't global so they weren't actually used. Also, they were
calling the wrong functions.

imx8_helpers.S only has placeholders for all of the functions.

Change-Id: I8d17bbf37c7dad74e134c61ceb92acb9af497718
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agozynqmp: Remove dependency on arm_helpers.S
Antonio Nino Diaz [Wed, 17 Oct 2018 15:46:41 +0000 (16:46 +0100)]
zynqmp: Remove dependency on arm_helpers.S

Non-Arm platforms shouldn't use Arm platform code. This patch copies the
implementation of the functions in arm_helpers.S to zynqmp_helpers.S to
remove this dependency of zynqmp on Arm platforms.

Change-Id: Ia85f303c4c63bcf0ffa57c7f3ef9d88376729b6b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1637 from antonio-nino-diaz-arm/an/rpi3-dtb
Antonio Niño Díaz [Wed, 24 Oct 2018 15:54:05 +0000 (17:54 +0200)]
Merge pull request #1637 from antonio-nino-diaz-arm/an/rpi3-dtb

rpi3: Add mem reserve region to DTB if present

6 years agorpi3: Add mem reserve region to DTB if present
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:16 +0000 (00:57 +0100)]
rpi3: Add mem reserve region to DTB if present

When a device tree blob is present at a known address, instead of, for
example, relying on the user modifying the Linux command line to warn
about the memory reserved for the Trusted Firmware, pass it on the DTB.

The current code deletes the memory reserved for the default bootstrap
of the Raspberry Pi and adds the region used by the Trusted Firmware.

This system replaces the previous one consisting on adding
``memmap=16M$256M`` to the Linux command line. It's also meant to be
used by U-Boot and any other bootloader that understands DTB files.

Change-Id: I13ee528475fb043d6e8d9e9f24228e37ac3ac436
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1643 from antonio-nino-diaz-arm/an/libfdt
Antonio Niño Díaz [Wed, 24 Oct 2018 09:30:18 +0000 (11:30 +0200)]
Merge pull request #1643 from antonio-nino-diaz-arm/an/libfdt

Update libfdt to version 1.4.7

6 years agoMerge pull request #1639 from chandnich/scmi-update
Antonio Niño Díaz [Wed, 24 Oct 2018 09:30:09 +0000 (11:30 +0200)]
Merge pull request #1639 from chandnich/scmi-update

plat/arm/scmi: introduce plat_css_get_scmi_info API

6 years agoMerge pull request #1641 from jeenu-arm/ptrauth
Antonio Niño Díaz [Wed, 24 Oct 2018 09:29:57 +0000 (11:29 +0200)]
Merge pull request #1641 from jeenu-arm/ptrauth

AArch64: Enable lower ELs to use pointer authentication

6 years agolibfdt: Import version v1.4.7
Antonio Nino Diaz [Thu, 18 Oct 2018 23:56:54 +0000 (00:56 +0100)]
libfdt: Import version v1.4.7

Change-Id: Iad7adaf0b16a3d086594cb3432210ac2c4e207f8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibfdt: Remove current version
Antonio Nino Diaz [Thu, 18 Oct 2018 23:56:46 +0000 (00:56 +0100)]
libfdt: Remove current version

The current version of libfdt (1.4.2) has been modified to integrate it
in this repository. In order to do a clean import it is needed to remove
the current version first.

Change-Id: I2cab8c8e5632280d282fa7a2f2339768a0ad1e0f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agojuno: Increase BL2 max size
Antonio Nino Diaz [Tue, 23 Oct 2018 17:31:08 +0000 (18:31 +0100)]
juno: Increase BL2 max size

Version 1.4.7 of libfdt is bigger than the current one (1.4.2) and the
current reserved space for BL2 in Juno isn't enough to fit the Trusted
Firmware when compiling with clang or armclang.

Change-Id: I7b73394ca60d17f417773f56dd5b3d54495a45a8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Integrate strrchr in libc
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:10 +0000 (00:57 +0100)]
libc: Integrate strrchr in libc

Change-Id: I3ddc07cb02d73cd7614af7a5b21827aae155f9a0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agolibc: Import strrchr from FreeBSD
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:01 +0000 (00:57 +0100)]
libc: Import strrchr from FreeBSD

Imported from lib/libc/string/strrchr.c from commit:

59fd2fb98e4cc7e9bfc89598e28e21d405fd470c

Change-Id: I898206c6f0372d4d211c149ec0fb9522d0a5b01c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1648 from jforissier/qemu-dt-1M
Antonio Niño Díaz [Tue, 23 Oct 2018 16:11:52 +0000 (18:11 +0200)]
Merge pull request #1648 from jforissier/qemu-dt-1M

qemu: increase PLAT_QEMU_DT_MAX_SIZE to 1 MiB

6 years agoMerge pull request #1645 from antonio-nino-diaz-arm/an/fix-windows
Antonio Niño Díaz [Tue, 23 Oct 2018 13:39:01 +0000 (15:39 +0200)]
Merge pull request #1645 from antonio-nino-diaz-arm/an/fix-windows

Makefile: Fix verbose builds on Windows

6 years agoMerge pull request #1634 from antonio-nino-diaz-arm/an/tzc
Antonio Niño Díaz [Tue, 23 Oct 2018 13:05:31 +0000 (15:05 +0200)]
Merge pull request #1634 from antonio-nino-diaz-arm/an/tzc

tzc: Fix MISRA defects

6 years agotzc: Fix MISRA defects
Antonio Nino Diaz [Mon, 15 Oct 2018 13:58:11 +0000 (14:58 +0100)]
tzc: Fix MISRA defects

The definitions FAIL_CONTROL_*_SHIFT were incorrect, they have been
fixed.

The types tzc_region_attributes_t and tzc_action_t have been removed and
replaced by unsigned int because it is not allowed to do logical
operations on enums.

Also, fix some address definitions in arm_def.h.

Change-Id: Id37941d76883f9fe5045a5f0a4224c133c504d8b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMulti-console: Deprecate the `finish_console_register` macro
Soby Mathew [Wed, 10 Oct 2018 15:03:09 +0000 (16:03 +0100)]
Multi-console: Deprecate the `finish_console_register` macro

The `finish_console_register` macro is used by the multi console
framework to register the `console_t` driver callbacks. It relied
on weak references to the `ldr` instruction to populate 0 to the
callback in case the driver has not defined the appropriate
function. Use of `ldr` instruction to load absolute address to a
reference makes the binary position dependant. These instructions
should be replaced with adrp/adr instruction for position independant
executable(PIE). But adrp/adr instructions don't work well with weak
references as described in GNU ld bugzilla issue 22589.

This patch defines a new version of `finish_console_register` macro
which can spcify which driver callbacks are valid and deprecates the
old one. If any of the argument is not specified, then the macro
populates 0 for that callback. Hence the functionality of the previous
deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
is used to select the new variant of the macro and will be removed
once the deprecated variant is removed.

All the upstream console drivers have been migrated to use the new
macro in this patch.

NOTE: Platforms be aware that the new variant of the
`finish_console_register` should be used and the old variant is
deprecated.

Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMakefile: Fix verbose builds on Windows
Antonio Nino Diaz [Fri, 19 Oct 2018 14:44:30 +0000 (15:44 +0100)]
Makefile: Fix verbose builds on Windows

Commit <ee1ba6d4ddf1> ("Makefile: Support totally quiet output with -s")
broke verbose (V=1) builds on Windows. This patch fixes it by adding
helpers to silence echo prints in a OS-dependent way.

Change-Id: I24669150457516e9fb34fa32fa103398efe8082d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoqemu: increase PLAT_QEMU_DT_MAX_SIZE to 1 MiB
Jerome Forissier [Thu, 18 Oct 2018 14:41:25 +0000 (16:41 +0200)]
qemu: increase PLAT_QEMU_DT_MAX_SIZE to 1 MiB

Since upstream QEMU commit 14ec3cbd7c1e ("device_tree: Increase
FDT_MAX_SIZE to 1 MiB"), which is included in release v2.12.1
and later, BL2 initialization fails with the following error (-3 is
-FDT_ERR_NOSPACE):

 ERROR:   Invalid Device Tree at 0x40000000: error -3

Increase PLAT_QEMU_DT_MAX_SIZE accordingly.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
6 years agoplat/arm/scmi: introduce plat_css_get_scmi_info API
Chandni Cherukuri [Thu, 11 Oct 2018 08:38:08 +0000 (14:08 +0530)]
plat/arm/scmi: introduce plat_css_get_scmi_info API

The default values of 'plat_css_scmi_plat_info' is not applicable for
all the platforms. There should be a provision to let platform code to
register a platform specific instance of scmi_channel_plat_info_t.

Add a new API 'plat_css_get_scmi_info' which lets the platform to
register a platform specific instance of scmi_channel_plat_info_t and
remove the default values.

In addition to this, the existing 'plat_css_scmi_plat_info' structure
is removed from the common code and instantiated for the platforms that
need it. This allows for a consistent provisioning of the SCMI channel
information across all the existing and upcoming platforms.

Change-Id: I4fb65d7f2f165b78697b4677f1e8d81edebeac06
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
6 years agoMerge pull request #1632 from Yann-lms/stm32mp1_mmc
Soby Mathew [Thu, 18 Oct 2018 09:44:53 +0000 (10:44 +0100)]
Merge pull request #1632 from Yann-lms/stm32mp1_mmc

Add MMC support for STM32MP1

6 years agoMerge pull request #1582 from ldts/rcar_gen3/upstream
Soby Mathew [Thu, 18 Oct 2018 08:54:55 +0000 (09:54 +0100)]
Merge pull request #1582 from ldts/rcar_gen3/upstream

rcar_gen3: initial support

6 years agoMerge pull request #1553 from glneo/dcache-late-disable
Soby Mathew [Thu, 18 Oct 2018 08:49:03 +0000 (09:49 +0100)]
Merge pull request #1553 from glneo/dcache-late-disable

Allow D-Cache to remain on during core power-down

6 years agoMerge pull request #1629 from robertovargas-arm/hw-assisted-coherency-lock
Soby Mathew [Thu, 18 Oct 2018 08:35:14 +0000 (09:35 +0100)]
Merge pull request #1629 from robertovargas-arm/hw-assisted-coherency-lock

Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled

6 years agoMerge pull request #1631 from deepan02/deepak-arm/relocate-jump_if_cpu_midr
Soby Mathew [Thu, 18 Oct 2018 08:34:20 +0000 (09:34 +0100)]
Merge pull request #1631 from deepan02/deepak-arm/relocate-jump_if_cpu_midr

plat/arm: relocate the jump_if_cpu_midr macro.

6 years agoMerge pull request #1628 from antonio-nino-diaz-arm/an/sharing
Soby Mathew [Thu, 18 Oct 2018 08:20:04 +0000 (09:20 +0100)]
Merge pull request #1628 from antonio-nino-diaz-arm/an/sharing

plat/arm: Small reorganization of platform code

6 years agorcar_gen3: drivers: watchdog
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:42:08 +0000 (09:42 +0200)]
rcar_gen3: drivers: watchdog

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: serial controller interface
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:53 +0000 (09:41 +0200)]
rcar_gen3: drivers: serial controller interface

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: spi multio bus controller
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:39 +0000 (09:41 +0200)]
rcar_gen3: drivers: spi multio bus controller

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: rom api
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:21 +0000 (09:41 +0200)]
rcar_gen3: drivers: rom api

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: power controller
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:10 +0000 (09:41 +0200)]
rcar_gen3: drivers: power controller

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: console
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:00 +0000 (09:41 +0200)]
rcar_gen3: drivers: console

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: io [emmc/mem]
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:40:45 +0000 (09:40 +0200)]
rcar_gen3: drivers: io [emmc/mem]

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: i2c dvfs
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:40:26 +0000 (09:40 +0200)]
rcar_gen3: drivers: i2c dvfs

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: emmc
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:56 +0000 (09:39 +0200)]
rcar_gen3: drivers: emmc

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: dma
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:48 +0000 (09:39 +0200)]
rcar_gen3: drivers: dma

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: micro delay generator
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:37 +0000 (09:39 +0200)]
rcar_gen3: drivers: micro delay generator

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: cpld
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:19 +0000 (09:39 +0200)]
rcar_gen3: drivers: cpld

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: board identification
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:11 +0000 (09:39 +0200)]
rcar_gen3: drivers: board identification

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: avs [adaptive voltage scaling]
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:38:56 +0000 (09:38 +0200)]
rcar_gen3: drivers: avs [adaptive voltage scaling]

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: authentication
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:38:24 +0000 (09:38 +0200)]
rcar_gen3: drivers: authentication

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agorcar_gen3: drivers: staging
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:36:52 +0000 (09:36 +0200)]
rcar_gen3: drivers: staging

 - ddr
 - pfc [pin function controller]
 - qos [bandwidth]

checkpatch.pl is generating too many errors.

6 years agorcar-gen3: initial commit for the rcar-gen3 boards
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:36:13 +0000 (09:36 +0200)]
rcar-gen3: initial commit for the rcar-gen3 boards

Reference code:
==============

rar_gen3: IPL and Secure Monitor Rev1.0.22
https://github.com/renesas-rcar/arm-trusted-firmware [rcar_gen3]

Author: Takuya Sakata <takuya.sakata.wz@bp.renesas.com>
Date:   Thu Aug 30 21:26:41 2018 +0900
Update IPL and Secure Monitor Rev1.0.22

General Information:
===================

This port has been tested on the Salvator-X Soc_id r8a7795 revision
ES1.1 (uses an SPD).

Build Tested:
-------------
ATFW_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1"
MBEDTLS_DIR=$mbedtls

$ make clean bl2 bl31 rcar PLAT=rcar ${ATFW_OPT} SPD=opteed

Other dependencies:
------------------
* mbed_tls:
  git@github.com:ARMmbed/mbedtls.git [devel]

  Merge: 68dbc94 f34a4c1
  Author: Simon Butcher <simon.butcher@arm.com>
  Date:   Thu Aug 30 00:57:28 2018 +0100

* optee_os:
  https://github.com/BayLibre/optee_os

  Until it gets merged into OP-TEE, the port requires Renesas' Trusted
  Environment with a modification to support power management.

  Author: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
  Date:   Thu Aug 30 16:49:49 2018 +0200
    plat-rcar: cpu-suspend: handle the power level
Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
* u-boot:
  The port has beent tested using mainline uboot.

  Author: Fabio Estevam <festevam@gmail.com>
  Date:   Tue Sep 4 10:23:12 2018 -0300

*linux:
  The port has beent tested using mainline kernel.

  Author: Linus Torvalds <torvalds@linux-foundation.org>
  Date:   Sun Sep 16 11:52:37 2018 -0700
      Linux 4.19-rc4

Overview
---------

BOOTROM starts the cpu at EL3; In this port BL2 will therefore be entered
at this exception level (the Renesas' ATF reference tree [1] resets into
EL1 before entering BL2 - see its bl2.ld.S)

BL2 initializes DDR (and i2c to talk to the PMIC on some platforms)
before determining the boot reason (cold or warm).

During suspend all CPUs are switched off and the DDR is put in
backup mode (some kind of self-refresh mode). This means that BL2 is
always entered in a cold boot scenario.

Once BL2 boots, it determines the boot reason, writes it to shared
memory (BOOT_KIND_BASE) together with the BL31 parameters
(PARAMS_BASE) and jumps to BL31.

To all effects, BL31 is as if it is being entered in reset mode since
it still needs to initialize the rest of the cores; this is the reason
behind using direct shared memory access to  BOOT_KIND_BASE and
PARAMS_BASE instead of using registers to get to those locations (see
el3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use
case).

Depending on the boot reason BL31 initializes the rest of the cores:
in case of suspend, it uses a MBOX memory region to recover the
program counters.

[1] https://github.com/renesas-rcar/arm-trusted-firmware
Tests
-----

* cpuidle
  -------
   enable kernel's cpuidle arm_idle driver and boot

* system suspend
  --------------
  $ cat suspend.sh
    #!/bin/bash
    i2cset -f -y 7 0x30 0x20 0x0F
    read -p "Switch off SW23 and press return " foo
    echo mem > /sys/power/state

* cpu hotplug:
  ------------
  $ cat offline.sh
    #!/bin/bash
    nbr=$1
    echo 0 > /sys/devices/system/cpu/cpu$nbr/online
    printf "ONLINE:  " && cat /sys/devices/system/cpu/online
    printf "OFFLINE: " && cat /sys/devices/system/cpu/offline

  $ cat online.sh
    #!/bin/bash
    nbr=$1
    echo 1 > /sys/devices/system/cpu/cpu$nbr/online
    printf "ONLINE:  " && cat /sys/devices/system/cpu/online
    printf "OFFLINE: " && cat /sys/devices/system/cpu/offline

Signed-off-by: ldts <jramirez@baylibre.com>
6 years agoti: k3: common: Do not disable cache on TI K3 core powerdown
Andrew F. Davis [Fri, 12 Oct 2018 20:37:04 +0000 (15:37 -0500)]
ti: k3: common: Do not disable cache on TI K3 core powerdown

Leave the caches on and explicitly flush any data that
may be stale when the core is powered down. This prevents
non-coherent interconnect access which has negative side-
effects on AM65x.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoscmi: Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled
Roberto Vargas [Mon, 13 Nov 2017 13:41:58 +0000 (13:41 +0000)]
scmi: Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled

When HW_ASSISTED_COHERENCY is enabled we can use spinlocks
instead of using the more complex and slower bakery algorithm.

Change-Id: I9d791a70050d599241169b9160a67e57d5506564
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoAArch64: Enable lower ELs to use pointer authentication
Jeenu Viswambharan [Wed, 15 Aug 2018 13:29:29 +0000 (14:29 +0100)]
AArch64: Enable lower ELs to use pointer authentication

Pointer authentication is an Armv8.3 feature that introduces
instructions that can be used to authenticate and verify pointers.

Pointer authentication instructions are allowed to be accessed from all
ELs but only when EL3 explicitly allows for it; otherwise, their usage
will trap to EL3. Since EL3 doesn't have trap handling in place, this
patch unconditionally disables all related traps to EL3 to avoid
potential misconfiguration leading to an unhandled EL3 exception.

Fixes ARM-software/tf-issues#629

Change-Id: I9bd2efe0dc714196f503713b721ffbf05672c14d
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoplat/arm: relocate the jump_if_cpu_midr macro.
Deepak Pandey [Thu, 11 Oct 2018 08:14:43 +0000 (13:44 +0530)]
plat/arm: relocate the jump_if_cpu_midr macro.

macro jump_if_cpu_midr is used commonly by many arm platform.
It has now been relocated to common place to remove duplication
of code.

Change-Id: Ic0876097dbc085df4f90eadb4b7687dde7c726da
Signed-off-by: Deepak Pandey <Deepak.Pandey@arm.com>
6 years agostm32mp1: update platform files to use MMC devices
Yann Gautier [Mon, 15 Oct 2018 07:36:58 +0000 (09:36 +0200)]
stm32mp1: update platform files to use MMC devices

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agostm32mp1: add an IO to read MMC devices
Yann Gautier [Mon, 15 Oct 2018 07:36:44 +0000 (09:36 +0200)]
stm32mp1: add an IO to read MMC devices

Whereas the GPT table is read with io_block, the binaries to be loaded
(e.g. BL33) cannot use it, as it is not suitable to read them block by
block, or the boot time would be very bad.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agostm32mp1: add an IO to read STM32IMAGE binaries
Yann Gautier [Mon, 15 Oct 2018 07:36:32 +0000 (09:36 +0200)]
stm32mp1: add an IO to read STM32IMAGE binaries

This IO is required to read binaries with STM32 header.
This header is added with the stm32image tool.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agoAdd new defines for STM32MP1 platform
Yann Gautier [Mon, 15 Oct 2018 07:36:21 +0000 (09:36 +0200)]
Add new defines for STM32MP1 platform

To boot on eMMC or SD-cards, STM32MP1 platform needs:
- GPT_IMAGE_ID to read GPT table on those devices
- STM32_IMAGE_ID and IO_TYPE_STM32IMAGE to read images with STM32 header
- IO_TYPE_MMC to have a IO for MMC devices

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agostm32mp1: add sdmmc2 driver
Yann Gautier [Mon, 15 Oct 2018 07:36:04 +0000 (09:36 +0200)]
stm32mp1: add sdmmc2 driver

This driver is for the STMicroelectronics sdmmc2 IP
which is in STM32MP1 SoC.
It uses the MMC framework, and can address either eMMC or SD-card.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agoMerge pull request #1626 from Yann-lms/partition_verbose
Dimitris Papastamos [Fri, 12 Oct 2018 16:45:56 +0000 (17:45 +0100)]
Merge pull request #1626 from Yann-lms/partition_verbose

drivers: partition: correct compilation error in VERBOSE mode

6 years agoMerge pull request #1627 from sandrine-bailleux-arm/sb/object-pool-allocator
Dimitris Papastamos [Fri, 12 Oct 2018 16:45:31 +0000 (17:45 +0100)]
Merge pull request #1627 from sandrine-bailleux-arm/sb/object-pool-allocator

Introduce object pool allocator

6 years agoMerge pull request #1630 from antonio-nino-diaz-arm/an/fix-console
Dimitris Papastamos [Fri, 12 Oct 2018 16:45:09 +0000 (17:45 +0100)]
Merge pull request #1630 from antonio-nino-diaz-arm/an/fix-console

pl011: cnds: cbmem: 16550: Fix comments

6 years agopl011: cnds: cbmem: 16550: Fix comments
Antonio Nino Diaz [Mon, 8 Oct 2018 12:26:48 +0000 (13:26 +0100)]
pl011: cnds: cbmem: 16550: Fix comments

The comments with the prototypes of the register functions of the
console drivers are incorrect. The arguments are wrong. This patch fixes
them.

Change-Id: I38c4b481ee69e840780111c42f03c0752eb6315c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1615 from Andre-ARM/make_s
Soby Mathew [Fri, 12 Oct 2018 13:39:50 +0000 (14:39 +0100)]
Merge pull request #1615 from Andre-ARM/make_s

Makefile: Support totally quiet output with -s

6 years agoMerge pull request #1606 from satheesbalya-arm/sb1_2603_misra_plat
Soby Mathew [Fri, 12 Oct 2018 13:19:28 +0000 (14:19 +0100)]
Merge pull request #1606 from satheesbalya-arm/sb1_2603_misra_plat

plat/arm: Fix misra warnings in platform code

6 years agoMerge pull request #1622 from bryanodonoghue/master+imx7-mmc_fix
Soby Mathew [Fri, 12 Oct 2018 13:17:59 +0000 (14:17 +0100)]
Merge pull request #1622 from bryanodonoghue/master+imx7-mmc_fix

drivers: imx: mxc_usdhc: Do not set MMC_RSP_48 for MMC_RESPONSE_R2

6 years agoMerge pull request #1624 from glneo/less-cache-flushing
Soby Mathew [Fri, 12 Oct 2018 13:16:57 +0000 (14:16 +0100)]
Merge pull request #1624 from glneo/less-cache-flushing

PSCI cache flush and comment fixup

6 years agoplat/arm: Fix misra warnings in platform code
Sathees Balya [Thu, 27 Sep 2018 13:41:02 +0000 (14:41 +0100)]
plat/arm: Fix misra warnings in platform code

Change-Id: Ica944acc474a099219d50b041cfaeabd4f3d362f
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
6 years agoIntroduce object pool allocator
Sandrine Bailleux [Fri, 1 Jun 2018 12:17:08 +0000 (14:17 +0200)]
Introduce object pool allocator

The object pool allocator provides a simplistic interface to manage
allocation in a fixed-size static array. The caller creates a static
"object pool" out of such an array and may then call pool_alloc() to
get the next available object within the pool. There is also a variant
to get multiple consecutive objects: pool_alloc_n().

Note that this interface does not provide any way to free the objects
afterwards. This is by design and it is not a limitation. We do not
want to introduce complexity induced by memory freeing, such as
use-after-free bugs, memory fragmentation and so on.

Change-Id: Iefc2e153767851fbde5841a295f92ae48adda71f
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
6 years agodrivers: partition: correct compilation error in VERBOSE mode
Yann Gautier [Thu, 4 Oct 2018 17:04:17 +0000 (19:04 +0200)]
drivers: partition: correct compilation error in VERBOSE mode

Signed-off-by: Yann Gautier <yann.gautier@st.com>
6 years agoMerge pull request #1625 from ldts/psci
Soby Mathew [Thu, 11 Oct 2018 12:37:53 +0000 (13:37 +0100)]
Merge pull request #1625 from ldts/psci

psci: platform control of SYSTEM_SUSPEND entry

6 years agoplat/arm: Remove file arm_board_def.h
Antonio Nino Diaz [Thu, 11 Oct 2018 12:02:34 +0000 (13:02 +0100)]
plat/arm: Remove file arm_board_def.h

This file is shared between FVP and all CSS platforms. While it may be
true that some definitions can be common, it doesn't make sense
conceptually. For example, the stack size depends on the platform and so
does the SRAM size.

After removing them, there are not enough common definitions to justify
having this header, so the other definitions have been moved to the
platform_def.h of FVP, board_css_def.h and arm_def.h.

Change-Id: Ifbf4b017227f9dfefa1a430f67d7d6baae6a4ba1
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1621 from jts-arm/typos
Soby Mathew [Thu, 11 Oct 2018 11:00:48 +0000 (12:00 +0100)]
Merge pull request #1621 from jts-arm/typos

Various corrections of typos

6 years agoMerge pull request #1619 from antonio-nino-diaz-arm/an/norflash
Soby Mathew [Thu, 11 Oct 2018 10:59:37 +0000 (11:59 +0100)]
Merge pull request #1619 from antonio-nino-diaz-arm/an/norflash

plat/arm: Move norflash driver to drivers/ folder

6 years agopsci: platform control of SYSTEM_SUSPEND entry
ldts [Thu, 11 Oct 2018 06:40:32 +0000 (08:40 +0200)]
psci: platform control of SYSTEM_SUSPEND entry

Some platforms can only resume from system suspend from the boot
CPU, hence they should only enter that state from that same core.

The following commit presents an interface that allows the platform to
reject system suspend entry near its very last stage (last CPU).

6 years agoplat/arm: Move board_css_common.c to juno folder
Antonio Nino Diaz [Wed, 10 Oct 2018 10:02:34 +0000 (11:02 +0100)]
plat/arm: Move board_css_common.c to juno folder

This file is only used by Juno as all other CSS platforms have their own
private memory maps.

Change-Id: I1c9f27aac7b1d8bff4d92674e8bde5505b93c8c4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1620 from deepan02/deepak-arm/move-reset-to-bl31
Soby Mathew [Thu, 11 Oct 2018 08:55:00 +0000 (09:55 +0100)]
Merge pull request #1620 from deepan02/deepak-arm/move-reset-to-bl31

plat/arm: allow RESET_TO_BL31 for CSS-based platforms

6 years agoPSCI: Do not flush cache when unneeded
Andrew F. Davis [Thu, 30 Aug 2018 17:13:57 +0000 (12:13 -0500)]
PSCI: Do not flush cache when unneeded

When a platform enables its caches before it accesses the
psci_non_cpu_pd_nodes structure then explicit cache maintenance
is not needed.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoPSCI: Update comment on MMU disablement
Andrew F. Davis [Thu, 30 Aug 2018 17:08:01 +0000 (12:08 -0500)]
PSCI: Update comment on MMU disablement

The MMU is not disabled in this path, update the comment to
reflect this. Also clarify that both paths call prepare_cpu_pwr_dwn(),
but the second path does stack cache maintenance.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agoMerge pull request #1614 from MISL-EBU-System-SW/integration-fix
Soby Mathew [Wed, 10 Oct 2018 13:00:34 +0000 (14:00 +0100)]
Merge pull request #1614 from MISL-EBU-System-SW/integration-fix

Fix service CPU image load at BL2 stage and update maintainers list

6 years agoMerge pull request #1612 from antonio-nino-diaz-arm/an/tools
Soby Mathew [Wed, 10 Oct 2018 13:00:14 +0000 (14:00 +0100)]
Merge pull request #1612 from antonio-nino-diaz-arm/an/tools

tools: Make invocation of host compiler correct

6 years agoMerge pull request #1607 from girishpathak/gp/346_sgm775_earlylog_fix_v2
Soby Mathew [Wed, 10 Oct 2018 12:59:47 +0000 (13:59 +0100)]
Merge pull request #1607 from girishpathak/gp/346_sgm775_earlylog_fix_v2

plat/arm/css/sgm: Reorder early platform init

6 years agoMerge pull request #1489 from teknoraver/master
Soby Mathew [Wed, 10 Oct 2018 12:58:23 +0000 (13:58 +0100)]
Merge pull request #1489 from teknoraver/master

doimage: get rid of non null terminated strings by strncpy

6 years agodrivers: imx: mxc_usdhc: Do not set MMC_RSP_48 for MMC_RESPONSE_R2
Bryan O'Donoghue [Wed, 10 Oct 2018 11:08:33 +0000 (12:08 +0100)]
drivers: imx: mxc_usdhc: Do not set MMC_RSP_48 for MMC_RESPONSE_R2

commit 97d5db8c5cb95c7ce69ff4d36bcda2aeda143576 reverts an update to the
MMC layer that accompanied the original submission of this MMC driver this
is the right-thing-to-do in terms of the MMC spec.

Unfortunately the reversion also breaks this driver. The issue is the i.MX
controller doesn't want MMC_RSP_48 set for MMC_RESPONSE_R2.

The appropriate place to place that constraint is obviously in
drivers/imx/usdhc/imx_usdhc.c not in the shared MMC codebase. This patch
restores the logic the i.MX controller requires without breaking it for
everyone else.

Fixes: 97d5db8c5cb95c7ce69ff4d36bcda2aeda143576
Fixes: 2a82a9c95f6c06079f58d69315544a6b49cf64a4
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Jun Nie <jun.nie@linaro.org>
6 years agoFix typos in changelog
John Tsichritzis [Fri, 5 Oct 2018 13:16:26 +0000 (14:16 +0100)]
Fix typos in changelog

Change-Id: Icc6fb03abb9b4ef85931b9e3d767b5a9c271b5f3
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agodocs: Clarify usage of LOG_LEVEL
John Tsichritzis [Fri, 5 Oct 2018 11:02:29 +0000 (12:02 +0100)]
docs: Clarify usage of LOG_LEVEL

Change-Id: I1ce771a155e6e83885a00d2f05591bf98cd69854
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agoReplace S-EL3 references by EL3
John Tsichritzis [Fri, 14 Sep 2018 09:34:57 +0000 (10:34 +0100)]
Replace S-EL3 references by EL3

The "Secure" prefix (S-ELx) is valid only for S-EL0 and S-EL1 but is
meaningless for EL3, since EL3 is always secure. Hence, the "S" prefix
has been removed from wherever it was used as "S-EL3".

Change-Id: Icdeac9506d763f9f83d7297c7113aec7b85e9dbe
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agoReorder log level macro definitions for clarity
John Tsichritzis [Fri, 7 Sep 2018 13:42:09 +0000 (14:42 +0100)]
Reorder log level macro definitions for clarity

The definitions of the logging macros are reordered to be consistent
with the definitions of the log levels.

Change-Id: I6ff07b93eb64786ff147d39014d1c8e15db28444
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
6 years agoplat/arm/css/sgm: Reorder early platform init
Girish Pathak [Tue, 2 Oct 2018 14:18:34 +0000 (15:18 +0100)]
plat/arm/css/sgm: Reorder early platform init

In the function, bl1_early_platform_setup in the file
plat/arm/css/sgm/sgm_bl1_setup.c:

  plat_config_init();

  arm_bl1_early_platform_setup();

The debug messages logged by plat_config_init() are lost because
the console is initialized in the function
arm_bl1_early_platform_setup()

To see the logs of plat_config_init, this fix re-orders above calls
so that the console is initialized before call to plat_config_init.

Change-Id: I2e98f1f67c591cca24e28905acd0838ea3697a7c
Signed-off-by: Girish Pathak <girish.pathak@arm.com>
6 years agoMerge pull request #1618 from satheesbalya-arm/sb1_2601_misra_smc_pwr
Soby Mathew [Wed, 10 Oct 2018 10:35:28 +0000 (11:35 +0100)]
Merge pull request #1618 from satheesbalya-arm/sb1_2601_misra_smc_pwr

Fix misra warnings in SMC and power mgmt code

6 years agoplat/arm: Move norflash driver to drivers/ folder
Antonio Nino Diaz [Wed, 10 Oct 2018 10:14:44 +0000 (11:14 +0100)]
plat/arm: Move norflash driver to drivers/ folder

This way it can be reused by other platforms if needed.

Note that this driver is designed to work with the Versatile Express NOR
flash of Juno and FVP. In said platforms, the memory is organized as an
interleaved memory of two chips with a 16 bit word.

Any platform that wishes to reuse it with a different configuration will
need to modify the driver so that it is more generic.

Change-Id: Ic721758425864e0cf42b7b9b04bf0d9513b6022e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoplat/arm: allow RESET_TO_BL31 for CSS-based platforms
Deepak Pandey [Fri, 25 May 2018 07:13:30 +0000 (12:43 +0530)]
plat/arm: allow RESET_TO_BL31 for CSS-based platforms

This lets any future CSS platforms to use RESET_TO_BL31 flag.

Change-Id: I32a90fce43cb0c6f4d33589653a0fd6a7ecc9577
Signed-off-by: Deepak Pandey <Deepak.Pandey@arm.com>
6 years agoFix misra warnings in SMC and power mgmt code
Sathees Balya [Fri, 5 Oct 2018 12:30:59 +0000 (13:30 +0100)]
Fix misra warnings in SMC and power mgmt code

Change-Id: Ia00eba2b18804e6498d935d33ec104953e0e5e03
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
6 years agoMerge pull request #1617 from antonio-nino-diaz-arm/an/bugfix
Dimitris Papastamos [Mon, 8 Oct 2018 16:34:59 +0000 (17:34 +0100)]
Merge pull request #1617 from antonio-nino-diaz-arm/an/bugfix

xlat: Fix checks in mmap_add() and mmap_add_ctx()

6 years agoxlat: Fix checks in mmap_add() and mmap_add_ctx()
Antonio Nino Diaz [Mon, 8 Oct 2018 15:11:11 +0000 (16:11 +0100)]
xlat: Fix checks in mmap_add() and mmap_add_ctx()

Commit 79621f0038b789de23ecc8891024f7cf6aa65999 broke sgi575.

It is possible to have a region with 0 as value for the attributes. It
means device memory, read only, secure, executable. This is legitimate
if the code is in flash and the code is executed from there.

This is the case for SGI_MAP_FLASH0_RO, defined in the file
plat/arm/css/sgi/sgi_plat.c.

This problem is solved by checking both size and attributes in xlat v1.
In xlat v2, it is enough to check the granularity, as it can never be 0.

Change-Id: I7be11f1b0e51c4c2ffd560b4a6cdfbf15de2c276
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMakefile: Support totally quiet output with -s
Andre Przywara [Thu, 27 Sep 2018 09:56:05 +0000 (10:56 +0100)]
Makefile: Support totally quiet output with -s

"-s" is a command line option to the make tool, to suppress normal output,
something to the effect of prepending every line with '@' in the Makefile.
However with our V={0|1} support, we now print the shortened command line
output in any case (even with V=1, in addition to the long line!).
Normally -s helps to not miss non-fatal warnings, which tend to scroll out
of the window easily.

Introduce a new Makefile variable ECHO, to control the shortened output.
We only set it in the (current default) V=0 case, and replace every
occurence of "@echo" with that variable.
When the user specifies "-s", we set ECHO to some magic string which
changes the output line into a comment, so the output is suppressed.

Beside suppressing every output for "-s", we also avoid the redundant
short output when compiling with V=1.

This changes the output to:
==========
$ make -s PLAT=.... bl31

Built build/.../release/bl31.bin

==========
$ make PLAT=.... bl31
...
  CC      lib/libc/strncmp.c
  CC      lib/libc/strnlen.c
...
==========
$ make V=1 PLAT=.... bl31
...
gcc -DDEBUG=0 .... -o build/.../release/libc/strncmp.o
gcc -DDEBUG=0 .... -o build/.../release/libc/strnlen.o
...
==========

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 years agoplat: marvell: invoke platform specific scp_bl2 image handler
Grzegorz Jaszczyk [Thu, 4 Oct 2018 07:44:56 +0000 (09:44 +0200)]
plat: marvell: invoke platform specific scp_bl2 image handler

Before switching to new API the scp_bl2 handler was invoked from
bl2/bl2_image_load.c which was removed. Invoke the platform specific
scp_bl2 handler in analogy to ARM and HiSilicon.

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
6 years agoadd Marvell tools to maintained sources list
Konstantin Porotchkin [Sun, 7 Oct 2018 09:21:31 +0000 (12:21 +0300)]
add Marvell tools to maintained sources list

Declate Marvell's ownership on tools/doimage

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
6 years agoMerge pull request #1611 from antonio-nino-diaz-arm/an/misra-common
Dimitris Papastamos [Thu, 4 Oct 2018 15:46:53 +0000 (16:46 +0100)]
Merge pull request #1611 from antonio-nino-diaz-arm/an/misra-common

Remove some MISRA defects in common code

6 years agoMerge pull request #1610 from sandrine-bailleux-arm/sb/fix-makefile
Dimitris Papastamos [Thu, 4 Oct 2018 15:45:40 +0000 (16:45 +0100)]
Merge pull request #1610 from sandrine-bailleux-arm/sb/fix-makefile

Remove incorrect tabulation in Makefile

6 years agoMerge pull request #1583 from danielboulby-arm/db/AArch32_Multi_Console
Dimitris Papastamos [Thu, 4 Oct 2018 15:43:39 +0000 (16:43 +0100)]
Merge pull request #1583 from danielboulby-arm/db/AArch32_Multi_Console

Enable Multi Console API in AArch32