Commit Graph

3115 Commits

Author SHA1 Message Date
Soby Mathew 7af7038e87 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>
2018-02-22 15:19:52 +00:00
Soby Mathew caf4eca135 ARM Platforms: Add CASSERT for BL2_BASE
Change-Id: I93e491fde2a991fc39584c2762f33cbea40541e3
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-22 15:19:03 +00:00
Soby Mathew 81bf6aae68 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>
2018-02-22 15:16:48 +00:00
Arve Hjønnevåg 06ff251ec1 tegra/trusty: Setup tegra specific trusty args in platform code
Fixes tegra build with SPD=trusty. Not tested.

Change-Id: I851a2b00b8b1cc65112b6088980a811d8eda1a99
2018-02-21 17:36:44 -08:00
Stephen Warren c6f651f9a3 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>
2018-02-21 17:13:50 -07:00
davidcunado-arm 4535554e68
Merge pull request #1275 from soby-mathew/sm/tzc400_fix
Resolve TZC400 build issue when DEBUG=1 and ENABLE_ASSERTIONS=0
2018-02-21 20:24:59 +00:00
Soby Mathew 806d9ad171 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>
2018-02-21 16:51:12 +00:00
Antonio Nino Diaz 6bf0e07930 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>
2018-02-21 13:54:55 +00:00
davidcunado-arm 5ff5a6d9c3
Merge pull request #1270 from antonio-nino-diaz-arm/an/smc-unknown
Redefine SMC_UNK as -1 instead of 0xFFFFFFFF
2018-02-20 09:02:24 +00:00
davidcunado-arm 601abdba4a
Merge pull request #1271 from afaerber/tegra-fixes
tegra: Fix mmap_region_t struct mismatch
2018-02-19 23:27:24 +00:00
davidcunado-arm 1504715051
Merge pull request #1259 from hzhuang1/fix_uart
hikey960: avoid hardcode on uart port
2018-02-17 21:55:57 +00:00
Andreas Färber 28db3e96ef tegra: Fix mmap_region_t struct mismatch
Commit fdb1964c34 ("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>
2018-02-17 06:15:35 +01:00
Haojian Zhuang 135d713c7a 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>
2018-02-17 12:06:18 +08:00
davidcunado-arm 3d4f60358d
Merge pull request #1268 from jeenu-arm/ehf-pri-fix
EHF: Fix priority check
2018-02-17 00:21:25 +00:00
davidcunado-arm 885b7c85c1
Merge pull request #1267 from jeenu-arm/console-fix
ARM platforms: Fix console address for flush
2018-02-16 22:47:06 +00:00
davidcunado-arm aedbc7b9e4
Merge pull request #1266 from antonio-nino-diaz-arm/an/misra-urls
Remove URLs from comments
2018-02-16 21:09:36 +00:00
davidcunado-arm f89a89f96f
Merge pull request #1258 from vchong/optee_dbg
optee: print header info before validate
2018-02-16 21:02:04 +00:00
Antonio Nino Diaz 4abd7fa71f 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>
2018-02-15 15:04:34 +00:00
Antonio Nino Diaz fb1198b1bf 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>
2018-02-14 11:41:26 +00:00
Jeenu Viswambharan db1631ef9c 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>
2018-02-12 15:12:53 +00:00
Jeenu Viswambharan f2c83c1a54 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>
2018-02-12 15:12:53 +00:00
davidcunado-arm 15e5958560
Merge pull request #1256 from jeenu-arm/tsp-ehf
TSP changes for EHF
2018-02-12 17:52:08 +08:00
Santeri Salko 53a98be35f 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>
2018-02-09 20:49:57 +02:00
davidcunado-arm e47a8323ec
Merge pull request #1257 from vchong/poplar_maintainer
maintainers.rst: Add maintainer for plat Poplar
2018-02-09 11:38:12 +08:00
davidcunado-arm 976f7f40a4
Merge pull request #1251 from vchong/ld_img_v2
poplar: misc updates
2018-02-09 11:36:51 +08:00
davidcunado-arm 014334ccfe
Merge pull request #1260 from sandrine-bailleux-arm/topics/sb/fix-zlib-build
zlib: Fix build error when LOG_LEVEL=50
2018-02-09 01:14:52 +08:00
Sandrine Bailleux 57546074cb 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>
2018-02-08 09:36:48 +01:00
davidcunado-arm cc40f7fe01
Merge pull request #1254 from masahir0y/bl2-at-el3
Fix zero_normalmem() for BL2_AT_EL3
2018-02-08 13:33:11 +08:00
Victor Chong 5c0bda714b 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>
2018-02-08 02:17:24 +09:00
Victor Chong 3b12a6fc8e hikey*, poplar: platform.mk: Fix typo in variable assignments
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2018-02-08 02:14:46 +09:00
Victor Chong f3d522be8e 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>
2018-02-08 02:14:46 +09:00
Victor Chong 0d8052a4ea poplar: Add LOAD_IMAGE_V2 support
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-08 02:14:46 +09:00
Victor Chong 8ad132b3f1 poplar: Add build option for dram size
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-08 02:14:46 +09:00
Victor Chong ce2547f8d3 poplar: Fix typo
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-07 19:20:52 +09:00
Victor Chong b715f116ee poplar: Remove unused function prototype
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-07 19:20:52 +09:00
Victor Chong db04653dd6 maintainers.rst: Add maintainer for plat Poplar
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2018-02-07 19:20:15 +09:00
davidcunado-arm 5b75b4a725
Merge pull request #1173 from etienne-lms/armv7-qemu
support to boot OP-TEE on AArch32/Armv7+example with Cortex-A15/Qemu
2018-02-07 11:57:19 +08:00
Etienne Carriere 95ae5b0044 [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>
2018-02-06 10:58:30 +01:00
Jeenu Viswambharan fb750ee161 interrupt-framework-design.rst: Cosmetic changes
Change-Id: Id2e2800af59ca35fc0c4cfdddd9f5c5afd56a4db
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-06 07:58:55 +00:00
Jeenu Viswambharan 6027796fff TSPD: Require NS preemption along with EL3 exception handling
At present, the build option TSP_NS_INTR_ASYNC_PREEMPT controls how
Non-secure interrupt affects TSPs execution. When TSP is executing:

  1. When TSP_NS_INTR_ASYNC_PREEMPT=0, Non-secure interrupts are received
     at the TSP's exception vector, and TSP voluntarily preempts itself.

  2. When TSP_NS_INTR_ASYNC_PREEMPT=1, Non-secure interrupts causes a
     trap to EL3, which preempts TSP execution.

When EL3 exception handling is in place (i.e.,
EL3_EXCEPTION_HANDLING=1), FIQs are always trapped to EL3. On a system
with GICv3, pending NS interrupts while TSP is executing will be
signalled as FIQ (which traps to EL3). This situation necessitates the
same treatment applied to case (2) above.

Therefore, when EL3 exception handling is in place, additionally
require that TSP_NS_INTR_ASYNC_PREEMPT is set to one 1.

Strictly speaking, this is not required on a system with GICv2, but the
same model is uniformly followed regardless, for simplicity.

Relevant documentation updated.

Change-Id: I928a8ed081fb0ac96e8b1dfe9375c98384da1ccd
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-06 07:58:55 +00:00
Jeenu Viswambharan 1dd022ca6a TSPD: Explicitly allow NS preemption for Yielding SMCs
When EL3 exception handling is in effect (i.e.,
EL3_EXCEPTION_HANDLING=1), Non-secure interrupts can't preempt Secure
execution. However, for yielding SMCs, preemption by Non-secure
interupts is intended.

This patch therefore adds a call to ehf_allow_ns_preemption() before
dispatching a Yielding SMC to TSP.

Change-Id: Ia3a1ae252f3adc0f14e6d7e0502f251bdb349bdf
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-06 07:58:55 +00:00
Jeenu Viswambharan 26ea390891 Deprecate one EL3 interrupt routing model with EL3 exception handling
When ARM Trusted Firmware is built with EL3_EXCEPTION_HANDLING=1,
EL3 interrupts (INTR_TYPE_EL3) will always preempt both Non-secure and
secure execution.

The interrupt management framework currently treats EL3 interrupt
routing as valid. For the above reason, this patch makes them invalid
when EL3_EXCEPTION_HANDLING is in effect.

Change-Id: I95bca8f5dc8df8eb0ff6f305cfba098611522a39
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-06 07:58:55 +00:00
Jeenu Viswambharan c8b55b8f8b Add EL3_EXCEPTION_HANDLING to build command line
Commit 21b818c05f (BL31: Introduce
Exception Handling Framework) introduced the build option
EL3_EXCEPTION_HANDLING, but missed to pass that to the build command
line. This patch fixes that.

Change-Id: I0a1be2c7b41a81e748ad7d6cf795aab7f6d19193
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-06 07:58:55 +00:00
davidcunado-arm 9fd2f13bd6
Merge pull request #1224 from masahir0y/gzip
Support GZIP-compressed images for faster loading and verification
2018-02-06 05:12:28 +00:00
Etienne Carriere 765ed9fc55 qemu: support ARMv7/Cortex-A15
Define Qemu AArch32 implementation for some platform functions
(core position, secondary boot cores, crash console). These are
derived from the AArch64 implementation.

BL31 on Qemu is needed only for ARMv8 and later. On ARMv7, BL32 is
the first executable image after BL2.

Support SP_MIN and OP-TEE as BL32: create a sp_min make script target
in Qemu, define mapping for IMAGE_BL32

Minor fix Qemu return value type for plat_get_ns_image_entrypoint().

Qemu model for the Cortex-A15 does not support the virtualization
extension although the core expects it. To overcome the issue, Qemu
ARMv7 configuration set ARCH_SUPPORTS_VIRTUALIZATION to 0.

Add missing AArch32 assembly macro arm_print_gic_regs from ARM platform
used by the Qemu platform.

Qemu Cortex-A15 model integrates a single cluster with up to 4 cores.

Change-Id: I65b44399071d6f5aa40d5183be11422b9ee9ca15
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2018-02-05 10:42:47 +01:00
Etienne Carriere 10c6695854 aarch32: optee: define the OP-TEE secure payload
AArch32 only platforms can boot the OP-TEE secure firmware as
a BL32 secure payload. Such configuration can be defined through
AARCH32_SP=optee.

The source files can rely on AARCH32_SP_OPTEE to condition
OP-TEE boot specific instruction sequences.

OP-TEE does not expect ARM Trusted Firmware formatted structure
as boot argument. Load sequence is expected to have already loaded
to OP-TEE boot arguments into the bl32 entrypoint info structure.

Last, AArch32 platform can only boot AArch32 OP-TEE images.

Change-Id: Ic28eec5004315fc9111051add6bb1a1d607fc815
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2018-02-05 10:42:42 +01:00
davidcunado-arm 10787b0519
Merge pull request #1249 from masahir0y/uniphier
uniphier: fix and improve memory layout
2018-02-02 22:59:16 +00:00
Etienne Carriere 3fe81dcf5d aarch32: use lr as bl32 boot argument on aarch32 only systems
Add 'lr_svc' as a boot parameter in AArch32 bl1. This is used by Optee
and Trusty to get the non-secure entry point on AArch32 platforms.

This change is not ported in AArch64 mode where the BL31, not BL32,
is in charge of booting the non secure image (BL33).

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2018-02-02 13:16:18 +01:00
davidcunado-arm 9c00555ba6
Merge pull request #1253 from dp-arm/dp/amu32
AMUv1 support for AArch32
2018-02-02 11:14:17 +00:00
Masahiro Yamada 4f557c77f5 uniphier: add ULL to physical address literals
Looks like this is requirement in the pre-merge static analysis.

misra_violation: [Required] MISRA C-2012 Rule 7.2 violation:
Unsigned constants must be declared with U or u suffix.

Adding ULL as requested.  I used ULL() macros for BL*_{BASE,LIMIT}
because they are referenced from linker scripts.

Requested-by: David Cunado <david.cunado@arm.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-02 16:32:30 +09:00