project/bcm63xx/atf.git
7 years agoFactor out extension enabling to a separate function
Dimitris Papastamos [Tue, 7 Nov 2017 09:55:29 +0000 (09:55 +0000)]
Factor out extension enabling to a separate function

Factor out extension enabling to a separate function that is called
before exiting from EL3 for first entry into Non-secure world.

Change-Id: Ic21401ebba531134d08643c0a1ca9de0fc590a1b
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
7 years agoMerge pull request #1160 from davidcunado-arm/dc/fp_regs
davidcunado-arm [Fri, 17 Nov 2017 12:18:22 +0000 (12:18 +0000)]
Merge pull request #1160 from davidcunado-arm/dc/fp_regs

Move FPEXC32_EL2 to FP Context

7 years agoMove FPEXC32_EL2 to FP Context
David Cunado [Fri, 20 Oct 2017 10:30:57 +0000 (11:30 +0100)]
Move FPEXC32_EL2 to FP Context

The FPEXC32_EL2 register controls SIMD and FP functionality when the
lower ELs are executing in AArch32 mode. It is architecturally mapped
to AArch32 system register FPEXC.

This patch removes FPEXC32_EL2 register from the System Register context
and adds it to the floating-point context. EL3 only saves / restores the
floating-point context if the build option CTX_INCLUDE_FPREGS is set to 1.

The rationale for this change is that if the Secure world is using FP
functionality and EL3 is not managing the FP context, then the Secure
world will save / restore the appropriate FP registers.

NOTE - this is a break in behaviour in the unlikely case that
CTX_INCLUDE_FPREGS is set to 0 and the platform contains an AArch32
Secure Payload that modifies FPEXC, but does not save and restore
this register

Change-Id: Iab80abcbfe302752d52b323b4abcc334b585c184
Signed-off-by: David Cunado <david.cunado@arm.com>
7 years agoMerge pull request #1159 from jeenu-arm/sdei-fix
davidcunado-arm [Tue, 14 Nov 2017 09:25:50 +0000 (09:25 +0000)]
Merge pull request #1159 from jeenu-arm/sdei-fix

SDEI: Fix build error with logging enabled

7 years agoSDEI: Fix build error with logging enabled
Jeenu Viswambharan [Mon, 13 Nov 2017 12:30:45 +0000 (12:30 +0000)]
SDEI: Fix build error with logging enabled

Change-Id: Iee617a3528225349b6eede2f8abb26da96640678
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1152 from jeenu-arm/ehf-and-sdei
davidcunado-arm [Mon, 13 Nov 2017 10:58:40 +0000 (10:58 +0000)]
Merge pull request #1152 from jeenu-arm/ehf-and-sdei

EHF and SDEI

7 years agodocs: Add SDEI dispatcher documentation
Jeenu Viswambharan [Wed, 18 Oct 2017 13:35:20 +0000 (14:35 +0100)]
docs: Add SDEI dispatcher documentation

The document includes SDEI sequence diagrams that are generated using
PlantUML [1].

A shell script is introduced to generate SVG files from PlantUML files
supplied in arguments.

[1] http://plantuml.com/PlantUML_Language_Reference_Guide.pdf

Change-Id: I433897856810bf1927f2800a7b2b1d81827c69b2
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoSDEI: Add API for explicit dispatch
Jeenu Viswambharan [Mon, 2 Oct 2017 11:10:54 +0000 (12:10 +0100)]
SDEI: Add API for explicit dispatch

This allows for other EL3 components to schedule an SDEI event dispatch
to Normal world upon the next ERET. The API usage constrains are set out
in the SDEI dispatcher documentation.

Documentation to follow.

Change-Id: Id534bae0fd85afc94523490098c81f85c4e8f019
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoARM platforms: Enable SDEI
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:10 +0000 (08:32 +0100)]
ARM platforms: Enable SDEI

Support SDEI on ARM platforms using frameworks implemented in earlier
patches by defining and exporting SDEI events: this patch defines the
standard event 0, and a handful of shared and private dynamic events.

Change-Id: I9d3d92a92cff646b8cc55eabda78e140deaa24e1
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoARM platforms: Define exception macros
Jeenu Viswambharan [Tue, 24 Oct 2017 10:47:13 +0000 (11:47 +0100)]
ARM platforms: Define exception macros

Define number of priority bits, and allocate priority levels for SDEI.

Change-Id: Ib6bb6c5c09397f7caef950c4caed5a737b3d4112
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoARM platforms: Provide SDEI entry point validation
Jeenu Viswambharan [Thu, 19 Oct 2017 08:15:15 +0000 (09:15 +0100)]
ARM platforms: Provide SDEI entry point validation

