1. 11 Mar, 2020 2 commits
    • Jeetesh Burman's avatar
      Tegra194: add SE support to generate SHA256 of TZRAM · 029dd14e
      Jeetesh Burman authored
      
      
      The BL3-1 firmware code is stored in TZSRAM on Tegra194 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 to PMC scratch registers.
      
      Change-Id: I04cc0eb7f54c69d64b6c34fc2ff62e4cfbdd43b2
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      029dd14e
    • Jeetesh Burman's avatar
      Tegra194: store TZDRAM base/size to scratch registers · 2ac7b223
      Jeetesh Burman authored
      
      
      This patch saves the TZDRAM base and size values to secure scratch
      registers, for the WB0. The WB0 reads these values and uses them to
      verify integrity of the TZDRAM aperture.
      
      Change-Id: I2f5fd11c87804d20e2698de33be977991c9f6f33
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      2ac7b223
  2. 09 Mar, 2020 4 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
    • 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
    • kalyani chidambaram's avatar
      Tegra210: update the PMC blacklisted registers · 24902fae
      kalyani chidambaram authored
      
      
      Update the list to include PMC registers that the NS world cannot
      access even with smc calls.
      
      Change-Id: I588179b56ebc0c29200b55e6d61535fd3a7a3b7e
      Signed-off-by: default avatarkalyani chidambaram <kalyanic@nvidia.com>
      24902fae
  3. 25 Feb, 2020 1 commit
  4. 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
    • Varun Wadekar's avatar
      Tegra: platform handler to relocate BL32 image · 6f47acdb
      Varun Wadekar authored
      
      
      This patch provides platforms an opportunity to relocate the
      BL32 image, during cold boot. Tegra186 platforms, for example,
      relocate BL32 images to TZDRAM memory as the previous bootloader
      relies on BL31 to do so.
      
      Change-Id: Ibb864901e43aca5bf55d8c79e918b598c12e8a28
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      6f47acdb
  5. 31 Jan, 2020 2 commits
  6. 23 Jan, 2020 7 commits
  7. 17 Jan, 2020 4 commits
  8. 12 Jan, 2020 1 commit
  9. 09 Jan, 2020 2 commits
  10. 10 Dec, 2019 2 commits
  11. 28 Nov, 2019 13 commits
    • Jeetesh Burman's avatar
      Tegra194: add support to reset GPU · 2d1f1010
      Jeetesh Burman authored
      
      
      This patch adds macros, to define registers required to support GPU
      reset, for Tegra194 SoCs.
      
      Change-Id: Ifa7e0161b9e8de695a33856193f500b847a03526
      Signed-off-by: default avatarJeetesh Burman <jburman@nvidia.com>
      2d1f1010
    • Steven Kao's avatar
      Tegra194: memctrl: fix logic to check TZDRAM config register access · 95397d96
      Steven Kao authored
      
      
      This patch fixes the logic to check if the previous bootloader has
      disabled access to the TZDRAM configuration registers. The polarity
      for the bit was incorrect in the previous check.
      
      Change-Id: I7a0ba4f7b1714997508ece904c0261ca2c901a03
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      95397d96
    • 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
    • Varun Wadekar's avatar
      Tegra: include: drivers: introduce spe.h · f0222c23
      Varun Wadekar authored
      
      
      This patch introduces a header file for the spe-console driver. This
      file currently provides a device struct and a registration function
      call for clients.
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      Change-Id: Ic65c056f5bd60871d8a3f44f2c1210035f878799
      f0222c23
    • Steven Kao's avatar
      Tegra194: memctrl: platform handler for TZDRAM setup · 4e697b77
      Steven Kao authored
      
      
      This patch provides the platform with flexibility to perform custom
      steps during TZDRAM setup. Tegra194 platforms checks if the config
      registers are locked and TZDRAM setup has already been done by the
      previous bootloaders, before setting up the fence.
      
      Change-Id: Ifee7077d4b46a7031c4568934c63e361c53a12e3
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      4e697b77
    • Varun Wadekar's avatar
      Tegra194: save system suspend entry marker to TZDRAM · 040529e9
      Varun Wadekar authored
      
      
      This patch adds support to save the system suspend entry and exit
      markers to TZDRAM to help the trampoline code decide if the current
      warmboot is actually an exit from System Suspend.
      
      The Tegra194 platform handler sets the system suspend entry marker
      before entering SC7 state and the trampoline flips the state back to
      system resume, on exiting SC7.
      
      Change-Id: I29d73f1693c89ebc8d19d7abb1df1e460eb5558e
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      040529e9
    • Varun Wadekar's avatar
      Tegra194: helper functions for CPU rst handler and SMMU ctx offset · 653fc380
      Varun Wadekar authored
      
      
      This patch adds a helper function to get the SMMU context's offset
      and uses another helper function to get the CPU trampoline offset.
      These helper functions are used by the System Suspend entry sequence
      to save the SMMU context and CPU reset handler to TZDRAM.
      
      Change-Id: I95e2862fe37ccad00fa48ec165c6e4024df01147
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      653fc380
    • Varun Wadekar's avatar
      Tegra194: cleanup references to Tegra186 · 1c62509e
      Varun Wadekar authored
      
      
      This patch cleans up all references to the Tegra186 family of SoCs.
      
      Change-Id: Ife892caba5f2523debacedf8ec465289def9afd0
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      1c62509e
    • Steven Kao's avatar
      Tegra194: drivers: SE and RNG1/PKA1 context save support · 6eb3c188
      Steven Kao authored
      
      
      This patch adds the driver, to implement the programming sequence to
      save/restore hardware context, during System Suspend/Resume.
      
      Change-Id: If851a81cd4e699b58a0055d0be7f145759792ee9
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      Signed-off-by: default avatarJeff Tsai <jefft@nvidia.com>
      6eb3c188
    • Steven Kao's avatar
      Tegra194: rename secure scratch register macros · 192fd367
      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_RSV44_* -> SCRATCH_BOOT_PARAMS_ADDR_*
      - SECURE_SCRATCH_RSV97 -> SCRATCH_SECURE_BOOTP_FCFG
      - SECURE_SCRATCH_RSV99_* -> SCRATCH_SMMU_TABLE_ADDR_*
      - SECURE_SCRATCH_RSV109_* -> SCRATCH_RESET_VECTOR_*
      
      Change-Id: I838ece3da39bc4be8f349782e99bac777755fa39
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      192fd367
    • Anthony Zhou's avatar
      Tegra194: fix defects flagged by MISRA scan · b6533b56
      Anthony Zhou authored
      
      
      Main fixes:
      
      Fix invalid use of function pointer [Rule 1.3]
      
      Added explicit casts (e.g. 0U) to integers in order for them to be
      compatible with whatever operation they're used in [Rule 10.1]
      
      convert object type to match the type of function parameters
      [Rule 10.3]
      
      Force operands of an operator to the same type category [Rule 10.4]
      
      Fix implicit widening of composite assignment [Rule 10.6]
      
      Fixed if statement conditional to be essentially boolean [Rule 14.4]
      
      Added curly braces ({}) around if statements in order to
      make them compound [Rule 15.6]
      
      Voided non c-library functions whose return types are not used
      [Rule 17.7]
      
      Change-Id: I65a2b33e59aebb7746bd31544c79d57c3d5678c5
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      b6533b56
    • Steven Kao's avatar
      Tegra194: remove the GPU reset register macro · a76d4617
      Steven Kao authored
      
      
      There is a possibility that once we have checked that the GPU is
      in reset, some component can get still it out of reset.
      This patch removes the check register macro.
      
      Change-Id: Idbbba36f97e37c7db64ab9e42848a040ccd05acd
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      a76d4617
    • Varun Wadekar's avatar
      Tegra194: MC registers to allow CPU accesses to TZRAM · 1d9aad42
      Varun Wadekar authored
      
      
      This patch adds MC registers and macros to allow CPU to access
      TZRAM.
      
      Change-Id: I46da526aa760c89714f8898591981bb6cfb29237
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      1d9aad42