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

Fix FVP DRAM2 size

6 years agoFix FVP DRAM2 size
Roberto Vargas [Thu, 1 Feb 2018 15:19:00 +0000 (15:19 +0000)]
Fix FVP DRAM2 size

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

Change-Id: I9aabe3284a50ec2a36ed94966eb7e4ddf37cec3b
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoMerge pull request #1291 from dp-arm/dp/mk
davidcunado-arm [Thu, 1 Mar 2018 01:15:22 +0000 (01:15 +0000)]
Merge pull request #1291 from dp-arm/dp/mk

Revert "Make all build results depend on all makefiles"

6 years agoMerge pull request #1290 from jeenu-arm/dynamiq
davidcunado-arm [Wed, 28 Feb 2018 20:10:29 +0000 (20:10 +0000)]
Merge pull request #1290 from jeenu-arm/dynamiq

DynamIQ on FVP

6 years agoMerge pull request #1282 from robertovargas-arm/misra-changes
davidcunado-arm [Wed, 28 Feb 2018 18:53:30 +0000 (18:53 +0000)]
Merge pull request #1282 from robertovargas-arm/misra-changes

Misra changes

6 years agoFix MISRA rule 8.4 Part 2
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.4 Part 2

Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined

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

Change-Id: Ic8f611da734f356566e8208053296e6c62b54709
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.5 Part 1
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.5 Part 1

Rule 8.5: An external object or function shall be declared
          once in one and only one file.

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

Change-Id: I2420c58134c280db90706cad2d5e7a190f9f9311
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.4 Part 1
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.4 Part 1

Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined

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

Change-Id: I7c2ad3f5c015411c202605851240d5347e4cc8c7
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.3 Part 1
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.3 Part 1

Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers.

Fixed for:

make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all

Change-Id: I48201c9ef022f6bd42ea8644529afce70f9b3f22
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.8 in common code
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.8 in common code

Rule 8.8: The static storage class specifier shall be used
          in all declarations of objects and functions that
          have internal linkage.

Change-Id: I1e94371caaadebb2cec38d0ae0fa5c59e43369e0
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.4 in common code
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.4 in common code

Rule 8.4: A compatible declaration shall be visible when
          an object or function with external linkage is defined.

Change-Id: I26e042cb251a6f9590afa1340fdac73e42f23979
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoFix MISRA rule 8.3 in common code
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.3 in common code

Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers.

Change-Id: Iff384187c74a598a4e73f350a1893b60e9d16cec
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
6 years agoRevert "Make all build results depend on all makefiles"
Dimitris Papastamos [Wed, 28 Feb 2018 15:09:25 +0000 (15:09 +0000)]
Revert "Make all build results depend on all makefiles"

Seems to have unintended side-effects on the build system such as
rebuilding certain parts of TF even though nothing has changed.

This reverts commit c6f651f9a3322857c8e1f8250274a0984c024283.

Change-Id: I1472e6c630cb6371ec629b7d97a5748d9a6fd096
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoMerge pull request #1289 from sandrine-bailleux-arm/topics/sb/juno-scmi-by-default
davidcunado-arm [Wed, 28 Feb 2018 16:58:33 +0000 (16:58 +0000)]
Merge pull request #1289 from sandrine-bailleux-arm/topics/sb/juno-scmi-by-default

Select SCMI/SDS drivers by default on Juno

6 years agoFVP: Allow building for DynamIQ systems
Jeenu Viswambharan [Wed, 31 Jan 2018 14:52:08 +0000 (14:52 +0000)]
FVP: Allow building for DynamIQ systems

FVPs that model DynamIQ configuration implements all CPUs in a single
cluster. I.e., such models have a single cluster with more than 4 CPUs.
This differs from existing default build configuration for FVP where up
to 4 CPUs are assumed per cluster.

To allow building for DynamIQ configuration, promote the macro
FVP_MAX_CPUS_PER_CLUSTER as a build option to have it set from the build
command line. The value of the build option defaults to 4.

Change-Id: Idc3853bc95f680869b434b011c2dbd733e40c6ce
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agofdts: Add DTS for DynamIQ platforms
Jeenu Viswambharan [Wed, 31 Jan 2018 10:57:46 +0000 (10:57 +0000)]
fdts: Add DTS for DynamIQ platforms

DynamIQ platforms host all CPUs in a single cluster. This patch adds a
DTS and DTB for DynamicQ platforms hosting up to 8 CPUs.

Change-Id: I2d97bc740ac3062818767e7251020644f5bb9100
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoSelect SCMI/SDS drivers by default on Juno
Sandrine Bailleux [Wed, 28 Feb 2018 10:47:23 +0000 (11:47 +0100)]
Select SCMI/SDS drivers by default on Juno

The SCP binaries provided in the 17.10 Linaro release (and onwards)
have migrated to the SCMI/SDS protocols. Therefore, the ARM TF should
now use the corresponding drivers by default.

This patch changes the default value of the CSS_USE_SCMI_SDS_DRIVER
build option to 1 for Juno.

Change-Id: Idb7e3c6af582f49e332167a2158703c2d781b437
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
6 years agoMerge pull request #1287 from davidcunado-arm/dc/fix_misra
davidcunado-arm [Wed, 28 Feb 2018 09:48:35 +0000 (09:48 +0000)]
Merge pull request #1287 from davidcunado-arm/dc/fix_misra

Update ULL() macro and instances of ull to comply with MISRA

