Commit Graph

463 Commits

Author SHA1 Message Date
Soby Mathew b1a9631d81 Optimize barrier usage during Cortex-A57 power down
This the patch replaces the DSB SY with DSB ISH
after disabling L2 prefetches during the Cortex-A57
power down sequence.

Change-Id: I048d12d830c1b974b161224eff079fb9f8ecf52d
2014-10-29 17:38:56 +00:00
Soby Mathew 7395a725ae Apply errata workarounds only when major/minor revisions match.
Prior to this patch, the errata workarounds were applied for any version
of the CPU in the release build and in the debug build an assert
failure resulted when the revision did not match. This patch applies
errata workarounds in the Cortex-A57 reset handler only if the 'variant'
and 'revision' fields read from the MIDR_EL1 match. In the debug build,
a warning message is printed for each errata workaround which is not
applied.

The patch modifies the register usage in 'reset_handler` so
as to adhere to ARM procedure calling standards.

Fixes ARM-software/tf-issues#242

Change-Id: I51b1f876474599db885afa03346e38a476f84c29
2014-10-29 17:38:56 +00:00
Soby Mathew 8e85791677 Add support for level specific cache maintenance operations
This patch adds level specific cache maintenance functions
to cache_helpers.S. The new functions 'dcsw_op_levelx',
where '1 <= x <= 3', allow to perform cache maintenance by
set/way for that particular level of cache.  With this patch,
functions to support cache maintenance upto level 3 have
been implemented since it is the highest cache level for
most ARM SoCs.

These functions are now utilized in CPU specific power down
sequences to implement them as mandated by processor specific
technical reference manual.

Change-Id: Icd90ce6b51cff5a12863bcda01b93601417fd45c
2014-10-29 17:38:56 +00:00
danh-arm 0f4b06347b Merge pull request #217 from jcastillo-arm/jc/tf-issues/257
FVP: keep shared data in Trusted SRAM
2014-10-28 12:25:51 +00:00
danh-arm 7ce0510673 Merge pull request #216 from vikramkanigiri/vk/juno_standby_support
Juno: Support entry into a standby state
2014-10-28 12:06:47 +00:00
danh-arm d1d92a23ec Merge pull request #215 from jcastillo-arm/jc/juno_mem_6
Jc/juno mem 6
2014-10-28 11:59:22 +00:00
Juan Castillo 20d51cad8b FVP: keep shared data in Trusted SRAM
This patch deprecates the build option to relocate the shared data
into Trusted DRAM in FVP. After this change, shared data is always
located at the base of Trusted SRAM. This reduces the complexity
of the memory map and the number of combinations in the build
options.

Fixes ARM-software/tf-issues#257

Change-Id: I68426472567b9d8c6d22d8884cb816f6b61bcbd3
2014-10-22 15:57:39 +01:00
Vikram Kanigiri fc680456cf Juno: Support entry into a standby state
This patch adds support on the Juno platform for entering a wfi in
response to a PSCI CPU_SUSPEND call where the state type is a
standby state.

Change-Id: I0a102dee1f8d2ad936c63ad1d1d3ad001a4a4768
2014-10-21 11:39:27 +01:00
Juan Castillo 740134e6dc Juno: Reserve some DDR-DRAM for secure use
This patch configures the TrustZone Controller in Juno to split
the 2GB DDR-DRAM memory at 0x80000000 into Secure and Non-Secure
regions:

- Secure DDR-DRAM: top 16 MB, except for the last 2 MB which are
  used by the SCP for DDR retraining
- Non-Secure DDR-DRAM: remaining DRAM starting at base address

Build option PLAT_TSP_LOCATION selects the location of the secure
payload (BL3-2):

- 'tsram' : Trusted SRAM (default option)
- 'dram'  : Secure region in the DDR-DRAM (set by the TrustZone
            controller)

The MMU memory map has been updated to give BL2 permission to load
BL3-2 into the DDR-DRAM secure region.

Fixes ARM-software/tf-issues#233

