1. 31 Mar, 2018 1 commit
    • Michalis Pappas's avatar
      qemu: don't use C functions for the crash console callbacks · 0e24ea81
      Michalis Pappas authored
      
      
      Use the console_pl011_core_* functions directly in the crash console
      callbacks.
      
      This bypasses the MULTI_CONSOLE_API for the crash console (UART1), but
      allows using the crash console before the C runtime has been initialized
      (eg to call ASM_ASSERT). This retains backwards compatibility with respect
      to functionality when the old API is used.
      
      Use the MULTI_CONSOLE_API to register UART0 as the boot and runtime
      console.
      
      Fixes ARM-software/tf-issues#572
      Signed-off-by: default avatarMichalis Pappas <mpappas@fastmail.fm>
      0e24ea81
  2. 28 Mar, 2018 2 commits
  3. 27 Mar, 2018 2 commits
    • Joel Hutton's avatar
      Clean usage of void pointers to access symbols · 9f85f9e3
      Joel Hutton authored
      
      
      Void pointers have been used to access linker symbols, by declaring an
      extern pointer, then taking the address of it. This limits symbols
      values to aligned pointer values. To remove this restriction an
      IMPORT_SYM macro has been introduced, which declares it as a char
      pointer and casts it to the required type.
      
      Change-Id: I89877fc3b13ed311817bb8ba79d4872b89bfd3b0
      Signed-off-by: default avatarJoel Hutton <Joel.Hutton@Arm.com>
      9f85f9e3
    • Antonio Nino Diaz's avatar
      rpi3: Use new console APIs · e0f21f62
      Antonio Nino Diaz authored
      
      
      Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1.
      
      The crash console doesn't use this API, it uses internally the core
      functions of the 16550 console.
      
      `bl31_plat_runtime_setup` is no longer needed. When this platform port
      was introduced, that function used to disable the console. It was needed
      to override that behaviour. The new behaviour is to switch to the
      runtime console. The console is registered for all scopes (boot, crash
      and runtime) in `rpi3_console_init` so it is not needed to override the
      default behaviour anymore.
      
      Update documentation.
      
      Change-Id: If2ee8f91044216183b7ef142e5c05ad6220ae92f
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      e0f21f62
  4. 26 Mar, 2018 2 commits
  5. 24 Mar, 2018 1 commit
  6. 22 Mar, 2018 1 commit
  7. 21 Mar, 2018 1 commit
    • Antonio Nino Diaz's avatar
      Rename 'smcc' to 'smccc' · 085e80ec
      Antonio Nino Diaz authored
      
      
      When the source code says 'SMCC' it is talking about the SMC Calling
      Convention. The correct acronym is SMCCC. This affects a few definitions
      and file names.
      
      Some files have been renamed (smcc.h, smcc_helpers.h and smcc_macros.S)
      but the old files have been kept for compatibility, they include the
      new ones with an ERROR_DEPRECATED guard.
      
      Change-Id: I78f94052a502436fdd97ca32c0fe86bd58173f2f
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      085e80ec
  8. 20 Mar, 2018 2 commits
    • Michalis Pappas's avatar
      qemu: Add support for stack canary protection · f68d22e8
      Michalis Pappas authored
      
      
      Allow qemu users to enable stack protection. Since the virt platform
      does not provide an RNG, use a basic, timer-based, canary generation,
      similarly to FVP.
      
      Increase SRAM size and BL2 size to fit images when stack protection is
      enabled.
      
      Notice that stack protection is not enabled by default in qemu.
      
      Fixes ARM-software/tf-issues#568
      Signed-off-by: default avatarMichalis Pappas <mpappas@fastmail.fm>
      f68d22e8
    • Lin Huang's avatar
      rockchip/rk3399: save/restore watchdog register correctly · 56bf9407
      Lin Huang authored
      
      
      there are two fix for save/restore watchdog register:
      1. watchdog plck will shutdown after secure_watchdog_disable(), so need
         to save register before it and restore after secure_watchdog_enable().
      2. need write 0x76 to cnt_restart to keep watchdog alive when restore
         watchdog register.
      
      Change-Id: I1f6fbceae22186e3b72a87df6332a110adf37479
      Signed-off-by: default avatarLin Huang <hl@rock-chips.com>
      56bf9407
  9. 17 Mar, 2018 1 commit
    • Wang Feng's avatar
      FVP: change the method for translating MPIDR values to a linear indices · 39b21d19
      Wang Feng authored
      
      
      x3 will be assigned by the folloing instructions.
      So the first instruction is not needed any more.
      
      old method:
        (ClusterId * FVP_MAX_CPUS_PER_CLUSTER)
      + (CPUId * FVP_MAX_PE_PER_CPU)
      + ThreadId
      
      it should be
        (ClusterId * FVP_MAX_CPUS_PER_CLUSTER) * FVP_MAX_PE_PER_CPU
      + (CPUId * FVP_MAX_PE_PER_CPU)
      + ThreadId
      
      which can be simplified as:
      (ClusterId * FVP_MAX_CPUS_PER_CLUSTER + CPUId) * FVP_MAX_PE_PER_CPU + ThreadId
      Signed-off-by: default avatarWang Feng <feng_feng.wang@spreadtrum.com>
      39b21d19
  10. 15 Mar, 2018 1 commit
  11. 12 Mar, 2018 1 commit
    • Michael Brandl's avatar
      plat/hikey: boot memory layout to dedicated file · 4368ae07
      Michael Brandl authored
      
      
      Boot memory layout is specific for a platform, but should not be
      mixed up with other platform specific attributes. A separate file is
      much cleaner and better to compare with other platforms. Take a look
      at plat/poplar where it is done the same way.
      
      Moved hikey_def.h to system include folder and moved includes from
      hikey_def.h to more general platform_def.h.
      Signed-off-by: default avatarMichael Brandl <git@fineon.pw>
      4368ae07
  12. 08 Mar, 2018 2 commits
    • Antonio Nino Diaz's avatar
      tegra: Use SPDX license identifier · 41376c3a
      Antonio Nino Diaz authored
      
      
      Change-Id: I770b2db68c8d115d10067bb557e32b5e269c94a5
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      41376c3a
    • Soby Mathew's avatar
      Juno: Change the Firmware update detect mechanism · 7b56928a
      Soby Mathew authored
      
      
      Previously, Juno used to depend on the SSC_GPRETN register to inform
      about the reset syndrome. This method was removed when SCP migrated
      to the SDS framework. But even the SDS framework doesn't report the
      reset syndrome correctly and hence Juno failed to enter Firmware
      update mode if BL2 authentication failed.
      
      In addition to that, the error code populated in V2M_SYS_NVFLAGS register
      does not seem to be retained any more on Juno across resets. This could
      be down to the motherboard firmware not doing the necessary to preserve
      the value.
      
      Hence this patch modifies the Juno platform to use the same mechanism to
      trigger firmware update as FVP which is to corrupt the FIP TOC on
      authentication failure. The implementation in `fvp_err.c` is made common
      for ARM platforms and is moved to the new `arm_err.c` file in
      plat/arm/common folder. The BL1 and BL2 mmap table entries for Juno
      are modified to allow write to the Flash memory address.
      
      Change-Id: Ica7d49a3e8a46a90efd4cf340f19fda3b549e945
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      7b56928a
  13. 07 Mar, 2018 1 commit
    • Soby Mathew's avatar
      BL2U: Fix ARM platform timer initilization · 74847ab2
      Soby Mathew authored
      
      
      This issue was detected when testing FWU on Juno. The Timer
      `timer_ops` was not being initialized before being used by
      the SDS driver on Juno. This patch adds the call to
      `generic_delay_timer_init()` during bl2u_early_platform_setup().
      This is done generically for all ARM platforms because the
      cost involved is minimal.
      
      Change-Id: I349cf0bd1db68406eb2298b65f9c729f792cabdc
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      74847ab2
  14. 06 Mar, 2018 2 commits
    • Haojian Zhuang's avatar
      hikey: fix build issue with CLANG · 84b589c9
      Haojian Zhuang authored
      
      
      plat/hisilicon/hikey/hikey_bl1_setup.c:565:47:
      error: value size does not match register size specified by the
      constraint and modifier [-Werror,-Wasm-operand-widths]
              __asm__ volatile ("mrs  %0, cpacr_el1" : "=r"(data));
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@linaro.org>
      84b589c9
    • Haojian Zhuang's avatar
      hikey960: fix build issue with CLANG · 056b3d49
      Haojian Zhuang authored
      
      
      plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c:290:20:
      error: unused function 'hisi_pdc_set_intmask' [-Werror,-Wunused-function]
      static inline void hisi_pdc_set_intmask(void *pdc_base_addr,
                         ^
      1 error generated.
      Makefile:605: recipe for target 'build/hikey960/release/bl31/hisi_pwrc.o' failed
      make: *** [build/hikey960/release/bl31/hisi_pwrc.o] Error 1
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@linaro.org>
      056b3d49
  15. 05 Mar, 2018 10 commits
  16. 04 Mar, 2018 1 commit
  17. 02 Mar, 2018 2 commits
    • Soby Mathew's avatar
      Remove sp_min functions from plat_common.c · 0ed8c001
      Soby Mathew authored
      
      
      This patch removes default platform implementations of sp_min
      platform APIs from plat/common/aarch32/plat_common.c. The APIs
      are now implemented in `plat_sp_min_common.c` file within the
      same folder.
      
      The ARM platform layer had a weak definition of sp_min_platform_setup2()
      which conflicted with the weak definition in the common file. Hence this
      patch fixes that by introducing a `plat_arm_` version of the API thus
      allowing individual boards within ARM platforms to override it if they
      wish to.
      
      Fixes ARM-software/tf-issues#559
      
      Change-Id: I11a74ecae8191878ccc7ea03f12bdd5ae88faba5
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      0ed8c001
    • Roberto Vargas's avatar
      Fix FVP DRAM2 size · d0c63eaa
      Roberto Vargas authored
      
      
      This was correct according to the model specifications , but it seems
      that FVP doesn't implement it. It is safer to use the size exposed by
      the DTB which is currently used by Linux.
      
      Change-Id: I9aabe3284a50ec2a36ed94966eb7e4ddf37cec3b
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      d0c63eaa
  18. 01 Mar, 2018 1 commit
    • Dan Handley's avatar
      Suppress spurious deprecated declaration warnings · 97924e45
      Dan Handley authored
      
      
      Some generic compatibility functions emit deprecated declaration warnings
      even when platforms do not use the deprecated functions directly. This
      can be confusing. Suppress these warnings by using:
      `#pragma GCC diagnostic ignored "-Wdeprecated-declarations"`
      
      Also emit a runtime warning if the weak plat/common implemntation of
      plat_get_syscnt_freq2() is used, as this implies the platform has not
      migrated from plat_get_syscnt_freq(). The deprecated  declaration warnings
      only help detect when platforms are calling deprecated functions, not when
      they are defining deprecated functions.
      
      Fixes ARM-software/tf-issues#550
      
      Change-Id: Id14a92279c2634c1e76db8ef210da8affdbb2a5d
      Signed-off-by: default avatarDan Handley <dan.handley@arm.com>
      97924e45
  19. 28 Feb, 2018 6 commits
    • Roberto Vargas's avatar
      Fix MISRA rule 8.4 Part 2 · fd116b9f
      Roberto Vargas authored
      
      
      Rule 8.4: A compatible declaration shall be visible when
                an object or function with external linkage is defined
      
      Fixed for:
      	make DEBUG=1 PLAT=juno LOG_LEVEL=50 all
      
      Change-Id: Ic8f611da734f356566e8208053296e6c62b54709
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      fd116b9f
    • Roberto Vargas's avatar
      Fix MISRA rule 8.4 Part 1 · 1af540ef
      Roberto Vargas authored
      
      
      Rule 8.4: A compatible declaration shall be visible when
                an object or function with external linkage is defined
      
      Fixed for:
      	make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all
      
      Change-Id: I7c2ad3f5c015411c202605851240d5347e4cc8c7
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      1af540ef
    • Roberto Vargas's avatar
      Fix MISRA rule 8.3 Part 1 · dc6aad2e
      Roberto Vargas authored
      
      
      Rule 8.3: All declarations of an object or function shall
                use the same names and type qualifiers.
      
      Fixed for:
      
      	make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all
      
      Change-Id: I48201c9ef022f6bd42ea8644529afce70f9b3f22
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      dc6aad2e
    • Roberto Vargas's avatar
      Fix MISRA rule 8.4 in common code · 7fabe1a8
      Roberto Vargas authored
      
      
      Rule 8.4: A compatible declaration shall be visible when
                an object or function with external linkage is defined.
      
      Change-Id: I26e042cb251a6f9590afa1340fdac73e42f23979
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      7fabe1a8
    • Jeenu Viswambharan's avatar
      FVP: Allow building for DynamIQ systems · fe7210cd
      Jeenu Viswambharan authored
      
      
      FVPs that model DynamIQ configuration implements all CPUs in a single
      cluster. I.e., such models have a single cluster with more than 4 CPUs.
      This differs from existing default build configuration for FVP where up
      to 4 CPUs are assumed per cluster.
      
      To allow building for DynamIQ configuration, promote the macro
      FVP_MAX_CPUS_PER_CLUSTER as a build option to have it set from the build
      command line. The value of the build option defaults to 4.
      
      Change-Id: Idc3853bc95f680869b434b011c2dbd733e40c6ce
      Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      fe7210cd
    • Michalis Pappas's avatar
      qemu: Support SEPARATE_CODE_AND_RODATA · 27e0ccab
      Michalis Pappas authored
      
      
      Update qemu_configure_mmu_##_el to add an additional region for code,
      marked as MT_CODE | MT_SECURE. Update ro region attributes to NON_EXEC.
      
      Update calls to QEMU_CONFIGURE_BLx_MMU() to pass an additional region for
      code. Update calls to pass regions defined in common_def.h.
      
      Increase MAX_MMAP_REGIONS to 10.
      
      Enable SEPARATE_CODE_AND_RODATA by default on QEMU builds.
      
      Fixes ARM-software/tf-issues#558
      Signed-off-by: default avatarMichalis Pappas <mpappas@fastmail.fm>
      27e0ccab