neomagic.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * linux/include/video/neo_reg.h -- NeoMagic Framebuffer Driver
  3. *
  4. * Copyright (c) 2001 Denis Oliver Kropp <dok@convergence.de>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General
  7. * Public License. See the file COPYING in the main directory of this
  8. * archive for more details.
  9. */
  10. #define NEO_BS0_BLT_BUSY 0x00000001
  11. #define NEO_BS0_FIFO_AVAIL 0x00000002
  12. #define NEO_BS0_FIFO_PEND 0x00000004
  13. #define NEO_BC0_DST_Y_DEC 0x00000001
  14. #define NEO_BC0_X_DEC 0x00000002
  15. #define NEO_BC0_SRC_TRANS 0x00000004
  16. #define NEO_BC0_SRC_IS_FG 0x00000008
  17. #define NEO_BC0_SRC_Y_DEC 0x00000010
  18. #define NEO_BC0_FILL_PAT 0x00000020
  19. #define NEO_BC0_SRC_MONO 0x00000040
  20. #define NEO_BC0_SYS_TO_VID 0x00000080
  21. #define NEO_BC1_DEPTH8 0x00000100
  22. #define NEO_BC1_DEPTH16 0x00000200
  23. #define NEO_BC1_X_320 0x00000400
  24. #define NEO_BC1_X_640 0x00000800
  25. #define NEO_BC1_X_800 0x00000c00
  26. #define NEO_BC1_X_1024 0x00001000
  27. #define NEO_BC1_X_1152 0x00001400
  28. #define NEO_BC1_X_1280 0x00001800
  29. #define NEO_BC1_X_1600 0x00001c00
  30. #define NEO_BC1_DST_TRANS 0x00002000
  31. #define NEO_BC1_MSTR_BLT 0x00004000
  32. #define NEO_BC1_FILTER_Z 0x00008000
  33. #define NEO_BC2_WR_TR_DST 0x00800000
  34. #define NEO_BC3_SRC_XY_ADDR 0x01000000
  35. #define NEO_BC3_DST_XY_ADDR 0x02000000
  36. #define NEO_BC3_CLIP_ON 0x04000000
  37. #define NEO_BC3_FIFO_EN 0x08000000
  38. #define NEO_BC3_BLT_ON_ADDR 0x10000000
  39. #define NEO_BC3_SKIP_MAPPING 0x80000000
  40. #define NEO_MODE1_DEPTH8 0x0100
  41. #define NEO_MODE1_DEPTH16 0x0200
  42. #define NEO_MODE1_DEPTH24 0x0300
  43. #define NEO_MODE1_X_320 0x0400
  44. #define NEO_MODE1_X_640 0x0800
  45. #define NEO_MODE1_X_800 0x0c00
  46. #define NEO_MODE1_X_1024 0x1000
  47. #define NEO_MODE1_X_1152 0x1400
  48. #define NEO_MODE1_X_1280 0x1800
  49. #define NEO_MODE1_X_1600 0x1c00
  50. #define NEO_MODE1_BLT_ON_ADDR 0x2000
  51. /* These are offseted in MMIO space by par->CursorOff */
  52. #define NEOREG_CURSCNTL 0x00
  53. #define NEOREG_CURSX 0x04
  54. #define NEOREG_CURSY 0x08
  55. #define NEOREG_CURSBGCOLOR 0x0C
  56. #define NEOREG_CURSFGCOLOR 0x10
  57. #define NEOREG_CURSMEMPOS 0x14
  58. #define NEO_CURS_DISABLE 0x00000000
  59. #define NEO_CURS_ENABLE 0x00000001
  60. #define NEO_ICON64_ENABLE 0x00000008
  61. #define NEO_ICON128_ENABLE 0x0000000C
  62. #define NEO_ICON_BLANK 0x00000010
  63. #define NEO_GR01_SUPPRESS_VSYNC 0x10
  64. #define NEO_GR01_SUPPRESS_HSYNC 0x20
  65. #ifdef __KERNEL__
  66. #ifdef NEOFB_DEBUG
  67. # define DBG(x) printk (KERN_DEBUG "neofb: %s\n", (x));
  68. #else
  69. # define DBG(x)
  70. #endif
  71. #define PCI_CHIP_NM2070 0x0001
  72. #define PCI_CHIP_NM2090 0x0002
  73. #define PCI_CHIP_NM2093 0x0003
  74. #define PCI_CHIP_NM2097 0x0083
  75. #define PCI_CHIP_NM2160 0x0004
  76. #define PCI_CHIP_NM2200 0x0005
  77. #define PCI_CHIP_NM2230 0x0025
  78. #define PCI_CHIP_NM2360 0x0006
  79. #define PCI_CHIP_NM2380 0x0016
  80. struct xtimings {
  81. unsigned int pixclock;
  82. unsigned int HDisplay;
  83. unsigned int HSyncStart;
  84. unsigned int HSyncEnd;
  85. unsigned int HTotal;
  86. unsigned int VDisplay;
  87. unsigned int VSyncStart;
  88. unsigned int VSyncEnd;
  89. unsigned int VTotal;
  90. unsigned int sync;
  91. int dblscan;
  92. int interlaced;
  93. };
  94. /* --------------------------------------------------------------------- */
  95. typedef volatile struct {
  96. __u32 bltStat;
  97. __u32 bltCntl;
  98. __u32 xpColor;
  99. __u32 fgColor;
  100. __u32 bgColor;
  101. __u32 pitch;
  102. __u32 clipLT;
  103. __u32 clipRB;
  104. __u32 srcBitOffset;
  105. __u32 srcStart;
  106. __u32 reserved0;
  107. __u32 dstStart;
  108. __u32 xyExt;
  109. __u32 reserved1[19];
  110. __u32 pageCntl;
  111. __u32 pageBase;
  112. __u32 postBase;
  113. __u32 postPtr;
  114. __u32 dataPtr;
  115. } Neo2200;
  116. #define MMIO_SIZE 0x200000
  117. #define NEO_EXT_CR_MAX 0x85
  118. #define NEO_EXT_GR_MAX 0xC7
  119. struct neofb_par {
  120. struct vgastate state;
  121. struct mutex open_lock;
  122. unsigned int ref_count;
  123. unsigned char MiscOutReg; /* Misc */
  124. unsigned char CRTC[25]; /* Crtc Controller */
  125. unsigned char Sequencer[5]; /* Video Sequencer */
  126. unsigned char Graphics[9]; /* Video Graphics */
  127. unsigned char Attribute[21]; /* Video Atribute */
  128. unsigned char GeneralLockReg;
  129. unsigned char ExtCRTDispAddr;
  130. unsigned char ExtCRTOffset;
  131. unsigned char SysIfaceCntl1;
  132. unsigned char SysIfaceCntl2;
  133. unsigned char ExtColorModeSelect;
  134. unsigned char biosMode;
  135. unsigned char PanelDispCntlReg1;
  136. unsigned char PanelDispCntlReg2;
  137. unsigned char PanelDispCntlReg3;
  138. unsigned char PanelDispCntlRegRead;
  139. unsigned char PanelVertCenterReg1;
  140. unsigned char PanelVertCenterReg2;
  141. unsigned char PanelVertCenterReg3;
  142. unsigned char PanelVertCenterReg4;
  143. unsigned char PanelVertCenterReg5;
  144. unsigned char PanelHorizCenterReg1;
  145. unsigned char PanelHorizCenterReg2;
  146. unsigned char PanelHorizCenterReg3;
  147. unsigned char PanelHorizCenterReg4;
  148. unsigned char PanelHorizCenterReg5;
  149. int ProgramVCLK;
  150. unsigned char VCLK3NumeratorLow;
  151. unsigned char VCLK3NumeratorHigh;
  152. unsigned char VCLK3Denominator;
  153. unsigned char VerticalExt;
  154. #ifdef CONFIG_MTRR
  155. int mtrr;
  156. #endif
  157. u8 __iomem *mmio_vbase;
  158. u8 cursorOff;
  159. u8 *cursorPad; /* Must die !! */
  160. Neo2200 __iomem *neo2200;
  161. /* Panels size */
  162. int NeoPanelWidth;
  163. int NeoPanelHeight;
  164. int maxClock;
  165. int pci_burst;
  166. int lcd_stretch;
  167. int internal_display;
  168. int external_display;
  169. int libretto;
  170. u32 palette[16];
  171. };
  172. typedef struct {
  173. int x_res;
  174. int y_res;
  175. int mode;
  176. } biosMode;
  177. #endif