Commit Graph

2666 Commits

Author SHA1 Message Date
Etienne Carriere 26e63c4450 ARMv7 target is driven by ARM_ARCH_MAJOR==7
External build environment shall sets directive ARM_ARCH_MAJOR to 7
to specify a target ARMv7-A core.

As ARM-TF expects AARCH to be set, ARM_ARCH_MAJOR==7 mandates
AARCH=aarch32.

The toolchain target architecture/cpu is delegated after the platform
configuration is parsed. Platform shall define target core through
ARM_CORTEX_A<x>=yes, <x> being 5, 7, 9, 12, 15 and/or 17.

Platform can bypass ARM_CORTEX_A<x>=yes directive and provide straight
the toolchain target directive through MARCH32_DIRECTIVE.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-11-08 13:48:40 +01:00
davidcunado-arm 2904f84e3c
Merge pull request #1155 from masahir0y/uniphier
Fix build error when creating ROT key for UniPhier platform
2017-11-07 16:16:51 +00:00
Masahiro Yamada 3c9461520f uniphier: make sure to create build directory before ROT key
Building the UniPhier platform in parallel with TRUSTED_BOARD_BOOT=1
could fail due to non-existing directory.  It might be difficult to
reproduce, but here is an easier way to trigger the problem:

$ make PLAT=uniphier TRUSTED_BOARD_BOOT=1 MBEDTLS_DIR=mbedtls certificates
  OPENSSL build/uniphier/release/rot_key.pem
/bin/sh: 1: cannot create build/uniphier/release/rot_key.pem: Directory nonexistent
make: *** [build/uniphier/release/rot_key.pem] Error 2

The $(ROT_KEY) must depend on $(BUILD_PLAT) so that the build directory
is created before the key.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-11-07 00:35:21 +09:00
Masahiro Yamada 8012cc5c2f Build: introduce ${BUILD_PLAT} target to create the top build directory
Some platforms (for ex. UniPhier) want to create files in the very
top of the build directory.  Add ${BUILD_PLAT} so such files can
depend on it.

Make existing directory targets depend on ${BUILD_PLAT} because
they are sub-directories of ${BUILD_PLAT}.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-11-07 00:35:21 +09:00
davidcunado-arm 92c5066c93
Merge pull request #1153 from robertovargas-arm/fix-macros
Avoid use of undefined macros
2017-11-06 13:59:42 +00:00
davidcunado-arm f9a6db0f48
Merge pull request #1151 from JoelHutton/jh/MISRA-Mandatory
Change sizeof to use type of struct not function
2017-11-03 20:59:57 +00:00
davidcunado-arm 157650c792
Merge pull request #1142 from etienne-lms/qemu-int
qemu: update deprecated interrupt registering
2017-11-03 16:27:42 +00:00
davidcunado-arm 3de7d58e61
Merge pull request #1137 from soby-mathew/sm/arm_plat_en_gicv3_save
Enable GICv3 save for ARM platforms
2017-11-03 13:12:48 +00:00
Etienne Carriere ad3803bfe7 qemu: update deprecated interrupt registering
Registered interrupts are configured in edge detection as the default
previous configuration assumed in previous code.

Not target mask required as Qemu BL31 will not send/route SGIs.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-11-02 12:05:12 +01:00
davidcunado-arm 122af7dd6d
Merge pull request #1150 from dp-arm/dp/events
aarch64: Add PubSub events to capture security state transitions
2017-11-01 08:46:02 +00:00
Roberto Vargas e8a87acd4b Fix usage of IMAGE_BLx macros
These macros are only defined for corresponding image,
and they are undefined for other images. It means that we have
to use ifdef or defined() instead of relying on being 0 by default.

Change-Id: Iad11efab9830ddf471599b46286e1c56581ef5a7
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2017-11-01 08:28:04 +00:00
Roberto Vargas d58f3cacc3 Always define ARM_TSP_RAM_LOCATION_ID
ARM_TSP_RAM_LOCATION_ID was defined only in AARCH64, but the macro
was also used in AARCH32, and it meant that it was taking the value 0,
which happened to equal ARM_TRUSTED_SRAM_ID.