Provide a strong definition for plat_sdei_validate_sdei_entrypoint()
which translates client address to Physical Address, and then validating
the address to be present in DRAM.

Change-Id: Ib93eb66b413d638aa5524d1b3de36aa16d38ea11
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoARM platforms: Make arm_validate_ns_entrypoint() common
Jeenu Viswambharan [Tue, 19 Sep 2017 08:27:18 +0000 (09:27 +0100)]
ARM platforms: Make arm_validate_ns_entrypoint() common

The function arm_validate_ns_entrypoint() validates a given non-secure
physical address. This function however specifically returns PSCI error
codes.

Non-secure physical address validation is potentially useful across ARM
platforms, even for non-PSCI use cases. Therefore make this function
common by returning 0 for success or -1 otherwise.

Having made the function common, make arm_validate_psci_entrypoint() a
wrapper around arm_validate_ns_entrypoint() which only translates return
value into PSCI error codes. This wrapper is now used where
arm_validate_ns_entrypoint() was currently used for PSCI entry point
validation.

Change-Id: Ic781fc3105d6d199fd8f53f01aba5baea0ebc310
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoBL31: Add SDEI dispatcher
Jeenu Viswambharan [Mon, 16 Oct 2017 07:43:14 +0000 (08:43 +0100)]
BL31: Add SDEI dispatcher

The implementation currently supports only interrupt-based SDEI events,
and supports all interfaces as defined by SDEI specification version
1.0 [1].

Introduce the build option SDEI_SUPPORT to include SDEI dispatcher in
BL31.

Update user guide and porting guide. SDEI documentation to follow.

[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0054a/ARM_DEN0054A_Software_Delegated_Exception_Interface.pdf

Change-Id: I758b733084e4ea3b27ac77d0259705565842241a
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoBL31: Program Priority Mask for SMC handling
Jeenu Viswambharan [Wed, 4 Oct 2017 11:21:34 +0000 (12:21 +0100)]
BL31: Program Priority Mask for SMC handling

On GICv3 systems, as a side effect of adding provision to handle EL3
interrupts (unconditionally routing FIQs to EL3), pending Non-secure
interrupts (signalled as FIQs) may preempt execution in lower Secure ELs
[1]. This will inadvertently disrupt the semantics of Fast SMC
(previously called Atomic SMC) calls.

To retain semantics of Fast SMCs, the GIC PMR must be programmed to
prevent Non-secure interrupts from preempting Secure execution. To that
effect, two new functions in the Exception Handling Framework subscribe
to events introduced in an earlier commit:

  - Upon 'cm_exited_normal_world', the Non-secure PMR is stashed, and
    the PMR is programmed to the highest Non-secure interrupt priority.

  - Upon 'cm_entering_normal_world', the previously stashed Non-secure
    PMR is restored.

The above sequence however prevents Yielding SMCs from being preempted
by Non-secure interrupts as intended. To facilitate this, the public API
exc_allow_ns_preemption() is introduced that programs the PMR to the
original Non-secure PMR value. Another API
exc_is_ns_preemption_allowed() is also introduced to check if
exc_allow_ns_preemption() had been called previously.

API documentation to follow.

[1] On GICv2 systems, this isn't a problem as, unlike GICv3, pending NS
    IRQs during Secure execution are signalled as IRQs, which aren't
    routed to EL3.

Change-Id: Ief96b162b0067179b1012332cd991ee1b3051dd0
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoBL31: Introduce Exception Handling Framework
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:10 +0000 (08:32 +0100)]
BL31: Introduce Exception Handling Framework

EHF is a framework that allows dispatching of EL3 interrupts to their
respective handlers in EL3.

This framework facilitates the firmware-first error handling policy in
which asynchronous exceptions may be routed to EL3. Such exceptions may
be handed over to respective exception handlers. Individual handlers
might further delegate exception handling to lower ELs.

The framework associates the delegated execution to lower ELs with a
priority value. For interrupts, this corresponds to the priorities
programmed in GIC; for other types of exceptions, viz. SErrors or
Synchronous External Aborts, individual dispatchers shall explicitly
associate delegation to a secure priority. In order to prevent lower
priority interrupts from preempting higher priority execution, the
framework provides helpers to control preemption by virtue of
programming Priority Mask register in the interrupt controller.

This commit allows for handling interrupts targeted at EL3. Exception
handlers own interrupts by assigning them a range of secure priorities,
and registering handlers for each priority range it owns.

Support for exception handling in BL31 image is enabled by setting the
build option EL3_EXCEPTION_HANDLING=1.

Documentation to follow.

