home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / ddx-mips.zip / FB_VDR1.H < prev    next >
C/C++ Source or Header  |  1992-06-17  |  6KB  |  208 lines

  1. /*
  2.  * |-----------------------------------------------------------|
  3.  * | Copyright (c) 1991, 1992 MIPS Computer Systems, Inc.      |
  4.  * | All Rights Reserved                       |
  5.  * |-----------------------------------------------------------|
  6.  * |          Restricted Rights Legend                   |
  7.  * | Use, duplication, or disclosure by the Government is      |
  8.  * | subject to restrictions as set forth in               |
  9.  * | subparagraph (c)(1)(ii) of the Rights in Technical           |
  10.  * | Data and Computer Software Clause of DFARS 252.227-7013.  |
  11.  * |         MIPS Computer Systems, Inc.               |
  12.  * |         950 DeGuigne Avenue                   |
  13.  * |         Sunnyvale, California 94088-3650, USA           |
  14.  * |-----------------------------------------------------------|
  15.  */
  16. /* $Header: fb_vdr1.h,v 1.6 92/06/17 09:47:40 dd Exp $ */
  17. #ifndef _SYS_FB_VDR1_H
  18. #define    _SYS_FB_VDR1_H
  19.  
  20. /*
  21.  * "VDR1"/"VDR3" frame buffer description
  22.  */
  23.  
  24. /* Inmos G364 video controller */
  25.  
  26. typedef struct {
  27. #ifdef _MIPSEL
  28.     volatile unsigned int r;
  29.     int pad;
  30. #else /* _MIPSEL */
  31.     int pad;
  32.     volatile unsigned int r;
  33. #endif /* _MIPSEL */
  34. } g364_reg;
  35.  
  36. struct g364 {
  37.     g364_reg boot;        /* 0x000 */
  38.     g364_reg pad021[0x20];
  39.     g364_reg halfsync;    /* 0x021 */
  40.     g364_reg backporch;    /* 0x022 */
  41.     g364_reg display;    /* 0x023 */
  42.     g364_reg shortdisplay;    /* 0x024 */
  43.     g364_reg broadpulse;    /* 0x025 */
  44.     g364_reg vsync;        /* 0x026 */
  45.     g364_reg vpreeq;    /* 0x027 */
  46.     g364_reg vposteq;    /* 0x028 */
  47.     g364_reg vblank;    /* 0x029 */
  48.     g364_reg vdisplay;    /* 0x02a */
  49.     g364_reg linetime;    /* 0x02b */
  50.     g364_reg linestart;    /* 0x02c */
  51.     g364_reg meminit;    /* 0x02d */
  52.     g364_reg xferdelay;    /* 0x02e */
  53.     g364_reg pad040[0x11];
  54.     g364_reg mask;        /* 0x040 */
  55.     g364_reg pad060[0x1f];
  56.     g364_reg control;    /* 0x060 */
  57.     g364_reg pad070[0x0f];
  58.     g364_reg controlb;    /* 0x070 */
  59.     g364_reg pad080[0x0f];
  60.     g364_reg top;        /* 0x080 */
  61.     g364_reg pad0a1[0x20];
  62.     g364_reg curcmap[3];    /* 0x0a1 .. 0x0a3 */
  63.     g364_reg pad0c0[0x1c];
  64.     g364_reg checksum[3];    /* 0x0c0 .. 0x0c2 */
  65.     g364_reg pad0c7[4];
  66.     g364_reg curpos;    /* 0x0c7 */
  67.     g364_reg pad100[0x38];
  68.     g364_reg cmap[256];    /* 0x100 .. 0x1ff */
  69.     g364_reg curpat[512];    /* 0x200 .. 0x3ff */
  70. };
  71.  
  72. /*
  73.  * Register bit definitions, and normal values for MIPS use
  74.  */
  75.  
  76. /*
  77.  * boot register
  78.  */
  79. #define    G364_BOOT_64BIT            0x40
  80. #define    G364_BOOT_PLL            0x20
  81. #define    G364_BOOTVAL(mult)        (0x40 + 0x20 + (mult))
  82.  
  83. /*
  84.  * control register A
  85.  */
  86. #define    G364_CONTROL_VTGON        0x000001
  87. #define    G364_CONTROL_INTERLACE        0x000002
  88. #define    G364_CONTROL_CCIR        0x000004
  89. #define    G364_CONTROL_SLAVE        0x000008
  90. #define    G364_CONTROL_PLAINSYNC        0x000010
  91. #define    G364_CONTROL_DIG_SEPSYNC    0x000020
  92. #define    G364_CONTROL_ANA_NOSYNC        0x000040
  93. #define    G364_CONTROL_PEDESTAL        0x000080
  94. #define    G364_CONTROL_CBLANKIN        0x000100
  95. #define    G364_CONTROL_CLKDISOUT        0x000200
  96. #define    G364_CONTROL_BLANK        0x000400
  97. #define    G364_CONTROL_BLANKOFF        0x000800
  98. #define    G364_CONTROL_VRAMINC_1        0x000000
  99. #define    G364_CONTROL_VRAMINC_256    0x001000
  100. #define    G364_CONTROL_VRAMINC_512    0x002000
  101. #define    G364_CONTROL_VRAMINC_1024    0x003000
  102. #define    G364_CONTROL_DMAOFF        0x004000
  103. #define    G364_CONTROL_PIXDELAY(val)    ((val) << 15)
  104. #define    G364_CONTROL_PIXINTERLEAVE    0x040000
  105. #define    G364_CONTROL_SAMPLEDELAY    0x080000
  106. #define    G364_CONTROL_BPP_1        0x000000
  107. #define    G364_CONTROL_BPP_2        0x100000
  108. #define    G364_CONTROL_BPP_4        0x200000
  109. #define    G364_CONTROL_BPP_8        0x300000
  110. #define    G364_CONTROL_BPP_15        0x400000
  111. #define    G364_CONTROL_BPP_16        0x500000
  112. #define    G364_CONTROL_BPP_24        0x600000
  113. #define    G364_CONTROL_CURSDIS        0x800000
  114.  
  115. #define    G364_CONTROL_INIT ( \
  116.     G364_CONTROL_CURSDIS | \
  117.     G364_CONTROL_BPP_8 | \
  118.     G364_CONTROL_BLANK)
  119.  
  120. /* initial control register value for 2M video boards */
  121. #define    G364_CONTROL_2M    ( \
  122.     G364_CONTROL_INIT | \
  123.     G364_CONTROL_VRAMINC_1024)
  124.  
  125. /* initial control register value for 1M video boards with G332 */
  126. #define    G332_CONTROL_1M    ( \
  127.     G364_CONTROL_INIT | \
  128.     G364_CONTROL_VRAMINC_1024 | \
  129.     G364_CONTROL_PIXINTERLEAVE | \
  130.     G364_CONTROL_SAMPLEDELAY)
  131.  
  132. /* initial control register value for 1M video boards with G364 */
  133. #define    G364_CONTROL_1M    ( \
  134.     G364_CONTROL_INIT | \
  135.     G364_CONTROL_VRAMINC_1024)
  136.  
  137. /*
  138.  * control register B (G335/G365 only)
  139.  */
  140. #define    G364_CONTROLB_EXTSAMP        0x000001
  141. #define    G364_CONTROLB_SYNCGREEN        0x000002
  142. #define    G364_CONTROLB_HSYNC_FLYBACK    0x000004
  143. #define    G364_CONTROLB_SPLITSAM        0x000008
  144. #define    G364_CONTROLB_COMP_BLUE        0x000010
  145. #define    G364_CONTROLB_COMP_GREEN    0x000020
  146. #define    G364_CONTROLB_COMP_RED        0x000040
  147. #define    G364_CONTROLB_COMPON        0x000080
  148. #define    G364_CONTROLB_CHKSUM_ZERO    0x000100
  149. #define    G364_CONTROLB_SYNCDIS        0x000200
  150. #define    G364_CONTROLB_VSYNC_ACTHIGH    0x000400
  151. #define    G364_CONTROLB_SYNC_ACTHIGH    0x000800
  152. #define    G364_CONTROLB_COMPCURS        0x001000
  153. #define    G364_CONTROLB_XGACURS        0x002000
  154. #define    G364_CONTROLB_EVEN_INTERLACE    0x004000
  155.  
  156.  
  157. /* minimum transfer delay */
  158. #define    G364_XFER_DELAY_33(pixel)    (((pixel) * 23) >> 6)    /* 1.35 us */
  159. #define    G364_XFER_DELAY_50(pixel)    (((pixel) * 16) >> 6)    /* 0.95 us */
  160. #define    G364_XFER_DELAY(pixel)        G364_XFER_DELAY_33(pixel)
  161.  
  162. /* cursor size, pixels and bytes */
  163. #define    G364_CURSMAX    64
  164. #define    G364_CURSBYTES    (64 * 64 * 2 / 8)
  165.  
  166. /* 8 bit register */
  167. struct vdr_reg8 {
  168. #ifdef _MIPSEL
  169.     volatile unsigned char r;
  170.     char pad[7];
  171. #else /* _MIPSEL */
  172.     char pad[7];
  173.     volatile unsigned char r;
  174. #endif /* _MIPSEL */
  175. };
  176.  
  177. /*
  178.  * VDR1 address map
  179.  */
  180. struct vdr1_reg {
  181.     struct g364 ramdac;    /* 0x60000000 .. 0x60002000 */
  182.     char pad1[0x10000 - sizeof (struct g364)];
  183.     struct vdr_reg8 id;    /* 0x60010000 */
  184.     char pad2[0x20000 - 0x10000 - 8];
  185.     struct vdr_reg8 reset;    /* 0x60020000 */
  186.     char pad3[4096 - 8];
  187. };
  188.  
  189.  
  190. /*
  191.  * "Fission" color frame buffer address map
  192.  */
  193. struct vdr1f_reg {
  194.     struct vdr_reg8 rom[65536];    /* 0x60000000 .. 0x6007ffff */
  195.     struct g364 ramdac;        /* 0x60080000 .. 0x60081fff */
  196.     char pad1[0x80000 - sizeof (struct g364)];
  197.     struct vdr_reg8 little_end;    /* 0x60100000 */
  198.     char pad2[0x2000 - 8];
  199.     struct vdr_reg8 big_end;    /* 0x60102000 */
  200.     char pad3[0x80000 - 0x2000 - 8];
  201.     struct vdr_reg8 reset;        /* 0x60180000 */
  202.     char pad4[0x2000 - 8];
  203.     struct vdr_reg8 monitor;    /* 0x60182000 */
  204.     char pad5[4096 - 8];
  205. };
  206.  
  207. #endif /* _SYS_FB_VDR1_H */
  208.