6 years agoMerge pull request #1286 from antonio-nino-diaz-arm/an/mmu-mismatch
davidcunado-arm [Wed, 28 Feb 2018 01:26:21 +0000 (01:26 +0000)]
Merge pull request #1286 from antonio-nino-diaz-arm/an/mmu-mismatch

Clarify comments in xlat tables lib and fixes related to the TLB

6 years agoMerge pull request #1284 from jeenu-arm/tspd-ehf
davidcunado-arm [Wed, 28 Feb 2018 00:30:55 +0000 (00:30 +0000)]
Merge pull request #1284 from jeenu-arm/tspd-ehf

TSPD and EHF

6 years agoMerge pull request #1283 from jeenu-arm/sdei-fixes
davidcunado-arm [Tue, 27 Feb 2018 23:24:30 +0000 (23:24 +0000)]
Merge pull request #1283 from jeenu-arm/sdei-fixes

SDEI fixes

6 years agoMerge pull request #1274 from dp-arm/dp/a75
davidcunado-arm [Tue, 27 Feb 2018 21:58:42 +0000 (21:58 +0000)]
Merge pull request #1274 from dp-arm/dp/a75

AMU fixes for Cortex-A75

6 years agoMerge pull request #1272 from dp-arm/dp/extensions
davidcunado-arm [Tue, 27 Feb 2018 17:27:16 +0000 (17:27 +0000)]
Merge pull request #1272 from dp-arm/dp/extensions

Refactor SPE/SVE code and fix some bugs in AMUv1 on AArch32

6 years agoUpdate ULL() macro and instances of ull to comply with MISRA
David Cunado [Fri, 16 Feb 2018 21:12:58 +0000 (21:12 +0000)]
Update ULL() macro and instances of ull to comply with MISRA

MISRA C-2012 Rule 7.3 violation: lowercase l shall not be used as literal suffixes.

This patch resolves this for the ULL() macro by using ULL suffix instead
of the ull suffix.

Change-Id: Ia8183c399e74677e676956e8653e82375d0e0a01
Signed-off-by: David Cunado <david.cunado@arm.com>
6 years agoInvalidate TLB entries during warm boot
Antonio Nino Diaz [Mon, 19 Feb 2018 16:27:06 +0000 (16:27 +0000)]
Invalidate TLB entries during warm boot

During the warm boot sequence:

1. The MMU is enabled with the data cache disabled. The MMU table walker
   is set up to access the translation tables as in cacheable memory,
   but its accesses are non-cacheable because SCTLR_EL3.C controls them
   as well.
2. The interconnect is set up and the CPU enters coherency with the
   rest of the system.
3. The data cache is enabled.

If the support for dynamic translation tables is enabled and another CPU
makes changes to a region, the changes may only be present in the data
cache, not in RAM. The CPU that is booting isn't in coherency with the
rest of the system, so the table walker of that CPU isn't either. This
means that it may read old entries from RAM and it may have invalid TLB
entries corresponding to the dynamic mappings.

This is not a problem for the boot code because the mapping is 1:1 and
the regions are static. However, the code that runs after the boot
sequence may need to access the dynamically mapped regions.

This patch invalidates all TLBs during warm boot when the dynamic
translation tables support is enabled to prevent this problem.

Change-Id: I80264802dc0aa1cb3edd77d0b66b91db6961af3d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1285 from soby-mathew/sm/fix_win_build_dyn_cfg
davidcunado-arm [Tue, 27 Feb 2018 15:30:40 +0000 (15:30 +0000)]
Merge pull request #1285 from soby-mathew/sm/fix_win_build_dyn_cfg

FVP: restrict dynamic config to Unix build environment

6 years agoTSPD: Register preempted SMC error code with EHF
Jeenu Viswambharan [Mon, 22 Jan 2018 12:42:54 +0000 (12:42 +0000)]
TSPD: Register preempted SMC error code with EHF

An earlier patch extended ehf_allow_ns_preemption() API to also register
an error code to offer to Non-secure when a Yielding SMC is preempted by
SDEI interrupt. In TSPD's case, register the error code TSP_PREEMPTED.

Change-Id: I31992b6651f80694e83bc5092b044ef7a3eda690
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoEHF: Introduce preempted return code parameter to ehf_allow_ns_preemption()
Jeenu Viswambharan [Mon, 22 Jan 2018 12:29:12 +0000 (12:29 +0000)]
EHF: Introduce preempted return code parameter to ehf_allow_ns_preemption()

When a Yielding SMC is preempted, it's possible that Non-secure world is
resumed afterwards. In this case, Non-secure execution would find itself
in a state where the SMC has returned. However, the dispatcher might not
get an opportunity to populate the corrected return code for having
been preempted, and therefore the caller of the Yielding SMC cannot
reliably determine whether the SMC had successfully completed or had
been preempted.

To solve this, this patch introduces a new parameter to the
ehf_allow_ns_preemption() API. An SPD, through this parameter, would
provide the expected error code when a Yielding SMC is preempted. EHF
can then populate the specified value in x0 of the Non-secure context so
that the caller of the Yielding SMC correctly identifies the SMC return
as a preemption.

Documentation updates to follow.

Change-Id: Ia9c3f8f03f9d72d81aa235eaae2ee0374b972e1e
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoSDEI: Add prioritisation clarification
Jeenu Viswambharan [Tue, 16 Jan 2018 09:29:30 +0000 (09:29 +0000)]
SDEI: Add prioritisation clarification