NOTE: The framework assumes the priority scheme supported by platform
interrupt controller is compliant with that of ARM GIC architecture (v2
or later).

Change-Id: I7224337e4cea47c6ca7d7a4ca22a3716939f7e42
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Introduce API to get interrupt ID
Jeenu Viswambharan [Tue, 24 Oct 2017 14:13:59 +0000 (15:13 +0100)]
GIC: Introduce API to get interrupt ID

Acknowledging interrupt shall return a raw value from the interrupt
controller in which the actual interrupt ID may be encoded. Add a
platform API to extract the actual interrupt ID from the raw value
obtained from interrupt controller.

Document the new function. Also clarify the semantics of interrupt
acknowledge.

Change-Id: I818dad7be47661658b16f9807877d259eb127405
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Fix Group 0 enabling
Jeenu Viswambharan [Tue, 7 Nov 2017 08:38:23 +0000 (08:38 +0000)]
GIC: Fix Group 0 enabling

At present, the GIC drivers enable Group 0 interrupts only if there are
Secure SPIs listed in the interrupt properties/list. This means that,
even if there are Group 0 SGIs/PPIs configured, the group remained
disabled in the absence of a Group 0 SPI.

Modify both GICv2 and GICv3 SGI/PPI configuration to enable Group 0 when
corresponding SGIs/PPIs are present.

Change-Id: Id123e8aaee0c22b476eebe3800340906d83bbc6d
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGICv2: Fix populating PE target data
Jeenu Viswambharan [Tue, 7 Nov 2017 16:10:19 +0000 (16:10 +0000)]
GICv2: Fix populating PE target data

This patch brings in the following fixes:

  - The per-PE target data initialized during power up needs to be
    flushed so as to be visible to other PEs.

  - Setup per-PE target data for the primary PE as well. At present,
    this was only setup for secondary PEs when they were powered on.

Change-Id: Ibe3a57c14864e37b2326dd7ab321a5c7bf80e8af
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1158 from antonio-nino-diaz-arm/an/spm-fix
davidcunado-arm [Fri, 10 Nov 2017 16:11:32 +0000 (16:11 +0000)]
Merge pull request #1158 from antonio-nino-diaz-arm/an/spm-fix

SPM: Fix pointer to MP info in boot info struct

7 years agoSPM: Fix pointer to MP info in boot info struct
Antonio Nino Diaz [Fri, 10 Nov 2017 12:25:49 +0000 (12:25 +0000)]
SPM: Fix pointer to MP info in boot info struct

The MP info struct is placed right after the boot info struct. However,
when calculating the address of the MP info, the size of the boot info
struct was being multiplied by the size of the MP boot info. This left
a big gap of empty space between the structs.

This didn't break any code because the boot info struct has a pointer to
the MP info struct. It was just wasting space.

Change-Id: I1668e3540d9173261968f6740623549000bd48db
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoMerge pull request #1148 from antonio-nino-diaz-arm/an/spm
davidcunado-arm [Thu, 9 Nov 2017 22:38:37 +0000 (22:38 +0000)]
Merge pull request #1148 from antonio-nino-diaz-arm/an/spm

Introduce Secure Partition Manager

7 years agoSPM: FVP: Introduce port of SPM
Antonio Nino Diaz [Thu, 9 Nov 2017 11:34:09 +0000 (11:34 +0000)]
SPM: FVP: Introduce port of SPM

This initial port of the Secure Partitions Manager to FVP supports BL31
in both SRAM and Trusted DRAM.

A document with instructions to build the SPM has been added.

Change-Id: I4ea83ff0a659be77f2cd72eaf2302cdf8ba98b32
Co-authored-by: Douglas Raillard <douglas.raillard@arm.com>
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Co-authored-by: Achin Gupta <achin.gupta@arm.com>
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoSPM: Introduce Secure Partition Manager
Antonio Nino Diaz [Tue, 24 Oct 2017 09:07:35 +0000 (10:07 +0100)]
SPM: Introduce Secure Partition Manager

A Secure Partition is a software execution environment instantiated in
S-EL0 that can be used to implement simple management and security
services. Since S-EL0 is an unprivileged exception level, a Secure
Partition relies on privileged firmware e.g. ARM Trusted Firmware to be
granted access to system and processor resources. Essentially, it is a
software sandbox that runs under the control of privileged software in
the Secure World and accesses the following system resources:

- Memory and device regions in the system address map.
- PE system registers.
- A range of asynchronous exceptions e.g. interrupts.
- A range of synchronous exceptions e.g. SMC function identifiers.

