secure.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SECURE_H
  7. #define SECURE_H
  8. /***************************************************************************
  9. * SGRF
  10. ***************************************************************************/
  11. #define SGRF_SOC_CON(i) ((i) * 0x4)
  12. #define SGRF_DMAC_CON(i) (0x30 + (i) * 0x4)
  13. #define SGRF_MST_S_ALL_NS 0xffffffff
  14. #define SGRF_SLV_S_ALL_NS 0xffff0000
  15. #define DMA_IRQ_BOOT_NS 0xffffffff
  16. #define DMA_PERI_CH_NS_15_0 0xffffffff
  17. #define DMA_PERI_CH_NS_19_16 0x000f000f
  18. #define DMA_MANAGER_BOOT_NS 0x00010001
  19. #define DMA_SOFTRST_REQ BITS_WITH_WMASK(1, 0x1, 12)
  20. #define DMA_SOFTRST_RLS BITS_WITH_WMASK(0, 0x1, 12)
  21. /***************************************************************************
  22. * DDR FIREWALL
  23. ***************************************************************************/
  24. #define FIREWALL_DDR_FW_DDR_RGN(i) ((i) * 0x4)
  25. #define FIREWALL_DDR_FW_DDR_MST(i) (0x20 + (i) * 0x4)
  26. #define FIREWALL_DDR_FW_DDR_CON_REG 0x40
  27. #define FIREWALL_DDR_FW_DDR_RGN_NUM 8
  28. #define FIREWALL_DDR_FW_DDR_MST_NUM 6
  29. #define PLAT_MAX_DDR_CAPACITY_MB 4096
  30. #define RG_MAP_SECURE(top, base) ((((top) - 1) << 16) | (base))
  31. /**************************************************
  32. * secure timer
  33. **************************************************/
  34. /* chanal0~5 */
  35. #define STIMER_CHN_BASE(n) (STIME_BASE + 0x20 * (n))
  36. #define TIMER_LOAD_COUNT0 0x0
  37. #define TIMER_LOAD_COUNT1 0x4
  38. #define TIMER_CUR_VALUE0 0x8
  39. #define TIMER_CUR_VALUE1 0xc
  40. #define TIMER_CONTROL_REG 0x10
  41. #define TIMER_INTSTATUS 0x18
  42. #define TIMER_DIS 0x0
  43. #define TIMER_EN 0x1
  44. #define TIMER_FMODE (0x0 << 1)
  45. #define TIMER_RMODE (0x1 << 1)
  46. #define TIMER_LOAD_COUNT0_MSK (0xffffffff)
  47. #define TIMER_LOAD_COUNT1_MSK (0xffffffff00000000)
  48. void secure_timer_init(void);
  49. void sgrf_init(void);
  50. #endif /* SECURE_H */