To make exception handling amongst Secure components, require that SDEI
exception priorities must be assigned the lowest among Secure
priorities. Clarify documentation to this effect.

Change-Id: I92524b7b7e9b3fa06a10c86372bc3c4dd18c00ad
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoSDEI: Pop dispatch context only after error checking
Jeenu Viswambharan [Mon, 22 Jan 2018 12:04:13 +0000 (12:04 +0000)]
SDEI: Pop dispatch context only after error checking

Currently, when the client attempts to do SDEI_EVENT_COMPLETE or
SDEI_EVENT_COMPLETE_AND_RESUME, the dispatcher pops off the outstanding
dispatch context for sanity check. There are however other checks
following this, which could potentially return failure. If that happens,
by popping the context, the dispatcher has inadvertently discarded a
valid context.

This patch fixes this bug by inspecting (not actually popping) the
outstanding context. The context is popped only after all error checks
are completed.

Change-Id: Ie199f6442f871a8177a8247a0c646543bad76d21
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoFVP: restrict dynamic config to Unix build environment
Soby Mathew [Tue, 27 Feb 2018 11:17:14 +0000 (11:17 +0000)]
FVP: restrict dynamic config to Unix build environment

This patch restricts building the dynamic config DTBs to the Unix
build environment as the Device Tree compiler may not be available
on other build environments.

Change-Id: Ie690e80010a174300e966240fd977b37561156e0
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMISRA fixes for Cortex A75 AMU implementation
Dimitris Papastamos [Tue, 27 Feb 2018 10:55:39 +0000 (10:55 +0000)]
MISRA fixes for Cortex A75 AMU implementation

Change-Id: I61c9fdfda0c0b3c3ec6249519db23602cf4c2100
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoRefactor AMU support for Cortex A75
Dimitris Papastamos [Wed, 14 Feb 2018 10:28:36 +0000 (10:28 +0000)]
Refactor AMU support for Cortex A75

This patch also fixes the assumption that the counters are disabled on
the resume path.  This is incorrect as the AMU counters are enabled
early in the CPU reset function before `cpuamu_context_restore()`
runs.

Change-Id: I38a94eb166a523f00de18e86860434ffccff2131
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoFactor out CPU AMU helpers
Dimitris Papastamos [Wed, 14 Feb 2018 10:00:06 +0000 (10:00 +0000)]
Factor out CPU AMU helpers

This patch also fixes `cpuamu_write_cpuamcntenclr_el0()` to use an MSR
instruction instead of an MRS instruction.

Change-Id: Ia6531f64b5ebc60ba432124eaa8d8eaccba40ed0
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoMISRA fixes for AMU/SPE and SVE
Dimitris Papastamos [Mon, 26 Feb 2018 17:56:31 +0000 (17:56 +0000)]
MISRA fixes for AMU/SPE and SVE

Change-Id: I38470528111410cf12b187eb1397d87b812c9416
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoaarch32: Fix multiple bugs in amu_helpers.S
Dimitris Papastamos [Tue, 20 Feb 2018 12:25:36 +0000 (12:25 +0000)]
aarch32: Fix multiple bugs in amu_helpers.S

AArch32 uses odd-even pairs when passing 64-bit arguments to
functions.  For example in `amu_group0_cnt_write_internal()` the
second argument is a uint64_t which is passed in r2 and r3.

In `amu_group1_set_evtype_internal()` the value that needs to be
written to the system register is in r1 not in r0.

Change-Id: I20196268fdb1dc9ef6c4ebe61e761fba9623b3f2
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoAssert that group0/group1 counter config is what we expect
Dimitris Papastamos [Tue, 20 Feb 2018 11:16:44 +0000 (11:16 +0000)]
Assert that group0/group1 counter config is what we expect

Before suspend the AMU counters should be enabled and after resume
they should be disabled.  Assert that to be consistent with the
AArch64 implementation of `amu_context_{save,restore}()`.

Change-Id: Ia46f77e4062b93afb93721a2890a9b9d2a7f300e
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoImplement {spe,sve}_supported() helpers and refactor code
Dimitris Papastamos [Mon, 19 Feb 2018 14:52:19 +0000 (14:52 +0000)]
Implement {spe,sve}_supported() helpers and refactor code

Implement helpers to test if the core supports SPE/SVE.  We have a
similar helper for AMU and this patch makes all extensions consistent
in their implementation.

Change-Id: I3e6f7522535ca358259ad142550b19fcb883ca67
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
6 years agoAdd comments about mismatched TCR_ELx and xlat tables
Antonio Nino Diaz [Fri, 23 Feb 2018 15:07:54 +0000 (15:07 +0000)]
Add comments about mismatched TCR_ELx and xlat tables

When the MMU is enabled and the translation tables are mapped, data
read/writes to the translation tables are made using the attributes
specified in the translation tables themselves. However, the MMU
performs table walks with the attributes specified in TCR_ELx. They are
completely independent, so special care has to be taken to make sure
that they are the same.

This has to be done manually because it is not practical to have a test
in the code. Such a test would need to know the virtual memory region
that contains the translation tables and check that for all of the
tables the attributes match the ones in TCR_ELx. As the tables may not
even be mapped at all, this isn't a test that can be made generic.

The flags used by enable_mmu_xxx() have been moved to the same header
where the functions are.

Also, some comments in the linker scripts related to the translation
tables have been fixed.