A Secure Partition enables privileged firmware to implement only the
absolutely essential secure services in EL3 and instantiate the rest in
a partition. Since the partition executes in S-EL0, its implementation
cannot be overly complex.

The component in ARM Trusted Firmware responsible for managing a Secure
Partition is called the Secure Partition Manager (SPM). The SPM is
responsible for the following:

- Validating and allocating resources requested by a Secure Partition.
- Implementing a well defined interface that is used for initialising a
  Secure Partition.
- Implementing a well defined interface that is used by the normal world
  and other secure services for accessing the services exported by a
  Secure Partition.
- Implementing a well defined interface that is used by a Secure
  Partition to fulfil service requests.
- Instantiating the software execution environment required by a Secure
  Partition to fulfil a service request.

Change-Id: I6f7862d6bba8732db5b73f54e789d717a35e802f
Co-authored-by: Douglas Raillard <douglas.raillard@arm.com>
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Co-authored-by: Achin Gupta <achin.gupta@arm.com>
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoxlat: Make function to calculate TCR PA bits public
Antonio Nino Diaz [Wed, 25 Oct 2017 10:53:25 +0000 (11:53 +0100)]
xlat: Make function to calculate TCR PA bits public

This function can be useful to setup TCR_ELx by callers that don't use
the translation tables library to setup the system registers related
to them. By making it common, it can be reused whenever it is needed
without duplicating code.

Change-Id: Ibfada9e846d2a6cd113b1925ac911bb27327d375
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agospd: Use `ENABLE_ASSERTIONS` instead of `DEBUG`
Antonio Nino Diaz [Thu, 19 Oct 2017 15:55:48 +0000 (16:55 +0100)]
spd: Use `ENABLE_ASSERTIONS` instead of `DEBUG`

A line in the upstream SPDs is only compiled in in `DEBUG` builds. This
line is used to help with assertions and so assertion failures can
happen in release builds with assertions enabled. Use
`ENABLE_ASSERTIONS` instead of `DEBUG`.

This bug was introduced in commit aa61368eb5, which introduced the build
option `ENABLE_ASSERTIONS`.

Change-Id: I7977df9c89c68677b00099b2a1926fa3cb0937c6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoMerge pull request #1154 from soby-mathew/sm/fix_psci_stat
davidcunado-arm [Wed, 8 Nov 2017 14:17:01 +0000 (14:17 +0000)]
Merge pull request #1154 from soby-mathew/sm/fix_psci_stat

Fix PSCI STAT time stamp collection

7 years agoMerge pull request #1155 from masahir0y/uniphier
davidcunado-arm [Tue, 7 Nov 2017 16:16:51 +0000 (16:16 +0000)]
Merge pull request #1155 from masahir0y/uniphier

Fix build error when creating ROT key for UniPhier platform

7 years agouniphier: make sure to create build directory before ROT key
Masahiro Yamada [Fri, 3 Nov 2017 18:14:03 +0000 (03:14 +0900)]
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>
7 years agoBuild: introduce ${BUILD_PLAT} target to create the top build directory
Masahiro Yamada [Fri, 3 Nov 2017 18:12:28 +0000 (03:12 +0900)]
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>
7 years agoMerge pull request #1153 from robertovargas-arm/fix-macros
davidcunado-arm [Mon, 6 Nov 2017 13:59:42 +0000 (13:59 +0000)]
Merge pull request #1153 from robertovargas-arm/fix-macros

Avoid use of undefined macros

7 years agoMerge pull request #1151 from JoelHutton/jh/MISRA-Mandatory
davidcunado-arm [Fri, 3 Nov 2017 20:59:57 +0000 (20:59 +0000)]
Merge pull request #1151 from JoelHutton/jh/MISRA-Mandatory

Change sizeof to use type of struct not function

7 years agoMerge pull request #1142 from etienne-lms/qemu-int
davidcunado-arm [Fri, 3 Nov 2017 16:27:42 +0000 (16:27 +0000)]
Merge pull request #1142 from etienne-lms/qemu-int

qemu: update deprecated interrupt registering

7 years agoFix PSCI STAT time stamp collection
Soby Mathew [Mon, 16 Oct 2017 14:19:31 +0000 (15:19 +0100)]
Fix PSCI STAT time stamp collection

This patch includes various fixes for PSCI STAT functionality
relating to timestamp collection:

1. The PSCI stat accounting for retention states for higher level
power domains were done outside the locks which could lead to
spurious values in some race conditions. This is moved inside
the locks. Also, the call to start the stat accounting was redundant
which is now removed.

2. The timestamp wrap-around case when calculating residency did
not cater for AArch32. This is now fixed.

