cci.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CCI_H
  7. #define CCI_H
  8. #include <lib/utils_def.h>
  9. /* Slave interface offsets from PERIPHBASE */
  10. #define SLAVE_IFACE6_OFFSET UL(0x7000)
  11. #define SLAVE_IFACE5_OFFSET UL(0x6000)
  12. #define SLAVE_IFACE4_OFFSET UL(0x5000)
  13. #define SLAVE_IFACE3_OFFSET UL(0x4000)
  14. #define SLAVE_IFACE2_OFFSET UL(0x3000)
  15. #define SLAVE_IFACE1_OFFSET UL(0x2000)
  16. #define SLAVE_IFACE0_OFFSET UL(0x1000)
  17. #define SLAVE_IFACE_OFFSET(index) (SLAVE_IFACE0_OFFSET + \
  18. (UL(0x1000) * (index)))
  19. /* Slave interface event and count register offsets from PERIPHBASE */
  20. #define EVENT_SELECT7_OFFSET UL(0x80000)
  21. #define EVENT_SELECT6_OFFSET UL(0x70000)
  22. #define EVENT_SELECT5_OFFSET UL(0x60000)
  23. #define EVENT_SELECT4_OFFSET UL(0x50000)
  24. #define EVENT_SELECT3_OFFSET UL(0x40000)
  25. #define EVENT_SELECT2_OFFSET UL(0x30000)
  26. #define EVENT_SELECT1_OFFSET UL(0x20000)
  27. #define EVENT_SELECT0_OFFSET UL(0x10000)
  28. #define EVENT_OFFSET(index) (EVENT_SELECT0_OFFSET + \
  29. (UL(0x10000) * (index)))
  30. /* Control and ID register offsets */
  31. #define CTRL_OVERRIDE_REG U(0x0)
  32. #define SECURE_ACCESS_REG U(0x8)
  33. #define STATUS_REG U(0xc)
  34. #define IMPRECISE_ERR_REG U(0x10)
  35. #define PERFMON_CTRL_REG U(0x100)
  36. #define IFACE_MON_CTRL_REG U(0x104)
  37. /* Component and peripheral ID registers */
  38. #define PERIPHERAL_ID0 U(0xFE0)
  39. #define PERIPHERAL_ID1 U(0xFE4)
  40. #define PERIPHERAL_ID2 U(0xFE8)
  41. #define PERIPHERAL_ID3 U(0xFEC)
  42. #define PERIPHERAL_ID4 U(0xFD0)
  43. #define PERIPHERAL_ID5 U(0xFD4)
  44. #define PERIPHERAL_ID6 U(0xFD8)
  45. #define PERIPHERAL_ID7 U(0xFDC)
  46. #define COMPONENT_ID0 U(0xFF0)
  47. #define COMPONENT_ID1 U(0xFF4)
  48. #define COMPONENT_ID2 U(0xFF8)
  49. #define COMPONENT_ID3 U(0xFFC)
  50. #define COMPONENT_ID4 U(0x1000)
  51. #define COMPONENT_ID5 U(0x1004)
  52. #define COMPONENT_ID6 U(0x1008)
  53. #define COMPONENT_ID7 U(0x100C)
  54. /* Slave interface register offsets */
  55. #define SNOOP_CTRL_REG U(0x0)
  56. #define SH_OVERRIDE_REG U(0x4)
  57. #define READ_CHNL_QOS_VAL_OVERRIDE_REG U(0x100)
  58. #define WRITE_CHNL_QOS_VAL_OVERRIDE_REG U(0x104)
  59. #define MAX_OT_REG U(0x110)
  60. /* Snoop Control register bit definitions */
  61. #define DVM_EN_BIT BIT_32(1)
  62. #define SNOOP_EN_BIT BIT_32(0)
  63. #define SUPPORT_SNOOPS BIT_32(30)
  64. #define SUPPORT_DVM BIT_32(31)
  65. /* Status register bit definitions */
  66. #define CHANGE_PENDING_BIT BIT_32(0)
  67. /* Event and count register offsets */
  68. #define EVENT_SELECT_REG U(0x0)
  69. #define EVENT_COUNT_REG U(0x4)
  70. #define COUNT_CNTRL_REG U(0x8)
  71. #define COUNT_OVERFLOW_REG U(0xC)
  72. /* Slave interface monitor registers */
  73. #define INT_MON_REG_SI0 U(0x90000)
  74. #define INT_MON_REG_SI1 U(0x90004)
  75. #define INT_MON_REG_SI2 U(0x90008)
  76. #define INT_MON_REG_SI3 U(0x9000C)
  77. #define INT_MON_REG_SI4 U(0x90010)
  78. #define INT_MON_REG_SI5 U(0x90014)
  79. #define INT_MON_REG_SI6 U(0x90018)
  80. /* Master interface monitor registers */
  81. #define INT_MON_REG_MI0 U(0x90100)
  82. #define INT_MON_REG_MI1 U(0x90104)
  83. #define INT_MON_REG_MI2 U(0x90108)
  84. #define INT_MON_REG_MI3 U(0x9010c)
  85. #define INT_MON_REG_MI4 U(0x90110)
  86. #define INT_MON_REG_MI5 U(0x90114)
  87. #define SLAVE_IF_UNUSED -1
  88. #ifndef __ASSEMBLER__
  89. #include <stdint.h>
  90. /* Function declarations */
  91. /*
  92. * The ARM CCI driver needs the following:
  93. * 1. Base address of the CCI product
  94. * 2. An array of map between AMBA 4 master ids and ACE/ACE lite slave
  95. * interfaces.
  96. * 3. Size of the array.
  97. *
  98. * SLAVE_IF_UNUSED should be used in the map to represent no AMBA 4 master exists
  99. * for that interface.
  100. */
  101. void cci_init(uintptr_t base, const int *map, unsigned int num_cci_masters);
  102. void cci_enable_snoop_dvm_reqs(unsigned int master_id);
  103. void cci_disable_snoop_dvm_reqs(unsigned int master_id);
  104. #endif /* __ASSEMBLER__ */
  105. #endif /* CCI_H */