1. 09 Oct, 2020 1 commit
    • Jimmy Brisson's avatar
      Don't return error information from console_flush · 831b0e98
      Jimmy Brisson authored
      
      
      And from crash_console_flush.
      
      We ignore the error information return by console_flush in _every_
      place where we call it, and casting the return type to void does not
      work around the MISRA violation that this causes. Instead, we collect
      the error information from the driver (to avoid changing that API), and
      don't return it to the caller.
      
      Change-Id: I1e35afe01764d5c8f0efd04f8949d333ffb688c1
      Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@arm.com>
      831b0e98
  2. 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
  3. 05 Oct, 2020 2 commits
  4. 04 Oct, 2020 5 commits
  5. 02 Oct, 2020 1 commit
  6. 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
  7. 28 Sep, 2020 1 commit
  8. 25 Sep, 2020 1 commit
    • Javier Almansa Sobrino's avatar
      arm_fpga: Add support for unknown MPIDs · 1994e562
      Javier Almansa Sobrino authored
      
      
      This patch allows the system to fallback to a default CPU library
      in case the MPID does not match with any of the supported ones.
      
      This feature can be enabled by setting SUPPORT_UNKNOWN_MPID build
      option to 1 (enabled by default only on arm_fpga platform).
      
      This feature can be very dangerous on a production image and
      therefore it MUST be disabled for Release images.
      Signed-off-by: default avatarJavier Almansa Sobrino <javier.almansasobrino@arm.com>
      Change-Id: I0df7ef2b012d7d60a4fd5de44dea1fbbb46881ba
      1994e562
  9. 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
  10. 21 Sep, 2020 3 commits
  11. 15 Sep, 2020 3 commits
  12. 14 Sep, 2020 1 commit
  13. 10 Sep, 2020 4 commits
  14. 09 Sep, 2020 1 commit
  15. 07 Sep, 2020 1 commit
    • Manish V Badarkhe's avatar
      plat: Fix build issue for qemu and rpi3 platforms · dad2934c
      Manish V Badarkhe authored
      
      
      Coverity build periodically throws below errors(non-consistently)
      for 'QEMU' and 'RPI3' platforms.
      
      /bin/sh: 1: cannot create build/qemu/debug/rot_key.pem: Directory
      nonexistent
      plat/qemu/qemu/platform.mk:86: recipe for target 'build/qemu/debug/
      rot_key.pem' failed
      make: *** [build/qemu/debug/rot_key.pem] Error 2
      
      /bin/sh: 1: cannot create /work/workspace/workspace/tf-coverity/build
      /rpi3/debug/rot_key.pem: Directory nonexistent
      plat/rpi/rpi3/platform.mk:214: recipe for target '/work/workspace/
      workspace/tf-coverity/build/rpi3/debug/rot_key.pem' failed
      make: *** [/work/workspace/workspace/tf-coverity/build/rpi3/debug/
      rot_key.pem] Error 2
      
      Issue seems to be occurred when 'ROT key' is generated before creating
      the platform build folder(for e.g.build/qemu/debug).
      
      Changes are made to fix this issue by adding orderly dependancy of
      the platform folder for the 'ROT key' creation which ensures that
      platform folder is created before generating 'ROT key'.
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      Change-Id: I20c82172dde84e4c7f2373c0bd095d353f845d38
      dad2934c
  16. 02 Sep, 2020 3 commits
    • Alexei Fedorov's avatar
      plat/arm: Introduce and use libc_asm.mk makefile · e3f2b1a9
      Alexei Fedorov authored
      Trace analysis of FVP_Base_AEMv8A 0.0/6063 model
      running in Aarch32 mode with the build options
      listed below:
      TRUSTED_BOARD_BOOT=1 GENERATE_COT=1
      ARM_ROTPK_LOCATION=devel_ecdsa KEY_ALG=ecdsa
      ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_ecdsa.pem
      shows that when auth_signature() gets called
      71.99% of CPU execution time is spent in memset() function
      written in C using single byte write operations,
      see lib\libc\memset.c.
      This patch introduces new libc_asm.mk makefile which
      replaces C memset() implementation with assembler
      version giving the following results:
      - for Aarch32 in auth_signature() call memset() CPU time
      reduced to 20.56%.
      The number of CPU instructions (Inst) executed during
      TF-A boot stage before start of BL33 in RELEASE builds
      for different versions is presented in the tables below,
      where:
      - C TF-A: existing TF-A C code;
      - C musl: "lightweight code" C "implementation of the
        standard library for Linux-based systems"
      https://git.musl-libc.org/cgit/musl/tree/src/string/memset.c
      - Asm Opt: assemler version from "Arm Optimized Routines"
        project
      https://github.com/ARM-software/optimized-routines/blob/
      master/string/arm/memset.S
      - Asm Linux: assembler version from Linux kernel
      https://github.com/torvalds/linux/blob/master/arch/arm/lib/memset.S
      
      
      - Asm TF-A: assembler version from this patch
      
      Aarch32:
      +-----------+------+------+--------------+----------+
      | Variant   | Set  | Size |    Inst 	 |  Ratio   |
      +-----------+------+------+--------------+----------+
      | C TF-A    | T32  | 16   | 2122110003   | 1.000000 |
      | C musl    | T32  | 156  | 1643917668   | 0.774662 |
      | Asm Opt   | T32  | 84   | 1604810003   | 0.756233 |
      | Asm Linux | A32  | 168  | 1566255018   | 0.738065 |
      | Asm TF-A  | A32  | 160  | 1525865101   | 0.719032 |
      +-----------+------+------+--------------+----------+
      
      AArch64:
      +-----------+------+------------+----------+
      | Variant   | Size |    Inst    |  Ratio   |
      +-----------+------+------------+----------+
      | C TF-A    | 28   | 2732497518 | 1.000000 |
      | C musl    | 212  | 1802999999 | 0.659836 |
      | Asm TF-A  | 140  | 1680260003 | 0.614917 |
      +-----------+------+------------+----------+
      
      This patch modifies 'plat\arm\common\arm_common.mk'
      by overriding libc.mk makefile with libc_asm.mk and
      does not effect other platforms.
      
      Change-Id: Ie89dd0b74ba1079420733a0d76b7366ad0157c2e
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      e3f2b1a9
    • Javier Almansa Sobrino's avatar
      arm_fpga: Add support to populate the CPU nodes in the DTB · 20ff991e
      Javier Almansa Sobrino authored
      
      
      At the moment BL31 dynamically discovers the CPU topology of an FPGA
      system at runtime, but does not export it to the non-secure world.
      Any BL33 user would typically looks at the devicetree to learn about
      existing CPUs.
      
      This patch exports a minimum /cpus node in a devicetree to satisfy
      the binding. This means that no cpumaps or caches are described.
      This could be added later if needed.
      
      An existing /cpus node in the DT will make the code bail out with a
      message.
      Signed-off-by: default avatarJavier Almansa Sobrino <javier.almansasobrino@arm.com>
      Change-Id: I589a2b3412411a3660134bdcef3a65e8200e1d7e
      20ff991e
    • Anders Dellien's avatar
      plat/arm: Add dependencies to configuration files · 3ab336a1
      Anders Dellien authored
      
      
      This patch adds dependencies to the generated configuration
      files that are included in the FIP. This fixes occasional
      build errors that occur when the FIP happens to be built first.
      
      Change-Id: I5a2bf724ba3aee13954403b141f2f19b4fd51d1b
      Signed-off-by: default avatarAnders Dellien <anders.dellien@arm.com>
      3ab336a1
  17. 01 Sep, 2020 1 commit
  18. 31 Aug, 2020 3 commits
    • anzhou's avatar
      Tegra: common: fixup the bl31 code size to be copied at reset · a565d16c
      anzhou authored
      
      
      If the CPU doesn't run from BL31_BASE, the firmware needs to be
      copied from load address to BL31_BASE during cold boot. The size
      should be the actual size of the code, which is indicated by the
      __RELA_END__ linker variable.
      
      This patch updates the copy routine to use this variable as a
      result.
      Signed-off-by: default avataranzhou <anzhou@nvidia.com>
      Change-Id: Ie3a48dd54cda1dc152204903d609da3117a0ced9
      a565d16c
    • anzhou's avatar
      Tegra: common: disable GICC after domain off · c23f5e1c
      anzhou authored
      
      
      The the GIC CPU interface should be disabled after cpu off. The
      Tegra power management code should mark the connected core as asleep
      as part of the CPU off sequence.
      
      This patch disables the GICC after CPU off as a result.
      Signed-off-by: default avataranzhou <anzhou@nvidia.com>
      Change-Id: Ib1a3d8903f5e6d55bd2ee0c16134dbe2562235ea
      c23f5e1c
    • anzhou's avatar
      Tegra: platform specific BL31_SIZE · 5a22eb42
      anzhou authored
      
      
      This patch moves the BL31_SIZE to the Tegra SoC specific
      tegra_def.h. This helps newer platforms configure the size of
      the memory available for BL31.
      Signed-off-by: default avataranzhou <anzhou@nvidia.com>
      Change-Id: I43c60b82fa7e43d5b05d87fbe7d673d729380d82
      5a22eb42