Change-Id: If9f4dbee1a2ba15e7806f2a03305b554bd327363
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2017-11-01 08:26:24 +00:00
Roberto Vargas 4d476e45f2 Include debug.h in debug.S
debug.S was using macros defined in debug.h, but since it didn't
include it, these macros were taking the value 0, which means that
all the preprocessor conditionals were wrong.

Change-Id: If4ca81cc5a1662991589f914a2557ceff0eaaede
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2017-11-01 08:26:24 +00:00
davidcunado-arm 5b5e6cb742
Merge pull request #1149 from robertovargas-arm/fwu-testing
Add FWU booting instructions to the user guide
2017-10-31 23:23:56 +00:00
davidcunado-arm 27b2493c6f
Merge pull request #1141 from robertovargas-arm/boot_redundancy
Add platform hooks for boot redundancy support
2017-10-31 23:21:39 +00:00
Joel Hutton 2614ea3ed6 Change sizeof to use type of struct not function
Change sizeof call so it references a static type instead of return of
a function in order to be MISRA compliant.

Change-Id: I6f1adb206073d6cd200156e281b8d76249e3af0e
Signed-off-by: Joel Hutton <joel.hutton@arm.com>
2017-10-31 11:03:18 +00:00
Dimitris Papastamos 17b4c0dd0a aarch64: Add PubSub events to capture security state transitions
Add events that trigger before entry to normal/secure world.  The
events trigger after the normal/secure context has been restored.

Similarly add events that trigger after leaving normal/secure world.
The events trigger after the normal/secure context has been saved.

Change-Id: I1b48a7ea005d56b1f25e2b5313d77e67d2f02bc5
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2017-10-31 10:33:27 +00:00
Roberto Vargas e29ee4693d Add FWU booting instructions to the user guide
FWU uses additional images that have to be loaded,
and this patch adds the documentation of how to do
it in FVP and Juno.

Change-Id: I1a40641c11c5a4c8db0aadeaeb2bec30c9279e28
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2017-10-31 08:54:44 +00:00
davidcunado-arm a2ef56af18
Merge pull request #1144 from geesun/qx/resize_bl2_size
Change the default option of ARM_TSP_RAM_LOCATION and Enlarge the BL2 size on ARM platforms
2017-10-30 16:56:07 +00:00
davidcunado-arm 24552242b2 Merge pull request #1147 from etienne-lms/qemu-optee-load
qemu/optee: load OP-TEE pageable part 2MB above OP-TEE image
2017-10-27 01:07:39 +01:00
davidcunado-arm 907140002e Merge pull request #1143 from etienne-lms/qemu-hpen
qemu: fix holding pen mailbox sequence
2017-10-26 16:10:36 +01:00
Etienne Carriere 11d9b20f4b qemu/optee: load OP-TEE pageable part 2MB above OP-TEE image
OP-TEE dedicates the end of the Qemu secure DRAM as specific out-of-TEE
secure RAM. To support this configuration the trusted firmware should
not load OP-TEE resources in this area.

To overcome the issue, OP-TEE pageable image is now loaded 2MByte above
the secure RAM base address.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-10-26 12:05:01 +02:00
davidcunado-arm cebec7421b Merge pull request #1138 from michpappas/tf-issues#526_qemu_does_not_support_TBB
qemu: Add support for Trusted Board Boot
2017-10-26 09:35:35 +01:00
Michalis Pappas 5cc34b10b0 qemu: Add support for Trusted Board Boot
This patch adds support for TBB to qemu. An RSA ROT keypair is generated at
build time and is included into BL1/BL2. The key and content certificates
are read over semihosting.