Change-Id: I6843fc32ef90aadd3ea6ac4c7f314f8ecbd5d07b
2014-10-14 10:03:58 +01:00
Andrew Thoelke d07baec4b5 Merge pull request #206 from soby-mathew/sm/reset_cntvoff
Reset CNTVOFF_EL2 register before exit into EL1 on warm boot
2014-10-10 12:13:48 +01:00
Juan Castillo ef538c6f1b Juno: Use TZC-400 driver calls
This patch replaces direct accesses to the TZC-400 registers by the
appropiate calls to the generic driver available in the Trusted
Firmware in order to initialize the TrustZone Controller.

Functions related to the initialization of the secure memory,
like the TZC-400 configuration, have been moved to a new file
'plat_security.c'. This reorganization makes easier to set up
the secure memory from any BL stage.

TZC-400 initialization has been moved from BL1 to BL2 because BL1
does not access the non-secure memory. It is BL2's responsibility
to enable and configure the TZC-400 before loading the next BL
images.

In Juno, BL3-0 initializes some of the platform peripherals, like
the DDR controller. Thus, BL3-0 must be loaded before configuring
the TrustZone Controller. As a consequence, the IO layer
initialization has been moved to early platform initialization.

Fixes ARM-software/tf-issues#234

Change-Id: I83dde778f937ac8d2996f7377e871a2e77d9490e
2014-10-09 17:15:24 +01:00
achingupta 7e998c42ce Merge pull request #214 from soby-mathew/sm/bl_specific_mmap
Create BL stage specific translation tables
2014-09-25 14:28:59 +01:00
Soby Mathew d0ecd97987 Create BL stage specific translation tables
This patch uses the IMAGE_BL<x> constants to create translation tables specific
to a boot loader stage. This allows each stage to create mappings only for areas
in the memory map that it needs.

Fixes ARM-software/tf-issues#209

Change-Id: Ie4861407ddf9317f0fb890fc7575eaa88d0de51c
2014-09-25 11:43:47 +01:00
achingupta d402f3dc4c Merge pull request #213 from soby-mathew/sm/crash_reporting_fix
Remove BSS section access by 'plat_print_gic' during crash reporting
2014-09-23 08:52:02 +01:00
Soby Mathew 6ab0391297 Remove BSS section access by 'plat_print_gic' during crash reporting
This patch avoids the problem of crash reporting mechanism accessing
global data in BSS by 'plat_print_gic_regs' for FVP platforms. Earlier
it depended on the global 'plat_config' object for the GIC Base address
in FVP platforms which would have caused exception if it were accessed
before the BSS was initialized. It is now fixed by dynamically
querying the V2M_SYS_ID to find the FVP model type and accordingly
selecting the appropriate GIC Base address.

This patch also fixes the 'plat_print_gic_regs' to use the correct GIC
Distributor base address for printing GICD_IS_PENDR register values
for both Juno and FVP platforms.

Fixes ARM-Software/tf-issues#236

Change-Id: I545c7b908b3111419bf27db0575ce86acf86784b
2014-09-22 18:20:31 +01:00
achingupta bcdbf9451e Merge pull request #212 from jcastillo-arm/jc/tf-issues/252
Fix LENGTH attribute value in linker scripts
2014-09-19 10:43:29 +01:00
Juan Castillo d7fbf13267 Fix LENGTH attribute value in linker scripts
This patch fixes the incorrect value of the LENGTH attribute in
the linker scripts. This attribute must define the memory size, not
the limit address.

Fixes ARM-software/tf-issues#252

Change-Id: I328c38b9ec502debe12046a8912d7dfc54610c46
2014-09-19 10:00:38 +01:00
achingupta 8e0bbcb3a9 Merge pull request #211 from jenswi-linaro/optee_140916
Dispatcher for OPTEE from Linaro SWG
2014-09-17 11:53:12 +01:00
Jens Wiklander aa5da46138 Add opteed based on tspd
Adds a dispatcher for OP-TEE based on the test secure payload
dispatcher.

