1. 01 Apr, 2020 1 commit
  2. 11 Mar, 2020 1 commit
  3. 09 Mar, 2020 1 commit
    • Harvey Hsieh's avatar
      Tegra210: SE: add context save support · 41554fb2
      Harvey Hsieh authored
      
      
      Tegra210B01 SoCs support atomic context save for the two SE
      hardware engines. Tegra210 SoCs have support for only one SE
      engine and support a software based save/restore mechanism
      instead.
      
      This patch updates the SE driver to make this change.
      
      Change-Id: Ia5e5ed75d0fe011f17809684bbc2ed2338925946
      Signed-off-by: default avatarHarvey Hsieh <hhsieh@nvidia.com>
      41554fb2
  4. 25 Feb, 2020 1 commit
  5. 20 Feb, 2020 2 commits
    • Varun Wadekar's avatar
      Tegra: handler to check support for System Suspend · 5d52aea8
      Varun Wadekar authored
      
      
      Tegra210 SoCs need the sc7entry-fw to enter System Suspend mode,
      but there might be certain boards that do not have this firmware
      blob. To stop the NS world from issuing System suspend entry
      commands on such devices, we ned to disable System Suspend from
      the PSCI "features".
      
      This patch removes the System suspend handler from the Tegra PSCI
      ops, so that the framework will disable support for "System Suspend"
      from the PSCI "features".
      
      Original change by: kalyani chidambaram <kalyanic@nvidia.com>
      
      Change-Id: Ie029f82f55990a8b3a6debb73e95e0e218bfd1f5
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      5d52aea8
    • kalyani chidambaram's avatar
      Tegra210: secure PMC hardware block · 37f76024
      kalyani chidambaram authored
      
      
      This patch sets the "secure" bit to mark the PMC hardware block
      as accessible only from the secure world. This setting must be
      programmed during cold boot and System Resume.
      
      The sc7entry-fw, running on the COP, needs access to the PMC block
      to enter System Suspend state, so "unlock" the PMC block before
      passing control to the COP.
      
      Change-Id: I00e39a49ae6b9f8c8eafe0cf7ff63fe6a67fdccf
      Signed-off-by: default avatarkalyani chidambaram <kalyanic@nvidia.com>
      37f76024
  6. 31 Jan, 2020 1 commit
    • Varun Wadekar's avatar
      Tegra: remove weakly defined platform setup handlers · 39171cd0
      Varun Wadekar authored
      
      
      This patch converts the weakly defined platform setup handlers into
      actual platform specific handlers to improve code coverage numbers
      and some MISRA defects.
      
      The weakly defined handlers never get executed thus resulting in
      lower coverage - function, function calls, statements, branches
      and pairs.
      
      Change-Id: I02f450f66b5754a90d934df4d76eb91459fca5f9
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      39171cd0
  7. 28 Nov, 2019 1 commit
    • Varun Wadekar's avatar
      Tegra: introduce plat_enable_console() · 117dbe6c
      Varun Wadekar authored
      
      
      This patch introduces the 'plat_enable_console' handler to allow
      the platform to enable the right console. Tegra194 platform supports
      multiple console, while all the previous platforms support only one
      console.
      
      For Tegra194 platforms, the previous bootloader checks the platform
      config and sets the uart-id boot parameter, to 0xFE. On seeing this
      boot parameter, the platform port uses the proper memory aperture
      base address to communicate with the SPE. This functionality is
      currently protected by a platform macro, ENABLE_CONSOLE_SPE.
      
      Change-Id: I3972aa376d66bd10d868495f561dc08fe32fcb10
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      117dbe6c
  8. 03 Apr, 2019 1 commit
  9. 05 Feb, 2019 1 commit
  10. 31 Jan, 2019 5 commits
    • Varun Wadekar's avatar
      Tegra: restrict non-secure PMC accesses · a01b0f16
      Varun Wadekar authored
      
      
      Platforms that do not support bpmp firmware, do not need access
      to the PMC block from outside of the CPU complex. The agents
      running on the CPU can always access the PMC through the EL3
      exception space.
      
      This patch restricts non-secure world access to the PMC block on
      such platforms.
      
      Change-Id: I2c4318dc07ddf6407c1700595e0f4aac377ba258
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      a01b0f16
    • Varun Wadekar's avatar
      Tegra210: move sc7entry-fw inside the TZDRAM fence · 7350277b
      Varun Wadekar authored
      
      
      This patch uses the sc7entry-fw base/size values to calculate the
      TZDRAM fence, so as to move sc7entry-fw inside the TZDRAM fence.
      
      Change-Id: I91aeeeece857076c478cdc4c18a6ad70dc265031
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      7350277b
    • Varun Wadekar's avatar
      Tegra210: power off all DMA masters before System Suspend entry · 2d5560f9
      Varun Wadekar authored
      
      
      This patch puts all the DMA masters in reset before starting the System
      Suspend sequence. This helps us make sure that there are no rogue agents
      in the system trying to over-write the SC7 Entry Firmware with their own.
      
      Change-Id: I7eb39999d229951e612fbfeb9f86c4efb8f98b5a
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      2d5560f9
    • Varun Wadekar's avatar
      Tegra: support for System Suspend using sc7entry-fw binary · 3ca3c27c
      Varun Wadekar authored
      
      
      This patch adds support to enter System Suspend on Tegra210 platforms
      without the traditional BPMP firmware. The BPMP firmware will no longer
      be supported on Tegra210 platforms and its functionality will be
      divided across the CPU and sc7entry-fw.
      
      The sc7entry-fw takes care of performing the hardware sequence required
      to enter System Suspend (SC7 power state) from the COP. The CPU is required
      to load this firmware to the internal RAM of the COP and start the sequence.
      The CPU also make sure that the COP is off after cold boot and is only
      powered on when we want to start the actual System Suspend sequence.
      
      The previous bootloader loads the firmware to TZDRAM and passes its base and
      size as part of the boot parameters. The EL3 layer is supposed to sanitize
      the parameters before touching the firmware blob.
      
      To assist the warmboot code with the PMIC discovery, EL3 is also supposed to
      program PMC's scratch register #210, with appropriate values. Without these
      settings the warmboot code wont be able to get the device out of System
      Suspend.
      
      Change-Id: I5a7b868512dbfd6cfefd55acf3978a1fd7ebf1e2
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      3ca3c27c
    • Varun Wadekar's avatar
      Tegra210: Enable WDT_CPU interrupt for FIQ Debugger · 51a5e593
      Varun Wadekar authored
      
      
      This patch enables the watchdog timer's interrupt as an FIQ
      interrupt to the CPU. The interrupt generated by the watchdog
      is connected to the flow controller for power management reasons,
      and needs to be routed to the GICD for it to reach the CPU.
      
      Change-Id: I9437b516da2c5d763eca72694ed7f3c7389b3d9e
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      51a5e593
  11. 16 Jan, 2019 5 commits
  12. 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
  13. 17 Feb, 2018 1 commit
    • Andreas Färber's avatar
      tegra: Fix mmap_region_t struct mismatch · 28db3e96
      Andreas Färber authored
      Commit fdb1964c
      
       ("xlat: Introduce
      MAP_REGION2() macro") added a granularity field to mmap_region_t.
      
      Tegra platforms were using the v2 xlat_tables implementation in
      common/tegra_common.mk, but v1 xlat_tables.h headers in soc/*/plat_setup.c
      where arrays are being defined. This caused the next physical address to
      be read as granularity, causing EINVAL error and triggering an assert.
      
      Consistently use xlat_tables_v2.h header to avoid this.
      
      Fixes ARM-software/tf-issues#548.
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      28db3e96
  14. 03 May, 2017 1 commit
  15. 28 Feb, 2017 1 commit
    • Varun Wadekar's avatar
      Tegra: GIC: enable FIQ interrupt handling · d3360301
      Varun Wadekar authored
      
      
      Tegra chips support multiple FIQ interrupt sources. These interrupts
      are enabled in the GICD/GICC interfaces by the tegra_gic driver. A
      new FIQ handler would be added in a subsequent change which can be
      registered by the platform code.
      
      This patch adds the GIC programming as part of the tegra_gic_setup()
      which now takes an array of all the FIQ interrupts to be enabled for
      the platform. The Tegra132 and Tegra210 platforms right now do not
      register for any FIQ interrupts themselves, but will definitely use
      this support in the future.
      
      Change-Id: I0ea164be901cd6681167028fea0567399f18d4b8
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      d3360301
  16. 22 Feb, 2017 1 commit
    • Varun Wadekar's avatar
      Tegra: init normal/crash console for platforms · e1084216
      Varun Wadekar authored
      
      
      The BL2 fills in the UART controller ID to be used as the normal as
      well as the crash console on Tegra platforms. The controller ID to
      UART controller base address mapping is handled by each Tegra SoC
      the base addresses might change across Tegra chips.
      
      This patch adds the handler to parse the platform params to get the
      UART ID for the per-soc handlers.
      
      Change-Id: I4d167b20a59aaf52a31e2a8edf94d8d6f89598fa
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      e1084216
  17. 20 May, 2016 1 commit
  18. 21 Apr, 2016 1 commit
    • Yatharth Kochar's avatar
      Move `plat_get_syscnt_freq()` to arm_common.c · c073fda1
      Yatharth Kochar authored
      This patch moves the definition for `plat_get_syscnt_freq()`
      from arm_bl31_setup.c to arm_common.c. This could be useful
      in case a delay timer needs to be installed based on the
      generic timer in other BLs.
      This patch also modifies the return type for this function
      from `uint64_t` to `unsigned long long` within ARM and other
      platform files.
      
      Change-Id: Iccdfa811948e660d4fdcaae60ad1d700e4eda80d
      c073fda1
  19. 04 Dec, 2015 1 commit
  20. 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
  21. 31 Mar, 2015 1 commit
  22. 15 Aug, 2014 1 commit
    • Achin Gupta's avatar
      Unmask SError interrupt and clear SCR_EL3.EA bit · 0c8d4fef
      Achin Gupta authored
      This patch disables routing of external aborts from lower exception levels to
      EL3 and ensures that a SError interrupt generated as a result of execution in
      EL3 is taken locally instead of a lower exception level.
      
      The SError interrupt is enabled in the TSP code only when the operation has not
      been directly initiated by the normal world. This is to prevent the possibility
      of an asynchronous external abort which originated in normal world from being
      taken when execution is in S-EL1.
      
      Fixes ARM-software/tf-issues#153
      
      Change-Id: I157b996c75996d12fd86d27e98bc73dd8bce6cd5
      0c8d4fef
  23. 28 Jul, 2014 1 commit
    • Achin Gupta's avatar
      Simplify management of SCTLR_EL3 and SCTLR_EL1 · ec3c1003
      Achin Gupta authored
      This patch reworks the manner in which the M,A, C, SA, I, WXN & EE bits of
      SCTLR_EL3 & SCTLR_EL1 are managed. The EE bit is cleared immediately after reset
      in EL3. The I, A and SA bits are set next in EL3 and immediately upon entry in
      S-EL1. These bits are no longer managed in the blX_arch_setup() functions. They
      do not have to be saved and restored either. The M, WXN and optionally the C
      bit are set in the enable_mmu_elX() function. This is done during both the warm
      and cold boot paths.
      
      Fixes ARM-software/tf-issues#226
      
      Change-Id: Ie894d1a07b8697c116960d858cd138c50bc7a069
      ec3c1003
  24. 24 Jun, 2014 1 commit
  25. 23 Jun, 2014 1 commit
    • Andrew Thoelke's avatar
      Initialise CPU contexts from entry_point_info · 167a9357
      Andrew Thoelke authored
      Consolidate all BL3-1 CPU context initialization for cold boot, PSCI
      and SPDs into two functions:
      *  The first uses entry_point_info to initialize the relevant
         cpu_context for first entry into a lower exception level on a CPU
      *  The second populates the EL1 and EL2 system registers as needed
         from the cpu_context to ensure correct entry into the lower EL
      
      This patch alters the way that BL3-1 determines which exception level
      is used when first entering EL1 or EL2 during cold boot - this is now
      fully determined by the SPSR value in the entry_point_info for BL3-3,
      as set up by the platform code in BL2 (or otherwise provided to BL3-1).
      
      In the situation that EL1 (or svc mode) is selected for a processor
      that supports EL2, the context management code will now configure all
      essential EL2 register state to ensure correct execution of EL1. This
      allows the platform code to run non-secure EL1 payloads directly
      without requiring a small EL2 stub or OS loader.
      
      Change-Id: If9fbb2417e82d2226e47568203d5a369f39d3b0f
      167a9357
  26. 07 May, 2014 2 commits
    • Andrew Thoelke's avatar
      Correct usage of data and instruction barriers · 8cec598b
      Andrew Thoelke authored
      The current code does not always use data and instruction
      barriers as required by the architecture and frequently uses
      barriers excessively due to their inclusion in all of the
      write_*() helper functions.
      
      Barriers should be used explicitly in assembler or C code
      when modifying processor state that requires the barriers in
      order to enable review of correctness of the code.
      
      This patch removes the barriers from the helper functions and
      introduces them as necessary elsewhere in the code.
      
      PORTING NOTE: check any port of Trusted Firmware for use of
      system register helper functions for reliance on the previous
      barrier behaviour and add explicit barriers as necessary.
      
      Fixes ARM-software/tf-issues#92
      
      Change-Id: Ie63e187404ff10e0bdcb39292dd9066cb84c53bf
      8cec598b
    • Andrew Thoelke's avatar
      Set processor endianness immediately after RESET · 40fd0725
      Andrew Thoelke authored
      SCTLR_EL3.EE is being configured too late in bl1_arch_setup() and
      bl31_arch_setup() after data accesses have already occured on
      the cold and warm boot paths.
      
      This control bit must be configured immediately on CPU reset to
      match the endian state of the firmware (little endian).
      
      Fixes ARM-software/tf-issues#145
      
      Change-Id: Ie12e46fbbed6baf024c30beb50751591bb8c8655
      40fd0725
  27. 06 May, 2014 1 commit
    • Dan Handley's avatar
      Reduce deep nesting of header files · 97043ac9
      Dan Handley authored
      Reduce the number of header files included from other header
      files as much as possible without splitting the files. Use forward
      declarations where possible. This allows removal of some unnecessary
      "#ifndef __ASSEMBLY__" statements.
      
      Also, review the .c and .S files for which header files really need
      including and reorder the #include statements alphabetically.
      
      Fixes ARM-software/tf-issues#31
      
      Change-Id: Iec92fb976334c77453e010b60bcf56f3be72bd3e
      97043ac9
  28. 08 Apr, 2014 2 commits
    • Sandrine Bailleux's avatar
      Define frequency of system counter in platform code · 9e86490f
      Sandrine Bailleux authored
      BL3-1 architecture setup code programs the system counter frequency
      into the CNTFRQ_EL0 register. This frequency is defined by the
      platform, though. This patch introduces a new platform hook that
      the architecture setup code can call to retrieve this information.
      In the ARM FVP port, this returns the first entry of the frequency
      modes table from the memory mapped generic timer.
      
      All system counter setup code has been removed from BL1 as some
      platforms may not have initialized the system counters at this stage.
      The platform specific settings done exclusively in BL1 have been moved
      to BL3-1. In the ARM FVP port, this consists in enabling and
      initializing the System level generic timer. Also, the frequency change
      request in the counter control register has been set to 0 to make it
      explicit it's using the base frequency. The CNTCR_FCREQ() macro has been
      fixed in this context to give an entry number rather than a bitmask.
      
      In future, when support for firmware update is implemented, there
      is a case where BL1 platform specific code will need to program
      the counter frequency. This should be implemented at that time.
      
      This patch also updates the relevant documentation.
      
      It properly fixes ARM-software/tf-issues#24
      
      Change-Id: If95639b279f75d66ac0576c48a6614b5ccb0e84b
      9e86490f
    • Sandrine Bailleux's avatar
      Revert "Move architecture timer setup to platform-specific code" · 65a9c0e9
      Sandrine Bailleux authored
      This reverts commit 1c297bf0
      because it introduced a bug: the CNTFRQ_EL0 register was no
      longer programmed by all CPUs.  bl31_platform_setup() function
      is invoked only in the cold boot path and consequently only
      on the primary cpu.
      
      A subsequent commit will correctly implement the necessary changes
      to the counter frequency setup code.
      
      Fixes ARM-software/tf-issues#125
      
      Conflicts:
      
      	docs/firmware-design.md
      	plat/fvp/bl31_plat_setup.c
      
      Change-Id: Ib584ad7ed069707ac04cf86717f836136ad3ab54
      65a9c0e9
  29. 21 Mar, 2014 1 commit
    • Vikram Kanigiri's avatar
      Remove partially qualified asm helper functions · 6ba0b6d6
      Vikram Kanigiri authored
      Each ARM Trusted Firmware image should know in which EL it is running
      and it should use the corresponding register directly instead of reading
      currentEL and knowing which asm register to read/write
      
      Change-Id: Ief35630190b6f07c8fbb7ba6cb20db308f002945
      6ba0b6d6