1. 19 Aug, 2014 1 commit
    • Dan Handley's avatar
      Clarify platform porting interface to TSP · 5a06bb7e
      Dan Handley authored
      * Move TSP platform porting functions to new file:
        include/bl32/tsp/platform_tsp.h.
      
      * Create new TSP_IRQ_SEC_PHY_TIMER definition for use by the generic
        TSP interrupt handling code, instead of depending on the FVP
        specific definition IRQ_SEC_PHY_TIMER.
      
      * Rename TSP platform porting functions from bl32_* to tsp_*, and
        definitions from BL32_* to TSP_*.
      
      * Update generic TSP code to use new platform porting function names
        and definitions.
      
      * Update FVP port accordingly and move all TSP source files to:
        plat/fvp/tsp/.
      
      * Update porting guide with above changes.
      
      Note: THIS CHANGE REQUIRES ALL PLATFORM PORTS OF THE TSP TO
            BE UPDATED
      
      Fixes ARM-software/tf-issues#167
      
      Change-Id: Ic0ff8caf72aebb378d378193d2f017599fc6b78f
      5a06bb7e
  2. 14 Aug, 2014 1 commit
    • Dan Handley's avatar
      Remove redundant io_init() function · 6d16ce0b
      Dan Handley authored
      The intent of io_init() was to allow platform ports to provide
      a data object (io_plat_data_t) to the IO storage framework to
      allocate into. The abstraction was incomplete because io_plat_data_t
      uses a platform defined constant and the IO storage framework
      internally allocates other arrays using platform defined constants.
      
      This change simplifies the implementation by instantiating the
      supporting objects in the IO storage framework itself. There is now
      no need for the platform to call io_init().
      
      The FVP port has been updated accordingly.
      
      THIS CHANGE REQUIRES ALL PLATFORM PORTS THAT USE THE IO STORAGE
      FRAMEWORK TO BE UDPATED.
      
      Change-Id: Ib48ac334de9e538064734334c773f8b43df3a7dc
      6d16ce0b
  3. 12 Aug, 2014 1 commit
    • Juan Castillo's avatar
      FVP: apply new naming conventions to memory regions · 637ebd2e
      Juan Castillo authored
      Secure ROM at address 0x0000_0000 is defined as FVP_TRUSTED_ROM
      Secure RAM at address 0x0400_0000 is defined as FVP_TRUSTED_SRAM
      Secure RAM at address 0x0600_0000 is defined as FVP_TRUSTED_DRAM
      
      BLn_BASE and BLn_LIMIT definitions have been updated and are based on
      these new memory regions.
      
      The available memory for each bootloader in the linker script is
      defined by BLn_BASE and BLn_LIMIT, instead of the complete memory
      region.
      
      TZROM_BASE/SIZE and TZRAM_BASE/SIZE are no longer required as part of
      the platform porting.
      
      FVP common definitions are defined in fvp_def.h while platform_def.h
      contains exclusively (with a few exceptions) the definitions that are
      mandatory in the porting guide. Therefore, platform_def.h now includes
      fvp_def.h instead of the other way around.
      
      Porting guide has been updated to reflect these changes.
      
      Change-Id: I39a6088eb611fc4a347db0db4b8f1f0417dbab05
      637ebd2e
  4. 01 Aug, 2014 1 commit
    • Juan Castillo's avatar
      Call platform_is_primary_cpu() only from reset handler · 53fdcebd
      Juan Castillo authored
      The purpose of platform_is_primary_cpu() is to determine after reset
      (BL1 or BL3-1 with reset handler) if the current CPU must follow the
      cold boot path (primary CPU), or wait in a safe state (secondary CPU)
      until the primary CPU has finished the system initialization.
      
      This patch removes redundant calls to platform_is_primary_cpu() in
      subsequent bootloader entrypoints since the reset handler already
      guarantees that code is executed exclusively on the primary CPU.
      
      Additionally, this patch removes the weak definition of
      platform_is_primary_cpu(), so the implementation of this function
      becomes mandatory. Removing the weak symbol avoids other
      bootloaders accidentally picking up an invalid definition in case the
      porting layer makes the real function available only to BL1.
      
      The define PRIMARY_CPU is no longer mandatory in the platform porting
      because platform_is_primary_cpu() hides the implementation details
      (for instance, there may be platforms that report the primary CPU in
      a system register). The primary CPU definition in FVP has been moved
      to fvp_def.h.
      
      The porting guide has been updated accordingly.
      
      Fixes ARM-software/tf-issues#219
      
      Change-Id: If675a1de8e8d25122b7fef147cb238d939f90b5e
      53fdcebd
  5. 28 Jul, 2014 3 commits
    • Soby Mathew's avatar
      Add CPUECTLR_EL1 and Snoop Control register to crash reporting · 8c106902
      Soby Mathew authored
      This patch adds the CPUECTLR_EL1 register and the CCI Snoop Control
      register to the list of registers being reported when an unhandled
      exception occurs.
      
      Change-Id: I2d997f2d6ef3d7fa1fad5efe3364dc9058f9f22c
      8c106902
    • Soby Mathew's avatar
      Introduce crash console APIs for crash reporting · c67b09bd
      Soby Mathew authored
      This patch introduces platform APIs to initialise and
      print a character on a designated crash console.
      For the FVP platform, PL011_UART0 is the designated
      crash console. The platform porting guide is also updated
      to document the new APIs.
      
      Change-Id: I5e97d8762082e0c88c8c9bbb479353eac8f11a66
      c67b09bd
    • Achin Gupta's avatar
      Remove the concept of coherent stacks · 539a7b38
      Achin Gupta authored
      This patch removes the allocation of memory for coherent stacks, associated
      accessor function and some dead code which called the accessor function. It also
      updates the porting guide to remove the concept and the motivation behind using
      stacks allocated in coherent memory.
      
      Fixes ARM-software/tf-issues#198
      
      Change-Id: I00ff9a04f693a03df3627ba39727e3497263fc38
      539a7b38
  6. 11 Jul, 2014 1 commit
    • Sandrine Bailleux's avatar
      Update the documentation about the memory layout on FVP · 46d49f63
      Sandrine Bailleux authored
      Update the "Memory layout on FVP platforms" section in the Firmware
      Design document to reflect the overlaying of BL1 and BL2 images
      by BL3-1 and BL3-2.
      
      Also update the Porting Guide document to mention the
      BL31_PROGBITS_LIMIT and BL32_PROGBITS_LIMIT constants.
      
      Change-Id: I0b23dae5b5b4490a01be7ff7aa80567cff34bda8
      46d49f63
  7. 10 Jul, 2014 1 commit
    • Sandrine Bailleux's avatar
      Add support for BL3-0 image · 93d81d64
      Sandrine Bailleux authored
       - Add support for loading a BL3-0 image in BL2. Information about
         memory extents is populated by platform-specific code. Subsequent
         handling of BL3-0 is also platform specific.
         The BL2 main function has been broken down to improve readability.
         The BL3-2 image is now loaded before the BL3-3 image to align with
         the boot flow.
      
       - Build system: Add support for specifying a BL3-0 image that will be
         included into the FIP image.
      
       - IO FIP driver: Add support for identifying a BL3-0 image inside a
         FIP image.
      
       - Update the documentation to reflect the above changes.
      
      Change-Id: I067c184afd52ccaa86569f13664757570c86fc48
      93d81d64
  8. 01 Jul, 2014 1 commit
    • Sandrine Bailleux's avatar
      Remove concept of top/bottom image loading · 8f55dfb4
      Sandrine Bailleux authored
      This concept is no longer required since we now support loading of
      images at fixed addresses only.
      
      The image loader now automatically detects the position of the image
      inside the current memory layout and updates the layout such that
      memory fragmentation is minimised.
      
      The 'attr' field of the meminfo data structure, which used to hold
      the bottom/top loading information, has been removed. Also the 'next'
      field has been removed as it wasn't used anywhere.
      
      The 'init_bl2_mem_layout()' function has been moved out of common
      code and put in BL1-specific code. It has also been renamed into
      'bl1_init_bl2_mem_layout'.
      
      Fixes ARM-software/tf-issues#109
      
      Change-Id: I3f54642ce7b763d5ee3b047ad0ab59eabbcf916d
      8f55dfb4
  9. 23 Jun, 2014 1 commit
    • Andrew Thoelke's avatar
      Correctly dimension the PSCI aff_map_node array · 6c0b45d1
      Andrew Thoelke authored
      The array of affinity nodes is currently allocated for 32 entries
      with the PSCI_NUM_AFFS value defined in psci.h. This is not enough
      for large systems, and will substantially over allocate the array
      for small systems.
      
      This patch introduces an optional platform definition
      PLATFORM_NUM_AFFS to platform_def.h. If defined this value is
      used for PSCI_NUM_AFFS, otherwise a value of two times the number
      of CPU cores is used.
      
      The FVP port defines PLATFORM_NUM_AFFS to be 10 which saves
      nearly 1.5KB of memory.
      
      Fixes ARM-software/tf-issues#192
      
      Change-Id: I68e30ac950de88cfbd02982ba882a18fb69c1445
      6c0b45d1
  10. 03 Jun, 2014 2 commits
  11. 02 Jun, 2014 1 commit
  12. 30 May, 2014 1 commit
    • Dan Handley's avatar
      Fix porting guide references to platform.h · b68954c8
      Dan Handley authored
      Following recent refactoring changes to platform.h, this commit updates
      porting-guide.md to correctly refer to platform.h and platform_def.h where
      appropriate.
      
      Change-Id: Idf1e77503c24358696f8f3c14caa0cc1d579deb4
      b68954c8
  13. 23 May, 2014 1 commit
    • Sandrine Bailleux's avatar
      doc: Update information about the memory layout · 638363eb
      Sandrine Bailleux authored
      Rework the "Memory layout on FVP platforms" section in the Firmware
      Design document. Add information about where the TSP image fits
      in the memory layout when present.
      
      Add documentation for the base addresses of each bootloader image
      in the porting guide.
      
      Change-Id: I4afb2605e008a1cb28c44a697804f2cb6bb4c9aa
      638363eb
  14. 22 May, 2014 2 commits
    • Dan Handley's avatar
      Allow BL3-2 platform definitions to be optional · 1151c821
      Dan Handley authored
      The generic image loading and IO FIP code no longer forces the
      platform to create BL3-2 (Secure-EL1 Payload) specific
      definitions. The BL3-2 loading code in bl2/bl2main.c is wrapped
      by a #ifdef BL32_BASE blocks, allowing the BL3-2 definitions to
      be optional. Similarly for the name_uuid array defintion in
      drivers/io/io_fip.c.
      
      Also update the porting guide to reflect this change.
      
      The BL3-2 platform definitions remain non-configurably present
      in the FVP port.
      
      Fixes ARM-software/tf-issues#68
      
      Change-Id: Iea28b4e94d87a31f5522f271e290919a8a955460
      1151c821
    • Sandrine Bailleux's avatar
      TSP: Let the platform decide which secure memory to use · 2467f70f
      Sandrine Bailleux authored
      The TSP's linker script used to assume that the TSP would
      execute from secure DRAM. Although it is currently the case
      on FVPs, platforms are free to use any secure memory they wish.
      
      This patch introduces the flexibility to load the TSP into any
      secure memory. The platform code gets to specify the extents of
      this memory in the platform header file, as well as the BL3-2 image
      limit address. The latter definition allows to check in a generic way
      that the BL3-2 image fits in its bounds.
      
      Change-Id: I9450f2d8b32d74bd00b6ce57a0a1542716ab449c
      2467f70f
  15. 16 May, 2014 1 commit
    • Soby Mathew's avatar
      Rework BL3-1 unhandled exception handling and reporting · a43d431b
      Soby Mathew authored
      This patch implements the register reporting when unhandled exceptions are
      taken in BL3-1. Unhandled exceptions will result in a dump of registers
      to the console, before halting execution by that CPU. The Crash Stack,
      previously called the Exception Stack, is used for this activity.
      This stack is used to preserve the CPU context and runtime stack
      contents for debugging and analysis.
      
      This also introduces the per_cpu_ptr_cache, referenced by tpidr_el3,
      to provide easy access to some of BL3-1 per-cpu data structures.
      Initially, this is used to provide a pointer to the Crash stack.
      
      panic() now prints the the error file and line number in Debug mode
      and prints the PC value in release mode.
      
      The Exception Stack is renamed to Crash Stack with this patch.
      The original intention of exception stack is no longer valid
      since we intend to support several valid exceptions like IRQ
      and FIQ in the trusted firmware context. This stack is now
      utilized for dumping and reporting the system state when a
      crash happens and hence the rename.
      
      Fixes ARM-software/tf-issues#79 Improve reporting of unhandled exception
      
      Change-Id: I260791dc05536b78547412d147193cdccae7811a
      a43d431b
  16. 12 May, 2014 1 commit
    • Andrew Thoelke's avatar
      Fixes for TZC configuration on FVP · 84dbf6ff
      Andrew Thoelke authored
      The TZC configuration on FVP was incorrectly allowing both secure
      and non-secure accesses to the DRAM, which can cause aliasing
      problems for software. It was also not enabling virtio access on
      some models.
      
      This patch fixes both of those issues. The patch also enabless
      non-secure access to the DDR RAM for all devices with defined IDs.
      
      The third region of DDR RAM has been removed from the configuration
      as this is not used in any of the FVP models.
      
      Fixes ARM-software/tf-issues#150
      Fixes ARM-software/tf-issues#151
      
      Change-Id: I60ad5daaf55e14f178affb8afd95d17e7537abd7
      84dbf6ff
  17. 24 Apr, 2014 1 commit
  18. 15 Apr, 2014 1 commit
    • Andrew Thoelke's avatar
      Allocate single stacks for BL1 and BL2 · 2bf28e62
      Andrew Thoelke authored
      The BL images share common stack management code which provides
      one coherent and one cacheable stack for every CPU. BL1 and BL2
      just execute on the primary CPU during boot and do not require
      the additional CPU stacks. This patch provides separate stack
      support code for UP and MP images, substantially reducing the
      RAM usage for BL1 and BL2 for the FVP platform.
      
      This patch also provides macros for declaring stacks and
      calculating stack base addresses to improve consistency where
      this has to be done in the firmware.
      
      The stack allocation source files are now included via
      platform.mk rather than the common BLx makefiles. This allows
      each platform to select the appropriate MP/UP stack support
      for each BL image.
      
      Each platform makefile must be updated when including this
      commit.
      
      Fixes ARM-software/tf-issues#76
      
      Change-Id: Ia251f61b8148ffa73eae3f3711f57b1ffebfa632
      2bf28e62
  19. 08 Apr, 2014 2 commits
    • Sandrine Bailleux's avatar
      Define frequency of system counter in platform code · 9e86490f
      Sandrine Bailleux authored
      BL3-1 architecture setup code programs the system counter frequency
      into the CNTFRQ_EL0 register. This frequency is defined by the
      platform, though. This patch introduces a new platform hook that
      the architecture setup code can call to retrieve this information.
      In the ARM FVP port, this returns the first entry of the frequency
      modes table from the memory mapped generic timer.
      
      All system counter setup code has been removed from BL1 as some
      platforms may not have initialized the system counters at this stage.
      The platform specific settings done exclusively in BL1 have been moved
      to BL3-1. In the ARM FVP port, this consists in enabling and
      initializing the System level generic timer. Also, the frequency change
      request in the counter control register has been set to 0 to make it
      explicit it's using the base frequency. The CNTCR_FCREQ() macro has been
      fixed in this context to give an entry number rather than a bitmask.
      
      In future, when support for firmware update is implemented, there
      is a case where BL1 platform specific code will need to program
      the counter frequency. This should be implemented at that time.
      
      This patch also updates the relevant documentation.
      
      It properly fixes ARM-software/tf-issues#24
      
      Change-Id: If95639b279f75d66ac0576c48a6614b5ccb0e84b
      9e86490f
    • Sandrine Bailleux's avatar
      Revert "Move architecture timer setup to platform-specific code" · 65a9c0e9
      Sandrine Bailleux authored
      This reverts commit 1c297bf0
      because it introduced a bug: the CNTFRQ_EL0 register was no
      longer programmed by all CPUs.  bl31_platform_setup() function
      is invoked only in the cold boot path and consequently only
      on the primary cpu.
      
      A subsequent commit will correctly implement the necessary changes
      to the counter frequency setup code.
      
      Fixes ARM-software/tf-issues#125
      
      Conflicts:
      
      	docs/firmware-design.md
      	plat/fvp/bl31_plat_setup.c
      
      Change-Id: Ib584ad7ed069707ac04cf86717f836136ad3ab54
      65a9c0e9
  20. 10 Mar, 2014 1 commit
    • Jeenu Viswambharan's avatar
      Move architecture timer setup to platform-specific code · 1c297bf0
      Jeenu Viswambharan authored
      At present, bl1_arch_setup() and bl31_arch_setup() program the counter
      frequency using a value from the memory mapped generic timer. The
      generic timer however is not necessarily present on all ARM systems
      (although it is architected to be present on all server systems).
      
      This patch moves the timer setup to platform-specific code and updates
      the relevant documentation. Also, CNTR.FCREQ is set as the specification
      requires the bit corresponding to the counter's frequency to be set when
      enabling. Since we intend to use the base frequency, set bit 8.
      
      Fixes ARM-software/tf-issues#24
      
      Change-Id: I32c52cf882253e01f49056f47c58c23e6f422652
      1c297bf0
  21. 28 Feb, 2014 1 commit
    • Dan Handley's avatar
      Consolidate design and porting documentation · 57de6d72
      Dan Handley authored
      Consolidate firmware-design.md and porting-guide.pm so
      that recently added sections fit better with
      pre-existing sections. Make the documentation more
      consistent in use of terminology.
      
      Change-Id: Id87050b096122fbd845189dc2fe1cd17c3003468
      57de6d72
  22. 26 Feb, 2014 1 commit
    • Sandrine Bailleux's avatar
      fvp: Initialise UART earlier · 20d284c0
      Sandrine Bailleux authored
      The UART used to be initialised in bl1_platform_setup(). This is too
      late because there are some calls to the assert() macro, which needs
      to print some messages on the console, before that.
      
      This patch moves the UART initialisation code to
      bl1_early_platform_setup().
      
      Fixes ARM-software/tf-issues#49
      
      Change-Id: I98c83a803866372806d2a9c2e1ed80f2ef5b3bcc
      20d284c0
  23. 20 Feb, 2014 3 commits
    • Achin Gupta's avatar
      Add support for BL3-2 in BL3-1 · 35ca3511
      Achin Gupta authored
      This patch adds the following support to the BL3-1 stage:
      
      1. BL3-1 allows runtime services to specify and determine the security
         state of the next image after BL3-1. This has been done by adding
         the `bl31_set_next_image_type()` & `bl31_get_next_image_type()`
         apis. The default security state is non-secure. The platform api
         `bl31_get_next_image_info()` has been modified to let the platform
         decide which is the next image in the desired security state.
      
      2. BL3-1 exports the `bl31_prepare_next_image_entry()` function to
         program entry into the target security state. It uses the apis
         introduced in 1. to do so.
      
      3. BL3-1 reads the information populated by BL2 about the BL3-2 image
         into its internal data structures.
      
      4. BL3-1 introduces a weakly defined reference `bl32_init()` to allow
         initialisation of a BL3-2 image. A runtime service like the Secure
         payload dispatcher will define this function if present.
      
      Change-Id: Icc46dcdb9e475ce6575dd3f9a5dc7a48a83d21d1
      35ca3511
    • Achin Gupta's avatar
      Add support for BL3-2 in BL2 · a3050ed5
      Achin Gupta authored
      
      
      This patch adds support for loading a BL3-2 image in BL2. In case a
      BL3-2 image is found, it also passes information to BL3-1 about where it
      is located and the extents of memory available to it. Information about
      memory extents is populated by platform specific code.
      
      The documentation has also been updated to reflect the above changes.
      
      Change-Id: I526b2efb80babebab1318f2b02e319a86d6758b0
      Co-authored-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      a3050ed5
    • Achin Gupta's avatar
      Rework BL2 to BL3-1 hand over interface · e4d084ea
      Achin Gupta authored
      This patch reworks BL2 to BL3-1 hand over interface by introducing a
      composite structure (bl31_args) that holds the superset of information
      that needs to be passed from BL2 to BL3-1.
      
        - The extents of secure memory available to BL3-1
        - The extents of memory available to BL3-2 (not yet implemented) and
          BL3-3
        - Information to execute BL3-2 (not yet implemented) and BL3-3 images
      
      This patch also introduces a new platform API (bl2_get_bl31_args_ptr)
      that needs to be implemented by the platform code to export reference to
      bl31_args structure which has been allocated in platform-defined memory.
      
      The platform will initialize the extents of memory available to BL3-3
      during early platform setup in bl31_args structure. This obviates the
      need for bl2_get_ns_mem_layout platform API.
      
      BL2 calls the bl2_get_bl31_args_ptr function to get a reference to
      bl31_args structure. It uses the 'bl33_meminfo' field of this structure
      to load the BL3-3 image. It sets the entry point information for the
      BL3-3 image in the 'bl33_image_info' field of this structure. The
      reference to this structure is passed to the BL3-1 image.
      
      Also fixes issue ARM-software/tf-issues#25
      
      Change-Id: Ic36426196dd5ebf89e60ff42643bed01b3500517
      e4d084ea
  24. 17 Feb, 2014 1 commit
  25. 20 Jan, 2014 1 commit
  26. 17 Jan, 2014 1 commit
  27. 20 Dec, 2013 1 commit
    • Harry Liebel's avatar
      Local C library documentation updates · a960f282
      Harry Liebel authored
      - Update porting guide to describe where files live and how to get
        FreeBSD source code.
      - Update change-log to describe relocation and new functions.
      
      Change-Id: Id8f30cc7bafdd1064b3a5c5aae958c5aa3fb79f3
      a960f282
  28. 12 Dec, 2013 1 commit
    • Sandrine Bailleux's avatar
      Remove useless copies of meminfo structures · ee12f6f7
      Sandrine Bailleux authored
      Platform setup code has to reserve some memory for storing the
      memory layout information.  It is populated in early platform setup
      code.
      
      blx_get_sec_mem_layout() functions used to return a copy of this
      structure.  This patch modifies blx_get_sec_mem_layout() functions
      so that they now directly return a pointer to their memory layout
      structure.  It ensures that the memory layout returned by
      blx_get_sec_mem_layout() is always up-to-date and also avoids a
      useless copy of the meminfo structure.
      
      Also rename blx_get_sec_mem_layout() to blx_plat_sec_mem_layout()
      to make it clear those functions are platform specific.
      
      Change-Id: Ic7a6f9d6b6236b14865ab48a9f5eff545ce56551
      ee12f6f7
  29. 05 Dec, 2013 3 commits
    • Achin Gupta's avatar
      psci: fix error due to a non zero context id · c8afc789
      Achin Gupta authored
      In the previous psci implementation, the psci_afflvl_power_on_finish()
      function would run into an error condition if the value of the context
      id parameter in the cpu_on and cpu_suspend psci calls was != 0. The
      parameter was being restored as the return value of the affinity level
      0 finisher function. A non zero context id would be treated as an
      error condition. This would prevent successful wake up of the cpu from
      a power down state. Also, the contents of the general purpose
      registers were not being cleared upon return to the non-secure world
      after a cpu power up. This could potentially allow the non-secure
      world to view secure data.
      
      This patch ensures that all general purpose registers are set to ~0
      prior to the final eret that drops the execution to the non-secure
      world. The context id is used to initialize the general purpose
      register x0 prior to re-entry into the non-secure world and is no
      longer restored as a function return value. A platform helper
      (platform_get_stack()) has been introduced to facilitate this change.
      
      Change-Id: I2454911ffd75705d6aa8609a5d250d9b26fa097c
      c8afc789
    • Dan Handley's avatar
      Enable third party contributions · ab2d31ed
      Dan Handley authored
      - Add instructions for contributing to ARM Trusted Firmware.
      
      - Update copyright text in all files to acknowledge contributors.
      
      Change-Id: I9311aac81b00c6c167d2f8c889aea403b84450e5
      ab2d31ed
    • Sandrine Bailleux's avatar
      Update user guide further to linker scripts changes · cd29b0a6
      Sandrine Bailleux authored
      This patch updates the user guide section about the memory layout.
        - Explain the verifications that the linker scripts does on the
          global memory layout.
        - Refer to the new linker symbols.
        - Describe the linker symbols exported to the trusted firmware code.
      
      Change-Id: I033ab2b867e8b9776deb4185b9986bcb8218f286
      cd29b0a6
  30. 14 Nov, 2013 1 commit
  31. 25 Oct, 2013 1 commit