Commit Graph

1457 Commits

Author SHA1 Message Date
Ashutosh Singh 29464f13f6 opteed: assume aarch64 for optee
OPTEE to execute in aarch64 bit mode, set it accordingly
when execution transitions from EL3 to EL1

Change-Id: I59f2f940bdc1aac10543045b006a137d107ec95f
Signed-off-by: Ashutosh Singh <ashutosh.singh@arm.com>
2016-06-13 10:19:58 +01:00
Jens Wiklander 419e0d262b Add support for QEMU virt ARMv8-A target
This patch adds support for the QEMU virt ARMv8-A target.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2016-06-09 11:23:28 +02:00
danh-arm ae43c9493d Merge pull request #642 from soby-mathew/sm/override_rotpk
Allow dynamic overriding of ROTPK verification
2016-06-08 16:06:43 +01:00
danh-arm 174baeed26 Merge pull request #643 from sandrine-bailleux-arm/sb/checkpatch-conf-file
Move checkpatch options in a configuration file
2016-06-08 13:30:03 +01:00
danh-arm adb1ddf86f Merge pull request #639 from danh-arm/dh/import-libfdt
Import libfdt v1.4.1 and related changes
2016-06-08 13:20:35 +01:00
David Wang 68b105ae47 CSS: Add support to wake up the core from wfi in GICv3
In GICv3 mode, the non secure group1 interrupts are signalled via the
FIQ line in EL3. To support waking up from CPU_SUSPEND to standby on
these systems, EL3 should route FIQ to EL3 temporarily before wfi and
restore the original setting after resume. This patch makes this change
for the CSS platforms in the `css_cpu_standby` psci pm ops hook.

Change-Id: Ibf3295d16e2f08da490847c1457bc839e1bac144
2016-06-08 17:20:20 +08:00
Mirela Simonovic 2ba6895919 zynqmp: pm: Added NODE_IPI_APU slave node ID in pm_defs.h
NODE_IPI_APU is the node ID of APU's IPI device. If APU should be
woken-up on an IPI from FPD power down, this node shall be set as
the wake-up source upon suspend.

Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
2016-06-07 13:30:37 -07:00
danh-arm e4f51eee91 Merge pull request #645 from sandrine-bailleux-arm/sb/improve-load-image-comments
Update comments in load_image()
2016-06-07 09:35:02 +01:00
Sandrine Bailleux a6b995fba3 Update comments in load_image()
- Fix the function documentation.
  Since commit 16948ae1, load_image() uses image IDs rather than image
  names.

- Clarify the consequences of a null entry point argument.

- Slightly reorganize the code to remove an unnecessary 'if' statement.

Change-Id: Iebea3149a37f23d3b847a37a206ed23f7e8ec717
2016-06-07 09:15:17 +01:00
danh-arm 87e7a9a557 Merge pull request #644 from sandrine-bailleux-arm/sb/rm-outdated-comment
xlat lib: Remove out-dated comment
2016-06-06 10:54:28 +01:00
Sandrine Bailleux f607739cba Move checkpatch options in a configuration file
At the moment, the top Makefile specifies the options to pass to the
checkpatch script in order to check the coding style. The checkpatch
script also supports reading its options from a configuration file
rather than from the command line.

This patch makes use of this feature and moves the checkpatch options
out of the Makefile. This simplifies the Makefile and makes things
clearer.

This patch also adds some more checkpatch options:
  --showfile
  --ignore FILE_PATH_CHANGES
  --ignore AVOID_EXTERNS
  --ignore NEW_TYPEDEFS
  --ignore VOLATILE
The rationale behind each of these options has been documented
in the configuration file.

Change-Id: I423e1abe5670c0f57046cbf705f89a8463898676
2016-06-06 08:52:04 +01:00
Soby Mathew 04943d33cf Allow dynamic overriding of ROTPK verification
A production ROM with TBB enabled must have the ability to boot test software
before a real ROTPK is deployed (e.g. manufacturing mode). Previously the
function plat_get_rotpk_info() must return a valid ROTPK for TBB to succeed.
This patch adds an additional bit `ROTPK_NOT_DEPLOYED` in the output `flags`
parameter from plat_get_rotpk_info(). If this bit is set, then the ROTPK
in certificate is used without verifying against the platform value.

Fixes ARM-software/tf-issues#381

