malidp_regs.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
  3. * Author: Liviu Dudau <Liviu.Dudau@arm.com>
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * ARM Mali DP500/DP550/DP650 registers definition.
  11. */
  12. #ifndef __MALIDP_REGS_H__
  13. #define __MALIDP_REGS_H__
  14. /*
  15. * abbreviations used:
  16. * - DC - display core (general settings)
  17. * - DE - display engine
  18. * - SE - scaling engine
  19. */
  20. /* interrupt bit masks */
  21. #define MALIDP_DE_IRQ_UNDERRUN (1 << 0)
  22. #define MALIDP500_DE_IRQ_AXI_ERR (1 << 4)
  23. #define MALIDP500_DE_IRQ_VSYNC (1 << 5)
  24. #define MALIDP500_DE_IRQ_PROG_LINE (1 << 6)
  25. #define MALIDP500_DE_IRQ_SATURATION (1 << 7)
  26. #define MALIDP500_DE_IRQ_CONF_VALID (1 << 8)
  27. #define MALIDP500_DE_IRQ_CONF_MODE (1 << 11)
  28. #define MALIDP500_DE_IRQ_CONF_ACTIVE (1 << 17)
  29. #define MALIDP500_DE_IRQ_PM_ACTIVE (1 << 18)
  30. #define MALIDP500_DE_IRQ_TESTMODE_ACTIVE (1 << 19)
  31. #define MALIDP500_DE_IRQ_FORCE_BLNK_ACTIVE (1 << 24)
  32. #define MALIDP500_DE_IRQ_AXI_BUSY (1 << 28)
  33. #define MALIDP500_DE_IRQ_GLOBAL (1 << 31)
  34. #define MALIDP500_SE_IRQ_CONF_MODE (1 << 0)
  35. #define MALIDP500_SE_IRQ_CONF_VALID (1 << 4)
  36. #define MALIDP500_SE_IRQ_INIT_BUSY (1 << 5)
  37. #define MALIDP500_SE_IRQ_AXI_ERROR (1 << 8)
  38. #define MALIDP500_SE_IRQ_OVERRUN (1 << 9)
  39. #define MALIDP500_SE_IRQ_PROG_LINE1 (1 << 12)
  40. #define MALIDP500_SE_IRQ_PROG_LINE2 (1 << 13)
  41. #define MALIDP500_SE_IRQ_CONF_ACTIVE (1 << 17)
  42. #define MALIDP500_SE_IRQ_PM_ACTIVE (1 << 18)
  43. #define MALIDP500_SE_IRQ_AXI_BUSY (1 << 28)
  44. #define MALIDP500_SE_IRQ_GLOBAL (1 << 31)
  45. #define MALIDP550_DE_IRQ_SATURATION (1 << 8)
  46. #define MALIDP550_DE_IRQ_VSYNC (1 << 12)
  47. #define MALIDP550_DE_IRQ_PROG_LINE (1 << 13)
  48. #define MALIDP550_DE_IRQ_AXI_ERR (1 << 16)
  49. #define MALIDP550_SE_IRQ_EOW (1 << 0)
  50. #define MALIDP550_SE_IRQ_AXI_ERR (1 << 16)
  51. #define MALIDP550_DC_IRQ_CONF_VALID (1 << 0)
  52. #define MALIDP550_DC_IRQ_CONF_MODE (1 << 4)
  53. #define MALIDP550_DC_IRQ_CONF_ACTIVE (1 << 16)
  54. #define MALIDP550_DC_IRQ_DE (1 << 20)
  55. #define MALIDP550_DC_IRQ_SE (1 << 24)
  56. #define MALIDP650_DE_IRQ_DRIFT (1 << 4)
  57. /* bit masks that are common between products */
  58. #define MALIDP_CFG_VALID (1 << 0)
  59. #define MALIDP_DISP_FUNC_ILACED (1 << 8)
  60. /* register offsets for IRQ management */
  61. #define MALIDP_REG_STATUS 0x00000
  62. #define MALIDP_REG_SETIRQ 0x00004
  63. #define MALIDP_REG_MASKIRQ 0x00008
  64. #define MALIDP_REG_CLEARIRQ 0x0000c
  65. /* register offsets */
  66. #define MALIDP_DE_CORE_ID 0x00018
  67. #define MALIDP_DE_DISPLAY_FUNC 0x00020
  68. /* these offsets are relative to MALIDP5x0_TIMINGS_BASE */
  69. #define MALIDP_DE_H_TIMINGS 0x0
  70. #define MALIDP_DE_V_TIMINGS 0x4
  71. #define MALIDP_DE_SYNC_WIDTH 0x8
  72. #define MALIDP_DE_HV_ACTIVE 0xc
  73. /* macros to set values into registers */
  74. #define MALIDP_DE_H_FRONTPORCH(x) (((x) & 0xfff) << 0)
  75. #define MALIDP_DE_H_BACKPORCH(x) (((x) & 0x3ff) << 16)
  76. #define MALIDP500_DE_V_FRONTPORCH(x) (((x) & 0xff) << 0)
  77. #define MALIDP550_DE_V_FRONTPORCH(x) (((x) & 0xfff) << 0)
  78. #define MALIDP_DE_V_BACKPORCH(x) (((x) & 0xff) << 16)
  79. #define MALIDP_DE_H_SYNCWIDTH(x) (((x) & 0x3ff) << 0)
  80. #define MALIDP_DE_V_SYNCWIDTH(x) (((x) & 0xff) << 16)
  81. #define MALIDP_DE_H_ACTIVE(x) (((x) & 0x1fff) << 0)
  82. #define MALIDP_DE_V_ACTIVE(x) (((x) & 0x1fff) << 16)
  83. /* register offsets and bits specific to DP500 */
  84. #define MALIDP500_DC_BASE 0x00000
  85. #define MALIDP500_DC_CONTROL 0x0000c
  86. #define MALIDP500_DC_CONFIG_REQ (1 << 17)
  87. #define MALIDP500_HSYNCPOL (1 << 20)
  88. #define MALIDP500_VSYNCPOL (1 << 21)
  89. #define MALIDP500_DC_CLEAR_MASK 0x300fff
  90. #define MALIDP500_DE_LINE_COUNTER 0x00010
  91. #define MALIDP500_DE_AXI_CONTROL 0x00014
  92. #define MALIDP500_DE_SECURE_CTRL 0x0001c
  93. #define MALIDP500_DE_CHROMA_KEY 0x00024
  94. #define MALIDP500_TIMINGS_BASE 0x00028
  95. #define MALIDP500_CONFIG_3D 0x00038
  96. #define MALIDP500_BGND_COLOR 0x0003c
  97. #define MALIDP500_OUTPUT_DEPTH 0x00044
  98. #define MALIDP500_YUV_RGB_COEF 0x00048
  99. #define MALIDP500_COLOR_ADJ_COEF 0x00078
  100. #define MALIDP500_COEF_TABLE_ADDR 0x000a8
  101. #define MALIDP500_COEF_TABLE_DATA 0x000ac
  102. #define MALIDP500_DE_LV_BASE 0x00100
  103. #define MALIDP500_DE_LV_PTR_BASE 0x00124
  104. #define MALIDP500_DE_LG1_BASE 0x00200
  105. #define MALIDP500_DE_LG1_PTR_BASE 0x0021c
  106. #define MALIDP500_DE_LG2_BASE 0x00300
  107. #define MALIDP500_DE_LG2_PTR_BASE 0x0031c
  108. #define MALIDP500_SE_BASE 0x00c00
  109. #define MALIDP500_SE_PTR_BASE 0x00e0c
  110. #define MALIDP500_DC_IRQ_BASE 0x00f00
  111. #define MALIDP500_CONFIG_VALID 0x00f00
  112. #define MALIDP500_CONFIG_ID 0x00fd4
  113. /* register offsets and bits specific to DP550/DP650 */
  114. #define MALIDP550_DE_CONTROL 0x00010
  115. #define MALIDP550_DE_LINE_COUNTER 0x00014
  116. #define MALIDP550_DE_AXI_CONTROL 0x00018
  117. #define MALIDP550_DE_QOS 0x0001c
  118. #define MALIDP550_TIMINGS_BASE 0x00030
  119. #define MALIDP550_HSYNCPOL (1 << 12)
  120. #define MALIDP550_VSYNCPOL (1 << 28)
  121. #define MALIDP550_DE_DISP_SIDEBAND 0x00040
  122. #define MALIDP550_DE_BGND_COLOR 0x00044
  123. #define MALIDP550_DE_OUTPUT_DEPTH 0x0004c
  124. #define MALIDP550_DE_COLOR_COEF 0x00050
  125. #define MALIDP550_DE_COEF_TABLE_ADDR 0x00080
  126. #define MALIDP550_DE_COEF_TABLE_DATA 0x00084
  127. #define MALIDP550_DE_LV1_BASE 0x00100
  128. #define MALIDP550_DE_LV1_PTR_BASE 0x00124
  129. #define MALIDP550_DE_LV2_BASE 0x00200
  130. #define MALIDP550_DE_LV2_PTR_BASE 0x00224
  131. #define MALIDP550_DE_LG_BASE 0x00300
  132. #define MALIDP550_DE_LG_PTR_BASE 0x0031c
  133. #define MALIDP550_DE_LS_BASE 0x00400
  134. #define MALIDP550_DE_LS_PTR_BASE 0x0042c
  135. #define MALIDP550_DE_PERF_BASE 0x00500
  136. #define MALIDP550_SE_BASE 0x08000
  137. #define MALIDP550_DC_BASE 0x0c000
  138. #define MALIDP550_DC_CONTROL 0x0c010
  139. #define MALIDP550_DC_CONFIG_REQ (1 << 16)
  140. #define MALIDP550_CONFIG_VALID 0x0c014
  141. #define MALIDP550_CONFIG_ID 0x0ffd4
  142. /*
  143. * Starting with DP550 the register map blocks has been standardised to the
  144. * following layout:
  145. *
  146. * Offset Block registers
  147. * 0x00000 Display Engine
  148. * 0x08000 Scaling Engine
  149. * 0x0c000 Display Core
  150. * 0x10000 Secure control
  151. *
  152. * The old DP500 IP mixes some DC with the DE registers, hence the need
  153. * for a mapping structure.
  154. */
  155. #endif /* __MALIDP_REGS_H__ */