emi_mpu_priv.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef EMI_MPU_PRIV_H
  7. #define EMI_MPU_PRIV_H
  8. #define ENABLE_EMI_MPU_SW_LOCK (0)
  9. #define EMI_MPU_CTRL (EMI_MPU_BASE + 0x000)
  10. #define EMI_MPU_DBG (EMI_MPU_BASE + 0x004)
  11. #define EMI_MPU_SA0 (EMI_MPU_BASE + 0x100)
  12. #define EMI_MPU_EA0 (EMI_MPU_BASE + 0x200)
  13. #define EMI_MPU_SA(region) (EMI_MPU_SA0 + (region * 4))
  14. #define EMI_MPU_EA(region) (EMI_MPU_EA0 + (region * 4))
  15. #define EMI_MPU_APC0 (EMI_MPU_BASE + 0x300)
  16. #define EMI_MPU_APC(region, dgroup) (EMI_MPU_APC0 + (region * 4) + (dgroup * 0x100))
  17. #define EMI_MPU_CTRL_D0 (EMI_MPU_BASE + 0x800)
  18. #define EMI_MPU_CTRL_D(domain) (EMI_MPU_CTRL_D0 + (domain * 4))
  19. #define EMI_RG_MASK_D0 (EMI_MPU_BASE + 0x900)
  20. #define EMI_RG_MASK_D(domain) (EMI_RG_MASK_D0 + (domain * 4))
  21. #define SUB_EMI_MPU_CTRL (SUB_EMI_MPU_BASE + 0x000)
  22. #define SUB_EMI_MPU_DBG (SUB_EMI_MPU_BASE + 0x004)
  23. #define SUB_EMI_MPU_SA0 (SUB_EMI_MPU_BASE + 0x100)
  24. #define SUB_EMI_MPU_EA0 (SUB_EMI_MPU_BASE + 0x200)
  25. #define SUB_EMI_MPU_SA(region) (SUB_EMI_MPU_SA0 + (region * 4))
  26. #define SUB_EMI_MPU_EA(region) (SUB_EMI_MPU_EA0 + (region * 4))
  27. #define SUB_EMI_MPU_APC0 (SUB_EMI_MPU_BASE + 0x300)
  28. #define SUB_EMI_MPU_APC(region, dgroup) (SUB_EMI_MPU_APC0 + (region * 4) + (dgroup * 0x100))
  29. #define SUB_EMI_MPU_CTRL_D0 (SUB_EMI_MPU_BASE + 0x800)
  30. #define SUB_EMI_MPU_CTRL_D(domain) (SUB_EMI_MPU_CTRL_D0 + (domain * 4))
  31. #define SUB_EMI_RG_MASK_D0 (SUB_EMI_MPU_BASE + 0x900)
  32. #define SUB_EMI_RG_MASK_D(domain) (SUB_EMI_RG_MASK_D0 + (domain * 4))
  33. #define EMI_MPU_DOMAIN_NUM (16)
  34. #define EMI_MPU_REGION_NUM (32)
  35. #define EMI_MPU_ALIGN_BITS (16)
  36. #define DRAM_START_ADDR (0x40000000ULL)
  37. #define DRAM_OFFSET (DRAM_START_ADDR >> EMI_MPU_ALIGN_BITS)
  38. #define DRAM_MAX_SIZE (0x200000000ULL)
  39. #define BL32_REGION_BASE (0x43000000ULL)
  40. #define BL32_REGION_SIZE (0x4600000ULL)
  41. #define SCP_CORE0_REGION_BASE (0x50000000ULL)
  42. #define SCP_CORE0_REGION_SIZE (0x800000ULL)
  43. #define SCP_CORE1_REGION_BASE (0x70000000ULL)
  44. #define SCP_CORE1_REGION_SIZE (0xa000000ULL)
  45. #define DSP_PROTECT_REGION_BASE (0x60000000ULL)
  46. #define DSP_PROTECT_REGION_SIZE (0x1100000ULL)
  47. #define EMI_MPU_DGROUP_NUM (EMI_MPU_DOMAIN_NUM / 8)
  48. /* APU EMI MPU Setting */
  49. #define APUSYS_SEC_BUF_PA (0x55000000)
  50. #define APUSYS_SEC_BUF_SZ (0x100000)
  51. #define SVP_DRAM_REGION_COUNT (10)
  52. enum region_ids {
  53. BL31_EMI_REGION_ID = 0,
  54. BL32_REGION_ID,
  55. SCP_CORE0_REGION_ID,
  56. SCP_CORE1_REGION_ID,
  57. DSP_PROTECT_REGION_ID,
  58. SVP_DRAM_REGION_ID_START = 5,
  59. SVP_DRAM_REGION_ID_END = SVP_DRAM_REGION_ID_START + SVP_DRAM_REGION_COUNT - 1,
  60. APUSYS_SEC_BUF_EMI_REGION_ID = 21,
  61. ALL_DEFAULT_REGION_ID = 31,
  62. };
  63. #endif