Change-Id: I1754768bffdae75f53561b1c4a5baf043b45a304
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1263 from soby-mathew/sm/dyn_config
davidcunado-arm [Mon, 26 Feb 2018 22:24:12 +0000 (22:24 +0000)]
Merge pull request #1263 from soby-mathew/sm/dyn_config

Dynamic Configuration Prototype

6 years agoDynamic cfg: MISRA fixes
Soby Mathew [Wed, 21 Feb 2018 01:16:39 +0000 (01:16 +0000)]
Dynamic cfg: MISRA fixes

Change-Id: I1d85b76af002b8b672fcaeca94939b7420bc8243
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoFVP: Add TB_FW_CONFIG and HW_CONFIG
Soby Mathew [Thu, 8 Feb 2018 11:39:38 +0000 (11:39 +0000)]
FVP: Add TB_FW_CONFIG and HW_CONFIG

This patch adds TB_FW_CONFIG for FVP and allows FVP
to select the appropriate HW_CONFIG to include in the
fip. The HW_CONFIG for FVP is selected via `FVP_HW_CONFIG_DTS`
build option. The TB_FW_CONFIG specifies the load address of
HW_CONFIG to BL2. Since currently the load address is different
between AARCH32 and AARCH64, 2 separate TB_FW_CONFIGs are
maintained for the 2 modes.

Change-Id: Ide8581e752dfa900087f5895c775073c841c0daf
Signed-Off-By: Soby Mathew <soby.mathew@arm.com>
6 years agoFVP: Fix AArch32 dts for `interrupts` node
Soby Mathew [Fri, 9 Feb 2018 10:40:49 +0000 (10:40 +0000)]
FVP: Fix AArch32 dts for `interrupts` node

The commit 8d2c497 changed the interrupt map in `rtsm_ve-motherboard.dtsi`
for the Linux FDT sources to be compatible for FreeBSD. But this also
introduced a regression for FVP AArch32 mode but was undetected till now
because the corresponding DTB was not updated. This patch creates a
new `rtsm_ve-motherboard-aarch32.dtsi` which reverts the change and is
now included by the AArch32 DTS files.

Change-Id: Ibefbbf43a91c8fb890f0fa7a22be91f0227dad34
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoARM Platforms: Load HW_CONFIG in BL2
Soby Mathew [Mon, 15 Jan 2018 14:45:33 +0000 (14:45 +0000)]
ARM Platforms: Load HW_CONFIG in BL2

The patch adds the necessary changes to load HW_CONFIG in BL2 for
ARM Platforms :

1. The load address of HW_CONFIG is specified via the `hw_config_addr`
property in TB_FW_CONFIG is loaded by BL1. The `hw_config_max_size`
property defines the maximum size to be expected for the HW_CONFIG.
The `arm_dyn_cfg_helpers.c` and corresponding header implements
utility functions to parse these DT properties defined.
The `arm_dyn_cfg.c` implements wrappers to these helpers to enable
them to be invoked from ARM platform layer.

2. `HW_CONFIG` is added to the `bl2_mem_params_descs[]` array which is
the list of images to be loaded by BL2.

3. The `libfdt` sources are now included when BL2 is built

4. A new helper `populate_next_bl_params_config()` is introduced in
desc_image_load.c to populate the subsequent executable BL images
with the `hw_config` and the corresponding `fw_config` if available.
The `plat_get_next_bl_params()` API for ARM platforms is modified to
invoke this new helper.

5. The implementation of `bl2_early_platform_setup2()` is modified to
consider `arg0` as well in addition to `arg1` passed from BL1.

6. Bump up the BL2 size for Juno to accommodate the inclusion of libfdt.

Change-Id: I80f1554adec41753e0d179a5237364f04fe13a3f
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoARM Platorms: Load TB_FW_CONFIG in BL1
Soby Mathew [Mon, 15 Jan 2018 14:43:42 +0000 (14:43 +0000)]
ARM Platorms: Load TB_FW_CONFIG in BL1

This patch modifies the bl1_platform_setup() API to load and authenticate
TB_FW_CONFIG in BL1. The load address of the same is passed on to BL2 in
`arg0` of entrypoint info. The fvp_io_storage.c and arm_io_storage.c also
adds entries corresponding to TB_FW_CONFIG. A helper function
`arm_load_tb_fw_config()` is added to load and authenticate TB_FW_CONFIG
if present.

Change-Id: Ie7bce667b3fad2b1a083bbcbc0a773f9f04254b1
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoDynamic cfg: Introduce fdt wrappers
Soby Mathew [Mon, 6 Nov 2017 13:56:40 +0000 (13:56 +0000)]
Dynamic cfg: Introduce fdt wrappers

Change-Id: I9b1cdaf2430a1998a69aa366ea1461224a3d43dc
Co-Authoured-by: Jeenu Viswambharan <Jeenu.Viswambharan@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoAdd dynamic config image IDs
Soby Mathew [Mon, 8 Jan 2018 13:36:49 +0000 (13:36 +0000)]
Add dynamic config image IDs

Change-Id: I147031dea9487dc1976e31ad40c89b221e44edbc
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoBL1: Deprecate the `bl1_init_bl2_mem_layout()` API
Soby Mathew [Wed, 10 Jan 2018 12:51:34 +0000 (12:51 +0000)]
BL1: Deprecate the `bl1_init_bl2_mem_layout()` API

The `bl1_init_bl2_mem_layout()` API is now deprecated. The default weak
implementation of `bl1_plat_handle_post_image_load()` calculates the
BL2 memory layout and populates the same in x1(r1). This ensures
compatibility for the deprecated API.

