1. 20 Oct, 2020 2 commits
  2. 15 Oct, 2020 1 commit
  3. 13 Oct, 2020 6 commits
  4. 12 Oct, 2020 3 commits
    • Jimmy Brisson's avatar
      Increase type widths to satisfy width requirements · d7b5f408
      Jimmy Brisson authored
      
      
      Usually, C has no problem up-converting types to larger bit sizes. MISRA
      rule 10.7 requires that you not do this, or be very explicit about this.
      This resolves the following required rule:
      
          bl1/aarch64/bl1_context_mgmt.c:81:[MISRA C-2012 Rule 10.7 (required)]<None>
          The width of the composite expression "0U | ((mode & 3U) << 2U) | 1U |
          0x3c0U" (32 bits) is less that the right hand operand
          "18446744073709547519ULL" (64 bits).
      
      This also resolves MISRA defects such as:
      
          bl2/aarch64/bl2arch_setup.c:18:[MISRA C-2012 Rule 12.2 (required)]
          In the expression "3U << 20", shifting more than 7 bits, the number
          of bits in the essential type of the left expression, "3U", is
          not allowed.
      
      Further, MISRA requires that all shifts don't overflow. The definition of
      PAGE_SIZE was (1U << 12), and 1U is 8 bits. This caused about 50 issues.
      This fixes the violation by changing the definition to 1UL << 12. Since
      this uses 32bits, it should not create any issues for aarch32.
      
      This patch also contains a fix for a build failure in the sun50i_a64
      platform. Specifically, these misra fixes removed a single and
      instruction,
      
          92407e73        and     x19, x19, #0xffffffff
      
      from the cm_setup_context function caused a relocation in
      psci_cpus_on_start to require a linker-generated stub. This increased the
      size of the .text section and caused an alignment later on to go over a
      page boundary and round up to the end of RAM before placing the .data
      section. This sectionn is of non-zero size and therefore causes a link
      error.
      
      The fix included in this reorders the functions during link time
      without changing their ording with respect to alignment.
      
      Change-Id: I76b4b662c3d262296728a8b9aab7a33b02087f16
      Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@arm.com>
      d7b5f408
    • Manish V Badarkhe's avatar
      plat: brcm: Remove 'AARCH32' deprecated macro · 0e16177e
      Manish V Badarkhe authored
      
      
      Removed 'AARCH32' deprecated macro from 'stingray'
      Broadcom platform code.
      
      Change-Id: If8d9e785b7980fefd39df06547fcf71b899fd735
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      0e16177e
    • Manish V Badarkhe's avatar
      Remove deprecated macro from TF-A code · c959ea78
      Manish V Badarkhe authored
      
      
      Removed '__ASSEMBLY__' deprecated macro from TF-A code
      
      Change-Id: I9082a568b695acb5b903f509db11c8672b62d9d0
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      c959ea78
  5. 09 Oct, 2020 7 commits
  6. 06 Oct, 2020 1 commit
    • Usama Arif's avatar
      plat/arm: common: add guard for arm_get_rotpk_info_regs · 3bfcc9d7
      Usama Arif authored
      
      
      Only define arm_get_rotpk_info_regs if ROTPK is in registers,
      i.e. (ARM_ROTPK_LOCATION_ID == ARM_ROTPK_REGS_ID). This will
      allow platform build without definition of TZ_PUB_KEY_HASH_BASE
      if dedicated registers for ROTPK are not available on the platform.
      
      Change-Id: I74ee2d5007f5d876a031a1efca20ebee2dede0c7
      Signed-off-by: default avatarUsama Arif <usama.arif@arm.com>
      3bfcc9d7
  7. 05 Oct, 2020 2 commits
  8. 04 Oct, 2020 5 commits
  9. 02 Oct, 2020 1 commit
  10. 29 Sep, 2020 5 commits
    • Andre Przywara's avatar
      arm_fpga: Add post-build linker script · 01301b11
      Andre Przywara authored
      
      
      For the Arm Ltd. FPGAs to run, we need to load several payloads into the
      FPGA's memory:
      - Some trampoline code at address 0x0, to jump to BL31's entry point.
      - The actual BL31 binary at the beginning of DRAM.
      - The (generic) DTB image to describe the hardware.
      - The actual non-secure payloads (kernel, ramdisks, ...)
      
      The latter is application specific, but the first three blobs are rather
      generic.
      Since the uploader tool supports ELF binaries, it seems helpful to
      combine these three images into one .axf file, as this also simplifies
      the command line.
      
      Add a post-build linker script, that combines those three bits into one
      ELF file, together with their specific load addresses.
      Include a call to "ld" with this linker script in the platform Makefile,
      so it will be build automatically. The result will be called "bl31.axf".
      
      Change-Id: I4a90da16fa1e0e83b51d19e5b1daf61f5a0bbfca
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      01301b11
    • Andre Przywara's avatar
      arm_fpga: Add ROM trampoline · f45c6d86
      Andre Przywara authored
      
      
      The application cores of the FPGAs used in Arm Ltd. start execution at
      address 0x0. This is the location of some (emulated) ROM area (which can
      be written to by the uploading tool).
      Since the arm_fpga port is configured to run from DRAM, we load BL31 to
      the beginning of DRAM (mapped at 2GB). This requires some small
      trampoline code in the "ROM" to jump to the BL31 entry point.
      
      To avoid some extra magic binary, add a tiny assembly file with that
      trivial jump instruction to the tree, so this binary can be created
      alongside BL31.
      
      Change-Id: I9e4439fc0f093fa24dd49a8377c9edb030fbb477
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      f45c6d86
    • Andre Przywara's avatar
      arm_fpga: Add devicetree file · b48883c7
      Andre Przywara authored
      
      
      The FPGA images used in Arm Ltd. focus on CPU cores, so they share a
      common platform, with a minimal set of peripherals (interconnect, GIC,
      UART).
      This allows to support most platforms with a single devicetree file.
      The topology and number of CPU cores differ, but those will added at
      runtime, in BL31. Other adjustments (GICR size, SPE node, command line)
      are also done at this point.
      
      Add the common devicetree file to TF-A's build system, so it can be
      build together with BL31. At runtime, the resulting .dtb file should be
      uploaded to the address given with FPGA_PRELOADED_DTB_BASE at build time.
      
      Change-Id: I3206d6131059502ec96896e95329865452c9d83e
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      b48883c7
    • Andre Przywara's avatar
      arm_fpga: Remove SPE PMU DT node if SPE is not available · 40a0de19
      Andre Przywara authored
      
      
      The Statistical Profiling Extension (SPE) is an architectural feature we
      can safely detect at runtime. However it still relies on one piece of
      platform-specific information: the interrupt line it is connected
      to. This requires SPE to be described in a devicetree node.
      
      Since SPE support varies with the CPU cores found on an FPGA image, we
      should detect the presence of SPE at runtime, and remove a potentially
      existing SPE PMU node from the DT.
      
      This allows to always have the SPE node in a generic devicetree file,
      without risking exposing it on a CPU without this feature.
      
      Change-Id: I73d83ea8509b03fe7bba20b9cce8d1335035fa31
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      40a0de19
    • Andre Przywara's avatar
      arm_fpga: Adjust GICR size in DT to match number of cores · 283e5595
      Andre Przywara authored
      
      
      The size of a GICv3 redistributor region depends on the number of
      cores in the system. For the ARM FPGA port, we detect the topology at
      runtime, and adjust the CPU DT nodes accordingly.
      Now the size of the GICR region must also be adjusted, or Linux will
      fail to initialise the GICv3.
      
      Use the newly introduced function to overwrite the GICR size entry in
      the GICv3 reg property. We count the number of existing cores by
      iterating over the GICR frames until we find the LAST bit set in TYPER.
      
      Change-Id: Ib69565600859de9b1b15ceb8495172cd26d16fce
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      283e5595
  11. 28 Sep, 2020 1 commit
  12. 25 Sep, 2020 2 commits
  13. 24 Sep, 2020 3 commits
    • Sami Mujawar's avatar
      plat/arm/css/sgi: Map flash used for mem_protect · 7c15a8c1
      Sami Mujawar authored
      
      
      The SGI platform defines the macro PLAT_ARM_MEM_PROT_ADDR which
      indicates that the platform has mitigation for cold reboot attacks.
      
      However, the flash memory used for the mem_protect region was not
      mapped. This results in a crash when an OS calls PSCI MEM_PROTECT.
      
      To fix this map the flash region used for mem_protect.
      
      Change-Id: Ia494f924ecfe2ce835c045689ba8f942bf0941f4
      Signed-off-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      7c15a8c1
    • Usama Arif's avatar
      plat: tc0: enable TZC · 16796a25
      Usama Arif authored
      
      
      Change-Id: Ic2bb8482f0b602f6b7850d4fa553448bc4931edc
      Signed-off-by: default avatarUsama Arif <usama.arif@arm.com>
      16796a25
    • Yann Gautier's avatar
      fdts: stm32mp1: realign device tree with kernel · 277d6af5
      Yann Gautier authored
      
      
      There is one dtsi file per SoC version:
      - STM32MP151: common part for all version, Single Cortex-A7
      - STM32MP153: Dual Cortex-A7
      - STM32MP157: + GPU and DSI, but not needed for TF-A
      
      The STM32MP15xC include a cryptography peripheral, add it in a dedicated
      file.
      
      There are 4 packages available, for which  the IOs number change. Have one
      file for each package. The 2 packages AB and AD are added.
      
      STM32157A-DK1 and STM32MP157C-DK2 share most of their features, a common
      dkx file is then created.
      
      Some reordering is done in other files, and realign with kernel DT files.
      
      The DDR files are generated with our internal tool, no changes in the
      registers values.
      
      Change-Id: I9f2ef00306310abe34b94c2f10fc7a77a10493d1
      Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
      277d6af5
  14. 21 Sep, 2020 1 commit
    • Yann Gautier's avatar
      stm32mp1: correct crash console GPIO alternate configuration · 4170079a
      Yann Gautier authored
      
      
      If GPIO port for UART TX is less than 8, the register GPIO_AFRL should
      be used to set the alternate. GPIO_AFRH is used if GPIO port is greater
      or equal to 8. The macro GPIO_TX_ALT_SHIFT is removed and the GPIO port
      number is tested against GPIO_ALT_LOWER_LIMIT (=8) in
      plat_crash_console_init() function.
      
      Change-Id: Ibb62223ed6bce589bbcab59a5e986b2677e6d118
      Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
      4170079a