3. In the warm boot path, `plat_psci_stat_accounting_stop()` was
getting invoked prior to population of target power states. This
is now corrected.

Change-Id: I851526455304fb74ff0a724f4d5318cd89e19589
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoMerge pull request #1137 from soby-mathew/sm/arm_plat_en_gicv3_save
davidcunado-arm [Fri, 3 Nov 2017 13:12:48 +0000 (13:12 +0000)]
Merge pull request #1137 from soby-mathew/sm/arm_plat_en_gicv3_save

Enable GICv3 save for ARM platforms

7 years agoqemu: update deprecated interrupt registering
Etienne Carriere [Thu, 2 Nov 2017 11:05:12 +0000 (12:05 +0100)]
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>
7 years agoMerge pull request #1150 from dp-arm/dp/events
davidcunado-arm [Wed, 1 Nov 2017 08:46:02 +0000 (08:46 +0000)]
Merge pull request #1150 from dp-arm/dp/events

aarch64: Add PubSub events to capture security state transitions

7 years agoFix usage of IMAGE_BLx macros
Roberto Vargas [Mon, 23 Oct 2017 07:22:17 +0000 (08:22 +0100)]
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>
7 years agoAlways define ARM_TSP_RAM_LOCATION_ID
Roberto Vargas [Fri, 20 Oct 2017 09:46:23 +0000 (10:46 +0100)]
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>
7 years agoInclude debug.h in debug.S
Roberto Vargas [Fri, 20 Oct 2017 09:37:48 +0000 (10:37 +0100)]
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>
7 years agoMerge pull request #1149 from robertovargas-arm/fwu-testing
davidcunado-arm [Tue, 31 Oct 2017 23:23:56 +0000 (23:23 +0000)]
Merge pull request #1149 from robertovargas-arm/fwu-testing

Add FWU booting instructions to the user guide

7 years agoMerge pull request #1141 from robertovargas-arm/boot_redundancy
davidcunado-arm [Tue, 31 Oct 2017 23:21:39 +0000 (23:21 +0000)]
Merge pull request #1141 from robertovargas-arm/boot_redundancy

Add platform hooks for boot redundancy support

7 years agoChange sizeof to use type of struct not function
Joel Hutton [Fri, 20 Oct 2017 09:31:14 +0000 (10:31 +0100)]
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>
7 years agoaarch64: Add PubSub events to capture security state transitions
Dimitris Papastamos [Fri, 13 Oct 2017 14:27:58 +0000 (15:27 +0100)]
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>
7 years agoAdd FWU booting instructions to the user guide
Roberto Vargas [Tue, 17 Oct 2017 09:19:00 +0000 (10:19 +0100)]
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>
7 years agoMerge pull request #1144 from geesun/qx/resize_bl2_size
davidcunado-arm [Mon, 30 Oct 2017 16:56:07 +0000 (16:56 +0000)]
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

7 years agoMerge pull request #1147 from etienne-lms/qemu-optee-load
davidcunado-arm [Fri, 27 Oct 2017 00:07:39 +0000 (01:07 +0100)]
Merge pull request #1147 from etienne-lms/qemu-optee-load

qemu/optee: load OP-TEE pageable part 2MB above OP-TEE image

7 years agoMerge pull request #1143 from etienne-lms/qemu-hpen
davidcunado-arm [Thu, 26 Oct 2017 15:10:36 +0000 (16:10 +0100)]
Merge pull request #1143 from etienne-lms/qemu-hpen

qemu: fix holding pen mailbox sequence

7 years agoqemu/optee: load OP-TEE pageable part 2MB above OP-TEE image
Etienne Carriere [Thu, 26 Oct 2017 10:05:01 +0000 (12:05 +0200)]
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>
7 years agoMerge pull request #1138 from michpappas/tf-issues#526_qemu_does_not_support_TBB
davidcunado-arm [Thu, 26 Oct 2017 08:35:35 +0000 (09:35 +0100)]
Merge pull request #1138 from michpappas/tf-issues#526_qemu_does_not_support_TBB

qemu: Add support for Trusted Board Boot

7 years agoqemu: Add support for Trusted Board Boot
Michalis Pappas [Wed, 18 Oct 2017 01:43:37 +0000 (09:43 +0800)]
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>
7 years agoplat/arm: enlarge the BL2 size on Arm platforms when TBB is enabled
Qixiang Xu [Fri, 13 Oct 2017 01:23:42 +0000 (09:23 +0800)]
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>
7 years agoplat/arm: change the default option of ARM_TSP_RAM_LOCATION
Qixiang Xu [Fri, 13 Oct 2017 01:04:12 +0000 (09:04 +0800)]
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>
7 years agoAdd platform hooks for boot redundancy support
Roberto Vargas [Tue, 26 Sep 2017 11:53:01 +0000 (12:53 +0100)]
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>
7 years agoqemu: fix holding pen mailbox sequence
Etienne Carriere [Mon, 23 Oct 2017 23:09:52 +0000 (01:09 +0200)]
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>
7 years agoMerge pull request #1139 from hzhuang1/fix_edmac
davidcunado-arm [Mon, 23 Oct 2017 15:45:59 +0000 (16:45 +0100)]
Merge pull request #1139 from hzhuang1/fix_edmac