Change-Id: Id44bdc1f572dc42ee6ceef4036b3a46803689315
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoARM Platforms: Migrate to new BL handover interface
Soby Mathew [Wed, 10 Jan 2018 15:59:31 +0000 (15:59 +0000)]
ARM Platforms: Migrate to new BL handover interface

This patch migrates the ARM Standard platforms to the new BL
handover interface. The arm_blx_early_platform_setup() functions
are also modified to take in 4 arguments. The `ARM_BL31_PLAT_PARAM_VAL`
value passed to BL31 from BL2 is now in arg3 in preparation of dynamic
configuration arguments.

Change-Id: I33e8e61325a19e7a7127b1ff203c3b86921bf153
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoIntroduce the new BL handover interface
Soby Mathew [Tue, 9 Jan 2018 14:36:14 +0000 (14:36 +0000)]
Introduce the new BL handover interface

This patch introduces a new BL handover interface. It essentially allows
passing 4 arguments between the different BL stages. Effort has been made
so as to be compatible with the previous handover interface. The previous
blx_early_platform_setup() platform API is now deprecated and the new
blx_early_platform_setup2() variant is introduced. The weak compatiblity
implementation for the new API is done in the `plat_bl_common.c` file.
Some of the new arguments in the new API will be reserved for generic
code use when dynamic configuration support is implemented. Otherwise
the other registers are available for platform use.

Change-Id: Ifddfe2ea8e32497fe1beb565cac155ad9d50d404
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoDynamic cfg: Add HW and TB_FW configs to CoT
Soby Mathew [Tue, 7 Nov 2017 17:03:57 +0000 (17:03 +0000)]
Dynamic cfg: Add HW and TB_FW configs to CoT

This patch adds image IDs to `hw_config` and `tb_fw_config` and
includes them in the default Chain Of Trust (CoT).

Change-Id: If7bb3e9be8a5e48be76614b35bf43d58fc7fed12
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoDynamic cfg: Update the tools
Soby Mathew [Tue, 7 Nov 2017 16:50:31 +0000 (16:50 +0000)]
Dynamic cfg: Update the tools

This patch updates the `fiptool` and `cert_create` for the
`hw_config` and `tb_fw_config` dynamic configuration files.
The necessary UUIDs and OIDs are assigned to these files and
the `cert_create` is updated to generate appropriate hashes
and include them in the "Trusted Boot FW Certificate". The
`fiptool` is updated to allow the configs to be specified
via cmdline and included in the generated FIP.

Change-Id: I940e751a49621ae681d14e162aa1f5697eb0cb15
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMakefile: Add `all` target to MAKE_DTBS
Soby Mathew [Thu, 14 Dec 2017 17:44:56 +0000 (17:44 +0000)]
Makefile: Add `all` target to MAKE_DTBS

This patch makes some minor changes to `MAKE_DTBS` make macro
and adds `dtbs` target to the `all` make target.

Change-Id: I1c5b4a603ada31d2dac2ed73da9ff707b410dd11
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoAdd image_id to bl1_plat_handle_post/pre_image_load()
Soby Mathew [Thu, 8 Feb 2018 17:45:12 +0000 (17:45 +0000)]
Add image_id to bl1_plat_handle_post/pre_image_load()

This patch adds an argument to bl1_plat_post/pre_image_load() APIs
to make it more future proof. The default implementation of
these are moved to `plat_bl1_common.c` file.

These APIs are now invoked appropriately in the FWU code path prior
to or post image loading by BL1 and are not restricted
to LOAD_IMAGE_V2.

The patch also reorganizes some common platform files. The previous
`plat_bl2_el3_common.c` and `platform_helpers_default.c` files are
merged into a new `plat_bl_common.c` file.

NOTE: The addition of an argument to the above mentioned platform APIs
is not expected to have a great impact because these APIs were only
recently added and are unlikely to be used.

Change-Id: I0519caaee0f774dd33638ff63a2e597ea178c453
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMerge pull request #1273 from antonio-nino-diaz-arm/an/fix-tlbi-disable-mmu
davidcunado-arm [Mon, 26 Feb 2018 10:42:55 +0000 (10:42 +0000)]
Merge pull request #1273 from antonio-nino-diaz-arm/an/fix-tlbi-disable-mmu

Ensure the correct execution of TLBI instructions

6 years agoMerge pull request #1276 from swarren/issue-551
davidcunado-arm [Sun, 25 Feb 2018 21:03:42 +0000 (21:03 +0000)]
Merge pull request #1276 from swarren/issue-551

Make all build results depend on all makefiles

6 years agoMerge pull request #1264 from fengbaopeng/integration
davidcunado-arm [Sat, 24 Feb 2018 20:18:14 +0000 (20:18 +0000)]
Merge pull request #1264 from fengbaopeng/integration

drivers:ufs: fix hynix ufs bug with quirk on hi36xx SoC

6 years agodrivers:ufs: fix hynix ufs bug with quirk on hi36xx SoC
fengbaopeng [Mon, 12 Feb 2018 12:53:54 +0000 (20:53 +0800)]
drivers:ufs: fix hynix ufs bug with quirk on hi36xx SoC

Hynix ufs has deviations on hi36xx platform which will result
in ufs bursts transfer failures at a very low probability.

To fix the problem, the Hynix device must set the register
VS_DebugSaveConfigTime to 0x10, which will set time reference
for SaveConfigTime is 250 ns. The time reference for SaveConfigTime
is 40 ns by default.