Fixes arm-software/tf-issues#239
2014-09-16 11:51:54 -07:00
Jens Wiklander ae213cee8c Initialize SCTLR_EL1 based on MODE_RW bit
Initializes SCTLR_EL1 based on MODE_RW bit in SPSR for the entry
point. The RES1 bits for SCTLR_EL1 differs for Aarch64 and Aarch32
mode.
2014-09-16 11:39:32 -07:00
achingupta 087b67a62b Merge pull request #210 from soby-mathew/sm/makefile_bl_stages
Add support for specifying pre-built BL binaries in Makefile
2014-09-16 18:46:22 +01:00
Soby Mathew 27713fb420 Add support for specifying pre-built BL binaries in Makefile
This patch adds support for supplying pre-built BL binaries for BL2,
BL3-1 and BL3-2 during trusted firmware build. Specifying BLx = <path_to_BLx>
in the build command line, where 'x' is any one of BL2, BL3-1 or BL3-2, will
skip building that BL stage from source and include the specified binary in
final fip image.

This patch also makes BL3-3 binary for FIP optional depending on the
value of 'NEED_BL33' flag which is defined by the platform.

Fixes ARM-software/tf-issues#244
Fixes ARM-software/tf-issues#245

Change-Id: I3ebe1d4901f8b857e8bb51372290978a3323bfe7
2014-09-16 17:55:19 +01:00
Soby Mathew 14c0526b73 Reset CNTVOFF_EL2 register before exit into EL1 on warm boot
This patch resets the value of CNTVOFF_EL2 before exit to EL1 on
warm boot. This needs to be done if only the Trusted Firmware exits
to EL1 instead of EL2, otherwise the hypervisor would be responsible
for this.

Fixes ARM-software/tf-issues#240

Change-Id: I79d54831356cf3215bcf1f251c373bd8f89db0e0
2014-09-02 13:59:14 +01:00
danh-arm 14b6608c9a Merge pull request #205 from danh-arm/dh/1.0-docs
Documentation for version 1.0
2014-08-28 15:39:55 +01:00
danh-arm 98a357d7da Merge pull request #204 from danh-arm/dh/user-guide-fixes
Fix minor issues in user guide
2014-08-28 15:38:11 +01:00
Dan Handley c6249aaa4c Documentation for version 1.0
Final updates to readme.md and change-log.md for ARM Trusted
Firmware version 1.0. Also increment the version in the Makefile.

Change-Id: I00fe1016c8b936834bbf7bbba7aab07f51261bbb
2014-08-28 14:24:54 +01:00
Dan Handley d78baf2544 Fix minor issues in user guide
*   Fix broken link to SCP download.

*   Remove requirement to install `ia32-libs`. This package is no
    longer available in current versions of Ubuntu and is no
    longer required when using the Linaro toolchain.

Change-Id: I9823d535a1d69136685754b7707b73e1eef0978d
2014-08-28 14:04:06 +01:00
danh-arm b110f61a37 Merge pull request #203 from danh-arm/dh/misc-docs-1.0
Miscellaneous documentation fixes
2014-08-27 19:16:27 +01:00
Sandrine Bailleux 4480425288 Miscellaneous documentation fixes
This patch gathers miscellaneous minor fixes to the documentation, and comments
in the source code.

Change-Id: I631e3dda5abafa2d90f464edaee069a1e58b751b
Co-Authored-By: Soby Mathew <soby.mathew@arm.com>
Co-Authored-By: Dan Handley <dan.handley@arm.com>
2014-08-27 19:13:56 +01:00
danh-arm ae5bb9db5a Merge pull request #202 from achingupta/ag/fw-design-juno-update
Add information about Juno in firmware-design.md
2014-08-27 18:27:19 +01:00
Juan Castillo 2442d24865 Add information about Juno in firmware-design.md
This patch reorganizes the firmware design guide to add information about the
port of the ARM Trusted Firmware to the Juno ARM development platform.

