1. 08 Apr, 2019 4 commits
    • Alexei Fedorov's avatar
      Add support for Cortex-A76AE CPU · 9ccc5a57
      Alexei Fedorov authored
      
      
      Change-Id: I0a81f4ea94d41245cd5150de341b51fc70babffe
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      9ccc5a57
    • Joel Hutton's avatar
      cot-desc: optimise memory further · 30070427
      Joel Hutton authored
      
      
      This changes the auth_img_desc_t struct to have pointers to struct
      arrays instead of struct arrays. This saves memory as many of these
      were never used, and can be NULL pointers. Note the memory savings are
      only when these arrays are not initialised, as it is assumed these
      arrays are fixed length. A possible future optimisation could allow for
      variable length.
      
      memory diff:
      bl1:        bl2:
          text        text
            -12         -12
          bss         bss
            -1463       0
          data        data
            -56         -48
          rodata      rodata
            -5688       -2592
          total       total
            -7419       -2652
      
      Change-Id: I8f9bdedf75048b8867f40c56381e3a6dc6402bcc
      Signed-off-by: default avatarJoel Hutton <Joel.Hutton@Arm.com>
      30070427
    • Joel Hutton's avatar
      Reduce memory needed for CoT description · 0b6377d1
      Joel Hutton authored
      
      
      When Trusted Board Boot is enabled, we need to specify the Chain of
      Trust (CoT) of the BL1 and BL2 images. A CoT consists of an array
      of image descriptors. The authentication module assumes that each
      image descriptor in this array is indexed by its unique image
      identifier. For example, the Trusted Boot Firmware Certificate has to
      be at index [TRUSTED_BOOT_FW_CERT_ID].
      
      Unique image identifiers may not necessarily be consecutive. Also,
      a given BL image might not use all image descriptors. For example, BL1
      does not need any of the descriptors related to BL31. As a result, the
      CoT array might contain holes, which unnecessarily takes up space in
      the BL binary.
      
      Using pointers to auth_img_desc_t structs (rather than structs
      themselves) means these unused elements only use 1 pointer worth of
      space, rather than one struct worth of space. This patch also changes
      the code which accesses this array to reflect the change to pointers.
      
      Image descriptors not needed in BL1 or BL2 respectively are also
      ifdef'd out in this patch. For example, verifying the BL31 image is
      the responsibility of BL2 so BL1 does not need any of the data
      structures describing BL31.
      
      memory diff:
      bl1:        bl2:
          text        text
            -20         -20
          bss         bss
            -1463       0
          data        data
            -256        -48
          rodata      rodata
            -5240       -1952
          total       total
            -6979       -2020
      
      Change-Id: I163668b174dc2b9bbb183acec817f2126864aaad
      Signed-off-by: default avatarJoel Hutton <Joel.Hutton@Arm.com>
      0b6377d1
    • Heiko Stuebner's avatar
      cpus: Fix Cortex-A12 MIDR mask · 8785a7cf
      Heiko Stuebner authored
      
      
      The Cortex-A12's primary part number is 0xC0D not 0xC0C, so
      fix that to make the A12's cpu operations findable.
      
      Change-Id: I4440a039cd57a2fe425fd8a8ec5499ca8e895e31
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      8785a7cf
  2. 05 Apr, 2019 1 commit
    • Manish Pandey's avatar
      aarch32: Allow compiling with soft-float toolchain · fbd8f6c8
      Manish Pandey authored
      
      
      ARMv7 and Cortex-A32(ARMv8/aarch32) uses "arm-linux-gnueabi" toolchain which
      has both soft-float and hard-float variants and so there could be scenarios
      where soft-float toolchain is used.Even though TF-A documentation recommends
      to use hard-float toolchain for aarch32 but there are external projects where
      we cannot mandate the selection of toolchain and for those projects at least
      the build should not fail.
      
      Current TF-A source fails to build with soft-float toolchain because assembler
      does not recognizes "vmsr" instruction which is required to enable floating
      point unit.
      
      To avoid this piece of code being compiled with soft-float toolchain add
      predefined macro guard " __SOFTFP__" exposed by soft-float toolchain.
      
      Change-Id: I76ba40906a8d622dcd476dd36ab4d277a925996c
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      fbd8f6c8
  3. 03 Apr, 2019 4 commits
  4. 02 Apr, 2019 1 commit
  5. 01 Apr, 2019 1 commit
    • Ambroise Vincent's avatar
      Remove several warnings reported with W=1 · 609e053c
      Ambroise Vincent authored
      
      
      Improved support for W=1 compilation flag by solving missing-prototypes
      and old-style-definition warnings.
      
      The libraries are compiling with warnings (which turn into errors with
      the Werror flag).
      
      Outside of libraries, some warnings cannot be fixed without heavy
      structural changes.
      
      Change-Id: I1668cf99123ac4195c2a6a1d48945f7a64c67f16
      Signed-off-by: default avatarAmbroise Vincent <ambroise.vincent@arm.com>
      609e053c
  6. 15 Mar, 2019 1 commit
  7. 14 Mar, 2019 2 commits
  8. 13 Mar, 2019 3 commits
  9. 12 Mar, 2019 2 commits
    • Paul Beesley's avatar
      drivers: Remove TODO from io_storage · 9a2fffb8
      Paul Beesley authored
      
      
      This TODO was added five years ago so I assume that there is not
      going to be a shutdown API added after all.
      
      Change-Id: If0f4e2066454df773bd9bf41ed65d3a10248a2d3
      Signed-off-by: default avatarPaul Beesley <paul.beesley@arm.com>
      9a2fffb8
    • Tien Hock, Loh's avatar
      drivers: synopsys: Fix synopsys MMC driver · 3d0f30bb
      Tien Hock, Loh authored
      
      
      There are some issues with synopsys MMC driver:
      - CMD8 should not expect data (for SD)
      - ACMD51 should expect data (Send SCR for SD)
      - dw_prepare should not dictate size to be MMC_BLOCK_SIZE, block size is
      now handled in the dw_prepare function
      - after the CMD completes, when doing dw_read, we need to invalidate cache
      and wait for the data transfer to complete
      - Need to set FIFO threshold, otherwise DMA might never get the interrupt
      to read or write
      Signed-off-by: default avatarTien Hock, Loh <tien.hock.loh@intel.com>
      3d0f30bb
  10. 07 Mar, 2019 1 commit
    • Tien Hock, Loh's avatar
      drivers: mmc: Fix some issues with MMC stack · a468e756
      Tien Hock, Loh authored
      
      
      Some bugs in MMC stack needs to be fixed:
      - scr cannot be local as this will cause cache issue when invalidating
      after the read DMA transfer is completed
      - ACMD41 needs to send voltage information in initialization, otherwise the
      command is a query, thus will not initialize the controller
      - when checking device state, retry until the retries counter goes to zero
      before failing
      Signed-off-by: default avatarTien Hock, Loh <tien.hock.loh@intel.com>
      a468e756
  11. 04 Mar, 2019 1 commit
  12. 01 Mar, 2019 1 commit
  13. 28 Feb, 2019 8 commits
  14. 27 Feb, 2019 9 commits
    • Varun Wadekar's avatar
      Tegra: Support for scatterfile for the BL31 image · c2ad38ce
      Varun Wadekar authored
      
      
      This patch provides support for using the scatterfile format as
      the linker script with the 'armlink' linker for Tegra platforms.
      
      In order to enable the scatterfile usage the following changes
      have been made:
      
      * provide mapping for ld.S symbols in bl_common.h
      * include bl_common.h from all the affected files
      * update the makefile rules to use the scatterfile and armlink
        to compile BL31
      * update pubsub.h to add sections to the scatterfile
      
      NOTE: THIS CHANGE HAS BEEN VERIFIED WITH TEGRA PLATFORMS ONLY.
      
      Change-Id: I7bb78b991c97d74a842e5635c74cb0b18e0fce67
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      c2ad38ce
    • Antonio Nino Diaz's avatar
      TSP: Enable pointer authentication support · 67b6ff9f
      Antonio Nino Diaz authored
      
      
      The size increase after enabling options related to ARMv8.3-PAuth is:
      
      +----------------------------+-------+-------+-------+--------+
      |                            |  text |  bss  |  data | rodata |
      +----------------------------+-------+-------+-------+--------+
      | CTX_INCLUDE_PAUTH_REGS = 1 |   +40 |   +0  |   +0  |   +0   |
      |                            |  0.4% |       |       |        |
      +----------------------------+-------+-------+-------+--------+
      | ENABLE_PAUTH = 1           |  +352 |    +0 |  +16  |   +0   |
      |                            |  3.1% |       | 15.8% |        |
      +----------------------------+-------+-------+-------+--------+
      
      Results calculated with the following build configuration:
      
          make PLAT=fvp SPD=tspd DEBUG=1 \
          SDEI_SUPPORT=1                 \
          EL3_EXCEPTION_HANDLING=1       \
          TSP_NS_INTR_ASYNC_PREEMPT=1    \
          CTX_INCLUDE_PAUTH_REGS=1       \
          ENABLE_PAUTH=1
      
      Change-Id: I6cc1fe0b2345c547dcef66f98758c4eb55fe5ee4
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      67b6ff9f
    • Antonio Nino Diaz's avatar
      BL31: Enable pointer authentication support · 88cfd9a6
      Antonio Nino Diaz authored
      
      
      The size increase after enabling options related to ARMv8.3-PAuth is:
      
      +----------------------------+-------+-------+-------+--------+
      |                            |  text |  bss  |  data | rodata |
      +----------------------------+-------+-------+-------+--------+
      | CTX_INCLUDE_PAUTH_REGS = 1 |  +192 | +1536 |   +0  |   +0   |
      |                            |  0.3% |  3.1% |       |        |
      +----------------------------+-------+-------+-------+--------+
      | ENABLE_PAUTH = 1           | +1848 | +1536 |  +16  |   +0   |
      |                            |  3.3% |  3.1% |  3.1% |        |
      +----------------------------+-------+-------+-------+--------+
      
      Results calculated with the following build configuration:
      
          make PLAT=fvp SPD=tspd DEBUG=1 \
          SDEI_SUPPORT=1                 \
          EL3_EXCEPTION_HANDLING=1       \
          TSP_NS_INTR_ASYNC_PREEMPT=1    \
          CTX_INCLUDE_PAUTH_REGS=1       \
          ENABLE_PAUTH=1
      
      Change-Id: I43db7e509a4f39da6599ec2faa690d197573ec1b
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      88cfd9a6
    • Antonio Nino Diaz's avatar
      BL2_AT_EL3: Enable pointer authentication support · dcbfa11b
      Antonio Nino Diaz authored
      
      
      The size increase after enabling options related to ARMv8.3-PAuth is:
      
      +----------------------------+-------+-------+-------+--------+
      |                            |  text |  bss  |  data | rodata |
      +----------------------------+-------+-------+-------+--------+
      | CTX_INCLUDE_PAUTH_REGS = 1 |   +44 |   +0  |   +0  |   +0   |
      |                            |  0.2% |       |       |        |
      +----------------------------+-------+-------+-------+--------+
      | ENABLE_PAUTH = 1           |  +712 |   +0  |  +16  |   +0   |
      |                            |  3.1% |       |  0.9% |        |
      +----------------------------+-------+-------+-------+--------+
      
      The results are valid for the following build configuration:
      
          make PLAT=fvp SPD=tspd DEBUG=1 \
          BL2_AT_EL3=1                   \
          CTX_INCLUDE_PAUTH_REGS=1       \
          ENABLE_PAUTH=1
      
      Change-Id: I1c0616e7dea30962a92b4fd113428bc30a018320
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      dcbfa11b
    • Antonio Nino Diaz's avatar
      BL2: Enable pointer authentication support · 9d93fc2f
      Antonio Nino Diaz authored
      
      
      The size increase after enabling options related to ARMv8.3-PAuth is:
      
      +----------------------------+-------+-------+-------+--------+
      |                            |  text |  bss  |  data | rodata |
      +----------------------------+-------+-------+-------+--------+
      | CTX_INCLUDE_PAUTH_REGS = 1 |   +40 |   +0  |   +0  |   +0   |
      |                            |  0.2% |       |       |        |
      +----------------------------+-------+-------+-------+--------+
      | ENABLE_PAUTH = 1           |  +664 |   +0  |  +16  |   +0   |
      |                            |  3.1% |       |  0.9% |        |
      +----------------------------+-------+-------+-------+--------+
      
      Results calculated with the following build configuration:
      
          make PLAT=fvp SPD=tspd DEBUG=1 \
          SDEI_SUPPORT=1                 \
          EL3_EXCEPTION_HANDLING=1       \
          TSP_NS_INTR_ASYNC_PREEMPT=1    \
          CTX_INCLUDE_PAUTH_REGS=1       \
          ENABLE_PAUTH=1
      
      The changes for BL2_AT_EL3 aren't done in this commit.
      
      Change-Id: I8c803b40c7160525a06173bc6cdca21c4505837d
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      9d93fc2f
    • Antonio Nino Diaz's avatar
      BL1: Enable pointer authentication support · cd7d6b0e
      Antonio Nino Diaz authored
      
      
      The size increase after enabling options related to ARMv8.3-PAuth is:
      
      +----------------------------+-------+-------+-------+--------+
      |                            |  text |  bss  |  data | rodata |
      +----------------------------+-------+-------+-------+--------+
      | CTX_INCLUDE_PAUTH_REGS = 1 |  +108 |  +192 |   +0  |   +0   |
      |                            |  0.5% |  0.8% |       |        |
      +----------------------------+-------+-------+-------+--------+
      | ENABLE_PAUTH = 1           |  +748 |  +192 |  +16  |   +0   |
      |                            |  3.7% |  0.8% |  7.0% |        |
      +----------------------------+-------+-------+-------+--------+
      
      Results calculated with the following build configuration:
      
          make PLAT=fvp SPD=tspd DEBUG=1 \
          SDEI_SUPPORT=1                 \
          EL3_EXCEPTION_HANDLING=1       \
          TSP_NS_INTR_ASYNC_PREEMPT=1    \
          CTX_INCLUDE_PAUTH_REGS=1       \
          ENABLE_PAUTH=1
      
      Change-Id: I3a7d02feb6a6d212be32a01432b0c7c1a261f567
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      cd7d6b0e
    • Antonio Nino Diaz's avatar
      Add support for pointer authentication · b86048c4
      Antonio Nino Diaz authored
      
      
      The previous commit added the infrastructure to load and save
      ARMv8.3-PAuth registers during Non-secure <-> Secure world switches, but
      didn't actually enable pointer authentication in the firmware.
      
      This patch adds the functionality needed for platforms to provide
      authentication keys for the firmware, and a new option (ENABLE_PAUTH) to
      enable pointer authentication in the firmware itself. This option is
      disabled by default, and it requires CTX_INCLUDE_PAUTH_REGS to be
      enabled.
      
      Change-Id: I35127ec271e1198d43209044de39fa712ef202a5
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      b86048c4
    • Antonio Nino Diaz's avatar
      Add ARMv8.3-PAuth registers to CPU context · 5283962e
      Antonio Nino Diaz authored
      
      
      ARMv8.3-PAuth adds functionality that supports address authentication of
      the contents of a register before that register is used as the target of
      an indirect branch, or as a load.
      
      This feature is supported only in AArch64 state.
      
      This feature is mandatory in ARMv8.3 implementations.
      
      This feature adds several registers to EL1. A new option called
      CTX_INCLUDE_PAUTH_REGS has been added to select if the TF needs to save
      them during Non-secure <-> Secure world switches. This option must be
      enabled if the hardware has the registers or the values will be leaked
      during world switches.
      
      To prevent leaks, this patch also disables pointer authentication in the
      Secure world if CTX_INCLUDE_PAUTH_REGS is 0. Any attempt to use it will
      be trapped in EL3.
      
      Change-Id: I27beba9907b9a86c6df1d0c5bf6180c972830855
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      5283962e
    • Antonio Nino Diaz's avatar
      Cleanup context handling library · 4d1ccf0e
      Antonio Nino Diaz authored
      
      
      Minor style cleanup.
      
      Change-Id: Ief19dece41a989e2e8157859a265701549f6c585
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      4d1ccf0e
  15. 26 Feb, 2019 1 commit
    • Ying-Chun Liu (PaulLiu)'s avatar
      rpi3: sdhost: SDHost driver improvement · 2c8ef2ae
      Ying-Chun Liu (PaulLiu) authored
      
      
      This commit improves the SDHost driver for RPi3 as following:
       * Unblock MMC_CMD(17). Using MMC_CMD(17) is more efficient on
         block reading.
       * In some low probability that SEND_OP_COND might results CRC7
         error. We can consider that the command runs correctly. We don't
         need to retry this command so removing the code for retry.
       * Using MMC_BUS_WIDTH_1 as MMC default value to improve the stability.
       * Increase the clock to 50Mhz in data mode to speed up the io.
       * Change the pull resistors configuration to gain more stability.
      Signed-off-by: default avatarYing-Chun Liu (PaulLiu) <paulliu@debian.org>
      2c8ef2ae