Commit Graph

5728 Commits

Author SHA1 Message Date
Paul Beesley a8ab58e9b2 Merge changes from topic "jc/coverity-fixes" into integration
* changes:
  Fix Coverity #261967, Infinite loop
  Fix Coverity #343017, Missing unlock
  Fix Coverity #343008, Side affect in assertion
  Fix Coverity #342970, Uninitialized scalar variable
2019-08-13 11:20:25 +00:00
Alexei Fedorov 3e516bef12 Merge "spd: opteed: enable NS_TIMER_SWITCH" into integration 2019-08-12 08:50:51 +00:00
Sandrine Bailleux 5119fa7b8d Merge changes from topic "intel-plat-refactor" into integration
* changes:
  intel: Platform common code refactor
  intel: Platform common code refactor
2019-08-07 14:20:01 +00:00
Hadi Asyrafi 3f7b1490dc intel: Platform common code refactor
Pull out common code from aarch64 and include

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: I4d0f5e1bb01bcdacbedf8e6c359de594239b645f
2019-08-07 12:19:11 +00:00
Sandrine Bailleux 7aed52cdb4 Merge changes from topic "qemu_sbsa" into integration
* changes:
  plat/qemu: add gicv3 support for qemu
  plat/qemu: move gicv2 codes to separate file
2019-08-06 14:54:35 +00:00
Justin Chadwell 9624c0a9e0 Fix Coverity #261967, Infinite loop
Coverity has identified that the __aeabi_imod function will loop forever
if the denominator is not a power of 2, which is probably not the
desired behaviour.

The functions in the rest of the file are compiler implementations of
division if ARMv7 does not implement division which is permitted by the
spec. However, while most of the functions in the file are documented
and referenced in other places online, __aeabi_uimod and __aeabi_imod
are not. For this reason, these functions have been removed from the
code base, which also removes the Coverity error.

Change-Id: I20066d72365329a8b03a5536d865c4acaa2139ae
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
2019-08-06 13:06:03 +01:00
Justin Chadwell fc6b626c6b Fix Coverity #343017, Missing unlock
All other returns from this function unlock the responses_lock, so we
also should release the lock in this case.

Change-Id: Ie2cfa8755723fed79e809f9480190d11f373a217
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
2019-08-06 13:06:03 +01:00
Justin Chadwell 4249e8b94f Fix Coverity #343008, Side affect in assertion
This patch simply splits off the increment of next_xlat into a separate
statement to ensure consistent behaviour if the assert was to ever be
removed.

Change-Id: I827f601ccea55f4da9442048419c9b8cc0c5d22e
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
2019-08-06 13:06:03 +01:00
Justin Chadwell dbff52633a Fix Coverity #342970, Uninitialized scalar variable
This ensures that probe_data starts with a reasonable default, as
opposed to whatever was left on the stack.

Change-Id: I5550efea5e2bec7717f9fa063cb11e6a7005cce5
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
2019-08-06 13:05:57 +01:00
Sandrine Bailleux 0d7b0963cf Merge "meson: gxl: Fix CPU hotplug" into integration 2019-08-06 11:04:10 +00:00
Sumit Garg 43f999a7e3 spd: opteed: enable NS_TIMER_SWITCH
Enable dispatcher to save/restore unbanked timer registers. So that
both secure (OP-TEE) and non-secure (Linux) worlds can have independent
access control over timer registers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Change-Id: I4d58d5ff8298587ed478c8433fcbc3aef538d668
2019-08-05 16:15:23 +05:30
Alexei Fedorov 35c28cc9c9 Merge "intel: stratix10: Fix BL31 memory mapping" into integration 2019-08-02 12:50:31 +00:00
Alexei Fedorov a91e904324 Merge "meson: gxl: Fix reset and power off" into integration 2019-08-02 12:50:04 +00:00
Hadi Asyrafi 600db4e338 intel: stratix10: Fix BL31 memory mapping
Previous config blocks ATF runtime service communications with SDM mailbox

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: Ia857facd0bd0790056df94ed1e016bcf619a161e
2019-08-02 20:16:32 +08:00
Remi Pommarel b4694a8677 meson: gxl: Fix CPU hotplug
The CPU[1-3] are reset to initial/cold boot state (with their reset
address set to 0x0). In this state the cpus are waiting for another
one to set the reset address to bl31_warm_entrypoint and wake them up.

