Soby Mathew [Mon, 26 Oct 2015 14:01:53 +0000 (14:01 +0000)]
Prepare platforms to use refactored ARM GIC drivers
This patch adds platform helpers for the new GICv2 and GICv3 drivers in
plat_gicv2.c and plat_gicv3.c. The platforms can include the appropriate
file in their build according to the GIC driver to be used. The existing
plat_gic.c is only meant for the legacy GIC driver.
In the case of ARM platforms, the major changes are as follows:
1. The crash reporting helper macro `arm_print_gic_regs` that prints the GIC CPU
interface register values has been modified to detect the type of CPU
interface being used (System register or memory mappped interface) before
using the right interface to print the registers.
2. The power management helper function that is called after a core is powered
up has been further refactored. This is to highlight that the per-cpu
distributor interface should be initialised only when the core was originally
powered down using the CPU_OFF PSCI API and not when the CPU_SUSPEND PSCI API
was used.
3. In the case of CSS platforms, the system power domain restore helper
`arm_system_pwr_domain_resume()` is now only invoked in the `suspend_finish`
handler as the system power domain is always expected to be initialized when
the `on_finish` handler is invoked.
Change-Id: I7fc27d61fc6c2a60cea2436b676c5737d0257df6
Soby Mathew [Thu, 3 Sep 2015 17:29:38 +0000 (18:29 +0100)]
Enable use of FIQs and IRQs as TSP interrupts
On a GICv2 system, interrupts that should be handled in the secure world are
typically signalled as FIQs. On a GICv3 system, these interrupts are signalled
as IRQs instead. The mechanism for handling both types of interrupts is the same
in both cases. This patch enables the TSP to run on a GICv3 system by:
1. adding support for handling IRQs in the exception handling code.
2. removing use of "fiq" in the names of data structures, macros and functions.
The build option TSPD_ROUTE_IRQ_TO_EL3 is deprecated and is replaced with a
new build flag TSP_NS_INTR_ASYNC_PREEMPT. For compatibility reasons, if the
former build flag is defined, it will be used to define the value for the
new build flag. The documentation is also updated accordingly.
Change-Id: I1807d371f41c3656322dd259340a57649833065e
Soby Mathew [Tue, 22 Sep 2015 11:01:18 +0000 (12:01 +0100)]
Unify interrupt return paths from TSP into the TSPD
The TSP is expected to pass control back to EL3 if it gets preempted due to
an interrupt while handling a Standard SMC in the following scenarios:
1. An FIQ preempts Standard SMC execution and that FIQ is not a TSP Secure
timer interrupt or is preempted by a higher priority interrupt by the time
the TSP acknowledges it. In this case, the TSP issues an SMC with the ID
as `TSP_EL3_FIQ`. Currently this case is never expected to happen as only
the TSP Secure Timer is expected to generate FIQ.
2. An IRQ preempts Standard SMC execution and in this case the TSP issues
an SMC with the ID as `TSP_PREEMPTED`.
In both the cases, the TSPD hands control back to the normal world and returns
returns an error code to the normal world to indicate that the standard SMC it
had issued has been preempted but not completed.
This patch unifies the handling of these two cases in the TSPD and ensures that
the TSP only uses TSP_PREEMPTED instead of separate SMC IDs. Also instead of 2
separate error codes, SMC_PREEMPTED and TSP_EL3_FIQ, only SMC_PREEMPTED is
returned as error code back to the normal world.
Background information: On a GICv3 system, when the secure world has affinity
routing enabled, in 2. an FIQ will preempt TSP execution instead of an IRQ. The
FIQ could be a result of a Group 0 or a Group 1 NS interrupt. In both case, the
TSPD passes control back to the normal world upon receipt of the TSP_PREEMPTED
SMC. A Group 0 interrupt will immediately preempt execution to EL3 where it
will be handled. This allows for unified interrupt handling in TSP for both
GICv3 and GICv2 systems.
Change-Id: I9895344db74b188021e3f6a694701ad272fb40d4
Soby Mathew [Thu, 3 Dec 2015 14:12:54 +0000 (14:12 +0000)]
Rename GICv3 interrupt group macros
This patch renames the GICv3 interrupt group macros from
INT_TYPE_G0, INT_TYPE_G1S and INT_TYPE_G1NS to INTR_GROUP0,
INTR_GROUP1S and INTR_GROUP1NS respectively.
Change-Id: I40c66f589ce6234fa42205adcd91f7d6ad8f33d4
danh-arm [Wed, 2 Dec 2015 16:48:20 +0000 (16:48 +0000)]
Merge pull request #446 from vikramkanigiri/vk/tzc-400
Fix TZC-400 peripheral detection
danh-arm [Wed, 2 Dec 2015 16:42:33 +0000 (16:42 +0000)]
Merge pull request #449 from jcastillo-arm/jc/tbb_oid
TBB: add ARM OIDs
danh-arm [Wed, 2 Dec 2015 16:42:06 +0000 (16:42 +0000)]
Merge pull request #444 from jcastillo-arm/jc/tbb_wdog
Jc/tbb wdog
Juan Castillo [Tue, 6 Oct 2015 13:01:35 +0000 (14:01 +0100)]
TBB: add Trusted Watchdog support on ARM platforms
This patch adds watchdog support on ARM platforms (FVP and Juno).
A secure instance of SP805 is used as Trusted Watchdog. It is
entirely managed in BL1, being enabled in the early platform setup
hook and disabled in the exit hook. By default, the watchdog is
enabled in every build (even when TBB is disabled).
A new ARM platform specific build option `ARM_DISABLE_TRUSTED_WDOG`
has been introduced to allow the user to disable the watchdog at
build time. This feature may be used for testing or debugging
purposes.
Specific error handlers for Juno and FVP are also provided in this
patch. These handlers will be called after an image load or
authentication error. On FVP, the Table of Contents (ToC) in the FIP
is erased. On Juno, the corresponding error code is stored in the
V2M Non-Volatile flags register. In both cases, the CPU spins until
a watchdog reset is generated after 256 seconds (as specified in
the TBBR document).
Change-Id: I9ca11dcb0fe15af5dbc5407ab3cf05add962f4b4
Juan Castillo [Wed, 2 Dec 2015 09:48:34 +0000 (09:48 +0000)]
TBB: add ARM OIDs
This patch adds ARM specific OIDs which will be used to extract
the extension data from the certificates. These OIDs are arranged
as a subtree whose root node has been specifically allocated for
ARM Ltd.
{ iso(1) identified-organization(3) dod(6) internet(1)
private(4) enterprise(1) 4128 }
Change-Id: Ice20b3c8a31ddefe9102f3bd42f7429986f3ac34
danh-arm [Tue, 1 Dec 2015 19:02:24 +0000 (19:02 +0000)]
Merge pull request #443 from achingupta/sb/el3_payloads-cb_single_cpu
Add support to boot EL3 payloads and only a single CPU at cold reset
danh-arm [Tue, 1 Dec 2015 18:31:14 +0000 (18:31 +0000)]
Merge pull request #445 from jcastillo-arm/jc/tf-issues/320
Add NULL pointer check before reading BL32 entry point information
danh-arm [Tue, 1 Dec 2015 18:29:16 +0000 (18:29 +0000)]
Merge pull request #442 from soby-mathew/sm/remove_imf_read_intid
Remove the IMF_READ_INTERRUPT_ID build option
Vikram Kanigiri [Tue, 20 Oct 2015 15:55:26 +0000 (16:55 +0100)]
Fix TZC-400 peripheral detection
The TZC-400 driver implementation incorrectly uses the component
ID registers to detect the TZC-400 peripheral. As all ARM
peripherals share the same component ID, it doesn't allow to
uniquely identify the TZC-400 peripheral. This patch fixes the
TZC-400 driver by relying on the `part_number_0` and
`part_number_1` fields in the `PID` registers instead.
The `tzc_read_component_id` function has been replaced by
`tzc_read_peripheral_id`, which reads the 'part_number' values
and compares them with the TZC-400 peripheral ID.
Also, it adds a debug assertion to detect when the TZC driver
initialisation function is called multiple times.
Change-Id: I35949f6501a51c0a794144cd1c3a6db62440dce6
Juan Castillo [Tue, 8 Jul 2014 16:20:41 +0000 (17:20 +0100)]
Add a simple ARM SP805 watchdog driver
Based on SP805 Programmer's model (ARM DDI 0270B). This driver
provides three public APIs:
void sp805_start(uintptr_t base, unsigned long ticks);
void sp805_stop(uintptr_t base);
void sp805_refresh(uintptr_t base, unsigned long ticks);
Upon start, the watchdog starts counting down from the number of
ticks specified. When the count reaches 0 an interrupt is triggered.
The watchdog restarts counting down from the number of ticks
specified. If the count reaches 0 again, the system is reset. A
mechanism to handle the interrupt has not been implemented. Instead,
the API to refresh the watchdog should be used instead to prevent a
system reset.
Change-Id: I799d53f8d1213b10b341a4a67fde6486e89a3dab
Juan Castillo [Wed, 12 Aug 2015 11:53:02 +0000 (12:53 +0100)]
Add basic NOR flash driver for ARM platforms
FVP and Juno platforms include a NOR flash memory to store and
load the FIP, the kernel or a ramdisk. This NOR flash is arranged
as 2 x 16 bit flash devices and can be programmed using CFI
standard commands.
This patch provides a basic API to write single 32 bit words of
data into the NOR flash. Functions to lock/unlock blocks against
erase or write operations are also provided.
Change-Id: I1da7ad3105b1ea409c976adc863954787cbd90d2
Sandrine Bailleux [Wed, 11 Nov 2015 11:39:32 +0000 (11:39 +0000)]
User Guide: Remove reference to porting guide
The implications of the 'PROGRAMMABLE_RESET_ADDRESS' build option on
the platform porting layer are simple enough to be described in the
User Guide directly. This patch removes the reference to the Porting
Guide.
Change-Id: I7f753b18abd20effc4fd30836609e1fd51d9221d
Sandrine Bailleux [Fri, 30 Oct 2015 15:05:17 +0000 (15:05 +0000)]
Introduce COLD_BOOT_SINGLE_CPU build option
This patch introduces a new build option named COLD_BOOT_SINGLE_CPU,
which allows platforms that only release a single CPU out of reset to
slightly optimise their cold boot code, both in terms of code size
and performance.
COLD_BOOT_SINGLE_CPU defaults to 0, which assumes that the platform
may release several CPUs out of reset. In this case, the cold reset
code needs to coordinate all CPUs via the usual primary/secondary
CPU distinction.
If a platform guarantees that only a single CPU will ever be released
out of reset, there is no need to arbitrate execution ; the notion of
primary and secondary CPUs itself no longer exists. Such platforms
may set COLD_BOOT_SINGLE_CPU to 1 in order to compile out the
primary/secondary CPU identification in the cold reset code.
All ARM standard platforms can release several CPUs out of reset
so they use COLD_BOOT_SINGLE_CPU=0. However, on CSS platforms like
Juno, bringing up more than one CPU at reset should only be attempted
when booting an EL3 payload, as it is not fully supported in the
normal boot flow.
For platforms using COLD_BOOT_SINGLE_CPU=1, the following 2 platform
APIs become optional:
- plat_secondary_cold_boot_setup();
- plat_is_my_cpu_primary().
The Porting Guide has been updated to reflect that.
User Guide updated as well.
Change-Id: Ic5b474e61b7aec1377d1e0b6925d17dfc376c46b
Sandrine Bailleux [Thu, 1 Oct 2015 09:25:15 +0000 (10:25 +0100)]
Document the EL3 payload support
- Document the new build option EL3_PAYLOAD_BASE
- Document the EL3 payload boot flow
- Document the FVP model parameters to boot an EL3 payload
Change-Id: Ie6535914a9a68626e4401659bee4fcfd53d4bd37
Sandrine Bailleux [Fri, 2 Oct 2015 13:35:25 +0000 (14:35 +0100)]
FVP: Do not power off secondary CPUs when booting an EL3 payload
Normally, in the FVP port, secondary CPUs are immediately powered
down if they are powered on at reset. However, when booting an EL3
payload, we need to keep them powered on as the requirement is for
all CPUs to enter the EL3 payload image. This patch puts them in a
holding pen instead of powering them off.
Change-Id: I6526a88b907a0ddb820bead72f1d350a99b1692c
Sandrine Bailleux [Wed, 29 Apr 2015 15:28:52 +0000 (16:28 +0100)]
CSS: Put secondary CPUs in a pen when booting an EL3 payload
By default, only the primary CPU is powered on by SCP on CSS
platforms. Secondary CPUs are then powered on later using PSCI
calls.
However, it is possible to power on more than one CPU at boot time
using platform specific settings. In this case, several CPUs will
enter the Trusted Firmware and execute the cold boot path code.
This is currently not supported and secondary CPUs will panic.
This patch preserves this behaviour in the normal boot flow.
However, when booting an EL3 payload, secondary CPUs are now held in
a pen until their mailbox is populated, at which point they jump to
this address. Note that, since all CPUs share the same mailbox, they
will all be released from their holding pen at the same time and the
EL3 payload is responsible to arbitrate execution between CPUs if
required.
Change-Id: I83737e0c9f15ca5e73afbed2e9c761bc580735b9
Sandrine Bailleux [Thu, 26 Nov 2015 16:31:34 +0000 (16:31 +0000)]
CSS: Enable booting of EL3 payloads
This patch adds support for booting EL3 payloads on CSS platforms,
for example Juno. In this scenario, the Trusted Firmware follows
its normal boot flow up to the point where it would normally pass
control to the BL31 image. At this point, it jumps to the EL3
payload entry point address instead.
Before handing over to the EL3 payload, the data SCP writes for AP
at the beginning of the Trusted SRAM is restored, i.e. we zero the
first 128 bytes and restore the SCP Boot configuration. The latter
is saved before transferring the BL30 image to SCP and is restored
just after the transfer (in BL2). The goal is to make it appear that
the EL3 payload is the first piece of software to run on the target.
The BL31 entrypoint info structure is updated to make the primary
CPU jump to the EL3 payload instead of the BL31 image.
The mailbox is populated with the EL3 payload entrypoint address,
which releases the secondary CPUs out of their holding pen (if the
SCP has powered them on). The arm_program_trusted_mailbox() function
has been exported for this purpose.
The TZC-400 configuration in BL2 is simplified: it grants secure
access only to the whole DRAM. Other security initialization is
unchanged.
This alternative boot flow is disabled by default. A new build option
EL3_PAYLOAD_BASE has been introduced to enable it and provide the EL3
payload's entry point address. The build system has been modified
such that BL31 and BL33 are not compiled and/or not put in the FIP in
this case, as those images are not used in this boot flow.
Change-Id: Id2e26fa57988bbc32323a0effd022ab42f5b5077
Sandrine Bailleux [Tue, 10 Nov 2015 15:01:57 +0000 (15:01 +0000)]
Pass the entry point info to bl1_plat_prepare_exit()
This patch modifies the prototype of the bl1_plat_prepare_exit()
platform API to pass the address of the entry point info structure
received from BL2. The structure contains information that can be
useful, depending on the kind of clean up or bookkeeping operations
to perform.
The weak implementation of this function ignores this argument to
preserve platform backwards compatibility.
NOTE: THIS PATCH MAY BREAK PLATFORM PORTS THAT ARE RELYING ON THE
FORMER PROTOTYPE OF THE BL1_PLAT_PREPARE_EXIT() API.
Change-Id: I3fc18f637de06c85719c4ee84c85d6a4572a0fdb
Sandrine Bailleux [Tue, 10 Nov 2015 10:01:19 +0000 (10:01 +0000)]
Introduce SPIN_ON_BL1_EXIT build flag
This patch introduces a new build flag, SPIN_ON_BL1_EXIT, which
puts an infinite loop in BL1. It is intended to help debugging
the post-BL2 phase of the Trusted Firmware by stopping execution
in BL1 just before handing over to BL31. At this point, the
developer may take control of the target using a debugger.
This feature is disabled by default and can be enabled by
rebuilding BL1 with SPIN_ON_BL1_EXIT=1.
User Guide updated accordingly.
Change-Id: I6b6779d5949c9e5571dd371255520ef1ac39685c
Soby Mathew [Tue, 27 Oct 2015 10:01:06 +0000 (10:01 +0000)]
Remove the IMF_READ_INTERRUPT_ID build option
The IMF_READ_INTERRUPT_ID build option enables a feature where the interrupt
ID of the highest priority pending interrupt is passed as a parameter to the
interrupt handler registered for that type of interrupt. This additional read
of highest pending interrupt id from GIC is problematic as it is possible that
the original interrupt may get deasserted and another interrupt of different
type maybe become the highest pending interrupt. Hence it is safer to prevent
such behaviour by removing the IMF_READ_INTERRUPT_ID build option.
The `id` parameter of the interrupt handler `interrupt_type_handler_t` is
now made a reserved parameter with this patch. It will always contain
INTR_ID_UNAVAILABLE.
Fixes ARM-software/tf-issues#307
Change-Id: I2173aae1dd37edad7ba6bdfb1a99868635fa34de
Achin Gupta [Thu, 26 Nov 2015 16:30:24 +0000 (16:30 +0000)]
Merge pull request #439 from soby-mathew/sm/new-gic-driver
Introduce new GICv3 and GICv2 drivers
Soby Mathew [Mon, 26 Oct 2015 14:32:09 +0000 (14:32 +0000)]
Deprecate the GIC Legacy driver.
This patch deprecates the legacy ARM GIC driver and related header files
(arm_gic.h, gic_v2.h, gic_v3.h). For GICv2 systems, platform ports should
use the GICv2 driver in include/drivers/arm/gicv2.h and for GICv3 systems,
platform ports should use the GICv3 driver in include/drivers/arm/gicv3.h
NOTE: The ARM Legacy GIC drivers have been deprecated with this patch.
Platform ports are encouraged to migrate to the new GIC drivers.
Change-Id: Ic0460ef0427b54a6aac476279a7f29b81943e942
Soby Mathew [Wed, 7 Oct 2015 08:45:27 +0000 (09:45 +0100)]
Add ARM GICv2 driver
This patch adds a driver for ARM GICv2 systems, example GIC-400. Unlike
the existing GIC driver in `include/drivers/arm/arm_gic.h`, this driver
is optimised for GICv2 and does not support GICv3 systems in GICv2
compatibility mode. The driver interface has been implemented in
`drivers/arm/gic/v2/gicv2_main.c`. The corresponding header is in
`include/drivers/arm/gicv2.h`. Helper functions are implemented in
`drivers/arm/gic/v2/gicv2_helpers.c` and are accessible through the
`drivers/arm/gic/v2/gicv2_private.h` header.
Change-Id: I09fffa4e621fb99ba3c01204839894816cd89a2a
Achin Gupta [Thu, 3 Sep 2015 13:18:02 +0000 (14:18 +0100)]
Add ARM GICv3 driver without support for legacy operation
This patch adds a driver for ARM GICv3 systems that need to run software
stacks where affinity routing is enabled across all privileged exception
levels for both security states. This driver is a partial implementation
of the ARM Generic Interrupt Controller Architecture Specification, GIC
architecture version 3.0 and version 4.0 (ARM IHI 0069A). The driver does
not cater for legacy support of interrupts and asymmetric configurations.
The existing GIC driver has been preserved unchanged. The common code for
GICv2 and GICv3 systems has been refactored into a new file,
`drivers/arm/gic/common/gic_common.c`. The corresponding header is in
`include/drivers/arm/gic_common.h`.
The driver interface is implemented in `drivers/arm/gic/v3/gicv3_main.c`.
The corresponding header is in `include/drivers/arm/gicv3.h`. Helper
functions are implemented in `drivers/arm/gic/v3/arm_gicv3_helpers.c`
and are accessible through the `drivers/arm/gic/v3/gicv3_private.h`
header.
Change-Id: I8c3c834a1d049d05b776b4dcb76b18ccb927444a
Achin Gupta [Thu, 26 Nov 2015 12:25:54 +0000 (12:25 +0000)]
Merge pull request #438 from soby-mathew/sm/error_deprecate
Replace build macro WARN_DEPRECATED with ERROR_DEPRECATED
Soby Mathew [Mon, 26 Oct 2015 14:29:21 +0000 (14:29 +0000)]
Replace build macro WARN_DEPRECATED with ERROR_DEPRECATED
This patch changes the build time behaviour when using deprecated API within
Trusted Firmware. Previously the use of deprecated APIs would only trigger a
build warning (which was always treated as a build error), when
WARN_DEPRECATED = 1. Now, the use of deprecated C declarations will always
trigger a build time warning. Whether this warning is treated as error or not
is determined by the build flag ERROR_DEPRECATED which is disabled by default.
When the build flag ERROR_DEPRECATED=1, the invocation of deprecated API or
inclusion of deprecated headers will result in a build error.
Also the deprecated context management helpers in context_mgmt.c are now
conditionally compiled depending on the value of ERROR_DEPRECATED flag
so that the APIs themselves do not result in a build error when the
ERROR_DEPRECATED flag is set.
NOTE: Build systems that use the macro WARN_DEPRECATED must migrate to
using ERROR_DEPRECATED, otherwise deprecated API usage will no longer
trigger a build error.
Change-Id: I843bceef6bde979af7e9b51dddf861035ec7965a
Achin Gupta [Thu, 19 Nov 2015 21:46:43 +0000 (21:46 +0000)]
Merge pull request #435 from sandrine-bailleux/sb/juno-r2
Changes to platform reset handler for Juno r2
Achin Gupta [Thu, 19 Nov 2015 15:03:17 +0000 (15:03 +0000)]
Merge pull request #429 from vikramkanigiri/vk/fix_sctlr_res1
Add missing RES1 bit in SCTLR_EL1
Achin Gupta [Thu, 19 Nov 2015 15:03:01 +0000 (15:03 +0000)]
Merge pull request #430 from jcastillo-arm/jc/tf-issues/333
Fix build error when `BL32` is not defined
Sandrine Bailleux [Wed, 18 Nov 2015 11:59:35 +0000 (11:59 +0000)]
Juno R2: Configure the correct L2 RAM latency values
The default reset values for the L2 Data & Tag RAM latencies on the
Cortex-A72 on Juno R2 are not suitable. This patch modifies
the Juno platform reset handler to configure the right settings
on Juno R2.
Change-Id: I20953de7ba0619324a389e0b7bbf951b64057db8
Sandrine Bailleux [Wed, 18 Nov 2015 11:10:30 +0000 (11:10 +0000)]
Juno: Rework platform reset handler
This patch splits the Juno reset handler in 4 distinct pieces:
- Detection of the board revision;
- Juno R0 specific handler;
- Juno R1 specific handler;
- Juno R2 specific handler.
Depending on the board revision, the appropriate handler is called.
This makes the code easier to understand and maintain.
This patch is mainly cosmetic. The only functional change introduced
is that the Juno platform reset handler will now spin infinitely if
the board revision is not recognised. Previously, it would have
assumed that it was running on Juno R1 in this case.
Change-Id: I54ed77c4665085ead9d1573316c9c884d7d3ffa0
Juan Castillo [Thu, 12 Nov 2015 10:59:26 +0000 (10:59 +0000)]
Fix build error when `BL32` is not defined
If an SPD wants to use a prebuilt binary as BL32 image (for example,
the OPTEE Dispatcher), it must point the `BL32` variable to the
image file. This dependency should apply only to the `fip` target.
However, it also applies to the `all` target at the moment. If the
user tries to build all individual TF images using `make all`
without setting BL32, the build fails. The following command will
throw the error:
make CROSS_COMPILE=aarch64-linux-gnu- SPD=opteed all
...
...
aarch64-linux-gnu-gcc: fatal error: no input files
compilation terminated.
make: *** [build/fvp/release/bl32/bl32.ld] Error 1
The reason is that the build system checks if BL32 is defined, and
if it is not, it will try to build BL32 from source. If the SPD
makefile does not provide support for that (as is the case of the
OPTEE Dispatcher, since OPTEE is provided as an external binary),
the build will fail.
This patch fixes the issue by checking if `BL32_SOURCES` has been
defined by the SPD before attempting to build BL32 from source.
If neither `BL32` nor `BL32_SOURCES` is defined when building the
FIP, a warning message will be printed and the process aborted.
Fixes ARM-software/tf-issues#333
Change-Id: I5e801ad333103ed9b042e5c4757424c8df2ff6e4
Vikram Kanigiri [Wed, 22 Jul 2015 10:53:52 +0000 (11:53 +0100)]
Add missing RES1 bit in SCTLR_EL1
As per Section D7.2.81 in the ARMv8-A Reference Manual (DDI0487A Issue A.h),
bits[29:28], bits[23:22], bit[20] and bit[11] in the SCTLR_EL1 are RES1. This
patch adds the missing bit[20] to the SCTLR_EL1_RES1 macro.
Change-Id: I827982fa2856d04def6b22d8200a79fe6922a28e
Juan Castillo [Fri, 6 Nov 2015 10:01:37 +0000 (10:01 +0000)]
Add NULL pointer check before reading BL32 entry point information
BL2 is responsible for loading BL32 and passing a pointer to the
BL32 entrypoint info to BL31 in the BL31 parameters. If no BL32
image is loaded, a NULL pointer is passed. The platform is
responsible for accessing BL31 parameters and extracting the
corresponding BL32 EP info.
In ARM platforms, arm_bl31_early_platform_setup() dereferences the
pointer to the BL32 EP info without checking first if the pointer
is NULL. This will cause an exception if a BL32 entrypoint has not
been populated by BL2. FVP and Juno are not affected because they
always define BL32_BASE, irrespective of whether a BL32 image is
included in the FIP or not.
This patches fixes the issue by checking the BL32 ep_info pointer
before trying to access the data.
If `RESET_TO_BL31` is enabled, the BL32 entrypoint is not
populated if BL32_BASE is not defined.
NOTE: Maintainers of partner platforms should check for this issue
in their ports.
Fixes ARM-software/tf-issues#320
Change-Id: I31456155503f2765766e8b7cd30ab4a40958fb96
Achin Gupta [Wed, 11 Nov 2015 21:48:03 +0000 (21:48 +0000)]
Merge pull request #427 from jcastillo-arm/jc/tf-issues/294
Add -mstrict-align to the gcc options
Achin Gupta [Wed, 11 Nov 2015 21:46:19 +0000 (21:46 +0000)]
Merge pull request #428 from vwadekar/per-soc-system-reset-v2
Tegra: introduce per-soc system reset handler
Varun Wadekar [Tue, 10 Nov 2015 01:39:28 +0000 (17:39 -0800)]
Tegra: introduce per-soc system reset handler
This patch adds a per-soc system reset handler for Tegra chips. The
handler gets executed before the actual system resets. This allows
for custom handling of the system reset sequence on each SoC.
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Achin Gupta [Tue, 10 Nov 2015 13:46:00 +0000 (13:46 +0000)]
Merge pull request #424 from jcastillo-arm/jc/tf-issues/327
IMF: postpone SCR_EL3 update if context is not initialized
Juan Castillo [Fri, 6 Nov 2015 12:43:56 +0000 (12:43 +0000)]
Add -mstrict-align to the gcc options
ARMv8 architecture allows unaligned memory accesses. However,
Trusted Firmware disables such feature by setting the SCTLR_A_BIT
and SCTLR_SA_BIT in the SCTLR_EL3 register (it enables alignment
checks).
This patch adds -mstrict-align to the gcc build options. Although
there are not explicit unaligned memory accesses in Trusted Firmware,
this flag will tell the compiler not to use them.
Fixes ARM-software/tf-issues#294
Change-Id: I69748c6cf28504be9ca3dc975a331d14459c9ef1
Achin Gupta [Mon, 9 Nov 2015 13:06:44 +0000 (13:06 +0000)]
Merge pull request #425 from achingupta/ag/tf-issues#332
Re-introduce evaluation of ENABLE_PLAT_COMPAT build flag
Achin Gupta [Sat, 7 Nov 2015 16:19:23 +0000 (16:19 +0000)]
Re-introduce evaluation of ENABLE_PLAT_COMPAT build flag
Commit #
73c99d4eb377e0e25f7951be53087bf92e7b4b18 had refactored the top level
Makefile. This commit also broke platform ports that still rely on an enabled
ENABLE_PLAT_COMPAT build option since the evaluation of this option was also
accidentally removed from the Makefile.
This patch fixes this break by re-introducing the necessary support to ensure
that this build option is enabled by default if a platform port does not disable
it explicitly.
Fixes ARM-software/tf-issues#332
Change-Id: I2217595d2e0bccae7de98cc6c0ea448b5bf3dae2
Juan Castillo [Fri, 30 Oct 2015 14:53:24 +0000 (14:53 +0000)]
IMF: postpone SCR_EL3 update if context is not initialized
The set_routing_model() function in the Interrupt Management
Framework calls the context management library to update the
SCR_EL3 register. This context management library assumes that
the context has been previously initialized. Consequently, if
a Secure Payload Dispatcher (SPD) tries to set the routing model
before initializing the context, the system will fail (in debug
mode, an assertion will be raised).
This patch fixes the issue by checking if the context has been
initialized before updating SCR_EL3. If a valid context is not
available, SCR_EL3 update will be done when the SPD calls the
context initialization function. This function will call
get_scr_el3_from_routing_model() to obtain the SCR_EL3 value.
If the SPD does not call the context initialization function
then it is SPD's responsibility to obtain SCR_EL3 from the IMF
and update the context accordingly.
Fixes ARM-software/tf-issues#327
Change-Id: Ic2f1c6e899e578a8db858ec43747c63a8539c16f
Achin Gupta [Wed, 4 Nov 2015 22:32:50 +0000 (22:32 +0000)]
Merge pull request #423 from jcastillo-arm/jc/genfw/1211
Remove deprecated IO return definitions
Achin Gupta [Wed, 4 Nov 2015 17:27:16 +0000 (17:27 +0000)]
Merge pull request #421 from sandrine-bailleux/sb/improve-display_boot_progress
Improve images transitions debugging messages
Achin Gupta [Wed, 4 Nov 2015 17:18:16 +0000 (17:18 +0000)]
Merge pull request #422 from achingupta/bj/juno_r2_support
Add Cortex-A72 support for Juno R2
Brendan Jackman [Fri, 30 Oct 2015 16:25:12 +0000 (16:25 +0000)]
Add A72 support for Juno R2
Cortex-A72 library support is now compiled into the Juno platform port to go
with the existing A53/A57 support. This enables a single set of Juno TF
binaries to run on Juno R0, R1 and R2 boards.
Change-Id: I4a601dc4f671e98bdb19d98bbb66f02f0d8b7fc7
Juan Castillo [Mon, 2 Nov 2015 10:47:01 +0000 (10:47 +0000)]
Remove deprecated IO return definitions
Patch
7e26fe1f deprecates IO specific return definitions in favour
of standard errno codes. This patch removes those definitions
and its usage from the IO framework, IO drivers and IO platform
layer. Following this patch, standard errno codes must be used
when checking the return value of an IO function.
Change-Id: Id6e0e9d0a7daf15a81ec598cf74de83d5768650f
Sandrine Bailleux [Tue, 27 Oct 2015 15:52:33 +0000 (15:52 +0000)]
Improve display_boot_progress() function
- Remove out-dated information about the use of printf() in the
function comment.
- Make the argument const, as the function doesn't need to modify it.
- Rename the function into bl1_print_bl31_ep_info() to make its
purpose clearer.
Change-Id: I2a9d215a37f0ec11aefce0c5c9e050473b7a6b25
Sandrine Bailleux [Mon, 28 Sep 2015 16:03:06 +0000 (17:03 +0100)]
Introduce print_entry_point_info() function
This patch introduces a new function called 'print_entry_point_info'
that prints an entry_point_t structure for debugging purposes.
As such, it can be used to display the entry point address, SPSR and
arguments passed from a firmware image to the next one.
This function is now called in the following images transitions:
- BL1 to BL2
- BL1 to BL31
- BL31 to the next image (typically BL32 or BL33)
The following changes have been introduced:
- Fix the output format of the SPSR value : SPSR is a 32-bit value,
not a 64-bit one.
- Print all arguments values.
The entry_point_info_t structure allows to pass up to 8 arguments.
In most cases, only the first 2 arguments were printed.
print_entry_point_info() now prints all of them as 'VERBOSE'
traces.
Change-Id: Ieb384bffaa7849e6cb95a01a47c0b7fc2308653a
danh-arm [Fri, 30 Oct 2015 16:57:32 +0000 (16:57 +0000)]
Merge pull request #418 from soby-mathew/sm/sys_suspend
Support SYSTEM SUSPEND on Juno
danh-arm [Fri, 30 Oct 2015 16:56:25 +0000 (16:56 +0000)]
Merge pull request #419 from soby-mathew/sm/tf-issues#318
Include xlat_tables.h in plat_arm.h
Soby Mathew [Tue, 27 Oct 2015 10:31:35 +0000 (10:31 +0000)]
Include xlat_tables.h in plat_arm.h
This patch fixes a compilation issue for platforms that are aligned to ARM
Standard platforms and include the `plat_arm.h` header in their platform port.
The compilation would fail for such a platform because `xlat_tables.h` which
has the definition for `mmap_region_t` is not included in `plat_arm.h`. This
patch fixes this by including `xlat_tables.h` in `plat_arm.h` header.
Fixes ARM-Software/tf-issues#318
Change-Id: I75f990cfb4078b3996fc353c8cd37c9de61d555e
Soby Mathew [Tue, 13 Oct 2015 10:39:21 +0000 (11:39 +0100)]
Doc: Add instructions to test SYSTEM SUSPEND
This patch adds instructions to the user-guide.md to test SYSTEM SUSPEND
on Juno.
Change-Id: Icd01d10e1c1fb14b0db880d0ff134e505f097d2b
Soby Mathew [Mon, 12 Oct 2015 16:32:29 +0000 (17:32 +0100)]
Support PSCI SYSTEM SUSPEND on Juno
This patch adds the capability to power down at system power domain level
on Juno via the PSCI SYSTEM SUSPEND API. The CSS power management helpers
are modified to add support for power management operations at system
power domain level. A new helper for populating `get_sys_suspend_power_state`
handler in plat_psci_ops is defined. On entering the system suspend state,
the SCP powers down the SYSTOP power domain on the SoC and puts the memory
into retention mode. On wakeup from the power down, the system components
on the CSS will be reinitialized by the platform layer and the PSCI client
is responsible for restoring the context of these system components.
According to PSCI Specification, interrupts targeted to cores in PSCI CPU
SUSPEND should be able to resume it. On Juno, when the system power domain
is suspended, the GIC is also powered down. The SCP resumes the final core
to be suspend when an external wake-up event is received. But the other
cores cannot be woken up by a targeted interrupt, because GIC doesn't
forward these interrupts to the SCP. Due to this hardware limitation,
we down-grade PSCI CPU SUSPEND requests targeted to the system power domain
level to cluster power domain level in `juno_validate_power_state()`
and the CSS default `plat_arm_psci_ops` is overridden in juno_pm.c.
A system power domain resume helper `arm_system_pwr_domain_resume()` is
defined for ARM standard platforms which resumes/re-initializes the
system components on wakeup from system suspend. The security setup also
needs to be done on resume from system suspend, which means
`plat_arm_security_setup()` must now be included in the BL3-1 image in
addition to previous BL images if system suspend need to be supported.
Change-Id: Ie293f75f09bad24223af47ab6c6e1268f77bcc47
Soby Mathew [Fri, 8 May 2015 09:18:59 +0000 (10:18 +0100)]
CSS: Implement topology support for System power domain
This patch implements the necessary topology changes for supporting
system power domain on CSS platforms. The definition of PLAT_MAX_PWR_LVL and
PLAT_NUM_PWR_DOMAINS macros are removed from arm_def.h and are made platform
specific. In addition, the `arm_power_domain_tree_desc[]` and
`arm_pm_idle_states[]` are modified to support the system power domain
at level 2. With this patch, even though the power management operations
involving the system power domain will not return any error, the platform
layer will silently ignore any operations to the power domain. The actual
power management support for the system power domain will be added later.
Change-Id: I791867eded5156754fe898f9cdc6bba361e5a379
danh-arm [Wed, 28 Oct 2015 09:54:44 +0000 (09:54 +0000)]
Merge pull request #415 from jcastillo-arm/jc/plat_err_handler
Add optional platform error handler API
danh-arm [Wed, 28 Oct 2015 09:50:21 +0000 (09:50 +0000)]
Merge pull request #416 from davwan01/dw/css-common
Allow CSS to redefine function `plat_arm_calc_core_pos`
Juan Castillo [Fri, 25 Sep 2015 14:41:14 +0000 (15:41 +0100)]
Add optional platform error handler API
This patch adds an optional API to the platform port:
void plat_error_handler(int err) __dead2;
The platform error handler is called when there is a specific error
condition after which Trusted Firmware cannot continue. While panic()
simply prints the crash report (if enabled) and spins, the platform
error handler can be used to hand control over to the platform port
so it can perform specific bookeeping or post-error actions (for
example, reset the system). This function must not return.
The parameter indicates the type of error using standard codes from
errno.h. Possible errors reported by the generic code are:
-EAUTH : a certificate or image could not be authenticated
(when Trusted Board Boot is enabled)
-ENOENT : the requested image or certificate could not be found
or an IO error was detected
-ENOMEM : resources exhausted. Trusted Firmware does not use
dynamic memory, so this error is usually an indication
of an incorrect array size
A default weak implementation of this function has been provided.
It simply implements an infinite loop.
Change-Id: Iffaf9eee82d037da6caa43b3aed51df555e597a3
danh-arm [Tue, 27 Oct 2015 17:08:22 +0000 (17:08 +0000)]
Merge pull request #417 from jcastillo-arm/jc/makefile_2
Makefile rework and bug fix #2
Juan Castillo [Thu, 22 Oct 2015 10:34:44 +0000 (11:34 +0100)]
Make: fix dependency files generation
Currently, if no make goal is specified in the command line, 'all'
is assumed by default, but the dependency files are not generated.
This might lead to a successful but inconsistent build. This patch
provides a fix to the problem.
Change-Id: I0148719e114dbdbe46f8a57c7d05da7cbc212c92
Juan Castillo [Tue, 18 Aug 2015 13:23:04 +0000 (14:23 +0100)]
Rework Makefile
This patch is a complete rework of the main Makefile. Functionality
remains the same but the code has been reorganized in sections in
order to improve readability and facilitate adding future extensions.
A new file 'build_macros.mk' has been created and will contain common
definitions (variables, macros, etc) that may be used from the main
Makefile and other platform specific makefiles.
A new macro 'FIP_ADD_IMG' has been introduced and it will allow the
platform to specify binary images and the necessary checks for a
successful build. Platforms that require a BL30 image no longer need
to specify the NEED_BL30 option. The main Makefile is now completely
unaware of additional images not built as part of Trusted Firmware,
like BL30. It is the platform responsibility to specify images using
the macro 'FIP_ADD_IMG'. Juno uses this macro to include the BL30
image in the build.
BL33 image is specified in the main Makefile to preserve backward
compatibility with the NEED_BL33 option. Otherwise, platform ports
that rely on the definition of NEED_BL33 might break.
All Trusted Board Boot related definitions have been moved to a
separate file 'tbbr_tools.mk'. The main Makefile will include this
file unless the platform indicates otherwise by setting the variable
'INCLUDE_TBBR_MK := 0' in the corresponding platform.mk file. This
will keep backward compatibility but ideally each platform should
include the corresponding TBB .mk file in platform.mk.
Change-Id: I35e7bc9930d38132412e950e20aa2a01e2b26801
David Wang [Thu, 22 Oct 2015 05:30:50 +0000 (13:30 +0800)]
Allow CSS to redefine function `plat_arm_calc_core_pos`
Currently all ARM CSS platforms which include css_helpers.S use the same
strong definition of `plat_arm_calc_core_pos`. This patch allows these CSS
platforms to define their own strong definition of this function.
* Replace the strong definition of `plat_arm_calc_core_pos` in
css_helpers.S with a utility function `css_calc_core_pos_swap_cluster`
does the same thing (swaps cluster IDs). ARM CSS platforms may choose
to use this function or not.
* Add a Juno strong definition of `plat_arm_calc_core_pos`, which uses
`css_calc_core_pos_swap_cluster`.
Change-Id: Ib5385ed10e44adf6cd1398a93c25973eb3506d9d
danh-arm [Mon, 26 Oct 2015 11:10:13 +0000 (11:10 +0000)]
Merge pull request #413 from jcastillo-arm/jc/tbb_cert_opt
Certificate create tool flexibility improvements
danh-arm [Mon, 26 Oct 2015 11:02:40 +0000 (11:02 +0000)]
Merge pull request #414 from jcastillo-arm/jc/io_ret_values
Use standard error code definitions
Juan Castillo [Thu, 1 Oct 2015 17:37:40 +0000 (18:37 +0100)]
Use standard errno definitions in load_auth_image()
This patch replaces custom definitions used as return values for
the load_auth_image() function with standard error codes defined
in errno.h. The custom definitions have been removed.
It also replaces the usage of IO framework error custom definitions,
which have been deprecated. Standard errno definitions are used
instead.
Change-Id: I1228477346d3876151c05b470d9669c37fd231be
Juan Castillo [Thu, 1 Oct 2015 16:55:11 +0000 (17:55 +0100)]
IO Framework: use standard errno codes as return values
This patch redefines the values of IO_FAIL, IO_NOT_SUPPORTED and
IO_RESOURCES_EXHAUSTED to match the corresponding definitions in
errno.h:
#define IO_FAIL (-ENOENT)
#define IO_NOT_SUPPORTED (-ENODEV)
#define IO_RESOURCES_EXHAUSTED (-ENOMEM)
NOTE: please note that the IO_FAIL, IO_NOT_SUPPORTED and
IO_RESOURCES_EXHAUSTED definitions are considered deprecated
and their usage should be avoided. Callers should rely on errno.h
definitions when checking the return values of IO functions.
Change-Id: Ic8491aa43384b6ee44951ebfc053a3ded16a80be
Juan Castillo [Fri, 3 Jul 2015 15:23:16 +0000 (16:23 +0100)]
cert_create: specify command line options in the CoT
This patch introduces a new API that allows to specify command
line options in the Chain of Trust description. These command line
options may be used to specify parameters related to the CoT (i.e.
keys or certificates), instead of keeping a hardcoded list of
options in main.c.
Change-Id: I282b0b01cb9add557b26bddc238a28253ce05e44
Juan Castillo [Wed, 8 Jul 2015 11:11:38 +0000 (12:11 +0100)]
cert_create: improve command line argument check
The certificate generation tool currently checks if all command
line options required to create all certificates in the CoT have
been specified. This prevents using the tool to create individual
certificates when the whole CoT is not required.
This patch improves the checking function so only those options
required by the certificates specified in the command line are
verified.
Change-Id: I2c426a8e2e2dec85b15f2d98fd4ba949c1aed385
danh-arm [Wed, 21 Oct 2015 11:16:51 +0000 (12:16 +0100)]
Merge pull request #410 from soby-mathew/sm/psci_handler_reorg
Reorganise PSCI PM handler setup on ARM Standard platforms
danh-arm [Wed, 21 Oct 2015 11:12:12 +0000 (12:12 +0100)]
Merge pull request #411 from jcastillo-arm/jc/plat_bl1_exit
Jc/plat bl1 exit
danh-arm [Tue, 20 Oct 2015 16:04:27 +0000 (17:04 +0100)]
Merge pull request #409 from sandrine-bailleux/sb/break-down-bl1-sync-exceptions
Break down BL1 AArch64 synchronous exception handler
Juan Castillo [Mon, 5 Oct 2015 15:59:38 +0000 (16:59 +0100)]
Add optional bl1_plat_prepare_exit() API
This patch adds an optional API to the platform port:
void bl1_plat_prepare_exit(void);
This function is called prior to exiting BL1 in response to the
RUN_IMAGE_SMC request raised by BL2. It should be used to perform
platform specific clean up or bookkeeping operations before
transferring control to the next image.
A weak empty definition of this function has been provided to
preserve platform backwards compatibility.
Change-Id: Iec09697de5c449ae84601403795cdb6aca166ba1
Soby Mathew [Tue, 29 Sep 2015 14:47:16 +0000 (15:47 +0100)]
Reorganise PSCI PM handler setup on ARM Standard platforms
This patch does the following reorganization to psci power management (PM)
handler setup for ARM standard platform ports :
1. The mailbox programming required during `plat_setup_psci_ops()` is identical
for all ARM platforms. Hence the implementation of this API is now moved
to the common `arm_pm.c` file. Each ARM platform now must define the
PLAT_ARM_TRUSTED_MAILBOX_BASE macro, which in current platforms is the same
as ARM_SHARED_RAM_BASE.
2. The PSCI PM handler callback structure, `plat_psci_ops`, must now be
exported via `plat_arm_psci_pm_ops`. This allows the common implementation
of `plat_setup_psci_ops()` to return a platform specific `plat_psci_ops`.
In the case of CSS platforms, a default weak implementation of the same is
provided in `css_pm.c` which can be overridden by each CSS platform.
3. For CSS platforms, the PSCI PM handlers defined in `css_pm.c` are now
made library functions and a new header file `css_pm.h` is added to export
these generic PM handlers. This allows the platform to reuse the
adequate CSS PM handlers and redefine others which need to be customized
when overriding the default `plat_arm_psci_pm_ops` in `css_pm.c`.
Change-Id: I277910f609e023ee5d5ff0129a80ecfce4356ede
Sandrine Bailleux [Tue, 29 Sep 2015 12:38:20 +0000 (13:38 +0100)]
Break down BL1 AArch64 synchronous exception handler
The AArch64 synchronous exception vector code in BL1 is almost
reaching its architectural limit of 32 instructions. This means
there is very little space for this code to grow.
This patch reduces the size of the exception vector code by
moving most of its code in a function to which we branch from
SynchronousExceptionA64.
Change-Id: Ib35351767a685fb2c2398029d32e54026194f7ed
danh-arm [Mon, 19 Oct 2015 10:40:17 +0000 (11:40 +0100)]
Merge pull request #408 from sandrine-bailleux/sb/cassert
Make CASSERT() macro callable from anywhere
danh-arm [Mon, 19 Oct 2015 10:37:31 +0000 (11:37 +0100)]
Merge pull request #407 from sandrine-bailleux/sb/fix-arm-bl1-setup-include
Fix #include path in ARM platform BL1 setup code
Sandrine Bailleux [Wed, 14 Oct 2015 15:00:23 +0000 (16:00 +0100)]
Make CASSERT() macro callable from anywhere
The CASSERT() macro introduces a typedef for the sole purpose of
triggering a compilation error if the condition to check is false.
This typedef is not used afterwards. As a consequence, when the
CASSERT() macro is called from withing a function block, the compiler
complains and outputs the following error message:
error: typedef 'msg' locally defined but not used [-Werror=unused-local-typedefs]
This patch adds the "unused" attribute for the aforementioned
typedef. This silences the compiler warning and thus makes the
CASSERT() macro callable from within function blocks as well.
Change-Id: Ie36b58fcddae01a21584c48bb6ef43ec85590479
Sandrine Bailleux [Fri, 2 Oct 2015 08:32:35 +0000 (09:32 +0100)]
Fix #include path in ARM platform BL1 setup code
This patch fixes the relative path to the 'bl1_private.h' header file
included from 'arm_bl1_setup.c'. Note that, although the path was
incorrect, it wasn't causing a compilation error because the header
file still got included through an alternative include search path.
Change-Id: I28e4f3dbe50e3550ca6cad186502c88a9fb5e260
danh-arm [Wed, 14 Oct 2015 11:36:49 +0000 (12:36 +0100)]
Merge pull request #405 from vwadekar/tlkd-resume-fid-v3
TLKD: pass results with TLK_RESUME_FID function ID
danh-arm [Wed, 14 Oct 2015 11:12:38 +0000 (12:12 +0100)]
Merge pull request #406 from sandrine-bailleux/sb/cci-init-fix-assertion
Fix debug assertion in deprecated CCI-400 driver
Sandrine Bailleux [Fri, 2 Oct 2015 07:51:17 +0000 (08:51 +0100)]
Fix debug assertion in deprecated CCI-400 driver
This patch fixes a copy and paste issue that resulted in the cluster
indexes not being checked as intended. Note that this fix applies to
the deprecated CCI-400 driver, not the unified one.
Change-Id: I497132a91c236690e5eaff908f2db5c8c65e85ab
Varun Wadekar [Wed, 7 Oct 2015 11:45:41 +0000 (17:15 +0530)]
TLKD: pass results with TLK_RESUME_FID function ID
TLK sends the "preempted" event to the NS world along with an
identifier for certain use cases. The NS world driver is then
expected to take appropriate action depending on the identifier
value. Upon completion, the NS world driver then sends the
results to TLK (via x1-x3) with the TLK_RESUME_FID function ID.
This patch uses the already present code to pass the results
from the NS world to TLK for the TLK_RESUME_FID function ID.
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
danh-arm [Wed, 7 Oct 2015 10:41:08 +0000 (11:41 +0100)]
Merge pull request #402 from soby-mathew/sm/psci_cpu_off
PSCI: Update state only if CPU_OFF is not denied by SPD
Soby Mathew [Thu, 1 Oct 2015 15:46:06 +0000 (16:46 +0100)]
PSCI: Update state only if CPU_OFF is not denied by SPD
This patch fixes an issue in the PSCI framework where the affinity info
state of a core was being set to OFF even when the SPD had denied the
CPU_OFF request. Now, the state remains set to ON instead.
Fixes ARM-software/tf-issues#323
Change-Id: Ia9042aa41fae574eaa07fd2ce3f50cf8cae1b6fc
danh-arm [Wed, 30 Sep 2015 14:18:15 +0000 (15:18 +0100)]
Merge pull request #401 from sandrine-bailleux/sb/fix-sp804-bug-v2
Bug fix in the SP804 dual timer driver
Achin Gupta [Wed, 30 Sep 2015 12:19:06 +0000 (13:19 +0100)]
Merge pull request #400 from vwadekar/tlkd-pm-handlers-v5
Send power management events to the Trusted OS (TLK)
danh-arm [Wed, 30 Sep 2015 10:13:33 +0000 (11:13 +0100)]
Merge pull request #393 from mtk09422/misc-updates
mt8173: Update SPM and fix watchdog setting
Varun Wadekar [Wed, 26 Aug 2015 07:19:03 +0000 (12:49 +0530)]
Send power management events to the Trusted OS (TLK)
This patch adds PM handlers to TLKD for the system suspend/resume and
system poweroff/reset cases. TLK expects all SMCs through a single
handler, which then fork out into multiple handlers depending on the
SMC. We tap into the same single entrypoint by restoring the S-EL1
context before passing the PM event via register 'x0'. On completion
of the PM event, TLK sends a completion SMC and TLKD then moves on
with the PM process.
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Sandrine Bailleux [Mon, 28 Sep 2015 15:32:38 +0000 (16:32 +0100)]
Bug fix in the SP804 dual timer driver
The generic delay timer driver expects a pointer to a timer_ops_t
structure containing the specific timer driver information. It
doesn't make a copy of the structure, instead it just keeps the
pointer. Therefore, this pointer must remain valid over time.
The SP804 driver doesn't satisfy this requirement. The
sp804_timer_init() macro creates a temporary instanciation of the
timer_ops_t structure on the fly and passes it to the generic
delay timer. When this temporary instanciation gets deallocated,
the generic delay timer is left with a pointer to invalid data.
This patch fixes this bug by statically allocating the SP804
timer_ops_t structure.
Change-Id: I8fbf75907583aef06701e3fd9fabe0b2c9bc95bf
Achin Gupta [Mon, 28 Sep 2015 13:39:45 +0000 (14:39 +0100)]
Merge pull request #398 from achingupta/vk/fix_bakery_lock_size
Fix relocation of __PERCPU_BAKERY_LOCK_SIZE__ in PR #390
Vikram Kanigiri [Thu, 24 Sep 2015 14:45:43 +0000 (15:45 +0100)]
Fix relocation of __PERCPU_BAKERY_LOCK_SIZE__
When a platform port does not define PLAT_PERCPU_BAKERY_LOCK_SIZE, the total
memory that should be allocated per-cpu to accommodate all bakery locks is
calculated by the linker in bl31.ld.S. The linker stores this value in the
__PERCPU_BAKERY_LOCK_SIZE__ linker symbol. The runtime value of this symbol is
different from the link time value as the symbol is relocated into the current
section (.bss). This patch fixes this issue by marking the symbol as ABSOLUTE
which allows it to retain its correct value even at runtime.
The description of PLAT_PERCPU_BAKERY_LOCK_SIZE in the porting-guide.md has been
made clearer as well.
Change-Id: Ia0cfd42f51deaf739d792297e60cad5c6e6e610b
Achin Gupta [Tue, 22 Sep 2015 15:34:52 +0000 (16:34 +0100)]
Merge pull request #394 from achingupta/ag/ccn_driver
Support for ARM CoreLink CCN interconnects
Achin Gupta [Mon, 20 Jul 2015 21:28:23 +0000 (22:28 +0100)]
Add a generic driver for ARM CCN IP
This patch adds a device driver which can be used to program the following
aspects of ARM CCN IP:
1. Specify the mapping between ACE/ACELite/ACELite+DVM/CHI master interfaces and
Request nodes.
2. Add and remove master interfaces from the snoop and dvm
domains.
3. Place the L3 cache in a given power state.
4. Configuring system adress map and enabling 3 SN striping mode of memory
controller operation.
Change-Id: I0f665c6a306938e5b66f6a92f8549b529aa8f325
Vikram Kanigiri [Thu, 10 Sep 2015 13:12:36 +0000 (14:12 +0100)]
Tegra: Perform cache maintenance on video carveout memory
Currently, the non-overlapping video memory carveout region is cleared after
disabling the MMU at EL3. If at any exception level the carveout region is being
marked as cacheable, this zeroing of memory will not have an affect on the
cached lines. Hence, we first invalidate the dirty lines and update the memory
and invalidate again so that both caches and memory is zeroed out.
Change-Id: If3b2d139ab7227f6799c0911d59e079849dc86aa
Achin Gupta [Fri, 11 Sep 2015 15:03:13 +0000 (16:03 +0100)]
Make generic code work in presence of system caches
On the ARMv8 architecture, cache maintenance operations by set/way on the last
level of integrated cache do not affect the system cache. This means that such a
flush or clean operation could result in the data being pushed out to the system
cache rather than main memory. Another CPU could access this data before it
enables its data cache or MMU. Such accesses could be serviced from the main
memory instead of the system cache. If the data in the sysem cache has not yet
been flushed or evicted to main memory then there could be a loss of
coherency. The only mechanism to guarantee that the main memory will be updated
is to use cache maintenance operations to the PoC by MVA(See section D3.4.11
(System level caches) of ARMv8-A Reference Manual (Issue A.g/ARM DDI0487A.G).
This patch removes the reliance of Trusted Firmware on the flush by set/way
operation to ensure visibility of data in the main memory. Cache maintenance
operations by MVA are now used instead. The following are the broad category of
changes:
1. The RW areas of BL2/BL31/BL32 are invalidated by MVA before the C runtime is
initialised. This ensures that any stale cache lines at any level of cache
are removed.
2. Updates to global data in runtime firmware (BL31) by the primary CPU are made
visible to secondary CPUs using a cache clean operation by MVA.
3. Cache maintenance by set/way operations are only used prior to power down.
NOTE: NON-UPSTREAM TRUSTED FIRMWARE CODE SHOULD MAKE EQUIVALENT CHANGES IN
ORDER TO FUNCTION CORRECTLY ON PLATFORMS WITH SUPPORT FOR SYSTEM CACHES.
Fixes ARM-software/tf-issues#205
Change-Id: I64f1b398de0432813a0e0881d70f8337681f6e9a
Achin Gupta [Mon, 14 Sep 2015 20:49:10 +0000 (21:49 +0100)]
Merge pull request #390 from vikramkanigiri/at/unify_bakery_locks_v2
Re-design bakery lock allocation and algorithm