Fixes ARM-software/tf-issues#526

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
2017-10-25 10:48:58 +08:00
Qixiang Xu 9b1eae96bf plat/arm: enlarge the BL2 size on Arm platforms when TBB is enabled
For Trusted Board Boot, BL2 needs more space to support the ECDSA
and ECDSA+RSA algorithms.

Change-Id: Ie7eda9a1315ce836dbc6d18d6588f8d17891a92d
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
2017-10-25 09:27:15 +08:00
Qixiang Xu 7ca267bd8a plat/arm: change the default option of ARM_TSP_RAM_LOCATION
On Arm standard platforms, it runs out of SRAM space when TBB is
enabled, so the TSP default location is changed to dram when TBB
is enabled.

Change-Id: I516687013ad436ef454d2055d4e6fce06e467044
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
2017-10-25 09:27:15 +08:00
Roberto Vargas 01f62b6d0d Add platform hooks for boot redundancy support
These hooks are intended to allow one platform to try load
images from alternative places. There is a hook to initialize
the sequence of boot locations and a hook to pass to the next
sequence.

Change-Id: Ia0f84c415208dc4fa4f9d060d58476db23efa5b2
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2017-10-24 14:04:41 +01:00
Etienne Carriere 33dd33f8f0 qemu: fix holding pen mailbox sequence
Before this change, plat_secondary_cold_boot_setup reads wake up mailbox
as a byte array but through 64bit accesses on unaligned 64bit addresses.
In the other hand qemu_pwr_domain_on wakes secondary cores by writing
into a 64bit array.

This change forces the 64bit mailbox format as PLAT_QEMU_HOLD_ENTRY_SIZE
explicitly specifies it.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-10-24 13:57:36 +02:00
davidcunado-arm 3b39efa49d Merge pull request #1139 from hzhuang1/fix_edmac
Fix edmac
2017-10-23 16:45:59 +01:00
davidcunado-arm 4c37ac8903 Merge pull request #1132 from jeenu-arm/pubsub
Publish and Subscribe framework
2017-10-23 09:54:45 +01:00
Jeenu Viswambharan bd0c347781 PSCI: Publish CPU ON event
This allows other EL3 components to subscribe to CPU on events.

Update Firmware Design guide to list psci_cpu_on_finish as an available
event.

Change-Id: Ida774afe0f9cdce4021933fcc33a9527ba7aaae2
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-23 08:15:11 +01:00
Jeenu Viswambharan 8e743bcd6a BL31: Introduce Publish and Subscribe framework
This light-weight framework enables some EL3 components to publish
events which other EL3 components can subscribe to. Publisher can
optionally pass opaque data for subscribers. The order in which
subscribers are called is not defined.

Firmware design updated.

Change-Id: I24a3a70b2b1dedcb1f73cf48313818aebf75ebb6
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-23 08:15:11 +01:00
davidcunado-arm f911e229f3 Merge pull request #1131 from jeenu-arm/gic-migrate
Migrate upstream platforms to using interrupt properties
2017-10-21 22:50:35 +01:00
davidcunado-arm 623c43774a Merge pull request #1130 from jeenu-arm/gic-patches
New GIC APIs and specifying interrupt propertes
2017-10-21 22:18:48 +01:00
davidcunado-arm 6de7c00c14 Merge pull request #1135 from EvanLloyd/ejll/62_fiptool2
fiptool: Enable Visual Studio build
2017-10-21 21:35:32 +01:00
davidcunado-arm 8b9f419e3e Merge pull request #1136 from antonio-nino-diaz-arm/an/xlat-get-set-attr
Add APIs to get and modify attributes of memory regions
2017-10-20 17:17:09 +01:00
davidcunado-arm 37b5614ffe Merge pull request #1134 from masahir0y/uniphier
uniphier: fix section of  ROTPK hash
2017-10-19 09:53:15 +01:00
davidcunado-arm 3daf7c9aae Merge pull request #1140 from eleanorbonnici-arm/eb/docs/update_models
Update Foundation, AEM and Cortex Models versions
2017-10-18 23:39:30 +01:00
davidcunado-arm b4e81a3325 Merge pull request #1129 from robertovargas-arm/enable_O0
Fix use of MSR (immediate)
2017-10-18 23:39:07 +01:00
Eleanor Bonnici 99f38f513d Update Foundation, AEM and Cortex Models versions
Trusted Firmware has been tested as part of its CI system against Cortex
and Foundation models in the 11.1 Model release available on
developer.arm.com. Trusted Firmware has also been tested against the
v8.7 AEM model.  This patch updates the user guide documentation to
reflect the version of the Foundation, AEM and Cortex Models that
Trusted Firmware has been tested against.