Change-Id: I0b80e2e7a35ccad1af2e971506cfb7fe505f8b84
2014-08-27 17:57:35 +01:00
danh-arm e40ae239f8 Merge pull request #200 from danh-arm/dh/fix-reset-to-bl31-part2
Fix reset to BL3-1 instructions in user guide, part 2
2014-08-27 17:26:30 +01:00
danh-arm 21387b8f73 Merge pull request #201 from danh-arm/jc/juno-user-guide
Add Juno instructions to user guide
2014-08-27 17:25:50 +01:00
Juan Castillo d14e0acf99 Add Juno instructions to user guide
This patch makes the Trusted Firmware build instructions in the
user guide platform independent.

FVP specific instructions have been grouped together under a new
section dedicated to FVP.

Juno specific instructions to build and run the Trusted Firmware,
UEFI and Linux have been added.

Change-Id: I9bfb1b9d732b1f73abbe29f68ac931e1773a4fd5
2014-08-27 15:21:58 +01:00
Dan Handley 7ea4c43772 Fix reset to BL3-1 instructions in user guide, part 2
Fix the instructions for resetting to the BL3-1 entrypoint in the
user guide. The BL3-1 and BL3-2 image locations changed in the fix
to ARM-software/tf-issues#100 (commit 186c1d4). This is distinct
from the similar issue fixed in commit bfb1dd5.

Also clarify the dependence on the FVP_SHARED_DATA_LOCATION and
FVP_TSP_RAM_LOCATION build options, and tidy up the "Notes
regarding Base FVP configuration options" section.

Change-Id: I6b03452a71f0c69efa169852712bcb184242696e
2014-08-27 11:58:52 +01:00
danh-arm 17f89d084a Merge pull request #198 from danh-arm/dh/move-up-dependencies
Move up dependency versions in user guide
2014-08-21 18:30:31 +01:00
danh-arm 4ed74d02e0 Merge pull request #197 from soby-mathew/rationalize_uarts
Rationalize UART usage among different BL stages
2014-08-21 16:44:40 +01:00
Soby Mathew 12d554f941 Rationalize UART usage among different BL stages
This patch changes the UART port assignment for various BL stages
so as to make it consistent on the platform ports. The BL1, BL2 and
BL3-1 now uses UART0 on the FVP port and SoC UART0 on the Juno port.
The BL3-2 uses UART2 on the FVP port and FPGA UART0 on the Juno
port.

This provides an interim fix to ARM-software/tf-issues#220 until
support is added for changing the UART port for a BL image between
cold boot and runtime.

Change-Id: Iae5faea90be3d59e41e597b34a902f93e737505a
2014-08-21 16:30:25 +01:00
Dan Handley ba73bb098c Move up dependency versions in user guide
Move up the version numbers of the following Trusted Firmware
dependencies in the user guide:

*   Foundation and Base FVPs (latest publically available
    versions).

*   EDK2 implementation. The guide now uses the latest version from
    https://github.com/ARM-software/edk2.git. This requires the
    `iasl` package to also be installed.

*   Linux kernel. The guide now uses the latest version from
    https://github.com/ARM-software/linux.git.

*   Linaro OpenEmbedded file system.

*   ARM Development Studio 5.

Change-Id: I95bb863a61e47b9ef8be3d110f7087375ee78add
2014-08-21 16:18:17 +01:00
danh-arm e434cf1aa3 Merge pull request #196 from soby-mathew/sm/tf_juno_support
Add support for Juno in Trusted Firmware
2014-08-21 15:15:49 +01:00
Juan Castillo 38af430af6 Juno: Read primary CPU MPID from SCC GPR_1
This patch removes the PRIMARY_CPU definition hardcoded in the
Juno port. Instead, the primary CPU is obtained at runtime by
reading the SCC General Purpose Register 1 (GPR_1), whose value
is copied by the SCP into shared memory during the boot process.

Change-Id: I3981daa92eb7142250712274cf7f655b219837f5
2014-08-21 14:53:48 +01:00
Juan Castillo efafbc898e Juno: Implement PSCI SYSTEM_OFF and SYSTEM_RESET APIs
This patch adds the Juno platform specific handlers for PSCI
SYSTEM_OFF and SYSTEM_RESET operations.