Signed-off-by: fengbaopeng <fengbaopeng@hisilicon.com>
6 years agoMerge pull request #1281 from antonio-nino-diaz-arm/an/fix-foundation-instructions
davidcunado-arm [Fri, 23 Feb 2018 20:45:34 +0000 (20:45 +0000)]
Merge pull request #1281 from antonio-nino-diaz-arm/an/fix-foundation-instructions

Fix Foundation FVP instructions in User Guide

6 years agoMerge pull request #1262 from ssalko/ssalko_dev
davidcunado-arm [Fri, 23 Feb 2018 20:45:03 +0000 (20:45 +0000)]
Merge pull request #1262 from ssalko/ssalko_dev

qemu: Fix interrupt type check

6 years agoMerge pull request #1279 from soby-mathew/sm/BL2_base_assert
davidcunado-arm [Fri, 23 Feb 2018 19:25:17 +0000 (19:25 +0000)]
Merge pull request #1279 from soby-mathew/sm/BL2_base_assert

ARM Platforms: Add assertion for BL2_BASE

6 years agoFix Foundation FVP instructions in User Guide
Antonio Nino Diaz [Fri, 23 Feb 2018 11:01:31 +0000 (11:01 +0000)]
Fix Foundation FVP instructions in User Guide

The Arm Trusted Firmware is built by default for ARMv8-A version 8.0.
However, the Foundation FVP runs by default in the highest version of
the architecture it supports. This causes problems when trying to run
the Arm Trusted Firmware on it.

This patch adds a note to the User Guide about this problem.

Change-Id: I0220fe1a9c66c2292149ad4a7ffe5e27ba08ab28
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1278 from soby-mathew/sm/aarch32_errata_fix
davidcunado-arm [Thu, 22 Feb 2018 23:29:11 +0000 (23:29 +0000)]
Merge pull request #1278 from soby-mathew/sm/aarch32_errata_fix

Fixup AArch32 errata printing framework

6 years agoFixup AArch32 errata printing framework
Soby Mathew [Wed, 21 Feb 2018 15:48:03 +0000 (15:48 +0000)]
Fixup AArch32 errata printing framework

The AArch32 assembly implementation of `print_errata_status` did not save
a register which was getting clobbered by a `get_cpu_ops_ptr`. This
patch fixes that.

Change-Id: Id0711e46b7c685a18a10328d4b513e952a5d860b
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoARM Platforms: Add CASSERT for BL2_BASE
Soby Mathew [Tue, 20 Feb 2018 12:50:47 +0000 (12:50 +0000)]
ARM Platforms: Add CASSERT for BL2_BASE

Change-Id: I93e491fde2a991fc39584c2762f33cbea40541e3
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoARM Platforms: Don't build BL1 and BL2 if RESET_TO_SP_MIN=1
Soby Mathew [Tue, 20 Feb 2018 14:48:50 +0000 (14:48 +0000)]
ARM Platforms: Don't build BL1 and BL2 if RESET_TO_SP_MIN=1

Change-Id: Iadb21bb56f2e61d7e6aec9b3b3efd30059521def
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoMake all build results depend on all makefiles
Stephen Warren [Thu, 22 Feb 2018 00:13:50 +0000 (17:13 -0700)]
Make all build results depend on all makefiles

This makes incremental builds work when the only change is to a
definition in a makefile.

Fixes arm-software/tf-issues#551

Signed-off-by: Stephen Warren <swarren@nvidia.com>
6 years agoMerge pull request #1275 from soby-mathew/sm/tzc400_fix
davidcunado-arm [Wed, 21 Feb 2018 20:24:59 +0000 (20:24 +0000)]
Merge pull request #1275 from soby-mathew/sm/tzc400_fix

Resolve TZC400 build issue when DEBUG=1 and ENABLE_ASSERTIONS=0

6 years agoResolve TZC400 build issue when DEBUG=1 and ENABLE_ASSERTIONS=0
Soby Mathew [Tue, 20 Feb 2018 13:52:20 +0000 (13:52 +0000)]
Resolve TZC400 build issue when DEBUG=1 and ENABLE_ASSERTIONS=0

Previously the definition of `_tzc_read_peripheral_id()` was wrapped
in ENABLE_ASSERTIONS build flag. This causes build issue for TZC400 driver
when DEBUG=1 and ENABLE_ASSERTIONS=0. This patch fixes the same by
moving the definitions outside the ENABLE_ASSERTIONS build flag.

Change-Id: Ic1cad69f02ce65ac34aefd39eaa96d5781043152
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
6 years agoEnsure the correct execution of TLBI instructions
Antonio Nino Diaz [Mon, 19 Feb 2018 13:53:48 +0000 (13:53 +0000)]
Ensure the correct execution of TLBI instructions

After executing a TLBI a DSB is needed to ensure completion of the
TLBI.

rk3328: The MMU is allowed to load TLB entries for as long as it is
enabled. Because of this, the correct place to execute a TLBI is right
after disabling the MMU.

Change-Id: I8280f248d10b49a8c354a4ccbdc8f8345ac4c170
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoMerge pull request #1270 from antonio-nino-diaz-arm/an/smc-unknown
davidcunado-arm [Tue, 20 Feb 2018 09:02:24 +0000 (09:02 +0000)]
Merge pull request #1270 from antonio-nino-diaz-arm/an/smc-unknown

Redefine SMC_UNK as -1 instead of 0xFFFFFFFF