Change-Id: Ia0f51469032427b6056567d151bf8144a7cf0e42
Signed-off-by: Eleanor Bonnici <Eleanor.bonnici@arm.com>
2017-10-18 14:29:45 +01:00
Masahiro Yamada 917d79668d uniphier: move ROTPK hash to .rodata section
This is not executable code.  It should be put into .rodata instead
of .text section.

This produces more correct BL1 image when SEPARATE_CODE_AND_RODATA is
defined.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-18 21:57:34 +09:00
Haojian Zhuang 454748fc86 HiKey: make RTC out of reset mode
Make RTC out of reset mode since it may be used in UEFI.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2017-10-18 20:02:12 +08:00
Haojian Zhuang f715bfdd6c HiKey: init EDMA controller with non secure mode
Init EDMA controller with non secure mode. A lot of peripherals are
depend on EDMA controller. But EDMA controller is in secure mode
by default. And this operation has to be executed in secure mode.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2017-10-18 20:02:12 +08:00
davidcunado-arm 38f5d3f340 Merge pull request #1133 from geesun/qx/fixed_tbbr_doc_ver
docs: Update Trusted Board Boot Requirements document number
2017-10-17 17:29:42 +01:00
Jeenu Viswambharan 95ad62b2c2 zynqmp: Migrate to using interrupt properties
Change-Id: Ia8503d446cc8b4246013046f6294fea364c9c882
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-17 14:55:18 +01:00
Jeenu Viswambharan 831b37520a mt8173: Migrate to using interrupt properties
Change-Id: I1463a4f9b74d74d59ac1d37b7b9c8e53416ab904
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-17 14:55:17 +01:00
Jeenu Viswambharan be9a75078d poplar: Migrate to using interrupt properties
Change-Id: Ibca6ea29be32783de666e0e0a0481668fc11860f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-17 14:55:17 +01:00
davidcunado-arm ccd0c24cf8 Merge pull request #1127 from davidcunado-arm/dc/pmrc_init
Init and save / restore of PMCR_EL0 / PMCR
2017-10-17 13:53:17 +01:00
davidcunado-arm 5d2f87e850 Merge pull request #1126 from robertovargas-arm/psci-v1.1
Update PSCI to v1.1
2017-10-17 12:18:23 +01:00
Evan Lloyd a1ee383626 fiptool: Enable Visual Studio build
Updates are required to enable the fiptool utility to be built on a
Windows platform.  This change modifies the source files to enable
building with Visual Studio (detected via preprocessor settings).
The primary changes are:
  1.  Provide an implementation of the getopt_long function.  This does
      not exist in the Visual Studio CRT libraries because Windows
      commands normally use '/' not '-' as an option indicator.
  2.  Redirect some function names to match those supported by the
      Visual Studio libraries (when building with Visual Studio).
  2.  Modify a structure name (stat) to match that provided
      by the Visual Studio libraries (_stat).

Note - this change does not provide makefile updates.  It only modifies
       the sources to enable the fiptool to be built from a Visual
       Studio project.  In normal use the presence of FIPTOOL.EXE is
       enough to satisfy the make requirements.  A makefile change may
       be derived from the Visual Studio command line information at
       some point in the future.

Change-Id: I3ade77ea140246af3c030920b3f97c070087f111
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
2017-10-17 12:14:20 +01:00