1. 08 Nov, 2018 1 commit
    • Antonio Nino Diaz's avatar
      Standardise header guards across codebase · c3cf06f1
      Antonio Nino Diaz authored
      
      
      All identifiers, regardless of use, that start with two underscores are
      reserved. This means they can't be used in header guards.
      
      The style that this project is now to use the full name of the file in
      capital letters followed by 'H'. For example, for a file called
      "uart_example.h", the header guard is UART_EXAMPLE_H.
      
      The exceptions are files that are imported from other projects:
      
      - CryptoCell driver
      - dt-bindings folders
      - zlib headers
      
      Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      c3cf06f1
  2. 12 Jun, 2018 1 commit
    • Daniel Boulby's avatar
      Fix MISRA Rule 5.3 Part 3 · 7c934242
      Daniel Boulby authored
      
      
      Use a _ prefix for macro arguments to prevent that argument from
      hiding variables of the same name in the outer scope
      
      Rule 5.3: An identifier declared in an inner scope shall not
                hide an identifier declared in an outer scope
      
      Fixed For:
          make PLAT=fvp SPD=tspd
      
      Change-Id: I2d711b9584c4cb9ba3814ecd2ca65a42b7e24179
      Signed-off-by: default avatarDaniel Boulby <daniel.boulby@arm.com>
      7c934242
  3. 21 Apr, 2018 1 commit
  4. 13 Apr, 2018 2 commits
  5. 03 May, 2017 1 commit
  6. 26 Apr, 2017 1 commit
  7. 23 Dec, 2016 1 commit
    • Douglas Raillard's avatar
      Abort preempted TSP STD SMC after PSCI CPU suspend · 3df6012a
      Douglas Raillard authored
      
      
      Standard SMC requests that are handled in the secure-world by the Secure
      Payload can be preempted by interrupts that must be handled in the
      normal world. When the TSP is preempted the secure context is stored and
      control is passed to the normal world to handle the non-secure
      interrupt. Once completed the preempted secure context is restored. When
      restoring the preempted context, the dispatcher assumes that the TSP
      preempted context is still stored as the SECURE context by the context
      management library.
      
      However, PSCI power management operations causes synchronous entry into
      TSP. This overwrites the preempted SECURE context in the context
      management library. When restoring back the SECURE context, the Secure
      Payload crashes because this context is not the preempted context
      anymore.
      
      This patch avoids corruption of the preempted SECURE context by aborting
      any preempted SMC during PSCI power management calls. The
      abort_std_smc_entry hook of the TSP is called when aborting the SMC
      request.
      
      It also exposes this feature as a FAST SMC callable from normal world to
      abort preempted SMC with FID TSP_FID_ABORT.
      
      Change-Id: I7a70347e9293f47d87b5de20484b4ffefb56b770
      Signed-off-by: default avatarDouglas Raillard <douglas.raillard@arm.com>
      3df6012a
  8. 04 Dec, 2015 1 commit
    • Soby Mathew's avatar
      Enable use of FIQs and IRQs as TSP interrupts · 02446137
      Soby Mathew authored
      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
      02446137
  9. 26 Jan, 2015 1 commit
    • Soby Mathew's avatar
      Demonstrate model for routing IRQs to EL3 · f4f1ae77
      Soby Mathew authored
      This patch provides an option to specify a interrupt routing model
      where non-secure interrupts (IRQs) are routed to EL3 instead of S-EL1.
      When such an interrupt occurs, the TSPD arranges a return to
      the normal world after saving any necessary context. The interrupt
      routing model to route IRQs to EL3 is enabled only during STD SMC
      processing. Thus the pre-emption of S-EL1 is disabled during Fast SMC
      and Secure Interrupt processing.
      
      A new build option TSPD_ROUTE_NS_INT_EL3 is introduced to change
      the non secure interrupt target execution level to EL3.
      
      Fixes ARM-software/tf-issues#225
      
      Change-Id: Ia1e779fbbb6d627091e665c73fa6315637cfdd32
      f4f1ae77
  10. 01 Aug, 2014 1 commit
    • Vikram Kanigiri's avatar
      Rework the TSPD setup code · 50e27dad
      Vikram Kanigiri authored
      There is no mechanism which allows the TSPD to specify what SPSR to
      use when entering BL3-2 instead of BL3-3. This patch divides the
      responsibility between tspd_setup() and tspd_init() for initializing
      the TSPD and TSP to support the alternate BL3-2 initialization flow
      where BL3-1 handsover control to BL3-2 instead of BL3-3.
      SPSR generated by TSPD for TSP is preserved due the new division of
      labour which fixes #174.
      
      This patch also moves the cpu_context initialization code from
      tspd_setup() to tspd_init() immediately before entering the TSP.
      Instead tspd_setup() updates the BL3-2 entrypoint info structure
      with the state required for initializing the TSP later.
      
      Fixes  ARM-software/TF-issues#174
      
      Change-Id: Ida0a8a48d466c71d5b07b8c7f2af169b73f96940
      50e27dad
  11. 23 May, 2014 4 commits
    • Dan Handley's avatar
      Split platform.h into separate headers · 5f0cdb05
      Dan Handley authored
      Previously, platform.h contained many declarations and definitions
      used for different purposes. This file has been split so that:
      
      * Platform definitions used by common code that must be defined
        by the platform are now in platform_def.h. The exact include
        path is exported through $PLAT_INCLUDES in the platform makefile.
      
      * Platform definitions specific to the FVP platform are now in
        /plat/fvp/fvp_def.h.
      
      * Platform API declarations specific to the FVP platform are now
        in /plat/fvp/fvp_private.h.
      
      * The remaining platform API declarations that must be ported by
        each platform are still in platform.h but this file has been
        moved to /include/plat/common since this can be shared by all
        platforms.
      
      Change-Id: Ieb3bb22fbab3ee8027413c6b39a783534aee474a
      5f0cdb05
    • Dan Handley's avatar
      Remove extern keyword from function declarations · c6bc0710
      Dan Handley authored
      Function declarations implicitly have external linkage so do not
      need the extern keyword.
      
      Change-Id: Ia0549786796d8bf5956487e8996450a0b3d79f32
      c6bc0710
    • Andrew Thoelke's avatar
      Use a vector table for TSP entrypoints · 399fb08f
      Andrew Thoelke authored
      The TSP has a number of entrypoints used by the TSP on different
      occasions. These were provided to the TSPD as a table of function
      pointers, and required the TSPD to read the entry in the table,
      which is in TSP memory, in order to program the exception return
      address.
      
      Ideally, the TSPD has no access to the TSP memory.
      
      This patch changes the table of function pointers into a vector
      table of single instruction entrypoints. This allows the TSPD to
      calculate the entrypoint address instead of read it.
      
      Fixes ARM-software/tf-issues#160
      
      Change-Id: Iec6e055d537ade78a45799fbc6f43765a4725ad3
      399fb08f
    • Soby Mathew's avatar
      Non-Secure Interrupt support during Standard SMC processing in TSP · 239b04fa
      Soby Mathew authored
      Implements support for Non Secure Interrupts preempting the
      Standard SMC call in EL1. Whenever an IRQ is trapped in the
      Secure world we securely handover to the Normal world
      to process the interrupt. The normal world then issues
      "resume" smc call to resume the previous interrupted SMC call.
      Fixes ARM-software/tf-issues#105
      
      Change-Id: I72b760617dee27438754cdfc9fe9bcf4cc024858
      239b04fa
  12. 22 May, 2014 2 commits
    • Achin Gupta's avatar
      Add S-EL1 interrupt handling support in the TSPD · b44a4435
      Achin Gupta authored
      This patch adds support in the TSPD for registering a handler for
      S-EL1 interrupts. This handler ferries the interrupts generated in the
      non-secure state to the TSP at 'tsp_fiq_entry'. Support has been added
      to the smc handler to resume execution in the non-secure state once
      interrupt handling has been completed by the TSP.
      
      There is also support for resuming execution in the normal world if
      the TSP receives a EL3 interrupt. This code is currently unused.
      
      Change-Id: I816732595a2635e299572965179f11aa0bf93b69
      b44a4435
    • Achin Gupta's avatar
      Rework 'state' field usage in per-cpu TSP context · 3ee8a164
      Achin Gupta authored
      This patch lays the foundation for using the per-cpu 'state' field in
      the 'tsp_context' structure for other flags apart from the power state
      of the TSP.
      
      It allocates 2 bits for the power state, introduces the necessary
      macros to manipulate the power state in the 'state' field and
      accordingly reworks all use of the TSP_STATE_* states.
      
      It also allocates a flag bit to determine if the TSP is handling a
      standard SMC. If this flag is set then the TSP was interrupted due to
      non-secure or EL3 interupt depending upon the chosen routing
      model. Macros to get, set and clear this flag have been added as
      well. This flag will be used by subsequent patches.
      
      Change-Id: Ic6ee80bd5895812c83b35189cf2c3be70a9024a6
      3ee8a164
  13. 06 May, 2014 3 commits
    • Dan Handley's avatar
      Reduce deep nesting of header files · 97043ac9
      Dan Handley authored
      Reduce the number of header files included from other header
      files as much as possible without splitting the files. Use forward
      declarations where possible. This allows removal of some unnecessary
      "#ifndef __ASSEMBLY__" statements.
      
      Also, review the .c and .S files for which header files really need
      including and reorder the #include statements alphabetically.
      
      Fixes ARM-software/tf-issues#31
      
      Change-Id: Iec92fb976334c77453e010b60bcf56f3be72bd3e
      97043ac9
    • Dan Handley's avatar
      Always use named structs in header files · fb037bfb
      Dan Handley authored
      Add tag names to all unnamed structs in header files. This
      allows forward declaration of structs, which is necessary to
      reduce header file nesting (to be implemented in a subsequent
      commit).
      
      Also change the typedef names across the codebase to use the _t
      suffix to be more conformant with the Linux coding style. The
      coding style actually prefers us not to use typedefs at all but
      this is considered a step too far for Trusted Firmware.
      
      Also change the IO framework structs defintions to use typedef'd
      structs to be consistent with the rest of the codebase.
      
      Change-Id: I722b2c86fc0d92e4da3b15e5cab20373dd26786f
      fb037bfb
    • Dan Handley's avatar
      Separate out CASSERT macro into own header · bdbfc3c2
      Dan Handley authored
      Separate out the CASSERT macro out of bl_common.h into its own
      header to allow more efficient header inclusion.
      
      Change-Id: I291be0b6b8f9879645e839a8f0dd1ec9b3db9639
      bdbfc3c2
  14. 26 Feb, 2014 1 commit
    • Jeenu Viswambharan's avatar
      Implement late binding for runtime hooks · 7f366605
      Jeenu Viswambharan authored
      At present SPD power management hooks and BL3-2 entry are implemented
      using weak references. This would have the handlers bound and registered
      with the core framework at build time, but leaves them dangling if a
      service fails to initialize at runtime.
      
      This patch replaces implementation by requiring runtime handlers to
      register power management and deferred initialization hooks with the
      core framework at runtime. The runtime services are to register the
      hooks only as the last step, after having all states successfully
      initialized.
      
      Change-Id: Ibe788a2a381ef39aec1d4af5ba02376e67269782
      7f366605
  15. 20 Feb, 2014 1 commit
    • Achin Gupta's avatar
      Add Test Secure Payload Dispatcher (TSPD) service · 375f538a
      Achin Gupta authored
      
      
      This patch adds the TSPD service which is responsible for managing
      communication between the non-secure state and the Test Secure Payload
      (TSP) executing in S-EL1.
      
      The TSPD does the following:
      
      1. Determines the location of the TSP (BL3-2) image and passes control
         to it for initialization. This is done by exporting the 'bl32_init()'
         function.
      
      2. Receives a structure containing the various entry points into the TSP
         image as a response to being initialized. The TSPD uses this
         information to determine how the TSP should be entered depending on
         the type of operation.
      
      3. Implements a synchronous mechanism for entering into and returning
         from the TSP image. This mechanism saves the current C runtime
         context on top of the current stack and jumps to the TSP through an
         ERET instruction. The TSP issues an SMC to indicate completion of the
         previous request. The TSPD restores the saved C runtime context and
         resumes TSP execution.
      
      This patch also introduces a Make variable 'SPD' to choose the specific
      SPD to include in the build. By default, no SPDs are included in the
      build.
      
      Change-Id: I124da5695cdc510999b859a1bf007f4d049e04f3
      Co-authored-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      375f538a