1. 09 Aug, 2020 2 commits
  2. 22 Mar, 2020 1 commit
    • Ken Chang's avatar
      Tegra: memctrl: map video memory as uncached · 9b51aa87
      Ken Chang authored
      
      
      Memmap video memory as uncached normal memory by adding flag
      'MT_NON_CACHEABLE' in mmap_add_dynamic_region().
      This improves the time taken for clearing the non-overlapping video
      memory:
      
      test conditions: 32MB memory size, EMC running at 1866MHz, t186
      1) without MT_NON_CACHEABLE: 30ms ~ 40ms
      <3>[  133.852885]  vpr-heap: update vpr base to 0x00000000c6000000, size=e000000
      <3>[  133.860471] _tegra_set_vpr_params[120]: begin
      <3>[  133.896481] _tegra_set_vpr_params[123]: end
      <3>[  133.908944]  vpr-heap: update vpr base to 0x00000000c6000000, size=c000000
      <3>[  133.916397] _tegra_set_vpr_params[120]: begin
      <3>[  133.956369] _tegra_set_vpr_params[123]: end
      <3>[  133.970394]  vpr-heap: update vpr base to 0x00000000c6000000, size=a000000
      <3>[  133.977934] _tegra_set_vpr_params[120]: begin
      <3>[  134.013874] _tegra_set_vpr_params[123]: end
      <3>[  134.025666]  vpr-heap: update vpr base to 0x00000000c6000000, size=8000000
      <3>[  134.033512] _tegra_set_vpr_params[120]: begin
      <3>[  134.065996] _tegra_set_vpr_params[123]: end
      <3>[  134.075465]  vpr-heap: update vpr base to 0x00000000c6000000, size=6000000
      <3>[  134.082923] _tegra_set_vpr_params[120]: begin
      <3>[  134.113119] _tegra_set_vpr_params[123]: end
      <3>[  134.123448]  vpr-heap: update vpr base to 0x00000000c6000000, size=4000000
      <3>[  134.130790] _tegra_set_vpr_params[120]: begin
      <3>[  134.162523] _tegra_set_vpr_params[123]: end
      <3>[  134.172413]  vpr-heap: update vpr base to 0x00000000c6000000, size=2000000
      <3>[  134.179772] _tegra_set_vpr_params[120]: begin
      <3>[  134.209142] _tegra_set_vpr_params[123]: end
      
      2) with MT_NON_CACHEABLE: 10ms ~ 18ms
      <3>[  102.108702]  vpr-heap: update vpr base to 0x00000000c6000000, size=e000000
      <3>[  102.116296] _tegra_set_vpr_params[120]: begin
      <3>[  102.134272] _tegra_set_vpr_params[123]: end
      <3>[  102.145839]  vpr-heap: update vpr base to 0x00000000c6000000, size=c000000
      <3>[  102.153226] _tegra_set_vpr_params[120]: begin
      <3>[  102.164201] _tegra_set_vpr_params[123]: end
      <3>[  102.172275]  vpr-heap: update vpr base to 0x00000000c6000000, size=a000000
      <3>[  102.179638] _tegra_set_vpr_params[120]: begin
      <3>[  102.190342] _tegra_set_vpr_params[123]: end
      <3>[  102.197524]  vpr-heap: update vpr base to 0x00000000c6000000, size=8000000
      <3>[  102.205085] _tegra_set_vpr_params[120]: begin
      <3>[  102.216112] _tegra_set_vpr_params[123]: end
      <3>[  102.224080]  vpr-heap: update vpr base to 0x00000000c6000000, size=6000000
      <3>[  102.231387] _tegra_set_vpr_params[120]: begin
      <3>[  102.241775] _tegra_set_vpr_params[123]: end
      <3>[  102.248825]  vpr-heap: update vpr base to 0x00000000c6000000, size=4000000
      <3>[  102.256069] _tegra_set_vpr_params[120]: begin
      <3>[  102.266368] _tegra_set_vpr_params[123]: end
      <3>[  102.273400]  vpr-heap: update vpr base to 0x00000000c6000000, size=2000000
      <3>[  102.280672] _tegra_set_vpr_params[120]: begin
      <3>[  102.290929] _tegra_set_vpr_params[123]: end
      
      Change-Id: I5f604064ce7b8b73ea9ad5860156ae5e2c6cc42a
      Signed-off-by: default avatarKen Chang <kenc@nvidia.com>
      9b51aa87
  3. 18 Jan, 2019 2 commits
  4. 04 Jan, 2019 1 commit
    • Antonio Nino Diaz's avatar
      Sanitise includes across codebase · 09d40e0e
      Antonio Nino Diaz authored
      Enforce full include path for includes. Deprecate old paths.
      
      The following folders inside include/lib have been left unchanged:
      
      - include/lib/cpus/${ARCH}
      - include/lib/el3_runtime/${ARCH}
      
      The reason for this change is that having a global namespace for
      includes isn't a good idea. It defeats one of the advantages of having
      folders and it introduces problems that are sometimes subtle (because
      you may not know the header you are actually including if there are two
      of them).
      
      For example, this patch had to be created because two headers were
      called the same way: e0ea0928 ("Fix gpio includes of mt8173 platform
      to avoid collision."). More recently, this patch has had similar
      problems: 46f9b2c3 ("drivers: add tzc380 support").
      
      This problem was introduced in commit 4ecca339
      
       ("Move include and
      source files to logical locations"). At that time, there weren't too
      many headers so it wasn't a real issue. However, time has shown that
      this creates problems.
      
      Platforms that want to preserve the way they include headers may add the
      removed paths to PLAT_INCLUDES, but this is discouraged.
      
      Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      09d40e0e
  5. 15 Jun, 2017 1 commit
  6. 03 May, 2017 1 commit
  7. 13 Apr, 2017 1 commit
    • Varun Wadekar's avatar
      Tegra: memctrl_v1: disable AHB redirection after cold boot · 0c2276e3
      Varun Wadekar authored
      
      
      During boot, USB3 and flash media (SDMMC/SATA) devices need access to
      IRAM. Because these clients connect to the MC and do not have a direct
      path to the IRAM, the MC implements AHB redirection during boot to allow
      path to IRAM. In this mode, accesses to a programmed memory address aperture
      are directed to the AHB bus, allowing access to the IRAM. The AHB aperture
      is defined by the IRAM_BASE_LO and IRAM_BASE_HI registers, which are
      initialized to disable this aperture. Once bootup is complete, we must
      program IRAM base/top, thus disabling access to IRAM.
      
      This patch provides functionality to disable this access. The tegra port
      calls this new function before jumping to the non-secure world during
      cold boot.
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      0c2276e3
  8. 10 Apr, 2017 1 commit
    • Varun Wadekar's avatar
      Tegra: memctrl_v1: enable 'xlat_table_v2' library · c05a2197
      Varun Wadekar authored
      
      
      This patch enables the 'xlat_table_v2' library for the Tegra Memory
      Controller driver. This library allows us to dynamically map/unmap
      memory regions, with MMU enabled.
      
      The Memory Controller driver maps/unmaps non-overlapping Video Memory
      region, to clean it of any secure contents, before it resizes the
      region.
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      c05a2197
  9. 05 Apr, 2017 1 commit
  10. 23 Feb, 2017 2 commits
  11. 22 Feb, 2017 1 commit
  12. 06 Feb, 2017 2 commits
    • Douglas Raillard's avatar
      Replace some memset call by zeromem · 32f0d3c6
      Douglas Raillard authored
      
      
      Replace all use of memset by zeromem when zeroing moderately-sized
      structure by applying the following transformation:
      memset(x, 0, sizeof(x)) => zeromem(x, sizeof(x))
      
      As the Trusted Firmware is compiled with -ffreestanding, it forbids the
      compiler from using __builtin_memset and forces it to generate calls to
      the slow memset implementation. Zeromem is a near drop in replacement
      for this use case, with a more efficient implementation on both AArch32
      and AArch64.
      
      Change-Id: Ia7f3a90e888b96d056881be09f0b4d65b41aa79e
      Signed-off-by: default avatarDouglas Raillard <douglas.raillard@arm.com>
      32f0d3c6
    • Douglas Raillard's avatar
      Introduce unified API to zero memory · 308d359b
      Douglas Raillard authored
      
      
      Introduce zeromem_dczva function on AArch64 that can handle unaligned
      addresses and make use of DC ZVA instruction to zero a whole block at a
      time. This zeroing takes place directly in the cache to speed it up
      without doing external memory access.
      
      Remove the zeromem16 function on AArch64 and replace it with an alias to
      zeromem. This zeromem16 function is now deprecated.
      
      Remove the 16-bytes alignment constraint on __BSS_START__ in
      firmware-design.md as it is now not mandatory anymore (it used to comply
      with zeromem16 requirements).
      
      Change the 16-bytes alignment constraints in SP min's linker script to a
      8-bytes alignment constraint as the AArch32 zeromem implementation is now
      more efficient on 8-bytes aligned addresses.
      
      Introduce zero_normalmem and zeromem helpers in platform agnostic header
      that are implemented this way:
      * AArch32:
      	* zero_normalmem: zero using usual data access
      	* zeromem: alias for zero_normalmem
      * AArch64:
      	* zero_normalmem: zero normal memory  using DC ZVA instruction
      	                  (needs MMU enabled)
      	* zeromem: zero using usual data access
      
      Usage guidelines: in most cases, zero_normalmem should be preferred.
      
      There are 2 scenarios where zeromem (or memset) must be used instead:
      * Code that must run with MMU disabled (which means all memory is
        considered device memory for data accesses).
      * Code that fills device memory with null bytes.
      
      Optionally, the following rule can be applied if performance is
      important:
      * Code zeroing small areas (few bytes) that are not secrets should use
        memset to take advantage of compiler optimizations.
      
        Note: Code zeroing security-related critical information should use
        zero_normalmem/zeromem instead of memset to avoid removal by
        compilers' optimizations in some cases or misbehaving versions of GCC.
      
      Fixes ARM-software/tf-issues#408
      
      Change-Id: Iafd9663fc1070413c3e1904e54091cf60effaa82
      Signed-off-by: default avatarDouglas Raillard <douglas.raillard@arm.com>
      308d359b
  13. 14 Sep, 2015 1 commit
    • Vikram Kanigiri's avatar
      Tegra: Perform cache maintenance on video carveout memory · e3616819
      Vikram Kanigiri authored
      Currently, the non-overlapping video memory carveout region is cleared after
      disabling the MMU at EL3. If at any exception level the carveout region is being
      marked as cacheable, this zeroing of memory will not have an affect on the
      cached lines. Hence, we first invalidate the dirty lines and update the memory
      and invalidate again so that both caches and memory is zeroed out.
      
      Change-Id: If3b2d139ab7227f6799c0911d59e079849dc86aa
      e3616819
  14. 26 Aug, 2015 1 commit
  15. 12 Jun, 2015 1 commit
    • Varun Wadekar's avatar
      Reserve a Video Memory aperture in DRAM memory · 9a964510
      Varun Wadekar authored
      
      
      This patch adds support to reserve a memory carveout region in the
      DRAM on Tegra SoCs. The memory controller provides specific registers
      to specify the aperture's base and size. This aperture can also be
      changed dynamically in order to re-size the memory available for
      DRM video playback. In case of the new aperture not overlapping
      the previous one, the previous aperture has to be cleared before
      setting up the new one. This means we do not "leak" any video data
      to the NS world.
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      9a964510
  16. 29 May, 2015 1 commit
    • Varun Wadekar's avatar
      Support for NVIDIA's Tegra T210 SoCs · 08438e24
      Varun Wadekar authored
      
      
      T210 is the latest chip in the Tegra family of SoCs from NVIDIA. It is an
      ARM v8 dual-cluster (A57/A53) SoC, with any one of the clusters being active
      at a given point in time.
      
      This patch adds support to boot the Trusted Firmware on T210 SoCs. The patch
      also adds support to boot secondary CPUs, enter/exit core power states for
      all CPUs in the slow/fast clusters. The support to switch between clusters
      is still not available in this patch and would be available later.
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      08438e24