secure.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2024, Rockchip, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SECURE_H
  7. #define SECURE_H
  8. /* DSUSGRF */
  9. #define DSU_SGRF_SOC_CON(i) ((i) * 4)
  10. #define DSUSGRF_SOC_CON(i) ((i) * 4)
  11. #define DSUSGRF_SOC_CON_CNT 13
  12. #define DSUSGRF_DDR_HASH_CON(i) (0x240 + (i) * 4)
  13. #define DSUSGRF_DDR_HASH_CON_CNT 8
  14. /* PMUSGRF */
  15. #define PMU1SGRF_SOC_CON(n) ((n) * 4)
  16. /* SGRF */
  17. #define SGRF_SOC_CON(i) ((i) * 4)
  18. #define SGRF_FIREWALL_CON(i) (0x240 + (i) * 4)
  19. #define SGRF_FIREWALL_CON_CNT 32
  20. /* ddr firewall */
  21. #define FIREWALL_DDR_RGN(i) ((i) * 0x4)
  22. #define FIREWALL_DDR_RGN_CNT 16
  23. #define FIREWALL_DDR_MST(i) (0x40 + (i) * 0x4)
  24. #define FIREWALL_DDR_MST_CNT 42
  25. #define FIREWALL_DDR_CON 0xf0
  26. #define FIREWALL_SYSMEM_RGN(i) ((i) * 0x4)
  27. #define FIREWALL_SYSMEM_RGN_CNT 8
  28. #define FIREWALL_SYSMEM_MST(i) (0x40 + (i) * 0x4)
  29. #define FIREWALL_SYSMEM_MST_CNT 43
  30. #define FIREWALL_SYSMEM_CON 0xf0
  31. #define FIREWALL_DSU_RGN(i) ((i) * 0x4)
  32. #define FIREWALL_DSU_RGN_CNT 16
  33. #define FIREWALL_DSU_MST(i) (0x40 + (i) * 0x4)
  34. #define FIREWALL_DSU_MST_CNT 2
  35. #define FIREWALL_DSU_CON(i) (0xf0 + (i) * 4)
  36. #define FIREWALL_DSU_CON_CNT 4
  37. #define PLAT_MAX_DDR_CAPACITY_MB 0x8000 /* for 32Gb */
  38. #define RG_MAP_SECURE(top, base) \
  39. (((((top) - 1) & 0x7fff) << 16) | ((base) & 0x7fff))
  40. #define RG_MAP_SRAM_SECURE(top_kb, base_kb) \
  41. (((((top_kb) / 4 - 1) & 0xff) << 16) | ((base_kb) / 4 & 0xff))
  42. void secure_timer_init(void);
  43. void sgrf_init(void);
  44. #endif /* SECURE_H */