home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Examples / DriverKit / JAWS / JAWS_reloc.tproj / JAWSModes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-30  |  6.2 KB  |  264 lines

  1. /*     Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * JAWSModes.h - Private definitions for the JAWS display driver
  4.  *
  5.  * HISTORY
  6.  * 02 Sep 92    Joe Pasqua
  7.  *      Created. 
  8.  * 12 July 1993    Derek B Clegg
  9.  *    Cleanup for external release.
  10.  */
  11. #ifndef JAWSMODES_H__
  12. #define JAWSMODES_H__
  13.  
  14. #define    JAWS_EISA_ID    0x10AC6001
  15.  
  16. #define JAWS_VIDEO_W    1120            /* 1120 x 832 mode */
  17. #define JAWS_VIDEO_MW    1120
  18. #define JAWS_VIDEO_H    832
  19. #define JAWS_VIDEO_NBPL    (JAWS_VIDEO_MW * 2)    /* 2 bytes/pixel */
  20.  
  21. /* I/O Registers */
  22.  
  23. #define JAWS_CTL_PHYS_512M    1
  24. #define JAWS_CTL_PHYS_640M    2
  25. #define JAWS_CTL_PHYS_768M    3
  26. #define JAWS_CTL_REG_IOADDR    0x6C88
  27.  
  28. typedef struct {
  29.     unsigned char phys:2;
  30.     unsigned char cache:1;
  31.     unsigned char ienable:1;
  32.     unsigned char reset:1;
  33.     unsigned char retrace:1;
  34.     unsigned char JAWSvga:1;
  35.     unsigned char bbp12:1;
  36. } jaws_ctl_reg_t;
  37.  
  38. /* JAWS Control Bits Register
  39.  *   Make sure bit 0 is set - jaws_enable
  40.  *   Make sure of 20uS delay between CBR0_RESET and CBR0_ENABLE
  41.  *   Must RESET then set ENABLE.
  42.  */
  43. #define JAWS_CBR0    0x6C84
  44.  
  45. #define    CBR0_ENABLE    0x01
  46. #define CBR0_ERROR    0x02
  47. #define    CBR0_RESET    0x04
  48.  
  49. /* JAWS Output Port 1 */
  50.  
  51. #define JAWS_OPP1    0x6CA8
  52.  
  53. #define OPP1_MULTI    0x01
  54. #define    OPP1_VGA_PASS    0x02
  55. #define    OPP1_MEM_OFF    0x00
  56. #define    OPP1_MEM_512    0x04
  57. #define    OPP1_MEM_640    0x08
  58. #define OPP1_MEM_768    0x0C
  59.  
  60. /* JAWS Interrupt Config and Status Reg 0 */
  61.  
  62. #define JAWS_CSR0    0x6CA9
  63.  
  64. #define    CSR0_INT_OFF    0x00
  65. #define    CSR0_INT_05    0x09
  66. #define    CSR0_INT_09    0x08    /* IRQ9 is rumoured to be broken. */
  67. #define CSR0_INT_10    0X0A
  68. #define    CSR0_INT_11    0X0B
  69. #define CSR0_INT_SENSE    0x10
  70. #define    CSR0_INT_VSENS    0x20
  71. #define CSR0_INT_STAT    0x80
  72.  
  73. /* JAWS Input Port 1 */
  74.  
  75. #define JAWS_IPP1    0x6CAC
  76.  
  77. #define    IPP1_BLANK    0x01
  78.  
  79. /* JAWS Output Port 2
  80.  *   Must have CBR0_ENABLE set to use this register.
  81.  * Must avoid values 0x00 and 0x0C.
  82.  */
  83.  
  84. #define    JAWS_OPP2    0x6CAD
  85.  
  86. #define    OPP2_SCRATCH1    0x01
  87. #define OPP2_SCRATCH2    0x02
  88. #define    OPP2_MODE_NORM    0x08
  89. #define OPP2_MODE_NeXT    0x10
  90. #define    OPP2_FB_CACHE    0x20
  91.  
  92. /* Memory address. */
  93.  
  94. #define    JAWS_BASE_512    0x20000000
  95. #define    JAWS_BASE_640    0x28000000
  96. #define    JAWS_BASE_768    0x30000000
  97. #define JAWS_G332_OFF    0x00200000
  98. #define JAWS_BASE_SIZ    0x00400000
  99.  
  100. #define JAWS_PHYS_BAS    JAWS_BASE_512
  101.  
  102. /* JAWS_BASE_ADR is now a instance variable of the JAWS class. When
  103.  * we map the fb's physical address we allow the system to choose a virtual
  104.  * address. That address is `baseAddress'.
  105.  */
  106. #if 0
  107. #define    JAWS_BASE_ADR    (VM_MIN_KERNEL_ADDRESS + JAWS_PHYS_BAS)
  108. #else
  109. #define JAWS_BASE_ADR    (baseAddress)
  110. #endif
  111.  
  112. #define JAWS_BASE_REG    (JAWS_BASE_ADR + JAWS_G332_OFF)
  113.  
  114. #define JAWS_BASE_END    (JAWS_BASE_ADR + JAWS_BASE_SIZ)
  115.  
  116. /* ASIC REGS */
  117.  
  118. #define    JAWS_DAC0    0x6C91
  119. #define    JAWS_DAC1    0x6C92
  120. #define JAWS_DAC2    0x6C93
  121. #define JAWS_DAC3    0x6C94
  122. #define    JAWS_DAC4    0x6C99
  123. #define JAWS_DAC5    0x6C9A
  124. #define    JAWS_DAC6    0x6C9B
  125. #define    JAWS_DAC7    0x6C9C
  126. #define    JAWS_DAC8    0x6CAE
  127.  
  128. /* Memory Registers. */
  129.  
  130. /* BOOT register. */
  131.  
  132. #define    JAWS_BOOT_REG    (JAWS_BASE_REG + 0x00000000)
  133.  
  134. #define CLK_PLL_MUL_9    0x00000009
  135. #define    CLK_PLL_MUL_B    0x0000000B    /* Out of thin air !!! */
  136. #define CLK_PLL_MUL_C    0x0000000C
  137. #define    CLK_SRC_PLL    0x00000020
  138. #define MPA_ALIGN    0x00000040
  139.  
  140. #define    JAWS_CRA_REG    (JAWS_BASE_REG + 0x00000180)
  141.  
  142. #define    CRA_VTG_DIS    0x00000000
  143. #define    CRA_VTG_ENA    0x00000001
  144.  
  145. #define CRA_NON_INT    0x00000000
  146. #define    CRA_INTRLCE    0x00000002
  147.  
  148. #define    CRA_FMT_CCI    0x00000000
  149. #define    CRA_FMT_EIA    0x00000004
  150.  
  151. #define    CRA_MDE_MST    0x00000000
  152. #define    CRA_MDE_SLV    0x00000008
  153.  
  154. #define    CRA_SYN_TES    0x00000000
  155. #define    CRA_SYN_PLN    0x00000010
  156.  
  157. #define CRA_SYN_CMP    0x00000000
  158. #define    CRA_SYN_SEP    0x00000020
  159.  
  160. #define    CRA_FMT_C_S    0x00000000
  161. #define    CRA_FMT_VID    0x00000040
  162.  
  163. #define    CRA_BLK_NON    0x00000000
  164. #define    CRA_BLK_PED    0x00000080
  165.  
  166. #define    CRA_CBL_OUT    0x00000000
  167. #define    CRA_CBL_INP    0x00000100
  168.  
  169. #define CRA_BLK_PAD    0x00000000
  170. #define    CRA_CLK_PAD    0x00000200
  171.  
  172. #define    CRA_BLK_NON    0x00000000
  173. #define    CRA_BLK_FRC    0x00000400
  174.  
  175. #define CRA_BLK_ENA    0x00000000
  176. #define CRA_BLK_DIS    0x00000800
  177.  
  178. #define CRA_001_001    0x00000000
  179. #define CRA_256_002    0x00001000
  180. #define    CRA_512_512    0x00002000
  181. #define CRA_1KB_1KB    0x00003000
  182.  
  183. #define    CRA_DMA_ENA    0x00000000
  184. #define CRA_DMA_DIS    0x00004000
  185.  
  186. #define CRA_SYN_000    0x00000000
  187. #define CRA_SYN_001    0x00008000
  188. #define CRA_SYN_002    0x00010000
  189. #define CRA_SYN_003    0x00018000
  190. #define CRA_SYN_004    0x00020000
  191. #define CRA_SYN_005    0x00028000
  192. #define CRA_SYN_006    0x00030000
  193. #define CRA_SYN_007    0x00038000
  194.  
  195. #define    CRA_PPI_NON    0x00000000
  196. #define CRA_PPI_INT    0x00040000
  197.  
  198. #define    CRA_SMP_DIS    0x00000000
  199. #define CRA_SMP_DEL    0x00080000
  200.  
  201. #define CRA_ILM_008    0x00600000
  202. #define CRA_ILM_004    0x00400000
  203. #define CRA_ILM_002    0x00200000
  204. #define CRA_ILM_001    0x00000000
  205.  
  206. #define CRA_NON_016    0x00500000
  207. #define CRA_NON_015    0x00400000
  208. #define CRA_NON_008    0x00300000
  209. #define    CRA_NON_004    0x00200000
  210. #define    CRA_NON_002    0x00100000
  211. #define    CRA_NON_001    0x00000000
  212.  
  213. #define    CRA_CRS_ENA    0x00000000 
  214. #define    CRA_CRS_DIS    0x00800000 
  215.  
  216. /* Various VTG registers. */
  217.  
  218. #define    JAWS_VTG_HALF_SYNC        (JAWS_BASE_REG + 0x00000084)
  219. #define    JAWS_VTG_BACK_PORCH        (JAWS_BASE_REG + 0x00000088)
  220. #define    JAWS_VTG_DISPLAY        (JAWS_BASE_REG + 0x0000008C)
  221. #define    JAWS_VTG_SHORTDISPLAY        (JAWS_BASE_REG + 0x00000090)
  222. #define    JAWS_VTG_BROADPAUSE        (JAWS_BASE_REG + 0x00000094)
  223. #define    JAWS_VTG_VSYNC            (JAWS_BASE_REG + 0x00000098)
  224. #define    JAWS_VTG_VPREEQUALISE        (JAWS_BASE_REG + 0x0000009C)
  225. #define    JAWS_VTG_VPOSTEQUALISE        (JAWS_BASE_REG + 0x000000A0)
  226. #define    JAWS_VTG_VBLANK            (JAWS_BASE_REG + 0x000000A4)
  227. #define    JAWS_VTG_VDISPLAY        (JAWS_BASE_REG + 0x000000A8)
  228. #define    JAWS_VTG_LINETIME        (JAWS_BASE_REG + 0x000000AC)
  229. #define    JAWS_VTG_LINESTART        (JAWS_BASE_REG + 0x000000B0)
  230. #define    JAWS_VTG_MEMINIT        (JAWS_BASE_REG + 0x000000B4)
  231. #define    JAWS_VTG_TRANSFERDELAY        (JAWS_BASE_REG + 0x000000B8)
  232.  
  233. /* MASK register. */
  234.  
  235. #define    JAWS_MASK_REG    (JAWS_BASE_REG + 0x00000100)
  236.  
  237. /* TOP of SCREEN. */
  238.  
  239. #define JAWS_TOS_REG    (JAWS_BASE_REG + 0x00000200)
  240.  
  241. /* Colour palette. */
  242.  
  243. #define JAWS_COL_PAL    (JAWS_BASE_REG + 0x00000400)
  244.  
  245. extern int *colour_palette;
  246.  
  247. #define    BLUE    0x00F0
  248. #define GREEN    0x0F00
  249. #define    RED    0xF000
  250. #define    WHITE    0xFFF0
  251. #define BLACK    0x0000
  252.  
  253. #define OFF0 0x00000000
  254. #define OFF1 0x00080000
  255. #define OFF2 0x00100000
  256. #define OFF3 0x00180000
  257.  
  258. #define Red  0xF000F000
  259. #define Grn  0x0F000F00
  260. #define Blu  0x00F000F0
  261. #define Wht  0xFFF0FFF0
  262.  
  263. #endif    /* JAWSMODES_H__ */
  264.