Fix edmac

7 years agoMerge pull request #1132 from jeenu-arm/pubsub
davidcunado-arm [Mon, 23 Oct 2017 08:54:45 +0000 (09:54 +0100)]
Merge pull request #1132 from jeenu-arm/pubsub

Publish and Subscribe framework

7 years agoPSCI: Publish CPU ON event
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:10 +0000 (08:32 +0100)]
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>
7 years agoBL31: Introduce Publish and Subscribe framework
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:10 +0000 (08:32 +0100)]
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>
7 years agoMerge pull request #1131 from jeenu-arm/gic-migrate
davidcunado-arm [Sat, 21 Oct 2017 21:50:35 +0000 (22:50 +0100)]
Merge pull request #1131 from jeenu-arm/gic-migrate

Migrate upstream platforms to using interrupt properties

7 years agoMerge pull request #1130 from jeenu-arm/gic-patches
davidcunado-arm [Sat, 21 Oct 2017 21:18:48 +0000 (22:18 +0100)]
Merge pull request #1130 from jeenu-arm/gic-patches

New GIC APIs and specifying interrupt propertes

7 years agoMerge pull request #1135 from EvanLloyd/ejll/62_fiptool2
davidcunado-arm [Sat, 21 Oct 2017 20:35:32 +0000 (21:35 +0100)]
Merge pull request #1135 from EvanLloyd/ejll/62_fiptool2

fiptool: Enable Visual Studio build

7 years agoMerge pull request #1136 from antonio-nino-diaz-arm/an/xlat-get-set-attr
davidcunado-arm [Fri, 20 Oct 2017 16:17:09 +0000 (17:17 +0100)]
Merge pull request #1136 from antonio-nino-diaz-arm/an/xlat-get-set-attr

Add APIs to get and modify attributes of memory regions

7 years agoMerge pull request #1134 from masahir0y/uniphier
davidcunado-arm [Thu, 19 Oct 2017 08:53:15 +0000 (09:53 +0100)]
Merge pull request #1134 from masahir0y/uniphier

uniphier: fix section of  ROTPK hash

7 years agoMerge pull request #1140 from eleanorbonnici-arm/eb/docs/update_models
davidcunado-arm [Wed, 18 Oct 2017 22:39:30 +0000 (23:39 +0100)]
Merge pull request #1140 from eleanorbonnici-arm/eb/docs/update_models

Update Foundation, AEM and Cortex Models versions

7 years agoMerge pull request #1129 from robertovargas-arm/enable_O0
davidcunado-arm [Wed, 18 Oct 2017 22:39:07 +0000 (23:39 +0100)]
Merge pull request #1129 from robertovargas-arm/enable_O0

Fix use of MSR (immediate)

7 years agoUpdate Foundation, AEM and Cortex Models versions
Eleanor Bonnici [Wed, 4 Oct 2017 14:03:33 +0000 (15:03 +0100)]
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>
7 years agouniphier: move ROTPK hash to .rodata section
Masahiro Yamada [Tue, 17 Oct 2017 01:52:53 +0000 (10:52 +0900)]
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>
7 years agoHiKey: make RTC out of reset mode
Haojian Zhuang [Wed, 18 Oct 2017 11:56:02 +0000 (19:56 +0800)]
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>
7 years agoHiKey: init EDMA controller with non secure mode
Haojian Zhuang [Wed, 18 Oct 2017 11:52:20 +0000 (19:52 +0800)]
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>
7 years agoMerge pull request #1133 from geesun/qx/fixed_tbbr_doc_ver
davidcunado-arm [Tue, 17 Oct 2017 16:29:42 +0000 (17:29 +0100)]
Merge pull request #1133 from geesun/qx/fixed_tbbr_doc_ver

docs: Update Trusted Board Boot Requirements document number

7 years agozynqmp: Migrate to using interrupt properties
Jeenu Viswambharan [Fri, 29 Sep 2017 10:15:18 +0000 (11:15 +0100)]
zynqmp: Migrate to using interrupt properties

