permedia2.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /*
  2. * Permedia2 framebuffer driver definitions.
  3. * Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
  4. * --------------------------------------------------------------------------
  5. * $Id: pm2fb.h,v 1.26 2000/09/19 00:11:53 illo Exp $
  6. * --------------------------------------------------------------------------
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file COPYING in the main directory of this archive
  9. * for more details.
  10. */
  11. #ifndef PM2FB_H
  12. #define PM2FB_H
  13. #define PM2_REFERENCE_CLOCK 14318 /* in KHz */
  14. #define PM2_MAX_PIXCLOCK 230000 /* in KHz */
  15. #define PM2_REGS_SIZE 0x10000
  16. #define PM2TAG(r) (u32 )(((r)-0x8000)>>3)
  17. /*****************************************************************************
  18. * Permedia2 registers used in the framebuffer
  19. *****************************************************************************/
  20. #define PM2R_RESET_STATUS 0x0000
  21. #define PM2R_IN_FIFO_SPACE 0x0018
  22. #define PM2R_OUT_FIFO_WORDS 0x0020
  23. #define PM2R_APERTURE_ONE 0x0050
  24. #define PM2R_APERTURE_TWO 0x0058
  25. #define PM2R_FIFO_DISCON 0x0068
  26. #define PM2R_CHIP_CONFIG 0x0070
  27. #define PM2R_REBOOT 0x1000
  28. #define PM2R_MEM_CONTROL 0x1040
  29. #define PM2R_BOOT_ADDRESS 0x1080
  30. #define PM2R_MEM_CONFIG 0x10c0
  31. #define PM2R_BYPASS_WRITE_MASK 0x1100
  32. #define PM2R_FRAMEBUFFER_WRITE_MASK 0x1140
  33. #define PM2R_OUT_FIFO 0x2000
  34. #define PM2R_SCREEN_BASE 0x3000
  35. #define PM2R_SCREEN_STRIDE 0x3008
  36. #define PM2R_H_TOTAL 0x3010
  37. #define PM2R_HG_END 0x3018
  38. #define PM2R_HB_END 0x3020
  39. #define PM2R_HS_START 0x3028
  40. #define PM2R_HS_END 0x3030
  41. #define PM2R_V_TOTAL 0x3038
  42. #define PM2R_VB_END 0x3040
  43. #define PM2R_VS_START 0x3048
  44. #define PM2R_VS_END 0x3050
  45. #define PM2R_VIDEO_CONTROL 0x3058
  46. #define PM2R_LINE_COUNT 0x3070
  47. #define PM2R_FIFO_CONTROL 0x3078
  48. #define PM2R_RD_PALETTE_WRITE_ADDRESS 0x4000
  49. #define PM2R_RD_PALETTE_DATA 0x4008
  50. #define PM2R_RD_PIXEL_MASK 0x4010
  51. #define PM2R_RD_PALETTE_READ_ADDRESS 0x4018
  52. #define PM2R_RD_CURSOR_COLOR_ADDRESS 0x4020
  53. #define PM2R_RD_CURSOR_COLOR_DATA 0x4028
  54. #define PM2R_RD_INDEXED_DATA 0x4050
  55. #define PM2R_RD_CURSOR_DATA 0x4058
  56. #define PM2R_RD_CURSOR_X_LSB 0x4060
  57. #define PM2R_RD_CURSOR_X_MSB 0x4068
  58. #define PM2R_RD_CURSOR_Y_LSB 0x4070
  59. #define PM2R_RD_CURSOR_Y_MSB 0x4078
  60. #define PM2R_START_X_DOM 0x8000
  61. #define PM2R_D_X_DOM 0x8008
  62. #define PM2R_START_X_SUB 0x8010
  63. #define PM2R_D_X_SUB 0x8018
  64. #define PM2R_START_Y 0x8020
  65. #define PM2R_D_Y 0x8028
  66. #define PM2R_COUNT 0x8030
  67. #define PM2R_RENDER 0x8038
  68. #define PM2R_BIT_MASK_PATTERN 0x8068
  69. #define PM2R_RASTERIZER_MODE 0x80a0
  70. #define PM2R_RECTANGLE_ORIGIN 0x80d0
  71. #define PM2R_RECTANGLE_SIZE 0x80d8
  72. #define PM2R_PACKED_DATA_LIMITS 0x8150
  73. #define PM2R_SCISSOR_MODE 0x8180
  74. #define PM2R_SCISSOR_MIN_XY 0x8188
  75. #define PM2R_SCISSOR_MAX_XY 0x8190
  76. #define PM2R_SCREEN_SIZE 0x8198
  77. #define PM2R_AREA_STIPPLE_MODE 0x81a0
  78. #define PM2R_WINDOW_ORIGIN 0x81c8
  79. #define PM2R_TEXTURE_ADDRESS_MODE 0x8380
  80. #define PM2R_TEXTURE_MAP_FORMAT 0x8588
  81. #define PM2R_TEXTURE_DATA_FORMAT 0x8590
  82. #define PM2R_TEXTURE_READ_MODE 0x8670
  83. #define PM2R_TEXEL_LUT_MODE 0x8678
  84. #define PM2R_TEXTURE_COLOR_MODE 0x8680
  85. #define PM2R_FOG_MODE 0x8690
  86. #define PM2R_TEXEL0 0x8760
  87. #define PM2R_COLOR_DDA_MODE 0x87e0
  88. #define PM2R_CONSTANT_COLOR 0x87e8
  89. #define PM2R_ALPHA_BLEND_MODE 0x8810
  90. #define PM2R_DITHER_MODE 0x8818
  91. #define PM2R_FB_SOFT_WRITE_MASK 0x8820
  92. #define PM2R_LOGICAL_OP_MODE 0x8828
  93. #define PM2R_LB_READ_MODE 0x8880
  94. #define PM2R_LB_READ_FORMAT 0x8888
  95. #define PM2R_LB_SOURCE_OFFSET 0x8890
  96. #define PM2R_LB_WINDOW_BASE 0x88b8
  97. #define PM2R_LB_WRITE_FORMAT 0x88c8
  98. #define PM2R_STENCIL_MODE 0x8988
  99. #define PM2R_DEPTH_MODE 0x89a0
  100. #define PM2R_FB_READ_MODE 0x8a80
  101. #define PM2R_FB_SOURCE_OFFSET 0x8a88
  102. #define PM2R_FB_PIXEL_OFFSET 0x8a90
  103. #define PM2R_FB_WINDOW_BASE 0x8ab0
  104. #define PM2R_FB_WRITE_MODE 0x8ab8
  105. #define PM2R_FB_HARD_WRITE_MASK 0x8ac0
  106. #define PM2R_FB_BLOCK_COLOR 0x8ac8
  107. #define PM2R_FB_READ_PIXEL 0x8ad0
  108. #define PM2R_FILTER_MODE 0x8c00
  109. #define PM2R_SYNC 0x8c40
  110. #define PM2R_YUV_MODE 0x8f00
  111. #define PM2R_STATISTICS_MODE 0x8c08
  112. #define PM2R_FB_SOURCE_DELTA 0x8d88
  113. #define PM2R_CONFIG 0x8d90
  114. #define PM2R_DELTA_MODE 0x9300
  115. /* Permedia2v */
  116. #define PM2VR_RD_INDEX_LOW 0x4020
  117. #define PM2VR_RD_INDEX_HIGH 0x4028
  118. #define PM2VR_RD_INDEXED_DATA 0x4030
  119. /* Permedia2 RAMDAC indexed registers */
  120. #define PM2I_RD_CURSOR_CONTROL 0x06
  121. #define PM2I_RD_COLOR_MODE 0x18
  122. #define PM2I_RD_MODE_CONTROL 0x19
  123. #define PM2I_RD_MISC_CONTROL 0x1e
  124. #define PM2I_RD_PIXEL_CLOCK_A1 0x20
  125. #define PM2I_RD_PIXEL_CLOCK_A2 0x21
  126. #define PM2I_RD_PIXEL_CLOCK_A3 0x22
  127. #define PM2I_RD_PIXEL_CLOCK_STATUS 0x29
  128. #define PM2I_RD_MEMORY_CLOCK_1 0x30
  129. #define PM2I_RD_MEMORY_CLOCK_2 0x31
  130. #define PM2I_RD_MEMORY_CLOCK_3 0x32
  131. #define PM2I_RD_MEMORY_CLOCK_STATUS 0x33
  132. #define PM2I_RD_COLOR_KEY_CONTROL 0x40
  133. #define PM2I_RD_OVERLAY_KEY 0x41
  134. #define PM2I_RD_RED_KEY 0x42
  135. #define PM2I_RD_GREEN_KEY 0x43
  136. #define PM2I_RD_BLUE_KEY 0x44
  137. /* Permedia2v extensions */
  138. #define PM2VI_RD_MISC_CONTROL 0x000
  139. #define PM2VI_RD_SYNC_CONTROL 0x001
  140. #define PM2VI_RD_DAC_CONTROL 0x002
  141. #define PM2VI_RD_PIXEL_SIZE 0x003
  142. #define PM2VI_RD_COLOR_FORMAT 0x004
  143. #define PM2VI_RD_CURSOR_MODE 0x005
  144. #define PM2VI_RD_CURSOR_X_LOW 0x007
  145. #define PM2VI_RD_CURSOR_X_HIGH 0x008
  146. #define PM2VI_RD_CURSOR_Y_LOW 0x009
  147. #define PM2VI_RD_CURSOR_Y_HIGH 0x00A
  148. #define PM2VI_RD_CURSOR_X_HOT 0x00B
  149. #define PM2VI_RD_CURSOR_Y_HOT 0x00C
  150. #define PM2VI_RD_OVERLAY_KEY 0x00D
  151. #define PM2VI_RD_CLK0_PRESCALE 0x201
  152. #define PM2VI_RD_CLK0_FEEDBACK 0x202
  153. #define PM2VI_RD_CLK0_POSTSCALE 0x203
  154. #define PM2VI_RD_CLK1_PRESCALE 0x204
  155. #define PM2VI_RD_CLK1_FEEDBACK 0x205
  156. #define PM2VI_RD_CLK1_POSTSCALE 0x206
  157. #define PM2VI_RD_MCLK_CONTROL 0x20D
  158. #define PM2VI_RD_MCLK_PRESCALE 0x20E
  159. #define PM2VI_RD_MCLK_FEEDBACK 0x20F
  160. #define PM2VI_RD_MCLK_POSTSCALE 0x210
  161. #define PM2VI_RD_CURSOR_PALETTE 0x303
  162. #define PM2VI_RD_CURSOR_PATTERN 0x400
  163. /* Fields and flags */
  164. #define PM2F_RENDER_AREASTIPPLE (1L<<0)
  165. #define PM2F_RENDER_FASTFILL (1L<<3)
  166. #define PM2F_RENDER_PRIMITIVE_MASK (3L<<6)
  167. #define PM2F_RENDER_LINE 0
  168. #define PM2F_RENDER_TRAPEZOID (1L<<6)
  169. #define PM2F_RENDER_POINT (2L<<6)
  170. #define PM2F_RENDER_RECTANGLE (3L<<6)
  171. #define PM2F_RENDER_SYNC_ON_BIT_MASK (1L<<11)
  172. #define PM2F_RENDER_TEXTURE_ENABLE (1L<<13)
  173. #define PM2F_SYNCHRONIZATION (1L<<10)
  174. #define PM2F_PLL_LOCKED 0x10
  175. #define PM2F_BEING_RESET (1L<<31)
  176. #define PM2F_DATATYPE_COLOR 0x8000
  177. #define PM2F_VGA_ENABLE 0x02
  178. #define PM2F_VGA_FIXED 0x04
  179. #define PM2F_FB_WRITE_ENABLE 0x01
  180. #define PM2F_FB_READ_SOURCE_ENABLE 0x0200
  181. #define PM2F_RD_PALETTE_WIDTH_8 0x02
  182. #define PM2F_PART_PROD_MASK 0x01ff
  183. #define PM2F_SCREEN_SCISSOR_ENABLE 0x02
  184. #define PM2F_DATA_64_ENABLE 0x00010000
  185. #define PM2F_BLANK_LOW 0x02
  186. #define PM2F_HSYNC_MASK 0x18
  187. #define PM2F_VSYNC_MASK 0x60
  188. #define PM2F_HSYNC_ACT_HIGH 0x08
  189. #define PM2F_HSYNC_FORCED_LOW 0x10
  190. #define PM2F_HSYNC_ACT_LOW 0x18
  191. #define PM2F_VSYNC_ACT_HIGH 0x20
  192. #define PM2F_VSYNC_FORCED_LOW 0x40
  193. #define PM2F_VSYNC_ACT_LOW 0x60
  194. #define PM2F_LINE_DOUBLE 0x04
  195. #define PM2F_VIDEO_ENABLE 0x01
  196. #define PM2F_RD_PIXELFORMAT_SVGA 0x01
  197. #define PM2F_RD_PIXELFORMAT_RGB232OFFSET 0x02
  198. #define PM2F_RD_PIXELFORMAT_RGBA2321 0x03
  199. #define PM2F_RD_PIXELFORMAT_RGBA5551 0x04
  200. #define PM2F_RD_PIXELFORMAT_RGBA4444 0x05
  201. #define PM2F_RD_PIXELFORMAT_RGB565 0x06
  202. #define PM2F_RD_PIXELFORMAT_RGBA8888 0x08
  203. #define PM2F_RD_PIXELFORMAT_RGB888 0x09
  204. #define PM2F_RD_GUI_ACTIVE 0x10
  205. #define PM2F_RD_COLOR_MODE_RGB 0x20
  206. #define PM2F_DELTA_ORDER_RGB (1L<<18)
  207. #define PM2F_RD_TRUECOLOR 0x80
  208. #define PM2F_NO_ALPHA_BUFFER 0x10
  209. #define PM2F_TEXTEL_SIZE_16 0x00080000
  210. #define PM2F_TEXTEL_SIZE_32 0x00100000
  211. #define PM2F_TEXTEL_SIZE_4 0x00180000
  212. #define PM2F_TEXTEL_SIZE_24 0x00200000
  213. #define PM2F_INCREASE_X (1L<<21)
  214. #define PM2F_INCREASE_Y (1L<<22)
  215. #define PM2F_CONFIG_FB_WRITE_ENABLE (1L<<3)
  216. #define PM2F_CONFIG_FB_PACKED_DATA (1L<<2)
  217. #define PM2F_CONFIG_FB_READ_DEST_ENABLE (1L<<1)
  218. #define PM2F_CONFIG_FB_READ_SOURCE_ENABLE (1L<<0)
  219. #define PM2F_COLOR_KEY_TEST_OFF (1L<<4)
  220. #define PM2F_MEM_CONFIG_RAM_MASK (3L<<29)
  221. #define PM2F_MEM_BANKS_1 0L
  222. #define PM2F_MEM_BANKS_2 (1L<<29)
  223. #define PM2F_MEM_BANKS_3 (2L<<29)
  224. #define PM2F_MEM_BANKS_4 (3L<<29)
  225. #define PM2F_APERTURE_STANDARD 0
  226. #define PM2F_APERTURE_BYTESWAP 1
  227. #define PM2F_APERTURE_HALFWORDSWAP 2
  228. #define PM2F_CURSORMODE_CURSOR_ENABLE (1 << 0)
  229. #define PM2F_CURSORMODE_TYPE_X (1 << 4)
  230. typedef enum {
  231. PM2_TYPE_PERMEDIA2,
  232. PM2_TYPE_PERMEDIA2V
  233. } pm2type_t;
  234. #endif /* PM2FB_H */
  235. /*****************************************************************************
  236. * That's all folks!
  237. *****************************************************************************/