The CPU0 needs a bit of a workaround as changing the reset address
either through PSCI mailbox or the mmio mapped RVBAR (at 0xda834650)
does not seem to have any effect. Thus the workaround consists in
emulating the other CPUs' behavior with a WFE loop and manually jumping
to bl31_warm_entrypoint when woken back up by another one.

Change-Id: I11265620b5fd0619285e3993253a3f9a3ff6a7a4
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
2019-08-02 13:54:16 +02:00
Remi Pommarel 43d4a2910d meson: gxl: Fix reset and power off
Before CPU enters standby state (wfi), the AP needs to signal the SCP
through PSCI mailbox.

Also at boot time the AP has to wait for the SCP to be ready before
sending the first scpi commands or it can crash.

Change-Id: Iacc99f5bec745ad71922c5ea07ca5b87088133b6
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
2019-08-02 13:54:16 +02:00
Alexei Fedorov a3b16996ec Merge "Switch AARCH32/AARCH64 to __aarch64__" into integration 2019-08-02 10:21:53 +00:00
Alexei Fedorov 01c44dddbd Merge "Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__" into integration 2019-08-02 08:57:02 +00:00
Julius Werner 402b3cf876 Switch AARCH32/AARCH64 to __aarch64__
NOTE: AARCH32/AARCH64 macros are now deprecated in favor of __aarch64__.

All common C compilers pre-define the same macros to signal which
architecture the code is being compiled for: __arm__ for AArch32 (or
earlier versions) and __aarch64__ for AArch64. There's no need for TF-A
to define its own custom macros for this. In order to unify code with
the export headers (which use __aarch64__ to avoid another dependency),
let's deprecate the AARCH32 and AARCH64 macros and switch the code base
over to the pre-defined standard macro. (Since it is somewhat
unintuitive that __arm__ only means AArch32, let's standardize on only
using __aarch64__.)

Change-Id: Ic77de4b052297d77f38fc95f95f65a8ee70cf200
Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-08-01 13:45:03 -07:00
Julius Werner d5dfdeb65f Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__
NOTE: __ASSEMBLY__ macro is now deprecated in favor of __ASSEMBLER__.

All common C compilers predefine a macro called __ASSEMBLER__ when
preprocessing a .S file. There is no reason for TF-A to define it's own
__ASSEMBLY__ macro for this purpose instead. To unify code with the
export headers (which use __ASSEMBLER__ to avoid one extra dependency),
let's deprecate __ASSEMBLY__ and switch the code base over to the
predefined standard.

Change-Id: Id7d0ec8cf330195da80499c68562b65cb5ab7417
Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-08-01 13:14:12 -07:00
Alexei Fedorov f61469e532 Merge "doc: Suggest to use the latest version 8.3 of GCC" into integration 2019-08-01 10:41:59 +00:00
Louis Mayencourt 57b37e3717 doc: Suggest to use the latest version 8.3 of GCC
At the time of writting, GCC 8.3-2019.03 is the latest version available
on developer.arm.com.

Switch to bare-metal toolchain (arm-eabi-) for AArch32. This allows to
have a finer control on the use of floating-point and SIMD instructions.