Change-Id: Ia8503d446cc8b4246013046f6294fea364c9c882
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agomt8173: Migrate to using interrupt properties
Jeenu Viswambharan [Fri, 29 Sep 2017 10:14:51 +0000 (11:14 +0100)]
mt8173: Migrate to using interrupt properties

Change-Id: I1463a4f9b74d74d59ac1d37b7b9c8e53416ab904
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agopoplar: Migrate to using interrupt properties
Jeenu Viswambharan [Fri, 29 Sep 2017 10:14:02 +0000 (11:14 +0100)]
poplar: Migrate to using interrupt properties

Change-Id: Ibca6ea29be32783de666e0e0a0481668fc11860f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1127 from davidcunado-arm/dc/pmrc_init
davidcunado-arm [Tue, 17 Oct 2017 12:53:17 +0000 (13:53 +0100)]
Merge pull request #1127 from davidcunado-arm/dc/pmrc_init

Init and save / restore of PMCR_EL0 / PMCR

7 years agoMerge pull request #1126 from robertovargas-arm/psci-v1.1
davidcunado-arm [Tue, 17 Oct 2017 11:18:23 +0000 (12:18 +0100)]
Merge pull request #1126 from robertovargas-arm/psci-v1.1

Update PSCI to v1.1

7 years agofiptool: Enable Visual Studio build
Evan Lloyd [Thu, 25 May 2017 18:16:53 +0000 (19:16 +0100)]
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>
7 years agoIntroduce functions to disable the MMU in EL1
Antonio Nino Diaz [Thu, 5 Oct 2017 14:19:42 +0000 (15:19 +0100)]
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>
7 years agoxlat: Introduce API to change memory attributes of a region
Sandrine Bailleux [Tue, 17 Oct 2017 11:02:03 +0000 (12:02 +0100)]
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>
7 years agoxlat: Introduce API to get memory attributes of a region
Sandrine Bailleux [Fri, 13 Oct 2017 13:17:09 +0000 (14:17 +0100)]
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>
7 years agoxlat: Define translation regime in AArch32
Antonio Nino Diaz [Mon, 16 Oct 2017 14:25:22 +0000 (15:25 +0100)]
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>
7 years agoGIC: Allow specifying interrupt properties
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
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>
7 years agouniphier: Migrate to using interrupt properties
Jeenu Viswambharan [Fri, 29 Sep 2017 10:14:02 +0000 (11:14 +0100)]
uniphier: Migrate to using interrupt properties

Change-Id: I795ec540942130b5ddc0fa1fd7167f7e1d1ae967
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add helpers to set interrupt configuration
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
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>
7 years agoARM platforms: Migrate to using interrupt properties
Jeenu Viswambharan [Fri, 22 Sep 2017 07:59:59 +0000 (08:59 +0100)]
ARM platforms: Migrate to using interrupt properties

An earlier patch added provision for the platform to provide secure
interrupt properties. ARM platforms already has a list of interrupts
that fall into different secure groups.

This patch defines macros that enumerate interrupt properties in the
same fashion, and points the driver driver data to a list of interrupt
properties rather than list of secure interrupts on ARM platforms.  The
deprecated interrupt list definitions are however retained to support
legacy builds.

Configuration applied to individual interrupts remain unchanged, so no
runtime behaviour change expected.

NOTE: Platforms that use the arm/common function
plat_arm_gic_driver_init() must replace their PLAT_ARM_G1S_IRQS and
PLAT_ARM_G0_IRQS macro definitions with PLAT_ARM_G1S_IRQ_PROPS and
PLAT_ARM_G0_IRQ_PROPS macros respectively, using the provided
INTR_PROP_DESC macro.

Change-Id: I24d643b83e3333753a3ba97d4b6fb71e16bb0952
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to set priority mask
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to set priority mask

API documentation updated.

Change-Id: I40feec1fe67a960d035061b54dd55610bc34ce1d
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to set/clear interrupt pending
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to set/clear interrupt pending

API documentation updated.

Change-Id: I14e33cfc7dfa93257c82d76fae186b17a1b6d266
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to set interrupt routing
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to set interrupt routing

SPIs can be routed to either a specific PE, or to any one of all
available PEs.

API documentation updated.

Change-Id: I28675f634568aaf4ea1aa8aa7ebf25b419a963ed
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to raise secure SGI
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to raise secure SGI

API documentation updated.

Change-Id: I129725059299af6cc612bafa8d74817f779d7c4f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add APIs to set interrupt type and query support
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add APIs to set interrupt type and query support

The back end GIC driver converts and assigns the interrupt type to
suitable group.

