Commit Graph

2659 Commits

Author SHA1 Message Date
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 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
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
Antonio Nino Diaz ec0c8fdacf Introduce functions to disable the MMU in EL1
The implementation is the same as those used to disable it in EL3.

Change-Id: Ibfe7e69034a691fbf57477c5a76a8cdca28f6b26
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-10-17 12:02:37 +01:00
Sandrine Bailleux 996d6b390d xlat: Introduce API to change memory attributes of a region
This patch introduces a new API in the translation tables library
(v2), that allows to change the memory attributes of a memory
region. It may be used to change its execution permissions and
data access permissions.

As a prerequisite, the memory must be already mapped. Moreover, it
must be mapped at the finest granularity (currently 4 KB).

Change-Id: I242a8c6f0f3ef2b0a81a61e28706540462faca3c
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>
2017-10-17 12:02:36 +01:00
Sandrine Bailleux 1be910bb3d xlat: Introduce API to get memory attributes of a region
This patch introduces a new API in the translation tables library
(v2), that allows to query the memory attributes of a memory block
or a memory page.

Change-Id: I45a8b39a53da39e7617cbac4bff5658dc1b20a11
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>
2017-10-17 12:02:36 +01:00
Antonio Nino Diaz 8bf5bac88e xlat: Define translation regime in AArch32
Previously, in AArch32, `IMAGE_XLAT_DEFAULT_REGIME` wasn't defined. The
translation regime is only used in the AArch64 port of the translation
tables library v2, so this is not a problem for now, but future patches
will use it.

`IMAGE_EL` isn't used in AArch32, so it isn't needed to define it.

Change-Id: I4acdb01a58658956ab94bd82ed5b7fee1aa6ba90
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-10-17 10:44:10 +01:00
Jeenu Viswambharan c639e8ebee GIC: Allow specifying interrupt properties
The GIC driver initialization currently allows an array of interrupts to
be configured as secure. Future use cases would require more interrupt
configuration other than just security, such as priority.

This patch introduces a new interrupt property array as part of both
GICv2 and GICv3 driver data. The platform can populate the array with
interrupt numbers and respective properties. The corresponding driver
initialization iterates through the array, and applies interrupt
configuration as required.

This capability, and the current way of supplying array (or arrays, in
case of GICv3) of secure interrupts, are however mutually exclusive.
Henceforth, the platform should supply either:

  - A list of interrupts to be mapped as secure (the current way).
    Platforms that do this will continue working as they were. With this
    patch, this scheme is deprecated.

  - A list of interrupt properties (properties include interrupt group).
    Individual interrupt properties are specified via. descriptors of
    type 'interrupt_prop_desc_t', which can be populated with the macro
    INTR_PROP_DESC().

A run time assert checks that the platform doesn't specify both.

Henceforth the old scheme of providing list of secure interrupts is
deprecated. When built with ERROR_DEPRECATED=1, GIC drivers will require
that the interrupt properties are supplied instead of an array of secure
interrupts.

Add a section to firmware design about configuring secure interrupts.

Fixes ARM-software/tf-issues#262

Change-Id: I8eec29e72eb69dbb6bce77879febf32c95376942
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-16 16:50:02 +01:00
Jeenu Viswambharan a982f437b1 uniphier: Migrate to using interrupt properties
Change-Id: I795ec540942130b5ddc0fa1fd7167f7e1d1ae967
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-16 16:50:02 +01:00
Jeenu Viswambharan 2296610696 GIC: Add helpers to set interrupt configuration
The helpers perform read-modify-write on GIC*_ICFGR registers, but don't
serialise callers. Any serialisation must be taken care of by the
callers.

Change-Id: I71995f82ff2c7f70d37af0ede30d6ee18682fd3f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-10-16 16:50:02 +01:00