juno_tzmp1_def.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef JUNO_TZMP1_DEF_H
  7. #define JUNO_TZMP1_DEF_H
  8. /*
  9. * Public memory regions for both protected and non-protected mode
  10. *
  11. * OPTEE shared memory 0xFEE00000 - 0xFEFFFFFF
  12. */
  13. #define JUNO_AP_TZC_SHARE_DRAM1_SIZE ULL(0x02000000)
  14. #define JUNO_AP_TZC_SHARE_DRAM1_BASE (ARM_AP_TZC_DRAM1_BASE - \
  15. JUNO_AP_TZC_SHARE_DRAM1_SIZE)
  16. #define JUNO_AP_TZC_SHARE_DRAM1_END (ARM_AP_TZC_DRAM1_BASE - 1)
  17. /* ARM_MEDIA_FEATURES for MEDIA GPU Protect Mode Test */
  18. #define JUNO_TZC400_NSAID_FPGA_MEDIA_SECURE 8 /* GPU/DPU protected, VPU outbuf */
  19. #define JUNO_TZC400_NSAID_FPGA_VIDEO_PROTECTED 7 /* VPU protected */
  20. #define JUNO_TZC400_NSAID_FPGA_VIDEO_PRIVATE 10 /* VPU private (firmware) */
  21. #define JUNO_VPU_TZC_PRIV_DRAM1_SIZE ULL(0x02000000)
  22. #define JUNO_VPU_TZC_PRIV_DRAM1_BASE (JUNO_AP_TZC_SHARE_DRAM1_BASE - \
  23. JUNO_VPU_TZC_PRIV_DRAM1_SIZE)
  24. #define JUNO_VPU_TZC_PRIV_DRAM1_END (JUNO_AP_TZC_SHARE_DRAM1_BASE - 1)
  25. /* Video input protected buffer follows upper item */
  26. #define JUNO_VPU_TZC_PROT_DRAM1_SIZE ULL(0x06000000)
  27. #define JUNO_VPU_TZC_PROT_DRAM1_BASE (JUNO_VPU_TZC_PRIV_DRAM1_BASE - \
  28. JUNO_VPU_TZC_PROT_DRAM1_SIZE)
  29. #define JUNO_VPU_TZC_PROT_DRAM1_END (JUNO_VPU_TZC_PRIV_DRAM1_BASE - 1)
  30. /* Video, graphics and display shares same NSAID and same protected buffer */
  31. #define JUNO_MEDIA_TZC_PROT_DRAM1_SIZE ULL(0x0e000000)
  32. #define JUNO_MEDIA_TZC_PROT_DRAM1_BASE (JUNO_VPU_TZC_PROT_DRAM1_BASE - \
  33. JUNO_MEDIA_TZC_PROT_DRAM1_SIZE)
  34. #define JUNO_MEDIA_TZC_PROT_DRAM1_END (JUNO_VPU_TZC_PROT_DRAM1_BASE - 1)
  35. /* Rest of DRAM1 are Non-Secure public buffer */
  36. #define JUNO_NS_DRAM1_PT1_BASE ARM_DRAM1_BASE
  37. #define JUNO_NS_DRAM1_PT1_END (JUNO_MEDIA_TZC_PROT_DRAM1_BASE - 1)
  38. #define JUNO_NS_DRAM1_PT1_SIZE (JUNO_NS_DRAM1_PT1_END - \
  39. JUNO_NS_DRAM1_PT1_BASE + 1)
  40. /* TZC filter flags */
  41. #define JUNO_MEDIA_TZC_NS_DEV_ACCESS (PLAT_ARM_TZC_NS_DEV_ACCESS | \
  42. TZC_REGION_ACCESS_RD(JUNO_TZC400_NSAID_FPGA_MEDIA_SECURE))
  43. /* VPU / GPU /DPU protected access */
  44. #define JUNO_MEDIA_TZC_PROT_ACCESS \
  45. (TZC_REGION_ACCESS_RDWR(JUNO_TZC400_NSAID_FPGA_MEDIA_SECURE) | \
  46. TZC_REGION_ACCESS_WR(TZC400_NSAID_AP))
  47. #define JUNO_VPU_TZC_PROT_ACCESS \
  48. (TZC_REGION_ACCESS_RDWR(JUNO_TZC400_NSAID_FPGA_VIDEO_PROTECTED))
  49. #define JUNO_VPU_TZC_PRIV_ACCESS \
  50. (TZC_REGION_ACCESS_RDWR(JUNO_TZC400_NSAID_FPGA_VIDEO_PRIVATE))
  51. /*******************************************************************************
  52. * Mali-DP650 related constants
  53. ******************************************************************************/
  54. /* Base address of DP650 */
  55. #define DP650_BASE 0x6f200000
  56. /* offset to PROT_NSAID register */
  57. #define DP650_PROT_NSAID_OFFSET 0x10004
  58. /* config to PROT_NSAID register */
  59. #define DP650_PROT_NSAID_CONFIG 0x08008888
  60. /*******************************************************************************
  61. * Mali-V550 related constants
  62. ******************************************************************************/
  63. /* Base address of V550 */
  64. #define V550_BASE 0x6f030000
  65. /* offset to PROTCTRL register */
  66. #define V550_PROTCTRL_OFFSET 0x0040
  67. /* config to PROTCTRL register */
  68. #define V550_PROTCTRL_CONFIG 0xa8700000
  69. #endif /* JUNO_TZMP1_DEF_H */