Change-Id: Icbbffab6bff8ed76b72431ee21337f550d8fdbbb
2016-06-03 18:27:36 +01:00
danh-arm 11ec6c598f Merge pull request #641 from antonio-nino-diaz-arm/an/fvp-set-nv-ctr
Implement plat_set_nv_ctr for FVP platforms
2016-06-03 17:27:45 +01:00
danh-arm c47a0784ef Merge pull request #640 from sandrine-bailleux-arm/sb/fix-syntax-error
Fix a syntax error in plat/arm/common/aarch64/arm_common.c
2016-06-03 17:26:59 +01:00
danh-arm aed634fea6 Merge pull request #637 from yatharth-arm/yk/genfw-1134
Add support for ARM Cortex-A73 MPCore Processor
2016-06-03 15:12:51 +01:00
danh-arm 8d8c61ea75 Merge pull request #636 from soby-mathew/sm/cpu_ctx_rem_aarch32_regs
Build option to include AArch32 registers in cpu context
2016-06-03 15:12:37 +01:00
Sandrine Bailleux b4127c1fc0 Fix a syntax error
Building TF with ERROR_DEPRECATED=1 fails because of a missing
semi-column. This patch fixes this syntax error.

Change-Id: I98515840ce74245b0a0215805f85c8e399094f68
2016-06-03 15:01:47 +01:00
Dan Handley 754d78b1b3 Minor libfdt changes to enable TF integration
* Move libfdt API headers to include/lib/libfdt
* Add libfdt.mk helper makefile
* Remove unused libfdt files
* Minor changes to fdt.h and libfdt.h to make them C99 compliant

Co-Authored-By: Jens Wiklander <jens.wiklander@linaro.org>

Change-Id: I425842c2b111dcd5fb6908cc698064de4f77220e
2016-06-03 14:21:03 +01:00
Dan Handley 91176bc636 Import libfdt v1.4.1
Imports libfdt code from https://git.kernel.org/cgit/utils/dtc/dtc.git
tag "v1.4.1" commit 302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2.

Change-Id: Ia0d966058beee55a9047e80d8a05bbe4f71d8446
2016-06-03 14:21:03 +01:00
Dan Handley 1a41e8c1e0 Exclude more files from checkpatch and checkcodebase
Exclude documentation files from the `make checkcodebase` target
(these files were already excluded from checkpatch).

Also exclude libfdt files to prepare for import of this library.

Change-Id: Iee597ed66494de2b11cf84096f771f1f04472d5b
2016-06-03 14:21:03 +01:00
Dan Handley f0b489c1d2 Move stdlib header files to include/lib/stdlib
* Move stdlib header files from include/stdlib to include/lib/stdlib for
  consistency with other library headers.
* Fix checkpatch paths to continue excluding stdlib files.
* Create stdlib.mk to define the stdlib source files and include directories.
* Include stdlib.mk from the top level Makefile.
* Update stdlib header path in the fip_create Makefile.
* Update porting-guide.md with the new paths.

Change-Id: Ia92c2dc572e9efb54a783e306b5ceb2ce24d27fa
2016-06-03 14:20:48 +01:00
Antonio Nino Diaz fe7de03546 Implement plat_set_nv_ctr for FVP platforms
Replaced placeholder implementation of plat_set_nv_ctr for FVP
platforms by a working one.

On FVP, the mapping of region DEVICE2 has been changed from RO to RW
to prevent exceptions when writing to the NV counter, which is
contained in this region.

Change-Id: I56a49631432ce13905572378cbdf106f69c82f57
2016-06-03 11:17:03 +01:00
Soby Mathew 8cd16e6b5b Build option to include AArch32 registers in cpu context
The system registers that are saved and restored in CPU context include
AArch32 systems registers like SPSR_ABT, SPSR_UND, SPSR_IRQ, SPSR_FIQ,
DACR32_EL2, IFSR32_EL2 and FPEXC32_EL2. Accessing these registers on an
AArch64-only (i.e. on hardware that does not implement AArch32, or at
least not at EL1 and higher ELs) platform leads to an exception. This patch
introduces the build option `CTX_INCLUDE_AARCH32_REGS` to specify whether to
include these AArch32 systems registers in the cpu context or not. By default
this build option is set to 1 to ensure compatibility. AArch64-only platforms
must set it to 0. A runtime check is added in BL1 and BL31 cold boot path to
verify this.

Fixes ARM-software/tf-issues#386

Change-Id: I720cdbd7ed7f7d8516635a2ec80d025f478b95ee
2016-06-03 10:50:52 +01:00
Sandrine Bailleux 72b6008181 xlat lib: Remove out-dated comment
As of commit e1ea9290bb, if the attributes of an inner memory region
are different than the outer region, new page tables are generated
regardless of how "restrictive" they are. This patch removes an
out-dated comment still referring to the old priority system based
on which attributes were more restrictive.

