project/bcm63xx/atf.git
7 years agoxlat: Introduce function xlat_arch_tlbi_va_regime()
Douglas Raillard [Mon, 25 Sep 2017 14:23:22 +0000 (15:23 +0100)]
xlat: Introduce function xlat_arch_tlbi_va_regime()

Introduce a variant of the TLB invalidation helper function that
allows the targeted translation regime to be specified, rather than
defaulting to the current one.

This new function is useful in the context of EL3 software managing
translation tables for the S-EL1&0 translation regime, as then it
might need to invalidate S-EL1&0 TLB entries rather than EL3 ones.

Define a new enumeration to be able to represent translation regimes in
the xlat tables library.

Change-Id: Ibe4438dbea2d7a6e7470bfb68ff805d8bf6b07e5
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Co-authored-by: Douglas Raillard <douglas.raillard@arm.com>
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoxlat: Always compile TLB invalidation functions
Sandrine Bailleux [Tue, 25 Apr 2017 13:09:47 +0000 (14:09 +0100)]
xlat: Always compile TLB invalidation functions

TLB invalidation functions used to be conditionally compiled in.
They were enabled only when using the dynamic mapping feature.
because only then would we need to modify page tables on the fly.

Actually there are other use cases where invalidating TLBs is required.
When changing memory attributes in existing translation descriptors for
example. These other use cases do not necessarily depend on the dynamic
mapping feature.

This patch removes this dependency and always compile TLB invalidation
functions in. If they're not used, they will be removed from the binary
at link-time anyway so there's no consequence on the memory footprint
if these functions are not called.

Change-Id: I1c33764ae900eb00073ee23b7d0d53d4efa4dd21
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
7 years agoxlat: Introduce MAP_REGION2() macro
Sandrine Bailleux [Thu, 28 Sep 2017 20:58:12 +0000 (21:58 +0100)]
xlat: Introduce MAP_REGION2() macro

The current implementation of the memory mapping API favours mapping
memory regions using the biggest possible block size in order to
reduce the number of translation tables needed.

In some cases, this behaviour might not be desirable. When translation
tables are edited at run-time, coarse-grain mappings like that might
need splitting into finer-grain tables. This operation has a
performance cost.

The MAP_REGION2() macro allows to specify the granularity of
translation tables used for the initial mapping of a memory region.
This might increase performance for memory regions that are likely to
be edited in the future, at the expense of a potentially increased
memory footprint.

The Translation Tables Library Design Guide has been updated to
explain the use case for this macro. Also added a few intermediate
titles to make the guide easier to digest.

Change-Id: I04de9302e0ee3d326b8877043a9f638766b81b7b
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoMerge pull request #1115 from jeenu-arm/tsp-mt
davidcunado-arm [Wed, 4 Oct 2017 13:09:20 +0000 (14:09 +0100)]
Merge pull request #1115 from jeenu-arm/tsp-mt

TSP: Support multi-threading CPUs on FVP

7 years agoTSP: Support multi-threading CPUs on FVP
Jeenu Viswambharan [Tue, 3 Oct 2017 11:19:47 +0000 (12:19 +0100)]
TSP: Support multi-threading CPUs on FVP

Commit 11ad8f208db42f7729b0ce2bd16c631c293e665c added supporting
multi-threaded CPUs on FVP platform, including modifications for
calculating CPU IDs. This patch imports the strong definition of the
same CPU ID calculation on FVP platform for TSP.

Without this patch, TSP on FVP was using the default CPU ID calculation,
which would end up being wrong on CPUs with multi-threading.

Change-Id: If67fd492dfce1f57224c9e693988c4b0f89a9a9a
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1107 from geesun/qx/add_ecdsa_support
davidcunado-arm [Mon, 2 Oct 2017 14:03:16 +0000 (15:03 +0100)]
Merge pull request #1107 from geesun/qx/add_ecdsa_support

Add support for TBBR using ECDSA keys in ARM platforms

7 years agoMerge pull request #1114 from vchong/updt_docs
davidcunado-arm [Mon, 2 Oct 2017 14:03:00 +0000 (15:03 +0100)]
Merge pull request #1114 from vchong/updt_docs

hikey*: Update docs

7 years agohikey*: Update docs
Victor Chong [Fri, 29 Sep 2017 18:56:39 +0000 (19:56 +0100)]
hikey*: Update docs

Signed-off-by: Victor Chong <victor.chong@linaro.org>
7 years agoMerge pull request #1111 from douglas-raillard-arm/dr/fix_uniphier_xlat_include
davidcunado-arm [Wed, 27 Sep 2017 17:38:43 +0000 (18:38 +0100)]
Merge pull request #1111 from douglas-raillard-arm/dr/fix_uniphier_xlat_include

Uniphier: fix xlat tables lib inclusion

7 years agoUniphier: fix xlat tables lib inclusion
Douglas Raillard [Mon, 25 Sep 2017 16:48:20 +0000 (17:48 +0100)]
Uniphier: fix xlat tables lib inclusion

Uses the xlat tables library's Makefile instead of directly including
the source files in the Uniphier platform port.

Change-Id: I27294dd71bbf9bf3e82973c75324652b037e5bce
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #1110 from masahir0y/xlat
davidcunado-arm [Tue, 26 Sep 2017 17:59:10 +0000 (18:59 +0100)]
Merge pull request #1110 from masahir0y/xlat

Fix MAP_REGION for GCC 4.9

7 years agoxlat: remove cast in MAP_REGION to get back building with GCC 4.9
Masahiro Yamada [Tue, 26 Sep 2017 07:05:59 +0000 (16:05 +0900)]
xlat: remove cast in MAP_REGION to get back building with GCC 4.9