For GICv2, a build option GICV2_G0_FOR_EL3 is introduced, which
determines to which type Group 0 interrupts maps to.

 - When the build option is set 0 (the default), Group 0 interrupts are
   meant for Secure EL1. This is presently the case.

 - Otherwise, Group 0 interrupts are meant for EL3. This means the SPD
   will have to synchronously hand over the interrupt to Secure EL1.

The query API allows the platform to query whether the platform supports
interrupts of a given type.

API documentation updated.

Change-Id: I60fdb4053ffe0bd006b3b20914914ebd311fc858
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to set interrupt priority
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to set interrupt priority

API documentation updated.

Change-Id: Ib700eb1b8ca65503aeed0ac4ce0e7b934df67ff9
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add APIs to enable and disable interrupt
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add APIs to enable and disable interrupt

API documentation updated.

Change-Id: Ice7511f8df5356851001d2f7dc2a46cfe318f9ba
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to get interrupt active status
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to get interrupt active status

API documentation updated.

Change-Id: I6d61785af0d5330930c709de971a904dc7c3516c
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add APIs to query interrupt types
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add APIs to query interrupt types

These APIs allow the GIC implementation to categorize interrupt numbers
into SPIs, PPIs, and SGIs. The default implementations for GICv2 and
GICv3 follows interrupt numbering as specified by the ARM GIC
architecture.

API documentation updated.

Change-Id: Ia6aa379dc955994333232e6138f259535d4fa087
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoARM platforms: supply per-PE target mask array
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
ARM platforms: supply per-PE target mask array

Call the GICv2 driver API to initialise per-PE target mask.

Change-Id: Idc7eb0d906a5379f4c05917af05c90613057ab97
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGICv2: Add driver API to set PE target mask
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GICv2: Add driver API to set PE target mask

The PE target mask is used to translate linear PE index (returned by
platform core position) to a bit mask used when targeting interrupts to
a PE, viz. when raising SGIs and routing SPIs.

The platform shall:

  - Populate the driver data with a pointer to array that's to contain
    per-PE target masks.

  - Invoke the new driver API 'gicv2_set_pe_target_mask()' during
    per-CPU initialization so that the driver populates the target mask
    for that CPU.

Platforms that don't intend to target interrupts or raise SGIs need not
populate this.

Change-Id: Ic0db54da86915e9dccd82fff51479bc3c1fdc968
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoGIC: Add API to get running priority
Jeenu Viswambharan [Fri, 22 Sep 2017 07:32:09 +0000 (08:32 +0100)]
GIC: Add API to get running priority

Document the API in separate platform interrupt controller API document.

Change-Id: If18f208e10a8a243f5c59d226fcf48e985941949
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years agoMerge pull request #1123 from robertovargas-arm/reset2
davidcunado-arm [Mon, 16 Oct 2017 15:31:13 +0000 (16:31 +0100)]
Merge pull request #1123 from robertovargas-arm/reset2

Integration of reset2 PSCI v1.1 functionality

7 years agoFix use of MSR (immediate)
Roberto Vargas [Mon, 18 Sep 2017 08:53:25 +0000 (09:53 +0100)]
Fix use of MSR (immediate)

The macro DEFINE_SYSREG_WRITE_CONST_FUNC defines an inline function
to an assembly statement that uses the MSR (immediate) instruction
to access the PSTATE.  The "i" (immediate) assembly constraint on
the operand was only satisfied when compiling with optimizations
enabled which resulted in the function being optimized out - the
"const uint64_t v" parameter was optimized out and replaced by a
literal value.

When compiling without optimizations, the function call remained and
therefore the parameter is not optimized out - compilation fails as
the constraint is impossible to satisfy by the compiler.

This patch replaces the function encapsulating the use of
the MSR (immediate) with a macro that allows the literal value to be
directly fed to the inline assembly statement

Change-Id: Ib379a7acc48ef3cb83090a680cd8a6ce1a94a9d9
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
7 years agodocs: Update Trusted Board Boot Requirements document number
Qixiang Xu [Mon, 16 Oct 2017 09:29:18 +0000 (17:29 +0800)]
docs: Update Trusted Board Boot Requirements document number

Update DEN0006B-5(2013) to DEN0006C-1(2015)

Change-Id: I753a14214dde827d004fd04c47b5ba112df38d73
Signed-off-by: Qixiang Xu <qixiang.xu@arm.com>
7 years agoMerge pull request #1122 from EvanLloyd/ejll/62_fiptool1
davidcunado-arm [Mon, 16 Oct 2017 07:51:18 +0000 (08:51 +0100)]
Merge pull request #1122 from EvanLloyd/ejll/62_fiptool1

fiptool: Precursor changes for Visual Studio