Change-Id: Ie7fc1629c90ea91fe50315145f6de2f3995e5e00
2016-06-02 10:36:47 +01:00
Yatharth Kochar 2460ac18ef Add support for ARM Cortex-A73 MPCore Processor
This patch adds ARM Cortex-A73 MPCore Processor support
in the CPU specific operations framework. It also includes
this support for the Base FVP port.

Change-Id: I0e26b594f2ec1d28eb815db9810c682e3885716d
2016-06-01 12:07:41 +01:00
Soren Brinkmann a29f50c943 zynqmp: Remove double ';'
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-29 09:48:44 -07:00
Soren Brinkmann 55eae0d4ff zynqmp: Fix spelling of endianness
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-29 09:48:26 -07:00
danh-arm a7e530331d Merge pull request #632 from rockchip-linux/support-for-gpio-driver-v2
rockchip/rk3399: Support the gpio driver and configure
2016-05-27 14:10:42 +01:00
danh-arm aa037ca9a0 Merge pull request #634 from sandrine-bailleux-arm/sb/exception-vectors
Improve robustness and readability of exception code
2016-05-27 11:11:47 +01:00
danh-arm 2ff900f28d Merge pull request #633 from soby-mathew/sm/psci_wfi_hook
PSCI: Add pwr_domain_pwr_down_wfi() hook in plat_psci_ops
2016-05-27 11:08:45 +01:00
danh-arm 8c94f82c67 Merge pull request #627 from soby-mathew/sm/fvp_ccn502_sup_1
Add CCN support to FVP
2016-05-27 11:07:20 +01:00
Caesar Wang 86c253e450 rockchip: support system off function for rk3399
if define power off gpio, BL31 will do system power off through
gpio control.
2016-05-27 09:39:56 +08:00
Caesar Wang 8867299f05 rockchip: support reset SoC through gpio for rk3399
If define a reset gpio, BL31 will use gpio to reset SOC,
otherwise use CRU reset.
2016-05-27 09:39:56 +08:00
Caesar Wang 68ff45f40a rockchip: add reset or power off gpio configuration for rk3399
We add plat parameter structs to support BL2 to pass variable-length,
variable-type parameters to BL31. The parameters are structured as a
link list. During bl31 setup time, we travse the list to process each
parameter. throuth this way, we can get the reset or power off gpio
parameter, and do hardware control in BL31. This structure also can
pass other parameter to BL31 in future.
2016-05-27 09:39:56 +08:00
Caesar Wang 9901dcf6bb rockchip: support rk3399 gpio driver
There are 5 groups of GPIO (GPIO0~GPIO4), totally have 122 GPIOs
on rk3399 platform.
The pull direction(pullup or pulldown) for all of GPIOs are
software-programmable.
At the moment, we add the gpio basic driver since reset or power off
the devices from gpio configuration for BL31.
2016-05-27 09:39:56 +08:00
Caesar Wang 195889829e gpio: support gpio set/get pull status
On some platform gpio can set/get pull status when input, add these
function so we can set/get gpio pull status when need it. And they are
optional function.
2016-05-27 09:39:56 +08:00
Sandrine Bailleux 79627dc372 Fill exception vectors with zero bytes
The documentation of the GNU assembler specifies the following about
the .align assembler directive:
 "the padding bytes are normally zero. However, on some systems, if
 the section is marked as containing code and the fill value is
 omitted, the space is filled with no-op instructions."
