1. 02 Aug, 2017 1 commit
    • Jeenu Viswambharan's avatar
      FVP: Support Base FVP RevC · 955242d8
      Jeenu Viswambharan authored
      
      
      Revision C of the Base FVP has the same memory map as earlier revisions,
      but has the following differences:
      
        - Implements CCI550 instead of CCI400,
        - Has a single instantiation of SMMUv3,
        - CPU MPIDs are shifted left by one level, and has MT bit set in them.
      
      The correct interconnect to program is chosen at run time based on the
      FVP revision. Therefore, this patch implements FVP functions for
      interconnect programming, rather than depending on ARM generic ones. The
      macros used have been renamed to reflect this change.
      
      Additionally, this patch initializes SMMUv3 as part of FVP early
      platform setup.
      
      New ARM config flags are introduced for feature queries at run time.
      
      Change-Id: Ic7b7f080953a51fceaf62ce7daa6de0573801f09
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      955242d8
  2. 01 Aug, 2017 2 commits
    • Jeenu Viswambharan's avatar
      FVP: Remove CCI registers from crash dump · eeb9ff99
      Jeenu Viswambharan authored
      
      
      The CCI crash dump macros assumes CCI base at build time. Since this
      can't be the case for CCI on FVP, choose not to register dump CCI
      registers for FVP.
      
      Change-Id: I7374a037e7fd0a85b138e84b3cf0aa044262da97
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      eeb9ff99
    • Jeenu Viswambharan's avatar
      FVP: Add support for multi-threaded CPUs · 11ad8f20
      Jeenu Viswambharan authored
      
      
      ARM CPUs with multi-threading implementation has more than one
      Processing Element in a single physical CPU. Such an implementation will
      reflect the following changes in the MPIDR register:
      
        - The MT bit set;
      
        - Affinity levels pertaining to cluster and CPUs occupy one level
          higher than in a single-threaded implementation, and the lowest
          affinity level pertains to hardware threads. MPIDR affinity level
          fields essentially appear shifted to left than otherwise.
      
      The FVP port henceforth assumes that both properties above to be
      concomitant on a given FVP platform.
      
      To accommodate for varied MPIDR formats at run time, this patch
      re-implements the FVP platform-specific functions that translates MPIDR
      values to a linear indices, along with required validation. The same
      treatment is applied for GICv3 MPIDR hashing function as well.
      
      An FVP-specific build option FVP_MAX_PE_PER_CPU is introduced which
      specifies the maximum number of threads implemented per CPU. For
      backwards compatibility, its value defaults to 1.
      
      Change-Id: I729b00d3e121d16ce9a03de4f9db36dfac580e3f
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      11ad8f20
  3. 25 Jul, 2017 1 commit
  4. 20 Jul, 2017 3 commits
    • Soby Mathew's avatar
      CSS: Prevent SCP_BL2/2U from overwriting BL1 RW data · 1ea63d77
      Soby Mathew authored
      
      
      On ARM CSS platforms, the SCP_BL2/2U image is loaded below
      BL1 read-write data. This same memory is used to load BL31
      later on. But sufficient checks were not done to ensure that the
      SCP_BL2 would not overwrite BL1 rw data. This patch adds the
      required CASSERT checks to prevent overwrite into BL1 or BL2
      memory by load of SCP_BL2/2U. Also the size of BL31 is increased
      and SCP_BL2/2U size is decreased to accomodate it within the
      allocated region.
      
      Change-Id: I23b28b5e1589e91150852a06452bd52b273216ee
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      1ea63d77
    • Soby Mathew's avatar
      CSS: Reorganize the SCP Image transfer functionality · 74d44a49
      Soby Mathew authored
      
      
      The SCP_BL2 is transferred to SCP during BL2 image load and authenticate
      sequence. The Boot-Over-MHU (BOM) protocol is used as transport for this. After
      the SCP boots using the transferred image, the AP CPU waits till the `READY`
      message is received from SCP. This patch separates the API for transport of
      image from the wait for `READY` message and also moves the related files to
      the `css/drivers` folder. The previous API `scp_bootloader_transfer` is
      renamed to `css_scp_boot_image_xfer` to reflect the css naming convention.
      This reorganisation also allows easier switch to a different transport
      (eg: Shared Data Structure based transfer) in future
      
      Change-Id: I8a96f9c4616ffde6dbfdf7c18f6f6f8bfa40bbf0
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      74d44a49
    • Soby Mathew's avatar
      Resize the BL2 size limit for Juno · 6c401f31
      Soby Mathew authored
      
      
      Recent patches to reduce the memory footprint of BL images have
      resulted in saving several pages of memory. This patch reduces
      the BL2 size limit by 20KB for Juno when ARM_BOARD_OPTIMISE_MEM=1
      so that more free space can be freed up for Trusted OS (BL32). Also
      SCP_BL2/SCP_BL2U size is now restricted to 80K.
      
      Change-Id: I1573d7a34e24d15e4abce8a14da40dbb5dc81e37
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      6c401f31
  5. 14 Jul, 2017 1 commit
  6. 28 Jun, 2017 2 commits
    • Soby Mathew's avatar
      Use CryptoCell to set/get NVcounters and ROTPK · f143cafe
      Soby Mathew authored
      
      
      This patch implements the platform APIs plat_get_rotpk_info,
      plat_get_nv_ctr, plat_set_nv_ctr to invoke CryptoCell SBROM
      APIs when ARM_CRYPTOCELL_INT is set.
      
      Change-Id: I693556b3c7f42eceddd527abbe6111e499f55c45
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      f143cafe
    • Soby Mathew's avatar
      ARM plat changes to enable CryptoCell integration · e60f2af9
      Soby Mathew authored
      
      
      This patch makes the necessary changes to enable ARM platform to
      successfully integrate CryptoCell during Trusted Board Boot. The
      changes are as follows:
      
      * A new build option `ARM_CRYPTOCELL_INTEG` is introduced to select
        the CryptoCell crypto driver for Trusted Board boot.
      
      * The TrustZone filter settings for Non Secure DRAM is modified
        to allow CryptoCell to read this memory. This is required to
        authenticate BL33 which is loaded into the Non Secure DDR.
      
      * The CSS platforms are modified to use coherent stacks in BL1 and BL2
        when CryptoCell crypto is selected. This is because CryptoCell makes
        use of DMA to transfer data and the CryptoCell SBROM library allocates
        buffers on the stack during signature/hash verification.
      
      Change-Id: I1e6f6dcd1899784f1edeabfa2a9f279bbfb90e31
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      e60f2af9
  7. 26 Jun, 2017 2 commits
    • Dimitris Papastamos's avatar
      juno: Invalidate all caches before warm reset to AArch32 state. · 35bd2dda
      Dimitris Papastamos authored
      
      
      On Juno AArch32, the L2 cache may contain garbage after the warm reset
      from AArch64 to AArch32.  This is all fine until the MMU is configured
      and the data caches enabled.  To avoid fetching stale data from the L2
      unified cache, invalidate it before the warm reset to AArch32 state.
      
      Change-Id: I7d27e810692c02c3e83c9f31de67f6bae59a960a
      Signed-off-by: default avatarDimitris Papastamos <dimitris.papastamos@arm.com>
      35bd2dda
    • Dimitris Papastamos's avatar
      juno/aarch32: Restore `SCP_BOOT_CFG_ADDR` to the cold boot value · cc47e1ad
      Dimitris Papastamos authored
      
      
      Before BL2 loads the SCP ram firmware, `SCP_BOOT_CFG_ADDR` specifies
      the primary core.  After the SCP ram firmware has started executing,
      `SCP_BOOT_CFG_ADDR` is modified.  This is not normally an issue but
      the Juno AArch32 boot flow is a special case.  BL1 does a warm reset
      into AArch32 and the core jumps to the `sp_min` entrypoint.  This is
      effectively a `RESET_TO_SP_MIN` configuration.  `sp_min` has to be
      able to determine the primary core and hence we need to restore
      `SCP_BOOT_CFG_ADDR` to the cold boot value before `sp_min` runs.
      
      This magically worked when booting on A53 because the core index was
      zero and it just so happened to match with the new value in
      `SCP_BOOT_CFG_ADDR`.
      
      Change-Id: I105425c680cf6238948625c1d1017b01d3517c01
      Signed-off-by: default avatarDimitris Papastamos <dimitris.papastamos@arm.com>
      cc47e1ad
  8. 22 Jun, 2017 2 commits
    • Douglas Raillard's avatar
      Apply workarounds for A53 Cat A Errata 835769 and 843419 · a94cc374
      Douglas Raillard authored
      These errata are only applicable to AArch64 state. See the errata notice
      for more details:
      http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.epm048406/index.html
      
      
      
      Introduce the build options ERRATA_A53_835769 and ERRATA_A53_843419.
      Enable both of them for Juno.
      
      Apply the 835769 workaround as following:
      * Compile with -mfix-cortex-a53-835769
      * Link with --fix-cortex-a53-835769
      
      Apply the 843419 workaround as following:
      * Link with --fix-cortex-a53-843419
      
      The erratum 843419 workaround can lead the linker to create new sections
      suffixed with "*.stub*" and 4KB aligned. The erratum 835769 can lead the
      linker to create new "*.stub" sections with no particular alignment.
      
      Also add support for LDFLAGS_aarch32 and LDFLAGS_aarch64 in Makefile for
      architecture-specific linker options.
      
      Change-Id: Iab3337e338b7a0a16b0d102404d9db98c154f8f8
      Signed-off-by: default avatarDouglas Raillard <douglas.raillard@arm.com>
      a94cc374
    • dp-arm's avatar
      aarch64: Enable Statistical Profiling Extensions for lower ELs · d832aee9
      dp-arm authored
      
      
      SPE is only supported in non-secure state.  Accesses to SPE specific
      registers from SEL1 will trap to EL3.  During a world switch, before
      `TTBR` is modified the SPE profiling buffers are drained.  This is to
      avoid a potential invalid memory access in SEL1.
      
      SPE is architecturally specified only for AArch64.
      
      Change-Id: I04a96427d9f9d586c331913d815fdc726855f6b0
      Signed-off-by: default avatardp-arm <dimitris.papastamos@arm.com>
      d832aee9
  9. 20 Jun, 2017 2 commits
  10. 15 Jun, 2017 1 commit
    • jagadeesh ujja's avatar
      CSS:Fix scpi "get_power_state" when ARM_PLAT_MT is set · 878a8bdf
      jagadeesh ujja authored
      
      
      The ARM_PLAT_MT bit enables the support for MT bit in
      MPIDR format. This means that the level 0 affinity
      represents the thread and CPU / Cluster levels are
      at affinity level 1 and 2 respectively.
      This was not catered for in the scpi 'css_scp_get_power_state, API.
      Since the SCPI driver can only cater for single threaded CPUs,
      this patch fixes the problem by catering for this shift by
      effectively ignoring the Thread (level 0) affinity level.
      
      Change-Id: If44f55c9fb2773c8d3f8a9bbcf5420a6f7409dfe
      Signed-off-by: default avatarjagadeesh ujja <jagadeesh.ujja@arm.com>
      878a8bdf
  11. 14 Jun, 2017 1 commit
  12. 09 Jun, 2017 1 commit
  13. 05 Jun, 2017 2 commits
    • Soby Mathew's avatar
      Add SCMI support for Juno platform · 40111d44
      Soby Mathew authored
      
      
      This patch adds the memory map region for the SCMI payload memory
      and maps the Juno core indices to SCMI power domains via the
      `plat_css_core_pos_to_scmi_dmn_id_map` array.
      
      Change-Id: I0d2bb2a719ff5b6a9d8e22e91e1625ab14453665
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      40111d44
    • Soby Mathew's avatar
      CSS: Add SCMI driver for SCP · c04a3b6c
      Soby Mathew authored
      
      
      This patch adds the SCMI driver for communicating with SCP. The power
      domain management and system power management protocol of the SCMI
      specification[1] is implemented in the driver. The SCP power management
      abstraction layer for SCMI for CSS power management is also added.
      
      A new buid option `CSS_USE_SCMI_DRIVER` is introduced to select SCMI
      driver over SCPI.
      
      [1] ARM System Control and Management Interface v1.0 (SCMI)
      Document number: ARM DEN 0056A
      
      Change-Id: I67265615a17e679a2afe810b9b0043711ba09dbb
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      c04a3b6c
  14. 01 Jun, 2017 2 commits
    • Jeenu Viswambharan's avatar
      Introduce ARM GIC-600 driver · e1c59ab3
      Jeenu Viswambharan authored
      
      
      ARM GIC-600 IP complies with ARM GICv3 architecture, but among others,
      implements a power control register in the Redistributor frame. This
      register must be programmed to mark the frame as powered on, before
      accessing other registers in the frame. Rest of initialization sequence
      remains the same.
      
      The driver provides APIs for Redistributor power management, and
      overrides those in the generic GICv3 driver. The driver data is shared
      between generic GICv3 driver and that of GIC-600.
      
      For FVP platform, the GIC-600 driver is chosen when FVP_USE_GIC_DRIVER
      is set to FVP_GIC600. Also update user guide.
      
      Change-Id: I321b2360728d69f6d4b0a747b2cfcc3fe5a20d67
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      e1c59ab3
    • David Wang's avatar
      Add support for Cortex-A75 and Cortex-A55 CPUs · d40ab484
      David Wang authored
      
      
      Both Cortex-A75 and Cortex-A55 CPUs use the ARM DynamIQ Shared Unit
      (DSU). The power-down and power-up sequences are therefore mostly
      managed in hardware, and required software operations are considerably
      simpler.
      
      Change-Id: I68b30e6e1ebe7c041d5e67f39c59f08575fc7ecc
      Co-authored-by: default avatarSandrine Bailleux <sandrine.bailleux@arm.com>
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      d40ab484
  15. 24 May, 2017 5 commits
  16. 23 May, 2017 2 commits
    • Masahiro Yamada's avatar
      FVP,Juno: switch FVP and Juno to use generic TBBR OID header · 232c6b34
      Masahiro Yamada authored
      
      
      The header tbbr_oid.h contains OIDs obtained by ARM Ltd.
      so there is no good reason to use platform_oid.h
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      232c6b34
    • Masahiro Yamada's avatar
      cert: move platform_oid.h to include/tools_share for all platforms · bb41eb7a
      Masahiro Yamada authored
      
      
      Platforms aligned with TBBR are supposed to use their own OIDs, but
      defining the same macros with different OIDs does not provide any
      value (at least technically).
      
      For easier use of TBBR, this commit allows platforms to reuse the OIDs
      obtained by ARM Ltd.  This will be useful for non-ARM vendors that
      do not need their own extension fields in their certificate files.
      
      The OIDs of ARM Ltd. have been moved to include/tools_share/tbbr_oid.h
      
      Platforms can include <tbbr_oid.h> instead of <platform_oid.h> by
      defining USE_TBBR_DEFS as 1.  USE_TBBR_DEFS is 0 by default to keep the
      backward compatibility.
      
      For clarification, I inserted a blank line between headers from the
      include/ directory (#include <...>) and ones from a local directory
      (#include "..." ).
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      bb41eb7a
  17. 16 May, 2017 1 commit
  18. 15 May, 2017 2 commits
  19. 12 May, 2017 2 commits
  20. 11 May, 2017 1 commit
  21. 04 May, 2017 1 commit
    • Jeenu Viswambharan's avatar
      Introduce ARM SiP service to switch execution state · b10d4499
      Jeenu Viswambharan authored
      
      
      In AArch64, privileged exception levels control the execution state
      (a.k.a. register width) of the immediate lower Exception Level; i.e.
      whether the lower exception level executes in AArch64 or AArch32 state.
      For an exception level to have its execution state changed at run time,
      it must request the change by raising a synchronous exception to the
      higher exception level.
      
      This patch implements and adds such a provision to the ARM SiP service,
      by which an immediate lower exception level can request to switch its
      execution state. The execution state is switched if the request is:
      
        - raised from non-secure world;
      
        - raised on the primary CPU, before any secondaries are brought online
          with CPU_ON PSCI call;
      
        - raised from an exception level immediately below EL3: EL2, if
          implemented; otherwise NS EL1.
      
      If successful, the SMC doesn't return to the caller, but to the entry
      point supplied with the call. Otherwise, the caller will observe the SMC
      returning with STATE_SW_E_DENIED code. If ARM Trusted Firmware is built
      for AArch32, the feature is not supported, and the call will always
      fail.
      
      For the ARM SiP service:
      
        - Add SMC function IDs for both AArch32 and AArch64;
        - Increment the SiP service minor version to 2;
        - Adjust the number of supported SiP service calls.
      
      Add documentation for ARM SiP service.
      
      Fixes ARM-software/tf-issues#436
      
      Change-Id: I4347f2d6232e69fbfbe333b340fcd0caed0a4cea
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      b10d4499
  22. 03 May, 2017 1 commit
  23. 02 May, 2017 1 commit
  24. 29 Apr, 2017 1 commit
    • Scott Branden's avatar
      Move defines in utils.h to utils_def.h to fix shared header compile issues · 53d9c9c8
      Scott Branden authored
      
      
      utils.h is included in various header files for the defines in it.
      Some of the other header files only contain defines.  This allows the
      header files to be shared between host and target builds for shared defines.
      
      Recently types.h has been included in utils.h as well as some function
      prototypes.
      
      Because of the inclusion of types.h conflicts exist building host tools
      abd these header files now.  To solve this problem,
      move the defines to utils_def.h and have this included by utils.h and
      change header files to only include utils_def.h and not pick up the new
      types.h being introduced.
      
      Fixes ARM-software/tf-issues#461
      Signed-off-by: default avatarScott Branden <scott.branden@broadcom.com>
      
      Remove utils_def.h from utils.h
      
      This patch removes utils_def.h from utils.h as it is not required.
      And also makes a minor change to ensure Juno platform compiles.
      
      Change-Id: I10cf1fb51e44a8fa6dcec02980354eb9ecc9fa29
      53d9c9c8