gsc-regs.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd.
  3. * http://www.samsung.com
  4. *
  5. * Register definition file for Samsung G-Scaler driver
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef REGS_GSC_H_
  12. #define REGS_GSC_H_
  13. /* G-Scaler enable */
  14. #define GSC_ENABLE 0x00
  15. #define GSC_ENABLE_OP_STATUS (1 << 2)
  16. #define GSC_ENABLE_SFR_UPDATE (1 << 1)
  17. #define GSC_ENABLE_ON (1 << 0)
  18. /* G-Scaler S/W reset */
  19. #define GSC_SW_RESET 0x04
  20. #define GSC_SW_RESET_SRESET (1 << 0)
  21. /* G-Scaler IRQ */
  22. #define GSC_IRQ 0x08
  23. #define GSC_IRQ_STATUS_OR_IRQ (1 << 17)
  24. #define GSC_IRQ_STATUS_FRM_DONE_IRQ (1 << 16)
  25. #define GSC_IRQ_FRMDONE_MASK (1 << 1)
  26. #define GSC_IRQ_ENABLE (1 << 0)
  27. /* G-Scaler input control */
  28. #define GSC_IN_CON 0x10
  29. #define GSC_IN_ROT_MASK (7 << 16)
  30. #define GSC_IN_ROT_270 (7 << 16)
  31. #define GSC_IN_ROT_90_YFLIP (6 << 16)
  32. #define GSC_IN_ROT_90_XFLIP (5 << 16)
  33. #define GSC_IN_ROT_90 (4 << 16)
  34. #define GSC_IN_ROT_180 (3 << 16)
  35. #define GSC_IN_ROT_YFLIP (2 << 16)
  36. #define GSC_IN_ROT_XFLIP (1 << 16)
  37. #define GSC_IN_RGB_TYPE_MASK (3 << 14)
  38. #define GSC_IN_RGB_HD_NARROW (3 << 14)
  39. #define GSC_IN_RGB_HD_WIDE (2 << 14)
  40. #define GSC_IN_RGB_SD_NARROW (1 << 14)
  41. #define GSC_IN_RGB_SD_WIDE (0 << 14)
  42. #define GSC_IN_YUV422_1P_ORDER_MASK (1 << 13)
  43. #define GSC_IN_YUV422_1P_ORDER_LSB_Y (0 << 13)
  44. #define GSC_IN_YUV422_1P_OEDER_LSB_C (1 << 13)
  45. #define GSC_IN_CHROMA_ORDER_MASK (1 << 12)
  46. #define GSC_IN_CHROMA_ORDER_CBCR (0 << 12)
  47. #define GSC_IN_CHROMA_ORDER_CRCB (1 << 12)
  48. #define GSC_IN_FORMAT_MASK (7 << 8)
  49. #define GSC_IN_XRGB8888 (0 << 8)
  50. #define GSC_IN_RGB565 (1 << 8)
  51. #define GSC_IN_YUV420_2P (2 << 8)
  52. #define GSC_IN_YUV420_3P (3 << 8)
  53. #define GSC_IN_YUV422_1P (4 << 8)
  54. #define GSC_IN_YUV422_2P (5 << 8)
  55. #define GSC_IN_YUV422_3P (6 << 8)
  56. #define GSC_IN_TILE_TYPE_MASK (1 << 4)
  57. #define GSC_IN_TILE_C_16x8 (0 << 4)
  58. #define GSC_IN_TILE_MODE (1 << 3)
  59. #define GSC_IN_LOCAL_SEL_MASK (3 << 1)
  60. #define GSC_IN_PATH_MASK (1 << 0)
  61. #define GSC_IN_PATH_MEMORY (0 << 0)
  62. /* G-Scaler source image size */
  63. #define GSC_SRCIMG_SIZE 0x14
  64. #define GSC_SRCIMG_HEIGHT(x) ((x) << 16)
  65. #define GSC_SRCIMG_WIDTH(x) ((x) << 0)
  66. /* G-Scaler source image offset */
  67. #define GSC_SRCIMG_OFFSET 0x18
  68. #define GSC_SRCIMG_OFFSET_Y(x) ((x) << 16)
  69. #define GSC_SRCIMG_OFFSET_X(x) ((x) << 0)
  70. /* G-Scaler cropped source image size */
  71. #define GSC_CROPPED_SIZE 0x1c
  72. #define GSC_CROPPED_HEIGHT(x) ((x) << 16)
  73. #define GSC_CROPPED_WIDTH(x) ((x) << 0)
  74. /* G-Scaler output control */
  75. #define GSC_OUT_CON 0x20
  76. #define GSC_OUT_GLOBAL_ALPHA_MASK (0xff << 24)
  77. #define GSC_OUT_GLOBAL_ALPHA(x) ((x) << 24)
  78. #define GSC_OUT_RGB_TYPE_MASK (3 << 10)
  79. #define GSC_OUT_RGB_HD_WIDE (3 << 10)
  80. #define GSC_OUT_RGB_HD_NARROW (2 << 10)
  81. #define GSC_OUT_RGB_SD_WIDE (1 << 10)
  82. #define GSC_OUT_RGB_SD_NARROW (0 << 10)
  83. #define GSC_OUT_YUV422_1P_ORDER_MASK (1 << 9)
  84. #define GSC_OUT_YUV422_1P_ORDER_LSB_Y (0 << 9)
  85. #define GSC_OUT_YUV422_1P_OEDER_LSB_C (1 << 9)
  86. #define GSC_OUT_CHROMA_ORDER_MASK (1 << 8)
  87. #define GSC_OUT_CHROMA_ORDER_CBCR (0 << 8)
  88. #define GSC_OUT_CHROMA_ORDER_CRCB (1 << 8)
  89. #define GSC_OUT_FORMAT_MASK (7 << 4)
  90. #define GSC_OUT_XRGB8888 (0 << 4)
  91. #define GSC_OUT_RGB565 (1 << 4)
  92. #define GSC_OUT_YUV420_2P (2 << 4)
  93. #define GSC_OUT_YUV420_3P (3 << 4)
  94. #define GSC_OUT_YUV422_1P (4 << 4)
  95. #define GSC_OUT_YUV422_2P (5 << 4)
  96. #define GSC_OUT_YUV444 (7 << 4)
  97. #define GSC_OUT_TILE_TYPE_MASK (1 << 2)
  98. #define GSC_OUT_TILE_C_16x8 (0 << 2)
  99. #define GSC_OUT_TILE_MODE (1 << 1)
  100. #define GSC_OUT_PATH_MASK (1 << 0)
  101. #define GSC_OUT_PATH_LOCAL (1 << 0)
  102. #define GSC_OUT_PATH_MEMORY (0 << 0)
  103. /* G-Scaler scaled destination image size */
  104. #define GSC_SCALED_SIZE 0x24
  105. #define GSC_SCALED_HEIGHT(x) ((x) << 16)
  106. #define GSC_SCALED_WIDTH(x) ((x) << 0)
  107. /* G-Scaler pre scale ratio */
  108. #define GSC_PRE_SCALE_RATIO 0x28
  109. #define GSC_PRESC_SHFACTOR(x) ((x) << 28)
  110. #define GSC_PRESC_V_RATIO(x) ((x) << 16)
  111. #define GSC_PRESC_H_RATIO(x) ((x) << 0)
  112. /* G-Scaler main scale horizontal ratio */
  113. #define GSC_MAIN_H_RATIO 0x2c
  114. #define GSC_MAIN_H_RATIO_VALUE(x) ((x) << 0)
  115. /* G-Scaler main scale vertical ratio */
  116. #define GSC_MAIN_V_RATIO 0x30
  117. #define GSC_MAIN_V_RATIO_VALUE(x) ((x) << 0)
  118. /* G-Scaler destination image size */
  119. #define GSC_DSTIMG_SIZE 0x40
  120. #define GSC_DSTIMG_HEIGHT(x) ((x) << 16)
  121. #define GSC_DSTIMG_WIDTH(x) ((x) << 0)
  122. /* G-Scaler destination image offset */
  123. #define GSC_DSTIMG_OFFSET 0x44
  124. #define GSC_DSTIMG_OFFSET_Y(x) ((x) << 16)
  125. #define GSC_DSTIMG_OFFSET_X(x) ((x) << 0)
  126. /* G-Scaler input y address mask */
  127. #define GSC_IN_BASE_ADDR_Y_MASK 0x4c
  128. /* G-Scaler input y base address */
  129. #define GSC_IN_BASE_ADDR_Y(n) (0x50 + (n) * 0x4)
  130. /* G-Scaler input cb address mask */
  131. #define GSC_IN_BASE_ADDR_CB_MASK 0x7c
  132. /* G-Scaler input cb base address */
  133. #define GSC_IN_BASE_ADDR_CB(n) (0x80 + (n) * 0x4)
  134. /* G-Scaler input cr address mask */
  135. #define GSC_IN_BASE_ADDR_CR_MASK 0xac
  136. /* G-Scaler input cr base address */
  137. #define GSC_IN_BASE_ADDR_CR(n) (0xb0 + (n) * 0x4)
  138. /* G-Scaler output y address mask */
  139. #define GSC_OUT_BASE_ADDR_Y_MASK 0x10c
  140. /* G-Scaler output y base address */
  141. #define GSC_OUT_BASE_ADDR_Y(n) (0x110 + (n) * 0x4)
  142. /* G-Scaler output cb address mask */
  143. #define GSC_OUT_BASE_ADDR_CB_MASK 0x15c
  144. /* G-Scaler output cb base address */
  145. #define GSC_OUT_BASE_ADDR_CB(n) (0x160 + (n) * 0x4)
  146. /* G-Scaler output cr address mask */
  147. #define GSC_OUT_BASE_ADDR_CR_MASK 0x1ac
  148. /* G-Scaler output cr base address */
  149. #define GSC_OUT_BASE_ADDR_CR(n) (0x1b0 + (n) * 0x4)
  150. #endif /* REGS_GSC_H_ */