Since commit 769d65da778b ("xlat: Use MAP_REGION macro as compatibility
layer"), building with GCC 4.9 fails.

  CC      plat/arm/board/fvp/fvp_common.c
plat/arm/board/fvp/fvp_common.c:60:2: error: initializer element is not constant
  ARM_MAP_SHARED_RAM,
  ^
plat/arm/board/fvp/fvp_common.c:60:2: error: (near initialization for 'plat_arm_mmap[0]')
make: *** [Makefile:535: build/fvp/release/bl1/fvp_common.o] Error 1

Taking into account that MAP_REGION(_FLAT) is widely used in array
initializers, do not use cast.

Fixes: 769d65da778b ("xlat: Use MAP_REGION macro as compatibility layer")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoMerge pull request #1108 from sandrine-bailleux-arm/sb/fvp-utils-def
davidcunado-arm [Mon, 25 Sep 2017 22:35:37 +0000 (23:35 +0100)]
Merge pull request #1108 from sandrine-bailleux-arm/sb/fvp-utils-def

FVP: Include utils_def.h instead of utils.h

7 years agoMerge pull request #1105 from antonio-nino-diaz-arm/an/epd1-bit
davidcunado-arm [Mon, 25 Sep 2017 22:34:28 +0000 (23:34 +0100)]
Merge pull request #1105 from antonio-nino-diaz-arm/an/epd1-bit

Set TCR_EL1.EPD1 bit to 1

7 years agoMerge pull request #1106 from antonio-nino-diaz-arm/an/bit-macro
davidcunado-arm [Mon, 25 Sep 2017 17:56:48 +0000 (18:56 +0100)]
Merge pull request #1106 from antonio-nino-diaz-arm/an/bit-macro

Fix type of `unsigned long` constants

7 years agoDynamic selection of ECDSA or RSA
Qixiang Xu [Thu, 24 Aug 2017 07:26:39 +0000 (15:26 +0800)]
Dynamic selection of ECDSA or RSA

Add new option rsa+ecdsa for TF_MBEDTLS_KEY_ALG, which selects
rsa or ecdsa depending on the certificate used.

Change-Id: I08d9e99bdbba361ed2ec5624248dc382c750ad47
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
7 years agoAdd support for TBBR using ECDSA keys in ARM platforms
Qixiang Xu [Thu, 24 Aug 2017 07:12:20 +0000 (15:12 +0800)]
Add support for TBBR using ECDSA keys in ARM platforms

    - fixed compile error when KEY_ALG=ecdsa
    - add new option ecdsa for TF_MBEDTLS_KEY_ALG
    - add new option devel_ecdsa for ARM_ROTPK_LOCATION
    - add ecdsa key at plat/arm/board/common/rotpk/
    - reduce the mbedtls heap memory size to 13k

Change-Id: I3f7a6170af93fdbaaa7bf2fffb4680a9f6113c13
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
7 years agoplat/arm : update BL size macros to give BL1 and BL2 more space for TBB
Qixiang Xu [Thu, 24 Aug 2017 06:28:08 +0000 (14:28 +0800)]
plat/arm : update BL size macros to give BL1 and BL2 more space for TBB

For Trusted Board Boot, BL1 RW section and BL2 need more space to
support the ECDSA algorithm. Specifically, PLAT_ARM_MAX_BL1_RW_SIZE
is increased on ARM platforms.

And on the Juno platform:
    - BL2 size, PLAT_ARM_MAX_BL2_SIZE is increased.
    - SCP_BL2 is loaded into the space defined by BL31_BASE ->
      BL31_RW_BASE. In order to maintain the same size space for
      SCP_BL2,PLAT_ARM_MAX_BL31_SIZE is increased.

Change-Id: I379083f918b40ab1c765da4e71780d89f0058040
Co-Authored-By: David Cunado <david.cunado@arm.com>
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
7 years agoFVP: Include utils_def.h instead of utils.h
Sandrine Bailleux [Wed, 20 Sep 2017 15:39:20 +0000 (16:39 +0100)]
FVP: Include utils_def.h instead of utils.h

platform_def.h doesn't need all the definitions in utils.h,
the ones in utils_def.h are enough. This patch is related
to the changes introduced by commit 53d9c9c85b.

Change-Id: I4b2ff237a2d7fe07a7230e0e49b44b3fc2ca8abe
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
7 years agoFix type of `unsigned long` constants
Antonio Nino Diaz [Thu, 14 Sep 2017 14:57:44 +0000 (15:57 +0100)]
Fix type of `unsigned long` constants

The type `unsigned long` is 32 bit wide in AArch32, but 64 bit wide in
AArch64. This is inconsistent and that's why we avoid using it as per
the Coding Guidelines. This patch changes all `UL` occurrences to `U`
or `ULL` depending on the context so that the size of the constant is
clear.

This problem affected the macro `BIT(nr)`. As long as this macro is used
to fill fields of registers, that's not a problem, since all registers
are 32 bit wide in AArch32 and 64 bit wide in AArch64. However, if the
macro is used to fill the fields of a 64-bit integer, it won't be able
to set the upper 32 bits in AArch32.

By changing the type of this macro to `unsigned long long` the behaviour
is always the same regardless of the architecture, as this type is
64-bit wide in both cases.

Some Tegra platform files have been modified by this patch.

Change-Id: I918264c03e7d691a931f0d1018df25a2796cc221
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoSet TCR_EL1.EPD1 bit to 1
Antonio Nino Diaz [Fri, 15 Sep 2017 09:30:34 +0000 (10:30 +0100)]
Set TCR_EL1.EPD1 bit to 1

In the S-EL1&0 translation regime we aren't using the higher VA range,
whose translation table base address is held in TTBR1_EL1. The bit
TCR_EL1.EPD1 can be used to disable translations using TTBR1_EL1, but
the code wasn't setting it to 1. Additionally, other fields in TCR1_EL1
associated with the higher VA range (TBI1, TG1, SH1, ORGN1, IRGN1 and
A1) weren't set correctly as they were left as 0. In particular, 0 is a
reserved value for TG1. Also, TBBR1_EL1 was not explicitly set and its
reset value is UNKNOWN.

Therefore memory accesses to the higher VA range would result in
unpredictable behaviour as a translation table walk would be attempted
using an UNKNOWN value in TTBR1_EL1.

On the FVP and Juno platforms accessing the higher VA range resulted in
a translation fault, but this may not always be the case on all
platforms.

This patch sets the bit TCR_EL1.EPD1 to 1 so that any kind of
unpredictable behaviour is prevented.

This bug only affects the AArch64 version of the code, the AArch32
version sets this bit to 1 as expected.

Change-Id: I481c000deda5bc33a475631301767b9e0474a303
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoxlat: simplify mmap_add_region_check parameters (#1101)
Douglas Raillard [Thu, 21 Sep 2017 07:42:21 +0000 (08:42 +0100)]
xlat: simplify mmap_add_region_check parameters (#1101)

Use a mmap_region_t as parameter instead of getting a parameter for each
structure member. This reduces the scope of changes when adding members
to mmap_region_t.

Also align on the convention of using mm_cursor as a variable name for
the currently inspected region when iterating on the region array.

Change-Id: If40bc4351b56c64b214e60dda27276d11ce9dbb3
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #1099 from douglas-raillard-arm/dr/fix_mm_copy
davidcunado-arm [Tue, 19 Sep 2017 17:30:15 +0000 (18:30 +0100)]
Merge pull request #1099 from douglas-raillard-arm/dr/fix_mm_copy

xlat: fix mm copy when adding a region

7 years agoMerge pull request #1102 from Xilinx/fpga_load
davidcunado-arm [Tue, 19 Sep 2017 17:29:32 +0000 (18:29 +0100)]
Merge pull request #1102 from Xilinx/fpga_load

zynqmp: Sync function declaration and definition

7 years agozynqmp: Sync function declaration and definition
Soren Brinkmann [Mon, 18 Sep 2017 16:13:17 +0000 (09:13 -0700)]
zynqmp: Sync function declaration and definition

Synchronize argument order between function definition and declaration
of pm_fpga_load.

Fixes ARM-software/tf-issues#514
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
7 years agoMerge pull request #1093 from soby-mathew/eb/log_fw
davidcunado-arm [Mon, 18 Sep 2017 11:17:33 +0000 (12:17 +0100)]
Merge pull request #1093 from soby-mathew/eb/log_fw

Implement log framework

7 years agoMerge pull request #1094 from douglas-raillard-arm/dr/fix_mmap_add_dynamic_region
davidcunado-arm [Fri, 15 Sep 2017 13:32:08 +0000 (14:32 +0100)]
Merge pull request #1094 from douglas-raillard-arm/dr/fix_mmap_add_dynamic_region

xlat: Use MAP_REGION macro as compatibility layer

7 years agoMerge pull request #1089 from Leo-Yan/hikey_enable_debug_module
davidcunado-arm [Fri, 15 Sep 2017 10:29:03 +0000 (11:29 +0100)]
Merge pull request #1089 from Leo-Yan/hikey_enable_debug_module

Hikey: enable CPU debug module

7 years agoMerge pull request #1096 from davidcunado-arm/im/mair_attributes_helper
davidcunado-arm [Fri, 15 Sep 2017 08:37:05 +0000 (09:37 +0100)]
Merge pull request #1096 from davidcunado-arm/im/mair_attributes_helper

Helper macro to create MAIR encodings

7 years agoxlat: fix mm copy when adding a region
Douglas Raillard [Tue, 12 Sep 2017 09:31:49 +0000 (10:31 +0100)]
xlat: fix mm copy when adding a region

mmap_add_region_ctx and mmap_add_dynamic_region_ctx are clearing members
that they are not aware of by copying each member one by one. Replace
this by structure assignment.

Change-Id: I7c70cb408c8a8eb551402a5d8d956c1fb7f32b55
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #1098 from vchong/boot_without_spd
davidcunado-arm [Thu, 14 Sep 2017 08:37:53 +0000 (09:37 +0100)]
Merge pull request #1098 from vchong/boot_without_spd

hikey*: boot without spd

7 years agoMerge pull request #1095 from soby-mathew/sm/fix_cert_create_build
davidcunado-arm [Thu, 14 Sep 2017 08:37:32 +0000 (09:37 +0100)]
Merge pull request #1095 from soby-mathew/sm/fix_cert_create_build

Set default value of USE_TBBR_DEFS

7 years agohikey*: Undef BL32_BASE when building without SPD
Victor Chong [Wed, 13 Sep 2017 16:27:19 +0000 (01:27 +0900)]
hikey*: Undef BL32_BASE when building without SPD

Otherwise, BL2 tries to load a BL32 image and triggers
assert(result == 0)
in
plat_get_image_source()
in hikey{960}_io_storage.c
in a debug build, or displays
ERROR:   BL2: Failed to load image
in a release build.

Signed-off-by: Victor Chong <victor.chong@linaro.org>
7 years agohikey*: Fix typo
Victor Chong [Wed, 13 Sep 2017 16:22:14 +0000 (01:22 +0900)]
hikey*: Fix typo

Signed-off-by: Victor Chong <victor.chong@linaro.org>
7 years agoMerge pull request #1092 from jeenu-arm/errata-workarounds
davidcunado-arm [Wed, 13 Sep 2017 13:52:24 +0000 (14:52 +0100)]
Merge pull request #1092 from jeenu-arm/errata-workarounds

Errata workarounds

7 years agoMerge pull request #1097 from davidcunado-arm/dc/reset_bl31
davidcunado-arm [Wed, 13 Sep 2017 09:59:04 +0000 (10:59 +0100)]
Merge pull request #1097 from davidcunado-arm/dc/reset_bl31

plat/arm: Fix BL31_BASE when RESET_TO_BL31=1

7 years agoplat/arm: Fix BL31_BASE when RESET_TO_BL31=1
Qixiang Xu [Thu, 31 Aug 2017 03:45:32 +0000 (11:45 +0800)]
plat/arm: Fix BL31_BASE when RESET_TO_BL31=1

The value of BL31_BASE currently depends on the size of BL31. This
causes problems in the RESET_TO_BL31 case because the value of
BL31_BASE is used in the model launch parameters, which often changes.

Therefore, this patch fixes BL31_BASE to the middle of Trusted SRAM,
to avoid further model parameter changes in future.

Change-Id: I6d7fa4fe293717d84768974679539c0e0cb6d935
Signed-off-by: David Cunado <david.cunado@arm.com>
7 years agoMerge pull request #1091 from geesun/qx/el3_payload_base_cfg_check
davidcunado-arm [Tue, 12 Sep 2017 07:44:40 +0000 (08:44 +0100)]
Merge pull request #1091 from geesun/qx/el3_payload_base_cfg_check

Filter out invalid configure for EL3_PAYLOAD_BASE

7 years agoMerge pull request #1088 from soby-mathew/sm/sds_scmi
davidcunado-arm [Tue, 12 Sep 2017 07:43:38 +0000 (08:43 +0100)]
Merge pull request #1088 from soby-mathew/sm/sds_scmi

Introduce SDS Driver

7 years agoHelper macro to create MAIR encodings
Isla Mitchell [Fri, 21 Jul 2017 13:44:36 +0000 (14:44 +0100)]
Helper macro to create MAIR encodings

This patch provides helper macros for both Device and Normal memory MAIR
encodings as defined by the ARM Architecture Reference Manual for ARMv8-A
(ARM DDI0487B.A).

Change-Id: I5faae7f2cf366390ad4ba1d9253c6f3b60fd5e20
Signed-off-by: David Cunado <david.cunado@arm.com>
7 years agoMerge pull request #1087 from robertovargas-arm/psci_do_cpu_off
davidcunado-arm [Mon, 11 Sep 2017 17:19:03 +0000 (18:19 +0100)]
Merge pull request #1087 from robertovargas-arm/psci_do_cpu_off

Reduce time lock in psci_do_cpu_off

7 years agoSet default value of USE_TBBR_DEFS
Soby Mathew [Fri, 8 Sep 2017 09:54:12 +0000 (10:54 +0100)]
Set default value of USE_TBBR_DEFS

Using the OIDs defined in tbbr_oids.h is the recommended way to build
the cert_create tool. This patch hence sets default value of the build
flag USE_TBBR_DEFS to 1 in the Makefile in `tools/cert_create` folder
when cert_create is built from this folder.

Fixes ARM-software/tf-issues#482

Change-Id: Id1d224826b3417770bccbefa1b68d9bdb3b567f0
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoxlat: Use MAP_REGION macro as compatibility layer
Douglas Raillard [Thu, 31 Aug 2017 15:20:25 +0000 (16:20 +0100)]
xlat: Use MAP_REGION macro as compatibility layer

Use the MAP_REGION to build the mmap_region_t argument in wrappers like
mmap_add_region(). Evolution of the mmap_region_t might require adding
new members with a non-zero default value. Users of MAP_REGION are
protected against such evolution. This commit also protects users of
mmap_add_region() and mmap_add_dynamic_region() functions against these
evolutions.

Also make the MAP_REGION macro implementation more explicit and make it
a mmap_region_t compound literal to make it useable as a function
parameter on its own and to prevent using it in initialization of
variables of different type.

Change-Id: I7bfc4689f6dd4dd23c895b65f628d8ee991fc161
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoImplement log framework
Soby Mathew [Mon, 4 Sep 2017 10:49:29 +0000 (11:49 +0100)]
Implement log framework

This patch gives users control over logging messages printed from the C
code using the LOG macros defined in debug.h Users now have the ability
to reduce the log_level at run time using the tf_log_set_max_level()
function. The default prefix string can be defined by platform by
overriding the `plat_log_get_prefix()` platform API which is also
introduced in this patch.

The new log framework results in saving of some RO data. For example,
when BL1 is built for FVP with LOG_LEVEL=LOG_LEVEL_VERBOSE, resulted
in saving 384 bytes of RO data and increase of 8 bytes of RW data. The
framework also adds about 108 bytes of code to the release build of FVP.

Fixes ARM-software/tf-issues#462

Change-Id: I476013d9c3deedfdd4c8b0b0f125665ba6250554
Co-authored-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoIntroduce tf_vprintf() and tf_string_print()
Soby Mathew [Mon, 4 Sep 2017 10:45:52 +0000 (11:45 +0100)]
Introduce tf_vprintf() and tf_string_print()

This patch introduces tf_vprintf() and tf_string_print() APIs
which is needed by the logging framework introduced in a later
patch.

Change-Id: Ie4240443d0e04e070502b51e371e546dd469fd33
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoMerge pull request #1084 from davidcunado-arm/dc/warmboot_a32
davidcunado-arm [Mon, 11 Sep 2017 10:21:08 +0000 (11:21 +0100)]
Merge pull request #1084 from davidcunado-arm/dc/warmboot_a32

Set NS version SCTLR during warmboot path

7 years agoMerge pull request #1086 from robertovargas-arm/dead_loop
davidcunado-arm [Mon, 11 Sep 2017 08:50:11 +0000 (09:50 +0100)]
Merge pull request #1086 from robertovargas-arm/dead_loop

juno: Fix bug in plat_get_my_entrypoint

7 years agoFilter out invalid configure for EL3_PAYLOAD_BASE
Qixiang Xu [Thu, 24 Aug 2017 03:03:23 +0000 (11:03 +0800)]
Filter out invalid configure for EL3_PAYLOAD_BASE

TRUSTED_BOARD_BOOT and GENERATE_COT is not
compatible with EL3_PAYLOAD_BASE

Change-Id: I538c77e1f6c7da400d30ae4d633b8fcc55742202
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
7 years agoJuno: Disable 859971 and 859972 errata workarounds
Eleanor Bonnici [Fri, 4 Aug 2017 14:03:51 +0000 (15:03 +0100)]
Juno: Disable 859971 and 859972 errata workarounds

Earlier patches added errata workarounds 859972 for Cortex-A72, and
859972 for Cortex-A57 CPUs. Explicitly disable the workaround for Juno.

Also reorganize errata workaround flags.

No functional changes.

Change-Id: I3fe3745de57d77e5bf52012826d3969fe5d4844e
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoCortex-A72: Implement workaround for erratum 859971
Eleanor Bonnici [Wed, 2 Aug 2017 17:33:41 +0000 (18:33 +0100)]
Cortex-A72: Implement workaround for erratum 859971

Erratum 855971 applies to revision r0p3 or earlier Cortex-A72 CPUs. The
recommended workaround is to disable instruction prefetch.

Change-Id: I7fde74ee2a8a23b2a8a1891b260f0eb909fad4bf
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoCortex-A57: Implement workaround for erratum 859972
Eleanor Bonnici [Wed, 2 Aug 2017 15:35:04 +0000 (16:35 +0100)]
Cortex-A57: Implement workaround for erratum 859972

Erratum 855972 applies to revision r1p3 or earlier Cortex-A57 CPUs. The
recommended workaround is to disable instruction prefetch.

Change-Id: I56eeac0b753eb1432bd940083372ad6f7e93b16a
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoHikey: enable CPU debug module
Leo Yan [Thu, 7 Sep 2017 06:56:32 +0000 (14:56 +0800)]
Hikey: enable CPU debug module

Every CPU has its own debug module and this module is used by JTAG
debugging and coresight tracing. If without enabling it, it's easily to
introduce lockup issue when we enable debugging features.

This patch is to enable CPU debug module when power on CPU; this allows
connecting to all cores through JTAG and used by kernel coresight
driver.

Signed-off-by: Matthias Welwarsky <maw@sysgo.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
7 years agoMerge pull request #1082 from vchong/load_img_v2_parse_optee_header
davidcunado-arm [Thu, 7 Sep 2017 07:46:47 +0000 (08:46 +0100)]
Merge pull request #1082 from vchong/load_img_v2_parse_optee_header

hikey*: Add LOAD_IMAGE_V2 and OP-TEE header parsing support

7 years agoMerge pull request #1080 from soby-mathew/eb/RSA-PKCS1-5_support_1
davidcunado-arm [Thu, 7 Sep 2017 00:14:24 +0000 (01:14 +0100)]
Merge pull request #1080 from soby-mathew/eb/RSA-PKCS1-5_support_1

Support legacy RSA PKCS#1 v1.5 in cert create

7 years agoMerge pull request #1078 from douglas-raillard-arm/dr/add_cfi_vector_entry
davidcunado-arm [Wed, 6 Sep 2017 23:45:59 +0000 (00:45 +0100)]
Merge pull request #1078 from douglas-raillard-arm/dr/add_cfi_vector_entry

Add CFI debug info to vector entries

7 years agoMerge pull request #1019 from etienne-lms/log-size
davidcunado-arm [Wed, 6 Sep 2017 23:40:59 +0000 (00:40 +0100)]
Merge pull request #1019 from etienne-lms/log-size

CPU_DATA_LOG2SIZE depends on cache line size

7 years agoCSS: Changes for SDS framework
Soby Mathew [Mon, 12 Jun 2017 11:37:10 +0000 (12:37 +0100)]
CSS: Changes for SDS framework

This patch does the required changes to enable CSS platforms
to build and use the SDS framework. Since SDS is always coupled with
SCMI protocol, the preexisting SCMI build flag is now renamed to
`CSS_USE_SCMI_SDS_DRIVER` which will enable both SCMI and SDS on
CSS platforms. Also some of the workarounds applied for SCMI are
now removed with SDS in place.

Change-Id: I94e8b93f05e3fe95e475c5501c25bec052588a9c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoSDS: Introduce the sds drivers
Soby Mathew [Mon, 12 Jun 2017 11:13:04 +0000 (12:13 +0100)]
SDS: Introduce the sds drivers

This patch introduces the driver for Shared-Data-Structure (SDS)
framework which will be used for communication between SCP and AP
CPU. The SDS framework is intended to replace the Boot-Over-MHU
(BOM) protocol used currently for the communication

Change-Id: Ic174291121f4e581b174cce3389d22d6435f7269
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoSplit CSS makefile for sp_min on Juno
Soby Mathew [Mon, 12 Jun 2017 11:15:01 +0000 (12:15 +0100)]
Split CSS makefile for sp_min on Juno

This patch factors out common files required for sp_min for all CSS
platforms from the JUNO specific makefile to a the new `css_sp_min.mk`
makefile. This also allows the common build options that affect CSS
platforms to be configured in a central makefile for sp_min.

Change-Id: Ida952d8833b1aa5eda77ae0a6664a4632aeab24c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoFix JUNO AArch32 build
Soby Mathew [Wed, 5 Jul 2017 14:07:05 +0000 (15:07 +0100)]
Fix JUNO AArch32 build

This patch fixes the inconsistency with regards as to how
BL2_BASE/BL2U_BASE and BL2_LIMIT/BL2U_LIMIT macros are defined
when building Juno to run in AArch32 mode at EL3. In this case,
BL32 is compiled for AArch32 whereas BL1 and BL2 are compiled
for AArch64. This resulted in BL32 conditionally compiling a
different definition of the above mentioned macros from BL1/BL2.
This is fixed by taking into consideration the
JUNO_AARCH32_EL3_RUNTIME build flag as well in the conditional
compilation check.

Change-Id: I27ac68aa4df0502089c1739c05366a9c509eb5be
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoReduce time lock in psci_do_cpu_off
Roberto Vargas [Mon, 4 Sep 2017 15:49:41 +0000 (16:49 +0100)]
Reduce time lock in psci_do_cpu_off

psci_set_power_off_state only initializes a local variable, so there
isn't any reason why it should be done while the lock is held.

Change-Id: I1c62f4cd5d860d102532e5a5350152180d41d127
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
7 years agojuno: Fix bug in plat_get_my_entrypoint
Roberto Vargas [Fri, 1 Sep 2017 14:08:47 +0000 (15:08 +0100)]
juno: Fix bug in plat_get_my_entrypoint

plat_get_my_entrypoint was branching to juno_do_reset_to_aarch_32_state,
which is not supposed to return, and in case of returning it implemented
an infinite loop. The problem was that plat_get_my_entrypoint was using
"b" instead of "bl", so juno_do_reset_to_aarch_32_state was returning to
the caller of plat_get_my_entrypoint instead of stop the system with a
panic.

To avoid this problem juno_do_reset_to_aarch_32_state was modified to
call directly to plat_panic_handler if it tries to return.

Change-Id: I591cf2dd78d27d8568fb15b91366e4b3dce027b5
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
7 years agoMerge pull request #1076 from masahir0y/asm_macro
davidcunado-arm [Wed, 6 Sep 2017 08:16:17 +0000 (09:16 +0100)]
Merge pull request #1076 from masahir0y/asm_macro

asm_macros: set the default assembly code alignment to 4 byte

7 years agoSet NS version SCTLR during warmboot path
David Cunado [Mon, 4 Sep 2017 15:41:37 +0000 (16:41 +0100)]
Set NS version SCTLR during warmboot path

When ARM TF executes in AArch32 state, the NS version of SCTLR
is not being set during warmboot flow. This results in secondary
CPUs entering the Non-secure world with the default reset value
in SCTLR.

This patch explicitly sets the value of the NS version of SCTLR
during the warmboot flow rather than relying on the h/w.

Change-Id: I86bf52b6294baae0a5bd8af0cd0358cc4f55c416
Signed-off-by: David Cunado <david.cunado@arm.com>
7 years agoMerge pull request #1083 from soby-mathew/sm/fix_optee_map
davidcunado-arm [Tue, 5 Sep 2017 20:32:50 +0000 (21:32 +0100)]
Merge pull request #1083 from soby-mathew/sm/fix_optee_map

Fix BL2 memory map when OP-TEE is the Secure Payload

7 years agoFix BL2 memory map when OP-TEE is the Secure Payload
Soby Mathew [Fri, 1 Sep 2017 12:43:50 +0000 (13:43 +0100)]
Fix BL2 memory map when OP-TEE is the Secure Payload

The commit 3eb2d67 optimizes the memory map for BL2 when TSP
is not present. But this also broke OP-TEE as it was reusing
the TSP mapping. This patch fixes this problem by adding a
separate mapping for OP-TEE in the BL2 memory map table.

Change-Id: I130a2ea552b7b62d8478081feb1f4ddf5292a118
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoMerge pull request #1081 from masahir0y/uniphier
davidcunado-arm [Mon, 4 Sep 2017 08:35:13 +0000 (09:35 +0100)]
Merge pull request #1081 from masahir0y/uniphier

uniphier: fix-up for PXs3 SoC

7 years agohikey*: Support Trusted OS extra image (OP-TEE header) parsing
Victor Chong [Wed, 16 Aug 2017 04:53:56 +0000 (13:53 +0900)]
hikey*: Support Trusted OS extra image (OP-TEE header) parsing

Signed-off-by: Victor Chong <victor.chong@linaro.org>
7 years agohikey*: Add LOAD_IMAGE_V2 support
Victor Chong [Thu, 17 Aug 2017 06:21:10 +0000 (15:21 +0900)]
hikey*: Add LOAD_IMAGE_V2 support

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
7 years agodocs: hikey: Fix typo
Victor Chong [Sun, 27 Aug 2017 08:46:03 +0000 (17:46 +0900)]
docs: hikey: Fix typo

Signed-off-by: Victor Chong <victor.chong@linaro.org>
7 years agocpu log buffer size depends on cache line size
Etienne Carriere [Fri, 1 Sep 2017 08:22:20 +0000 (10:22 +0200)]
cpu log buffer size depends on cache line size

Platform may use specific cache line sizes. Since CACHE_WRITEBACK_GRANULE
defines the platform specific cache line size, it is used to define the
size of the cpu data structure CPU_DATA_SIZE aligned on cache line size.

Introduce assembly macro 'mov_imm' for AArch32 to simplify implementation
of function '_cpu_data_by_index'.

Change-Id: Ic2d49ffe0c3e51649425fd9c8c99559c582ac5a1
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
7 years agouniphier: work around Boot ROM bug for USB boot mode of PXs3 SoC
Masahiro Yamada [Thu, 31 Aug 2017 07:30:47 +0000 (16:30 +0900)]
uniphier: work around Boot ROM bug for USB boot mode of PXs3 SoC

Due to a bug in the Boot ROM, the USB load API turned out not working
as expected.  It is unfixable because the Boot ROM is hard-wired.

Add work around code in TF to bypass the problematic Boot ROM code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agouniphier: fix code indent for conditional statement
Masahiro Yamada [Thu, 31 Aug 2017 10:58:11 +0000 (19:58 +0900)]
uniphier: fix code indent for conditional statement

checkpatch.pl from Linux reports tons of coding style errors and
warnings.  I am just fixing under plat/socionext/uniphier/.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoMerge pull request #1072 from sandrine-bailleux-arm/sb/tsp-mapping
danh-arm [Thu, 31 Aug 2017 17:55:21 +0000 (18:55 +0100)]
Merge pull request #1072 from sandrine-bailleux-arm/sb/tsp-mapping

ARM platforms: Map TSP only when TSPD is included

7 years agocert_tool: Support for legacy RSA PKCS#1 v1.5
Soby Mathew [Thu, 31 Aug 2017 10:50:29 +0000 (11:50 +0100)]
cert_tool: Support for legacy RSA PKCS#1 v1.5

This patch enables choice of RSA version at run time to be used for
generating signatures by the cert_tool. The RSA PSS as defined in
PKCS#1 v2.1 becomes the default version and this patch enables to specify
the RSA PKCS#1 v1.5 algorithm to `cert_create` through the command line
-a option. Also, the build option `KEY_ALG` can be used to pass this
option from the build system. Please note that RSA PSS is mandated
by Trusted Board Boot requirements (TBBR) and legacy RSA support is
being added for compatibility reasons.

Fixes ARM-Software/tf-issues#499
Change-Id: Ifaa3f2f7c9b43f3d7b3effe2cde76bf6745a5d73
Co-Authored-By: Eleanor Bonnici <Eleanor.bonnici@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoExport KEY_ALG as a user build option
Soby Mathew [Thu, 31 Aug 2017 10:49:32 +0000 (11:49 +0100)]
Export KEY_ALG as a user build option

The `KEY_ALG` variable is used to select the algorithm for key
generation by `cert_create` tool for signing the certificates. This
variable was previously undocumented and did not have a global default
value. This patch corrects this and also adds changes to derive the
value of `TF_MBEDTLS_KEY_ALG` based on `KEY_ALG` if it not set by the
platform. The corresponding assignment of these variables are also now
removed from the `arm_common.mk` makefile.

Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: I78e2d6f4fc04ed5ad35ce2266118afb63127a5a4

7 years agoARM platforms: Map TSP only when TSPD is included
Sandrine Bailleux [Wed, 30 Aug 2017 09:59:22 +0000 (10:59 +0100)]
ARM platforms: Map TSP only when TSPD is included

This patch ensures that the ARM_MAP_TSP_SEC_MEM memory region is mapped
in BL2 only if the TSPD has been included in the build. This saves one
entry in the plat_arm_mmap[] array and avoids to map extra memory when
it's not needed.

Change-Id: I6ae60822ff8f0de198145925b0b0d45355179a94
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
7 years agoMerge pull request #1079 from douglas-raillard-arm/dr/doc_fix_typo
danh-arm [Thu, 31 Aug 2017 13:21:21 +0000 (14:21 +0100)]
Merge pull request #1079 from douglas-raillard-arm/dr/doc_fix_typo

porting-guide.rst: Fix some sections' level

7 years agoMerge pull request #1077 from soby-mathew/sm/fix_juno_assert_lvl
danh-arm [Thu, 31 Aug 2017 13:20:31 +0000 (14:20 +0100)]
Merge pull request #1077 from soby-mathew/sm/fix_juno_assert_lvl

Juno: Define PLAT_LOG_LEVEL_ASSERT to LOG_LEVEL_INFO

7 years agoporting-guide.rst: Fix some sections' level
Douglas Raillard [Wed, 2 Aug 2017 13:44:42 +0000 (14:44 +0100)]
porting-guide.rst: Fix some sections' level

Fix the level of the section
"13.   Function : plat_setup_psci_ops() [mandatory]",
including all the subsections.

Fix the level of the section
"12.7.   plat_psci_ops.pwr_domain_suspend_pwrdown_early() [optional]"
to lower it like the surrounding functions.

Change-Id: I781823bc96ece669f8fde4bd39c4e333c7bf4d1a
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoAdd CFI debug info to vector entries
Douglas Raillard [Mon, 7 Aug 2017 15:20:46 +0000 (16:20 +0100)]
Add CFI debug info to vector entries

Add Call Frame Information assembler directives to vector entries so
that debuggers display the backtrace of functions that triggered a
synchronous exception. For example, a function triggering a data abort
will be easier to debug if the backtrace can be displayed from a
breakpoint at the beginning of the synchronous exception vector.

DS-5 needs CFI otherwise it will not attempt to display the backtrace.
Other debuggers might have other needs. These debug information are
stored in the ELF file but not in the final binary.

Change-Id: I32dc4e4b7af02546c93c1a45c71a1f6d710d36b1
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoJuno: Define PLAT_LOG_LEVEL_ASSERT to LOG_LEVEL_INFO
Soby Mathew [Tue, 22 Aug 2017 13:06:19 +0000 (14:06 +0100)]
Juno: Define PLAT_LOG_LEVEL_ASSERT to LOG_LEVEL_INFO

This patch fixes the PLAT_LOG_LEVEL_ASSERT to 40 which corresponds
to LOG_LEVEL_INFO. Having this level of log for assertions means that the
`assert()` will not generate the strings implied in the expression taken
as parameter. This allows to save some memory when Juno is built for
LOG_LEVEL = LOG_LEVEL_VERBOSE and DEBUG = 1.

Fixes ARM-software/tf-issues#511

Change-Id: Id84a40f803ab07a5a8f6e587167af96694a07d04
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoasm_macros: set the default assembly code alignment to 4 byte
Masahiro Yamada [Thu, 31 Aug 2017 05:29:34 +0000 (14:29 +0900)]
asm_macros: set the default assembly code alignment to 4 byte

Assembly routines are usually defined by using "func" and "endfunc":

    func foo
      ...
    endfunc foo

Currently, the "func" macro does not specify ".align" directive
by default.  It causes unaligned instruction under some circumstances.

As far as I tested, this problem happens for GCC 5 or older.  It did
not happen for GCC 6 or newer.  Taking into account that GCC 4.x / 5.x
is still used, make sure that assembly code is at least 4 byte aligned.

[ How to reproduce the problem ]

For example, use GCC 5.3 downloaded from Linaro:
http://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/
aarch64-linux-gnu/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu.tar.xz

Expand mbedtls-2.4.2 to the current directory.

Try the following:

  $ git log --oneline -1
  77544ef Merge pull request #1071 from jeenu-arm/syntax-fix
  $ aarch64-linux-gnu-gcc --version | head -1
  aarch64-linux-gnu-gcc (Linaro GCC 5.3-2016.05) 5.3.1 20160412
  $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=uniphier \
    TRUSTED_BOARD_BOOT=1 MBEDTLS_DIR=mbedtls-2.4.2
    ( snip build log )
  $ aarch64-linux-gnu-nm build/uniphier/release/bl1/bl1.elf | grep handler
  00000000800088f4 T bl1_fwu_smc_handler
  00000000800084c8 T bl1_smc_handler
  000000008000a6e0 t _panic_handler
  000000008000a8e0 W plat_error_handler
  000000008000a8e8 W plat_panic_handler
  000000008000a8d8 W plat_reset_handler
  000000008000a39f T reset_handler
  000000008000a367 t smc_handler
  000000008000a2ef t smc_handler64

You will notice "smc_handler64", "reset_handler", etc. are not properly
aligned.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoMerge pull request #1069 from Leo-Yan/hikey_enable_watchdog_reset
danh-arm [Thu, 31 Aug 2017 08:37:47 +0000 (09:37 +0100)]
Merge pull request #1069 from Leo-Yan/hikey_enable_watchdog_reset

Hikey: enable watchdog reset

7 years agoMerge pull request #1074 from EvanLloyd/ejll/62_file_mode
davidcunado-arm [Wed, 30 Aug 2017 17:12:28 +0000 (18:12 +0100)]
Merge pull request #1074 from EvanLloyd/ejll/62_file_mode

fiptool: Update file open modes with 'b' (for Windows)

7 years agoMerge pull request #1075 from robertovargas-arm/fix_el3_payload
danh-arm [Wed, 30 Aug 2017 17:04:02 +0000 (18:04 +0100)]
Merge pull request #1075 from robertovargas-arm/fix_el3_payload

Don't use zero_normalmem in bl2_platform_setup

7 years agoDon't use zero_normalmem in bl2_platform_setup
Roberto Vargas [Wed, 30 Aug 2017 07:24:48 +0000 (08:24 +0100)]
Don't use zero_normalmem in bl2_platform_setup

zero_normalmem only can zero memory when caches are enabled
and the target memory is a normal memory, otherwise an abort is
generated. In the case of EL3_PAYLOAD_BASE bl2_platform_setup was
calling zero_normalmem with device memory and it generated an abort.

Change-Id: If013603f209a12af488a9c54481f97a8f395b26a
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
7 years agofiptool: Update file open modes with 'b' (for Windows)
Evan Lloyd [Fri, 13 Jan 2017 14:13:09 +0000 (14:13 +0000)]
fiptool: Update file open modes with 'b' (for Windows)

Unix does not distinguish binary and text modes.
On Windows the 'b' flag (e.g. "rb" instead of "r") is used to
indicate that files should be opened in binary mode.
This has no impact on Unix, but is needed on Windows to avoid
end-of-line issues.

Change-Id: I69424c55735d5d563d36c50bedd6357b8e05137e
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
7 years agoMerge pull request #1073 from davidcunado-arm/dc/update_docs
danh-arm [Wed, 30 Aug 2017 13:37:15 +0000 (14:37 +0100)]
Merge pull request #1073 from davidcunado-arm/dc/update_docs

Add usage note for FVP model versions 11.0 and 8.5

7 years agoMerge pull request #1066 from islmit01/im/enable_cnp_bit
danh-arm [Wed, 30 Aug 2017 13:34:57 +0000 (14:34 +0100)]
Merge pull request #1066 from islmit01/im/enable_cnp_bit

Enable CnP bit for ARMv8.2 CPUs

7 years agoMerge pull request #1062 from jeenu-arm/cpu-fixes
danh-arm [Wed, 30 Aug 2017 13:34:17 +0000 (14:34 +0100)]
Merge pull request #1062 from jeenu-arm/cpu-fixes

Cpu macro fixes

7 years agoAdd usage note for FVP model versions 11.0 and 8.5
David Cunado [Mon, 31 Jul 2017 11:24:51 +0000 (12:24 +0100)]
Add usage note for FVP model versions 11.0 and 8.5

The internal synchronisation timings of the FVP model version
11.0 build 11.0.34 and version 8.5 build 0.8.5202 has been
changed compared to older version of the models.

This change may have an impact on how the model behaves depending
on the workload being run on the model. For example test failures
have been seen where the primary core has powered on a secondary
core but was then starved of host CPU time and so was not able to
update power status, resulting a test failure due to an incorrect
status. This, or similar behaviour, is not to be expected from
real hardware platforms.

This patch adds a usage note on how to launch these models so
that internal synchronisation timing matches that of the older
version of the models, specifically adding the -Q 100 option.

Change-Id: If922afddba1581b7246ec889b3f1598533ea1b7e
Signed-off-by: David Cunado <david.cunado@arm.com>
7 years agoMerge pull request #1071 from jeenu-arm/syntax-fix
danh-arm [Tue, 29 Aug 2017 14:25:36 +0000 (15:25 +0100)]
Merge pull request #1071 from jeenu-arm/syntax-fix

plat/arm: Fix ARM_INSTANTIATE_LOCK syntax anomaly

7 years agoTegra: Rename CORTEX_A57_ACTLR_EL1 to *CPUACTLR*
Eleanor Bonnici [Thu, 10 Aug 2017 13:46:26 +0000 (14:46 +0100)]
Tegra: Rename CORTEX_A57_ACTLR_EL1 to *CPUACTLR*

CORTEX_A57_ACTLR_EL1 macro refers to the CPUACTLR_EL1 register. Since
ACTLR_EL1 is a different register (not implemented in Cortex-A57) this
patch renames this macro for clarity.

Change-Id: I94d7d564cd2423ae032bbdd59a99d2dc535cdff6
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
7 years agoHiKey: Rename CPUACTRL reg constants
Eleanor Bonnici [Thu, 10 Aug 2017 13:26:36 +0000 (14:26 +0100)]
HiKey: Rename CPUACTRL reg constants

Constants named as *ACTLR* refer in fact to the CPUACTRL_EL1 register.
Since ACTLR and ACTRL_EL1 are different registers this patch renames
these constants for clarity.

Change-Id: I2a9e402dab7b0fcb6e481ee0d8a11eda943ed299
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
7 years agoCPU: Correct names of implementation-defined aux regs
Eleanor Bonnici [Wed, 9 Aug 2017 15:42:40 +0000 (16:42 +0100)]
CPU: Correct names of implementation-defined aux regs

At present, various CPU register macros that refer to CPUACTLR are named
ACTLR. This patch fixes that.

The previous register names are retained, but guarded by the
ERROR_DEPRECATED macro, so as not to break platforms that continue using
the old names.

Change-Id: Ia872196d81803f8f390b887d149e0fd054df519b
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
7 years agoCPU: Make shifted constants unsigned
Eleanor Bonnici [Wed, 9 Aug 2017 09:36:08 +0000 (10:36 +0100)]
CPU: Make shifted constants unsigned

In order to avoid Undefined behavior, left operand in left-shift
expressions needs to be unsigned, and of sufficient size. The safest and
most consistent approach is to use unsigned long long type.

Change-Id: I9612f16a6e6ea4c7df62a02497d862abf19b8e1b
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
7 years agoplat/arm: Fix ARM_INSTANTIATE_LOCK syntax anomaly
Jeenu Viswambharan [Wed, 23 Aug 2017 13:12:59 +0000 (14:12 +0100)]
plat/arm: Fix ARM_INSTANTIATE_LOCK syntax anomaly

The current definition of ARM_INSTANTIATE_LOCK macro includes a
semicolon, which means it's omitted where it's used. This is anomalous
for a C statement in global scope.

Fix this by removing semicolon from the definition; and where it's a
NOP, declare a file-scoped variable explicitly tagged as unused to avoid
compiler warning.

No functional changes.

Change-Id: I2c1d92ece4777e272a025011e03b8003f3543335
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1070 from rockchip-linux/rk3399-fixes-logic
danh-arm [Tue, 29 Aug 2017 10:52:04 +0000 (11:52 +0100)]
Merge pull request #1070 from rockchip-linux/rk3399-fixes-logic

rockchip/rk3399: Support Turning off VD_LOGIC during suspend-to-ram

7 years agoMerge pull request #1068 from jenswi-linaro/optee_arm_plat
danh-arm [Tue, 29 Aug 2017 10:51:32 +0000 (11:51 +0100)]
Merge pull request #1068 from jenswi-linaro/optee_arm_plat

Optee arm platform common