(see https://sourceware.org/binutils/docs/as/Align.html)

When building Trusted Firmware, the AArch64 GNU assembler uses a
mix of zero bytes and no-op instructions as the padding bytes to
align exception vectors.

This patch mandates to use zero bytes to be stored in the padding
bytes in the exception vectors. In the AArch64 instruction set, no
valid instruction encodes as zero so this effectively inserts
illegal instructions. Should this code end up being executed for
any reason, it would crash immediately. This gives us an extra
protection against misbehaving code at no extra cost.

Change-Id: I4f2abb39d0320ca0f9d467fc5af0cb92ae297351
2016-05-26 17:04:39 +01:00
Sandrine Bailleux e0ae9fab61 Introduce some helper macros for exception vectors
This patch introduces some assembler macros to simplify the
declaration of the exception vectors. It abstracts the section
the exception code is put into as well as the alignments
constraints mandated by the ARMv8 architecture. For all TF images,
the exception code has been updated to make use of these macros.

This patch also updates some invalid comments in the exception
vector code.

Change-Id: I35737b8f1c8c24b6da89b0a954c8152a4096fa95
2016-05-26 17:04:39 +01:00
Soren Brinkmann e3f0391e85 zynqmp: PSCI: Wait for FW completing wake requests
Powering up cores didn't wait for the PMUFW to complete the request,
which could result in cores failing to power up in Linux.

Reported-by: Koteswararao Nayudu <kotin@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-25 10:47:03 -07:00
Soby Mathew ac1cc8eb76 PSCI: Add pwr_domain_pwr_down_wfi() hook in plat_psci_ops
This patch adds a new optional platform hook `pwr_domain_pwr_down_wfi()` in
the plat_psci_ops structure. This hook allows the platform to perform platform
specific actions including the wfi invocation to enter powerdown. This hook
is invoked by both psci_do_cpu_off() and psci_cpu_suspend_start() functions.
The porting-guide.md is also updated for the same.

This patch also modifies the `psci_power_down_wfi()` function to invoke
`plat_panic_handler` incase of panic instead of the busy while loop.

Fixes ARM-Software/tf-issues#375

Change-Id: Iba104469a1445ee8d59fb3a6fdd0a98e7f24dfa3
2016-05-25 14:00:00 +01:00
Soby Mathew 7123787616 Add CCN support to FVP platform port
This patch adds support to select CCN driver for FVP during build.
A new build option `FVP_INTERCONNECT_DRIVER` is added to allow
selection between the CCI and CCN driver. Currently only the CCN-502
variant is supported on FVP.

The common ARM CCN platform helper file now verifies the cluster
count declared by platform is equal to the number of root node
masters exported by the ARM Standard platform.

Change-Id: I71d7b4785f8925ed499c153b2e9b9925fcefd57a
2016-05-25 10:25:16 +01:00
Soby Mathew 6331a31a66 CCN: Add API to query the PART0 ID from CCN
This patch adds the API `ccn_get_part0_id` to query the PART0 ID from the
PERIPHERAL_ID 0 register in the CCN driver. This ID allows to distinguish
the variant of CCN present on the system and possibly enable dynamic
configuration of the IP based on the variant. Also added an assert in
`ccn_master_to_rn_id_map()` to ensure that the master map bitfield provided
by the platform is within the expected interface id.

Change-Id: I92d2db7bd93a9be8a7fbe72a522cbcba0aba2d0e
2016-05-25 10:24:23 +01:00
Soren Brinkmann 648fe99e9f zynqmp: Ignore the revision field of the IDCODE
The revision field may change between silicon revisions without changing
the mapping to a part. This avoids errors like:
  ERROR: Incorrect XILINX IDCODE 0x14738093, maskid 0x4600093
  NOTICE: ATF running on XCZUUNKN/EP108 v3/RTL5.1 at 0xfffe5000
on parts with a newer revision.

Reported-by: Love Kumar <love.kumar@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Tested-by: Love Kumar <love.kumar@xilinx.com>
2016-05-24 23:07:12 -07:00
Stefan Krsmanovic 03b8077309 zynqmp: Add bakery_lock to protect APU_PWRCTRL register access
Access to APU_PWRCTRL register is protected during suspend/wakeup pocedure
in order to save valid state. If more than one CPU is accessing this register
it can be left in corrupted state during read-modify-write process.

Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-24 10:18:07 -07:00
Stefan Krsmanovic 8212f1f0ee zynqmp: Put pm_secure_lock in coherent memory region
DEFINE_BAKERY_LOCK() macro is used to put lock in coherent memory region.
ARM Trusted Firmware design guide, chapter 11 states that bakery_lock data
structures should be allocated in coherent memory region because it is
accessed by multiple CPUs with mismatched shareability, cacheability and
memory attributes.

Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-24 10:18:07 -07:00
Anes Hadziahmetagic fc65b87b8a zynqmp: pm: Implement pm_register_notifier PM API function
Signed-off-by: Anes Hadziahmetagic <anes.hadziahmetagic@aggios.com>
Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-24 10:18:07 -07:00
Anes Hadziahmetagic 493541d640 zynqmp: pm: Implemented 'get_op_characteristic' PM API call
Signed-off-by: Anes Hadziahmetagic <anes.hadziahmetagic@aggios.com>
Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-24 10:18:07 -07:00
Filip Drazic df4c59c5d2 zynqmp: pm: Removed double declaration of pm_ipi_send functions
Functions pm_ipi_send and pm_ipi_send_sync are declared in pm_ipi.h

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-05-24 10:18:06 -07:00
Soren Brinkmann 142ec0433f zynqmp: Reduce mapped memory area
The GIC area is specified larger than it needs to be and can be reduced.
Which allows reducing the structures required for the translation tables
as well.
This results in a reduction of memory footprint of ca. 4k.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
2016-05-24 10:18:06 -07:00
danh-arm e141aa0357 Merge pull request #625 from antonio-nino-diaz-arm/an/delay-timer-v2
Implement generic delay timer and use it on platforms
2016-05-24 16:12:08 +01:00