1. 31 Aug, 2020 1 commit
    • 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
  2. 28 Aug, 2020 1 commit
    • Anthony Zhou's avatar
      Tegra: sip: add VPR resize enabled check · e9b9c2c8
      Anthony Zhou authored
      
      
      The Memory Controller provides a control register to check
      if the video memory can be resized. The previous bootloader
      might have locked this feature, which will be reflected by
      this register.
      
      This patch reads the control register before processing
      a video memory resize request. An error code, -ENOTSUP,
      is returned if the feature is locked.
      
      Change-Id: Ia1d67f7a94aa15c6b18ff5c9b9b952e179596ae3
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      e9b9c2c8
  3. 11 Mar, 2020 2 commits
    • Pritesh Raithatha's avatar
      Tegra: smmu: remove context save sequence · a391d494
      Pritesh Raithatha authored
      
      
      SMMU and MC registers are saved as part of the System Suspend sequence.
      The register list includes some NS world SMMU registers that need to be
      saved by NS world software instead. All that remains as a result are
      the MC registers.
      
      This patch moves code to MC file as a result and renames all the
      variables and defines to use the MC prefix instead of SMMU. The
      Tegra186 and Tegra194 platform ports are updated to provide the MC
      context register list to the parent driver. The memory required for
      context save is reduced due to removal of the SMMU registers.
      
      Change-Id: I83a05079039f52f9ce91c938ada6cd6dfd9c843f
      Signed-off-by: default avatarPritesh Raithatha <praithatha@nvidia.com>
      a391d494
    • Varun Wadekar's avatar
      Tegra: bpmp: fixup TEGRA_CLK_SE values for Tegra186/Tegra194 · e9044480
      Varun Wadekar authored
      
      
      This patch fixes the SE clock ID being used for Tegra186 and Tegra194
      SoCs. Previous assumption, that both SoCs use the same clock ID, was
      incorrect.
      
      Change-Id: I1ef0da5547ff2e14151b53968cad9cc78fee63bd
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      e9044480
  4. 09 Mar, 2020 2 commits
    • Jeetesh Burman's avatar
      Tegra186: add SE support to generate SHA256 of TZRAM · 4eed9c84
      Jeetesh Burman authored
      
      
      The BL3-1 firmware code is stored in TZSRAM on Tegra186 platforms. This
      memory loses power when we enter System Suspend and so its contents are
      stored to TZDRAM, before entry. This opens up an attack vector where the
      TZDRAM contents might be tampered with when we are in the System Suspend
      mode. To mitigate this attack the SE engine calculates the hash of entire
      TZSRAM and stores it in PMC scratch, before we copy data to TZDRAM. The
      WB0 code will validate the TZDRAM and match the hash with the one in PMC
      scratch.
      
      This patch adds driver for the SE engine, with APIs to calculate the hash
      and store SE SHA256 hash-result to PMC scratch registers.
      
      Change-Id: Ib487d5629225d3d99bd35d44f0402d6d3cf27ddf
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      4eed9c84
    • Jeetesh Burman's avatar
      Tegra186: add support for bpmp_ipc driver · 3827aa8a
      Jeetesh Burman authored
      
      
      This patch enables the bpmp-ipc driver for Tegra186 platforms,
      to ask BPMP firmware to toggle SE clock.
      
      Change-Id: Ie63587346c4d9b7e54767dbee17d0139fa2818ae
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      3827aa8a
  5. 31 Jan, 2020 1 commit
    • Varun Wadekar's avatar
      Tegra: per-SoC DRAM base values · 5f1803f9
      Varun Wadekar authored
      
      
      Tegra194 supports upto 64GB of DRAM, whereas the previous SoCs support
      upto 32GB DRAM. This patch moves the common DRAM base/end macros to
      individual Tegra SoC headers to fix this anomaly.
      
      Change-Id: I1a9f386b67c2311baab289e726d95cef6954071b
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      5f1803f9
  6. 31 Jan, 2019 2 commits
    • Steven Kao's avatar
      Tegra: platform dependent address space sizes · 1d11f73e
      Steven Kao authored
      
      
      This patch moves the PLAT_PHY_ADDR_SPACE_SIZE & PLAT_VIRT_ADDR_SPACE
      macros to tegra_def.h, to define the virtual/physical address space
      size on the platform.
      
      Change-Id: I1c5d264c7ffc1af0e7b14cc16ae2c0416efc76f6
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      1d11f73e
    • Jeetesh Burman's avatar
      Tegra: SiP: set GPU in reset after vpr resize · 3e28e935
      Jeetesh Burman authored
      
      
      Whenever the VPR memory is resized, the GPU is put into reset first
      and then the new VPR parameters are programmed to the memory controller
      block. There exists a scenario, where the GPU might be out before we
      program the new VPR parameters. This means, the GPU would still be
      using older settings and leak secrets.
      
      This patch puts the GPU back into reset, if it is out of reset after
      resizing VPR, to mitigate this hole.
      
      Change-Id: I38a1000e3803f80909efcb02e27da4bd46909931
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      3e28e935
  7. 23 Jan, 2019 3 commits
    • Steven Kao's avatar
      Tegra: rename secure scratch register macros · 601a8e54
      Steven Kao authored
      
      
      This patch renames all the secure scratch registers to reflect their
      usage.
      
      This is a list of all the macros being renamed:
      
      - SECURE_SCRATCH_RSV1_* -> SCRATCH_RESET_VECTOR_*
      - SECURE_SCRATCH_RSV6 -> SCRATCH_SECURE_BOOTP_FCFG
      - SECURE_SCRATCH_RSV11_* -> SCRATCH_SMMU_TABLE_ADDR_*
      - SECURE_SCRATCH_RSV53_* -> SCRATCH_BOOT_PARAMS_ADDR_*
      - SECURE_SCRATCH_RSV55_* -> SCRATCH_TZDRAM_ADDR_*
      
      NOTE: Future SoCs will have to define these macros to
            keep the drivers functioning.
      
      Change-Id: Ib3ba40dd32e77b92b47825f19c420e6fdfa8b987
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      601a8e54
    • Steven Kao's avatar
      Tegra: memctrl_v2: allow CPU accesses to TZRAM · d6306d14
      Steven Kao authored
      
      
      This patch enables CPU access configuration register to allow
      accesses to the TZRAM aperture on chips after Tegra186.
      
      Change-Id: I0898582f8bd6fd35360ecf8ca5cee21fe35f7aab
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      d6306d14
    • Harvey Hsieh's avatar
      Tegra: memctrl_v2: pack TZDRAM base to RSVD55_SCRATCH · b886c7c5
      Harvey Hsieh authored
      
      
      This patch saves the TZDRAM_BASE value to secure RSVD55
      scratch register. The warmboot code uses this register to
      restore the settings on exiting System Suspend.
      
      Change-Id: Id76175c2a7d931227589468511365599e2908411
      Signed-off-by: default avatarHarvey Hsieh <hhsieh@nvidia.com>
      b886c7c5
  8. 18 Jan, 2019 4 commits
    • Harvey Hsieh's avatar
      Tegra: memctrl_v2: pack TZDRAM base into SCRATCH54_LO · 70da35b0
      Harvey Hsieh authored
      
      
      This patch moves the TZDRAM base address to SCRATCH55_LO due
      to security concerns. The HI and LO address bits are packed
      into SCRATCH55_LO for the warmboot firmware to restore.
      SCRATCH54_HI is still being used for backward compatibility,
      but would be removed eventually.
      
      The scratch registers are populated as:
      * RSV55_0 = CFG1[12:0] | CFG0[31:20]
      * RSV55_1 = CFG3[1:0]
      * RSV54_1 = CFG1[12:0]
      
      Change-Id: Idc20d165d8117488010fcc8dfd946f7ad475da58
      Signed-off-by: default avatarHarvey Hsieh <hhsieh@nvidia.com>
      70da35b0
    • Anthony Zhou's avatar
      Tegra: fix defects flagged by MISRA Rule 10.3 · aa64c5fb
      Anthony Zhou authored
      
      
      MISRA Rule 10.3, the value of an expression shall not be assigned to
      an object with a narrower essential type or of a different essential
      type category.
      
      The essential type of a enum member is anonymous enum, the enum member
      should be casted to the right type when using it.
      
      Both UL and ULL suffix equal to uint64_t constant in compiler
      aarch64-linux-gnu-gcc, to avoid confusing, only keep U and ULL suffix
      in platform code. So in some case, cast a constant to uint32_t is
      necessary.
      
      Change-Id: I1aae8cba81ef47481736e7f95f53570de7013187
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      aa64c5fb
    • Anthony Zhou's avatar
      Tegra: common: drivers: fix MISRA defects · 61beb3e0
      Anthony Zhou authored
      
      
      Main fixes:
      
      Add suffix U for constant [Rule 10.1]
      
      Match the operands type [Rule 10.4]
      
      Use UL replace U for that constant define that need do "~"
      operation [Rule 12.4]
      
      Voided non c-library functions whose return types are not used
       [Rule 17.7]
      
      Change-Id: Ia1e814ca3890eab7904be9c79030502408f30936
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      61beb3e0
    • Varun Wadekar's avatar
      Tegra: gpcdma: driver for general purpose DMA · 647d4a03
      Varun Wadekar authored
      
      
      This patch adds the driver for the general purpose DMA hardware
      block on newer Tegra SoCs. The GPCDMA is a special purpose DMA
      used to speed up memory copy operations to/from DRAM and TZSRAM.
      
      This patch introduces a macro 'USE_GPC_DMA' to allow platforms
      to override CPU based memory operations.
      
      Change-Id: I3170d409c83b77e785437b1002a8d70188fabbeb
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      647d4a03
  9. 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
  10. 08 Nov, 2018 1 commit
    • Antonio Nino Diaz's avatar
      Standardise header guards across codebase · c3cf06f1
      Antonio Nino Diaz authored
      
      
      All identifiers, regardless of use, that start with two underscores are
      reserved. This means they can't be used in header guards.
      
      The style that this project is now to use the full name of the file in
      capital letters followed by 'H'. For example, for a file called
      "uart_example.h", the header guard is UART_EXAMPLE_H.
      
      The exceptions are files that are imported from other projects:
      
      - CryptoCell driver
      - dt-bindings folders
      - zlib headers
      
      Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      c3cf06f1
  11. 15 Jun, 2017 2 commits
  12. 03 May, 2017 1 commit
  13. 01 May, 2017 2 commits
  14. 13 Apr, 2017 1 commit
  15. 07 Apr, 2017 3 commits
  16. 05 Apr, 2017 4 commits
  17. 30 Mar, 2017 4 commits
  18. 27 Mar, 2017 1 commit
  19. 23 Mar, 2017 2 commits
    • Varun Wadekar's avatar
      Tegra186: enable support for simulation environment · abd3a91d
      Varun Wadekar authored
      
      
      The Tegra simulation environment has limited capabilities. This patch
      checks the chip's major and minor versions to decide the features to
      enable/disable - MCE firmware version checking is disabled and limited
      Memory Controller settings are enabled
      
      Change-Id: I258a807cc3b83cdff14a9975b4ab4f9d1a9d7dcf
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      abd3a91d
    • Varun Wadekar's avatar
      Tegra186: re-configure MSS' client settings · e64ce3ab
      Varun Wadekar authored
      
      
      This patch reprograms MSS to make ROC deal with ordering of
      MC traffic after boot and system suspend exit. This is needed
      as device boots with MSS having all control but POR wants ROC
      to deal with the ordering. Performance is expected to improve
      with ROC but since no one has really tested the performance,
      keep the option configurable for now by introducing a platform
      level makefile variable.
      
      Change-Id: I2e782fea138ccf9d281eb043a6b2c3bb97c839a7
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      e64ce3ab
  20. 22 Mar, 2017 1 commit
    • Varun Wadekar's avatar
      Tegra186: implement support for System Suspend · 50402b17
      Varun Wadekar authored
      
      
      This patch adds the chip level support for System Suspend entry
      and exit. As part of the entry sequence we first query the MCE
      firmware to check if it is safe to enter system suspend. Once
      we get a green light, we save hardware block settings and enter
      the power state. As expected, all the hardware settings are
      restored once we exit the power state.
      
      Change-Id: I6d192d7568d6a555eb10efdfd45f6d79c20f74ea
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      50402b17
  21. 20 Mar, 2017 1 commit