Change-Id: I4438401405eae1e5f6d531b0162e8fa06f69135e
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2019-08-01 11:07:38 +01:00
Hadi Asyrafi d8820789ca intel: Platform common code refactor
Pull out common code from agilex and stratix10

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: Iddc0a9e6eccb30823d7b15615d5ce9c6bedb2abc
2019-08-01 16:39:27 +08:00
Alexei Fedorov bd6ef775b4 Merge "intel: agilex: Fix BL31 memory mapping" into integration 2019-07-31 16:21:46 +00:00
Alexei Fedorov fe4604f44c Merge "Enable AMU for Cortex-Hercules" into integration 2019-07-31 16:15:44 +00:00
Balint Dobszay 3d08461a2d Enable AMU for Cortex-Hercules
Change-Id: Ie0a94783d0c8e111ae19fd592304e6485f04ca29
Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
2019-07-31 15:04:03 +00:00
Alexei Fedorov df42c3117b Merge "uniphier: fix typo and coding style" into integration 2019-07-31 14:28:26 +00:00
Alexei Fedorov ce12d794ad Merge "uniphier: replace DIV_ROUND_UP() with div_round_up() from utils_def.h" into integration 2019-07-31 14:28:21 +00:00
Alexei Fedorov 3ee48f40f5 Merge "rockchip: px30: Use new bl31_params_parse functions" into integration 2019-07-31 14:16:45 +00:00
Masahiro Yamada 4dd4bde4b7 uniphier: fix typo and coding style
Fix the typo "warn" -> "warm".

Also fix the following checkpatch.pl warnings:

  CHECK: Prefer using the BIT macro
  CHECK: No space is necessary after a cast
  CHECK: Alignment should match open parenthesis
  CHECK: Unnecessary parentheses around uniphier_io_policies[image_id].dev_handle

Change-Id: Ic11eea2668c4bf2d1e8f089e6338ba7b7156d80b
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-31 16:35:29 +09:00
Masahiro Yamada f5de1aba33 uniphier: replace DIV_ROUND_UP() with div_round_up() from utils_def.h
Use the helper in utils_def.h instead of the own macro.

Change-Id: I527f9e75914d60f66354e365006b960ba5e8cbae
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-31 16:34:25 +09:00
Hadi Asyrafi 94eef29058 intel: agilex: Fix BL31 memory mapping
Previous config blocks ATF runtime service communications with SDM mailbox

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: Ic97aa381d3ceb96395595ec192132859d626b8d1
2019-07-30 10:56:38 +08:00
Ambroise Vincent f8aa5d7df0 rockchip: px30: Use new bl31_params_parse functions
This change is needed for the platform to compile following the changes
made in commits cbdc72b559 and 3e02c7436c.

Change-Id: I3468dd27f3b4f3095fb82f445d51cd8714311eb7
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-07-29 14:52:20 +01:00
Soby Mathew 66c1dafc5e Merge "sgm775: Fix build fail for TSP support on sgm775" into integration 2019-07-26 17:06:14 +00:00
Hongbo Zhang d27c880a36 plat/qemu: add gicv3 support for qemu
This patch adds gicv3 support for qemu, in order not to break any legacy
use case, gicv2 is still set by default, gicv3 can be selected by
compiling parameter QEMU_USE_GIC_DRIVER=QEMU_GICV3.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
Reviewed-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Tested-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Change-Id: Ic63f38abf16ed3c36aa60e80d50103cf05cf797b
2019-07-26 18:53:18 +02:00
Hongbo Zhang 17953ff253 plat/qemu: move gicv2 codes to separate file
This file moves gicv2 codes to a new separate files, target is to add
gicv3 support later.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
Reviewed-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Tested-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Change-Id: I30eb1fda5ea5c2b35d79360c52f46601cbca1bcc
2019-07-26 18:53:18 +02:00
Soby Mathew ac1adfde3f Merge "rockchip: px30: Fix build error" into integration 2019-07-26 10:26:37 +00:00
Soby Mathew 4129340717 Merge changes from topic "advk-serror" into integration
* changes:
  marvell/a3700: Prevent SError accessing PCIe link while it is down
  marvell: Switch to xlat_tables_v2
2019-07-26 09:26:14 +00:00
Soby Mathew df7a906f88 Merge changes from topic "jun-add-imx7-pico" into integration
* changes:
  plat: imx7: Add PicoPi iMX7D basic support
  plat: imx7: refactor code for reuse
2019-07-26 09:25:54 +00:00
Soby Mathew 861264395f Merge changes from topic "gby/cryptocell-multi-vers" into integration
* changes:
  cryptocell: add product version awareness support
  cryptocell: move Cryptocell specific API into driver
