1. 31 Mar, 2020 3 commits
    • Masahiro Yamada's avatar
      xlat_tables_v2: add enable_mmu() · f5547735
      Masahiro Yamada authored
      
      
      enable_mmu_* has a different function name, so it is not handy in the
      shared code. enable_mmu() calls an appropriate one depending on the
      exception level.
      
      Change-Id: I0657968bfcb91c32733f75f9259f550a5c35b1c3
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      f5547735
    • Masahiro Yamada's avatar
      Add get_current_el_maybe_constant() · fd092be2
      Masahiro Yamada authored
      
      
      There are some cases where we want to run EL-dependent code in the
      shared code.
      
      We could use #ifdef, but it leaves slight possibility where we do not
      know the exception level at the build-time (e.g. library code).
      
      The counter approach is to use get_current_el(), but it is run-time
      detection, so all EL code is linked, some of which might be unneeded.
      
      This commit adds get_current_el_maybe_constant(). This is a static
      inline function that returns a constant value if we know the exception
      level at build-time. This is mostly the case.
      
          if (get_current_el_maybe_constant() == 1) {
                  /* do something for EL1 */
          } else if (get_current_el_maybe_constant() == 3) {
                  /* do something for EL3 */
          }
      
      If get_current_el_maybe_constant() is build-time constant, the compiler
      will optimize out the unreachable code.
      
      If such code is included from the library code, it is not built-time
      constant. In this case, it falls back to get_current_el(), so it still
      works.
      
      Change-Id: Idb03c20342a5b5173fe2d6b40e1fac7998675ad3
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      fd092be2
    • Masahiro Yamada's avatar
      Build: define IMAGE_AT_EL1 or IMAGE_AT_EL3 globally for C files · d5e97a1d
      Masahiro Yamada authored
      
      
      The build system defines the IMAGE_BL* macro when compiling each image.
      This is useful to distinguish which image the current file is being
      built for by using #if defined(IMAGE_BL2) or #if defined(IMAGE_BL31),
      or whatever.
      
      There are some cases where we are more interested in which exception
      level the current file is being built for.
      
      include/lib/cpus/{aarch32,aarch64}/cpu_macros.S defines IMAGE_AT_EL3,
      but we do not have it globally.
      
      Pass IMAGE_AT_EL1 or IMAGE_AT_EL3 to BL*_CFLAGS so that it is available
      from all C code.
      
      The library code (libc.a, libmbedtls.a, etc.) is exceptional cases,
      where the code can be shared between BL images.
      
      Other than that, we know the exception level at the build time, and
      this macro will be useful in the shared code.
      
      Change-Id: I7c8a1da10726906adfba981cfe8464dff111d6b0
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d5e97a1d
  2. 27 Mar, 2020 2 commits
  3. 26 Mar, 2020 7 commits
  4. 25 Mar, 2020 3 commits
  5. 24 Mar, 2020 7 commits
  6. 23 Mar, 2020 15 commits
  7. 22 Mar, 2020 3 commits
    • Anthony Zhou's avatar
      Tegra194: move cluster and CPU counter to header file. · 9aaa8882
      Anthony Zhou authored
      
      
      MISRA rules request that the cluster and CPU counter be unsigned
      values and have a suffix 'U'. If the define located in the makefile,
      this cannot be done.
      
      This patch moves the PLATFORM_CLUSTER_COUNT and PLATFORM_MAX_CPUS_PER_CLUSTER
      macros to tegra_def.h as a result.
      
      Change-Id: I9ef0beb29485729de204b4ffbb5241b039690e5a
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      9aaa8882
    • Varun Wadekar's avatar
      Tegra: gicv2: initialize target masks · 7644e2aa
      Varun Wadekar authored
      
      
      This patch initializes the target masks in the GICv2 driver
      data, for all PEs. This will allow platforms to set the PE
      target for SPIs.
      
      Change-Id: I7bf2ad79c04c2555ab310acba17823fb157327a3
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      7644e2aa
    • Mustafa Yigit Bilgen's avatar
      spd: tlkd: support new TLK SMCs for RPMB service · bd0c2f8d
      Mustafa Yigit Bilgen authored
      
      
      This patch adds support to handle following TLK SMCs:
      {TLK_SET_BL_VERSION, TLK_LOCK_BL_INTERFACE, TLK_BL_RPMB_SERVICE}
      
      These SMCs need to be supported in ATF in order to forward them to
      TLK. Otherwise, these functionalities won't work.
      
      Brief:
      TLK_SET_BL_VERSION: This SMC is issued by the bootloader to supply its
      version to TLK. TLK can use this to prevent rollback attacks.
      
      TLK_LOCK_BL_INTERFACE: This SMC is issued by bootloader before handing off
      execution to the OS. This allows preventing sensitive SMCs being used
      by the OS.
      
      TLK_BL_RPMB_SERVICE: bootloader issues this SMC to sign or verify RPMB
      frames.
      
      Tested by: Tests TLK can receive the new SMCs issued by bootloader
      
      Change-Id: I57c2d189a5f7a77cea26c3f8921866f2a6f0f944
      Signed-off-by: default avatarMustafa Yigit Bilgen <mbilgen@nvidia.com>
      bd0c2f8d