neomagic.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. /* --------------------------------------------------------------------- */
  81. typedef volatile struct {
  82. __u32 bltStat;
  83. __u32 bltCntl;
  84. __u32 xpColor;
  85. __u32 fgColor;
  86. __u32 bgColor;
  87. __u32 pitch;
  88. __u32 clipLT;
  89. __u32 clipRB;
  90. __u32 srcBitOffset;
  91. __u32 srcStart;
  92. __u32 reserved0;
  93. __u32 dstStart;
  94. __u32 xyExt;
  95. __u32 reserved1[19];
  96. __u32 pageCntl;
  97. __u32 pageBase;
  98. __u32 postBase;
  99. __u32 postPtr;
  100. __u32 dataPtr;
  101. } Neo2200;
  102. #define MMIO_SIZE 0x200000
  103. #define NEO_EXT_CR_MAX 0x85
  104. #define NEO_EXT_GR_MAX 0xC7
  105. struct neofb_par {
  106. struct vgastate state;
  107. unsigned int ref_count;
  108. unsigned char MiscOutReg; /* Misc */
  109. unsigned char CRTC[25]; /* Crtc Controller */
  110. unsigned char Sequencer[5]; /* Video Sequencer */
  111. unsigned char Graphics[9]; /* Video Graphics */
  112. unsigned char Attribute[21]; /* Video Attribute */
  113. unsigned char GeneralLockReg;
  114. unsigned char ExtCRTDispAddr;
  115. unsigned char ExtCRTOffset;
  116. unsigned char SysIfaceCntl1;
  117. unsigned char SysIfaceCntl2;
  118. unsigned char ExtColorModeSelect;
  119. unsigned char biosMode;
  120. unsigned char PanelDispCntlReg1;
  121. unsigned char PanelDispCntlReg2;
  122. unsigned char PanelDispCntlReg3;
  123. unsigned char PanelDispCntlRegRead;
  124. unsigned char PanelVertCenterReg1;
  125. unsigned char PanelVertCenterReg2;
  126. unsigned char PanelVertCenterReg3;
  127. unsigned char PanelVertCenterReg4;
  128. unsigned char PanelVertCenterReg5;
  129. unsigned char PanelHorizCenterReg1;
  130. unsigned char PanelHorizCenterReg2;
  131. unsigned char PanelHorizCenterReg3;
  132. unsigned char PanelHorizCenterReg4;
  133. unsigned char PanelHorizCenterReg5;
  134. int ProgramVCLK;
  135. unsigned char VCLK3NumeratorLow;
  136. unsigned char VCLK3NumeratorHigh;
  137. unsigned char VCLK3Denominator;
  138. unsigned char VerticalExt;
  139. #ifdef CONFIG_MTRR
  140. int mtrr;
  141. #endif
  142. u8 __iomem *mmio_vbase;
  143. u8 cursorOff;
  144. u8 *cursorPad; /* Must die !! */
  145. Neo2200 __iomem *neo2200;
  146. /* Panels size */
  147. int NeoPanelWidth;
  148. int NeoPanelHeight;
  149. int maxClock;
  150. int pci_burst;
  151. int lcd_stretch;
  152. int internal_display;
  153. int external_display;
  154. int libretto;
  155. u32 palette[16];
  156. };
  157. typedef struct {
  158. int x_res;
  159. int y_res;
  160. int mode;
  161. } biosMode;
  162. #endif