6 years agoMerge pull request #1271 from afaerber/tegra-fixes
davidcunado-arm [Mon, 19 Feb 2018 23:27:24 +0000 (23:27 +0000)]
Merge pull request #1271 from afaerber/tegra-fixes

tegra: Fix mmap_region_t struct mismatch

6 years agoMerge pull request #1259 from hzhuang1/fix_uart
davidcunado-arm [Sat, 17 Feb 2018 21:55:57 +0000 (21:55 +0000)]
Merge pull request #1259 from hzhuang1/fix_uart

hikey960: avoid hardcode on uart port

6 years agotegra: Fix mmap_region_t struct mismatch
Andreas Färber [Sat, 17 Feb 2018 05:02:32 +0000 (06:02 +0100)]
tegra: Fix mmap_region_t struct mismatch

Commit fdb1964c34968921379d3592e7ac6e9a685dbab1 ("xlat: Introduce
MAP_REGION2() macro") added a granularity field to mmap_region_t.

Tegra platforms were using the v2 xlat_tables implementation in
common/tegra_common.mk, but v1 xlat_tables.h headers in soc/*/plat_setup.c
where arrays are being defined. This caused the next physical address to
be read as granularity, causing EINVAL error and triggering an assert.

Consistently use xlat_tables_v2.h header to avoid this.

Fixes ARM-software/tf-issues#548.

Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agohikey960: avoid hardcode on uart port
Haojian Zhuang [Sat, 17 Feb 2018 04:06:18 +0000 (12:06 +0800)]
hikey960: avoid hardcode on uart port

Avoid hardcode on uart port. The uart port could be auto detected
on HiKey960 platform.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
6 years agoMerge pull request #1268 from jeenu-arm/ehf-pri-fix
davidcunado-arm [Sat, 17 Feb 2018 00:21:25 +0000 (00:21 +0000)]
Merge pull request #1268 from jeenu-arm/ehf-pri-fix

EHF: Fix priority check

6 years agoMerge pull request #1267 from jeenu-arm/console-fix
davidcunado-arm [Fri, 16 Feb 2018 22:47:06 +0000 (22:47 +0000)]
Merge pull request #1267 from jeenu-arm/console-fix

ARM platforms: Fix console address for flush

6 years agoMerge pull request #1266 from antonio-nino-diaz-arm/an/misra-urls
davidcunado-arm [Fri, 16 Feb 2018 21:09:36 +0000 (21:09 +0000)]
Merge pull request #1266 from antonio-nino-diaz-arm/an/misra-urls

Remove URLs from comments

6 years agoMerge pull request #1258 from vchong/optee_dbg
davidcunado-arm [Fri, 16 Feb 2018 21:02:04 +0000 (21:02 +0000)]
Merge pull request #1258 from vchong/optee_dbg

optee: print header info before validate

6 years agoRedefine SMC_UNK as -1 instead of 0xFFFFFFFF
Antonio Nino Diaz [Wed, 14 Feb 2018 14:22:29 +0000 (14:22 +0000)]
Redefine SMC_UNK as -1 instead of 0xFFFFFFFF

According to the SMC Calling Convention (ARM DEN0028B):

    The Unknown SMC Function Identifier is a sign-extended value of
    (-1) that is returned in R0, W0 or X0 register.

The value wasn't sign-extended because it was defined as a 32-bit
unsigned value (0xFFFFFFFF).

SMC_PREEMPT has been redefined as -2 for the same reason.

NOTE: This might be a compatibility break for some AArch64 platforms
that don't follow the previous version of the SMCCC (ARM DEN0028A)
correctly. That document specifies that only the bottom 32 bits of the
returned value must be checked. If a platform relies on the top 32 bits
of the result being 0 (so that SMC_UNK is 0x00000000FFFFFFFF), it will
have to fix its code to comply with the SMCCC.

Change-Id: I7f7b109f6b30c114fe570aa0ead3c335383cb54d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoRemove URLs from comments
Antonio Nino Diaz [Wed, 14 Feb 2018 11:41:26 +0000 (11:41 +0000)]
Remove URLs from comments

This fixes all defects according to MISRA Rule 3.1: "The character
sequences /* and // shall not be used within a comment". This affects
all URLs in comments, so they have been removed:

- The link in `sdei_state.c` can also be found in the documentation file
  `docs/sdei.rst`.

- The bug that the file `io_fip.c` talks about doesn't affect the
  currently supported version of GCC, so it doesn't make sense to keep
  the comment. Note that the version of GCC officially supported is the
  one that comes with Linaro Release 17.10, which is GCC 6.2.

- The link in `tzc400.c` was broken, and it didn't correctly direct to
  the Technical Reference Manual it should. The link has been replaced
  by the title of the document, which is more convenient when looking
  for the document.

Change-Id: I89f60c25f635fd4c008a5d3a14028f814c147bbe
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
6 years agoEHF: Fix priority check
Jeenu Viswambharan [Mon, 5 Feb 2018 11:20:37 +0000 (11:20 +0000)]
EHF: Fix priority check

When deactivating, it's not an error if the priority being deactivating
is equal to the active priority. Fix this.

Change-Id: I66f0e9e775ac9aba8a7cc48cd3ecd3b358be63c0
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoARM platforms: Fix console address for flush
Jeenu Viswambharan [Thu, 25 Jan 2018 12:49:57 +0000 (12:49 +0000)]
ARM platforms: Fix console address for flush

The console core flush API expects the base address in the first
register, but ARM helpers currently sets the second register with the
base address. This causes an assert failure.

This patch fixes that.

Change-Id: Ic54c423cd60f2756902ab3cfc77b3de2ac45481e
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
6 years agoMerge pull request #1256 from jeenu-arm/tsp-ehf
davidcunado-arm [Mon, 12 Feb 2018 09:52:08 +0000 (17:52 +0800)]
Merge pull request #1256 from jeenu-arm/tsp-ehf

TSP changes for EHF

6 years agoqemu: Fix interrupt type check
Santeri Salko [Thu, 8 Feb 2018 20:01:26 +0000 (22:01 +0200)]
qemu: Fix interrupt type check

Function plat_ic_get_pending_interrupt_type() should return interrupt
type, not id. The function is used in aarch64 exception handling and
currently the irq/fiq forwarding fails if a secure interrupt happens while
running normal world.

The qemu-specific gic file does not contain any extra functionality so it
can be removed and common file can be used instead.

fixes arm-software/tf-issues#546

Signed-off-by: Santeri Salko <santeri.salko@gmail.com>
6 years agoMerge pull request #1257 from vchong/poplar_maintainer
davidcunado-arm [Fri, 9 Feb 2018 03:38:12 +0000 (11:38 +0800)]
Merge pull request #1257 from vchong/poplar_maintainer

maintainers.rst: Add maintainer for plat Poplar

6 years agoMerge pull request #1251 from vchong/ld_img_v2
davidcunado-arm [Fri, 9 Feb 2018 03:36:51 +0000 (11:36 +0800)]
Merge pull request #1251 from vchong/ld_img_v2

poplar: misc updates

6 years agoMerge pull request #1260 from sandrine-bailleux-arm/topics/sb/fix-zlib-build
davidcunado-arm [Thu, 8 Feb 2018 17:14:52 +0000 (01:14 +0800)]
Merge pull request #1260 from sandrine-bailleux-arm/topics/sb/fix-zlib-build

zlib: Fix build error when LOG_LEVEL=50

6 years agozlib: Fix build error when LOG_LEVEL=50
Sandrine Bailleux [Wed, 7 Feb 2018 09:32:01 +0000 (10:32 +0100)]
zlib: Fix build error when LOG_LEVEL=50

When enabling VERBOSE() traces, the zlib library fails to compile
because of an incompatible format specifier string. Fix that.

Change-Id: I74ff1c8dc2e6157ee982f7754bce4504599e3013
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
6 years agoMerge pull request #1254 from masahir0y/bl2-at-el3
davidcunado-arm [Thu, 8 Feb 2018 05:33:11 +0000 (13:33 +0800)]
Merge pull request #1254 from masahir0y/bl2-at-el3

Fix zero_normalmem() for BL2_AT_EL3

6 years agooptee: print header info before validate
Victor Chong [Fri, 26 Jan 2018 07:10:07 +0000 (16:10 +0900)]
optee: print header info before validate

Currently optee header info is only printed after it is validated,
but this does not help with debugging in case of error, so print it
before.

Signed-off-by: Victor Chong <victor.chong@linaro.org>
6 years agohikey*, poplar: platform.mk: Fix typo in variable assignments
Victor Chong [Wed, 31 Jan 2018 15:37:49 +0000 (00:37 +0900)]
hikey*, poplar: platform.mk: Fix typo in variable assignments

Signed-off-by: Victor Chong <victor.chong@linaro.org>
6 years agopoplar: Support Trusted OS extra image (OP-TEE header) parsing
Victor Chong [Wed, 31 Jan 2018 15:35:39 +0000 (00:35 +0900)]
poplar: Support Trusted OS extra image (OP-TEE header) parsing

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
6 years agopoplar: Add LOAD_IMAGE_V2 support
Victor Chong [Wed, 31 Jan 2018 15:35:22 +0000 (00:35 +0900)]
poplar: Add LOAD_IMAGE_V2 support

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
6 years agopoplar: Add build option for dram size
Victor Chong [Mon, 29 Jan 2018 09:11:02 +0000 (18:11 +0900)]
poplar: Add build option for dram size

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
6 years agopoplar: Fix typo
Victor Chong [Mon, 29 Jan 2018 09:08:34 +0000 (18:08 +0900)]
poplar: Fix typo

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
6 years agopoplar: Remove unused function prototype
Victor Chong [Thu, 25 Jan 2018 16:41:24 +0000 (01:41 +0900)]
poplar: Remove unused function prototype

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
6 years agomaintainers.rst: Add maintainer for plat Poplar
Victor Chong [Tue, 6 Feb 2018 06:11:12 +0000 (15:11 +0900)]
maintainers.rst: Add maintainer for plat Poplar

Signed-off-by: Victor Chong <victor.chong@linaro.org>
6 years agoMerge pull request #1173 from etienne-lms/armv7-qemu
davidcunado-arm [Wed, 7 Feb 2018 03:57:19 +0000 (11:57 +0800)]
Merge pull request #1173 from etienne-lms/armv7-qemu

support to boot OP-TEE on AArch32/Armv7+example with Cortex-A15/Qemu

6 years ago[fix] aarch32: optee: define the OP-TEE secure payload
Etienne Carriere [Tue, 6 Feb 2018 09:58:21 +0000 (10:58 +0100)]
[fix] aarch32: optee: define the OP-TEE secure payload

As per MISRA C-2012 Rule 10.4.
arg0 is a u_register_t, can be a 32bit or 64bit upon architecture.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>