9 * ATT21C498 16-Bit Interface RAMDAC
10 * PrecisionDAC Technology
13 Cr0 = 0x00, /* Control register 0 */
14 Midr = 0x01, /* Manufacturer's identification register */
15 Didr = 0x02, /* Device identification register */
16 Rtest = 0x03, /* Red signature analysis register */
17 Gtest = 0x04, /* Green signature analysis register */
18 Btest = 0x05, /* Blue signature analysis register */
20 Nir = 0x06, /* number of indirect registers */
29 * Access to the indirect registers is accomplished by reading
30 * Pixmask 4 times, then subsequent reads cycle through the
31 * indirect registers. Any I/O write to a direct register resets
35 for(i = 0; i < 4+reg; i++)
52 attdaco(uchar reg, uchar data)
55 outportb(Pixmask, data);
60 options(Vga*, Ctlr* ctlr)
62 ctlr->flag |= Hpclk2x8|Foptions;
66 init(Vga* vga, Ctlr* ctlr)
72 * Part comes in -170, -130 and -110MHz speed-grades.
73 * In 8-bit mode the max. PCLK is 80MHz for the -110 part
74 * and 110MHz for the others. In 2x8-bit mode, the max.
75 * PCLK is the speed-grade, using the 2x doubler.
76 * We can use mode 2 (2x8-bit, internal clock doubler)
77 * if connected to a suitable graphics chip, e.g. the
79 * Work out the part speed-grade from name. Name can have,
80 * e.g. '-135' on the end for 135MHz part.
83 if(p = strrchr(ctlr->name, '-'))
84 grade = strtoul(p+1, 0, 0) * 1000000;
86 if(vga->ctlr && ((vga->ctlr->flag & Hpclk2x8) && vga->mode->z == 8))
89 if(grade == 110000000)
96 * If we don't already have a desired pclk,
97 * take it from the mode.
98 * Check it's within range.
101 vga->f[0] = vga->mode->frequency;
104 * Determine whether to use 2x8-bit mode or not.
105 * If yes and the clock has already been initialised,
106 * initialise it again.
108 if(vga->ctlr && (vga->ctlr->flag & Hpclk2x8) && vga->mode->z == 8 && vga->f[0] > 80000000){
110 resyncinit(vga, ctlr, Upclk2x8, 0);
113 error("%s: invalid pclk - %ld\n", ctlr->name, vga->f[0]);
119 load(Vga* vga, Ctlr* ctlr)
124 * Put the chip to sleep.
127 attdaco(Cr0, x|0x04);
130 if(ctlr->flag & Upclk2x8)
134 * Set the mode in the RAMDAC, setting 6/8-bit colour
135 * as appropriate and waking the chip back up.
137 if(vga->mode->z == 8 && 0)
145 dump(Vga*, Ctlr* ctlr)
149 printitem(ctlr->name, "");
150 for(i = 0; i < Nir; i++)
151 printreg(attdaci(i));
155 "att21c498", /* name */
157 options, /* options */