1. 22 Mar, 2020 1 commit
    • Anthony Zhou's avatar
      Tegra194: move cluster and CPU counter to header file. · 9aaa8882
      Anthony Zhou authored
      
      
      MISRA rules request that the cluster and CPU counter be unsigned
      values and have a suffix 'U'. If the define located in the makefile,
      this cannot be done.
      
      This patch moves the PLATFORM_CLUSTER_COUNT and PLATFORM_MAX_CPUS_PER_CLUSTER
      macros to tegra_def.h as a result.
      
      Change-Id: I9ef0beb29485729de204b4ffbb5241b039690e5a
      Signed-off-by: default avatarAnthony Zhou <anzhou@nvidia.com>
      9aaa8882
  2. 11 Mar, 2020 4 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
    • 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
  3. 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
  4. 23 Jan, 2020 4 commits
  5. 17 Jan, 2020 1 commit
  6. 12 Jan, 2020 1 commit
  7. 10 Dec, 2019 1 commit
  8. 28 Nov, 2019 17 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
    • 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: 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
    • Varun Wadekar's avatar
      Tegra194: memctrl: platform handlers to reprogram MSS · f32e8525
      Varun Wadekar authored
      
      
      Introduce platform handlers to reprogram the MSS settings.
      
      Change-Id: Ibb9a5457d1bad9ecccea619d69a62bed3bf7d861
      Signed-off-by: default avatarPuneet Saxena <puneets@nvidia.com>
      Signed-off-by: default avatarKrishna Reddy <vdumpa@nvidia.com>
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      f32e8525
    • Steven Kao's avatar
      Tegra194: correct the TEGRA_CAR_RESET_BASE macro value · c1485edf
      Steven Kao authored
      
      
      This patch corrects the TEGRA_CAR_RESET_BASE macro value to
      0x20000000 from 0x200000000.
      
      Change-Id: Iba25394ea99237df85395c39059926c5a8b26a84
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      c1485edf
    • Harvey Hsieh's avatar
      Tegra194: add MC_SECURITY mask defines · c0e1bcd0
      Harvey Hsieh authored
      
      
      This patch adds masks for the TZDRAM base/size registers.
      
      Change-Id: I5f688793be8cace28d2aa2d177a295e4faffd666
      Signed-off-by: default avatarHarvey Hsieh <hhsieh@nvidia.com>
      c0e1bcd0
    • Ajay Gupta's avatar
      Tegra194: program stream ids for XUSB · bc019041
      Ajay Gupta authored
      
      
      T194 XUSB has support for XUSB virtualization. It will have one
      physical function (PF) and four Virtual function (VF)
      
      There were below two SIDs for XUSB until T186.
      1) #define TEGRA_SID_XUSB_HOST    0x1bU
      2) #define TEGRA_SID_XUSB_DEV    0x1cU
      
      We have below four new SIDs added for VF(s)
      3) #define TEGRA_SID_XUSB_VF0    0x5dU
      4) #define TEGRA_SID_XUSB_VF1    0x5eU
      5) #define TEGRA_SID_XUSB_VF2    0x5fU
      6) #define TEGRA_SID_XUSB_VF3    0x60U
      
      When virtualization is enabled then we have to disable SID override
      and program above SIDs in below newly added SID registers in XUSB
      PADCTL MMIO space. These registers are TZ protected and so need to
      be done in ATF.
      a) #define XUSB_PADCTL_HOST_AXI_STREAMID_PF_0 (0x136cU)
      b) #define XUSB_PADCTL_DEV_AXI_STREAMID_PF_0  (0x139cU)
      c) #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_0 (0x1370U)
      d) #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_1 (0x1374U)
      e) #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_2 (0x1378U)
      f) #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_3 (0x137cU)
      
      This change disables SID override and programs XUSB SIDs in
      above registers to support both virtualization and non-virtualization.
      
      Change-Id: I38213a72999e933c44c5392441f91034d3b47a39
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      bc019041
    • Steven Kao's avatar
      Tegra194: smmu: ISO support · 13dcbc6f
      Steven Kao authored
      
      
      The FPGA configuration is encoded in the high byte of
      MISCREG_EMU_REVID. Configs GPU and MAX (encoded as
      2 and 3) support the ISO SMMU, while BASE (encoded as 1)
      does not. This patch implements this encoding and returns
      the proper number of SMMU instances.
      
      Change-Id: I024286b6091120c7602f63065d20ce48bcfd13fe
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      13dcbc6f
    • Steven Kao's avatar
      Tegra194: read-modify-write ACTLR_ELx registers · 2cd2e399
      Steven Kao authored
      
      
      This patch changes direct writes to ACTLR_ELx registers to use
      read-modify-write instead.
      
      Change-Id: I536dce75c01356ce054dd2edee80875e56164439
      Signed-off-by: default avatarSteven Kao <skao@nvidia.com>
      2cd2e399
    • Varun Wadekar's avatar
      Tegra194: platform support for memctrl/smmu drivers · 719fdb6e
      Varun Wadekar authored
      
      
      This patch adds platform support for the Memory Controller and
      SMMU drivers, for the Tegra194 SoC.
      
      Change-Id: Id8b482de70f1f93bedbca8d124575c39b469927f
      Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
      719fdb6e
  9. 13 Nov, 2019 1 commit
  10. 24 Oct, 2019 4 commits