2019-07-25 15:38:10 +00:00
Ambroise Vincent 8a079e88d1 rockchip: px30: Fix build error
"result of '1 << 31' requires 33 bits to represent, but 'int' only has
32 bits [-Werror=shift-overflow=]"

This is treated as an error since commit 93c690eba8 ("Enable
-Wshift-overflow=2 to check for undefined shift behavior")

Only the actual errors are being tackled by this patch. It is up to the
platform to choose whether there needs to be further modifications to
the code.

Change-Id: I70860ae5f2a34d7c684bd491b76da50aa04f778e
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-07-25 16:14:40 +01:00
Madhukar Pappireddy 425ace7d94 sgm775: Fix build fail for TSP support on sgm775
Fixed the path to a source file specified in tsp makefile
Created a platform specific tsp makefile

Change-Id: I89565127c67eff510e48e21fd450af4c3088c2d4
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2019-07-25 14:45:17 +00:00
Soby Mathew 18b8266caf Merge "Romlib makefile refactoring and script rewriting" into integration 2019-07-25 12:54:59 +00:00
Gilad Ben-Yossef 76f3c7dc8b cryptocell: add product version awareness support
Add support for multiple Cryptocell revisions which
use different APIs.

This commit only refactors the existing code in preperation to the addition
of another Cryptocell revisions later on.

Signed-off-by: Gilad Ben-Yossef <gilad.benyossef@arm.com>
Change-Id: I16d80b31afb6edd56dc645fee5ea619cc74f09b6
2019-07-25 13:38:07 +03:00
Gilad Ben-Yossef 36ec2bb0bc cryptocell: move Cryptocell specific API into driver
Code using Cryptocell specific APIs was used as part of the
arm common board ROT support, instead of being abstracted
in Cryptocell specific driver code, creating two problems:
- Any none arm board that uses Cryptocell wuld need to
  copy and paste the same code.
- Inability to cleanly support multiple versions of Cryptocell
  API and products.

Move over Cryptocell specific API calls into the Cryptocell
driver, creating abstraction API where needed.

Signed-off-by: Gilad Ben-Yossef <gilad.benyossef@arm.com>
Change-Id: I9e03ddce90fcc47cfdc747098bece86dbd11c58e
2019-07-25 13:29:15 +03:00
Soby Mathew f7fb88f668 Merge changes from topic "jts/spsr" into integration
* changes:
  Refactor SPSR initialisation code
  SSBS: init SPSR register with default SSBS value
2019-07-25 09:13:49 +00:00
Soby Mathew d38613df9a Merge changes I0d17ba6c,I540741d2,I9e6475ad,Ifd769320,I12c04a85, ... into integration
* changes:
  plat/mediatek/mt81*: Use new bl31_params_parse() helper
  plat/rockchip: Use new bl31_params_parse_helper()
  Add helper to parse BL31 parameters (both versions)
  Factor out cross-BL API into export headers suitable for 3rd party code
  Use explicit-width data types in AAPCS parameter structs
  plat/rockchip: Switch to use new common BL aux parameter library
  Introduce lightweight BL platform parameter library
2019-07-25 09:04:21 +00:00
Julius Werner cbdc72b559 plat/mediatek/mt81*: Use new bl31_params_parse() helper
The Mediatek MT8173/MT8183 SoCs are prime candidates for switching to
the new bl31_params_parse() helper, so switch them over. This will allow
BL2 implementations on these platforms to transparently switch over to
the version 2 parameter structure.

Change-Id: I0d17ba6c455102d325a06503d2078a76d12b5deb
Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-07-24 11:04:05 -07:00
Julius Werner 3e02c7436c plat/rockchip: Use new bl31_params_parse_helper()
The Rockchip platform is a prime candidate for switching to the new
bl31_params_parse_helper(), so switch it over. This will allow BL2
implementations on this platform to transparently switch over to the
version 2 parameter structure.

Change-Id: I540741d2425c93f66c8697ce749a351eb2b3a7e8
Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-07-24 11:04:03 -07:00
Soby Mathew 8b6394c95d Merge "plat: imx8m: Add basic rdc module init driver" into integration 2019-07-24 16:18:01 +00:00