Change-Id: Ie389adead533ec2314af44d721b4d0f306147c7d
2014-08-21 14:53:48 +01:00
Sandrine Bailleux edfda10a6b Juno: Add support for Test Secure-EL1 Payload
This patch implements the TSP on Juno. It executes from on-chip Trusted
SRAM.

Also, the other bootloader images (i.e. BL1 R/W, BL2 and BL3-1) have
been moved around. The reason is, although there was enough space
overall to store the TSP in SRAM, there was no contiguous free chunk
of SRAM big enough to hold it.

This patch keeps the overall memory layout (i.e. keeping BL1 R/W at
the bottom, BL2 at the top and BL3-1 in between) but moves the base
addresses of all the bootloader images in such a way that:
 - memory fragmentation is reduced enough to fit BL3-2 in;
 - new base addresses are suitable for release builds as well as debug
   ones;
 - each image has a few extra kilobytes for future growth.
   BL3-1 and BL3-2 are the images which received the biggest allocations
   since they will most probably grow the most.

This patch also adds instruction synchronization barriers around the code which
handles the timer interrupt in the TSP. This ensures that the interrupt is not
acknowledged after or EOIed before it is deactivated at the peripheral.

Change-Id: I1c5b51858700027ee283ac85d18e06863a27c72e
2014-08-21 14:53:48 +01:00
Achin Gupta fef4fdb9cc Juno: Implement PSCI CPU_OFF and CPU_SUSPEND APIs
This patch adds support for PSCI CPU_OFF and CPU_SUSPEND APIs to the Juno port
of the ARM Trusted Firmware. The maximum affinity level that can be suspended is
the cluster level (affinity level 1). Support for suspending the system level is
not present.

Change-Id: Ie2c9da0acd7d1b0d5ac64940cdf40347153e52c8
2014-08-21 14:53:48 +01:00
Sandrine Bailleux 01b916bff2 Juno: Implement initial platform port
This patch adds the initial port of the ARM Trusted Firmware on the Juno
development platform. This port does not support a BL3-2 image or any PSCI APIs
apart from PSCI_VERSION and PSCI_CPU_ON. It enables workarounds for selected
Cortex-A57 (#806969 & #813420) errata and implements the workaround for a Juno
platform errata (Defect id 831273).

Change-Id: Ib3d92df3af53820cfbb2977582ed0d7abf6ef893
2014-08-21 14:53:48 +01:00
danh-arm e822d7c1c7 Merge pull request #195 from achingupta/ag/fvp_dt_updates
FVP: Update device trees to match cpuidle driver
2014-08-20 20:15:16 +01:00
danh-arm 7963671c04 Merge pull request #194 from danh-arm/sm/tf-issues#98
Implement the CPU Specific operations framework v3
2014-08-20 20:14:59 +01:00
Achin Gupta bab7bfd282 FVP: Update device trees to match cpuidle driver
This patch updates the representation of idle tables and cpu/cluster topology in
the device tree source files for the FVP to what the latest cpuidle driver in
Linux expects. The device tree binaries have also been updated.

Change-Id: If0668b96234f65aa0435fba52f288c9378bd8824
2014-08-20 19:38:58 +01:00
Soby Mathew 3fd5ddfeb0 Add documentation for CPU specific abstraction and Errata workarounds
This patch adds documentation for CPU specific abstraction in the firmware-
design.md and adds a new document cpu-errata-workarounds.md to describe
the cpu errata workaround build flags.

Change-Id: Ia08c2fec0b868a0a107d0264e87a60182797a1bd
2014-08-20 19:14:32 +01:00
Soby Mathew d9bdaf2d98 Add support for selected Cortex-A57 errata workarounds
This patch adds workarounds for selected errata which affect the Cortex-A57 r0p0
part. Each workaround has a build time flag which should be used by the platform
port to enable or disable the corresponding workaround. The workarounds are
disabled by default. An assertion is raised if the platform enables a workaround
which does not match the CPU revision at runtime.

Change-Id: I9ae96b01c6ff733d04dc733bd4e67dbf77b29fb0
2014-08-20 19:14:31 +01:00