1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #define IBM525_REVISION 0x00
32 #define IBM525_ID 0x01
33
34
35 #define IBM525_MISC_CLOCK 0x02
36 #define MC_B24P_PLL 0x00
37 #define MC_B24P_SCLK 0x20
38 #define MC_DDOT_DIV_1 0x00
39 #define MC_DDOT_DIV_2 0x02
40 #define MC_DDOT_DIV_4 0x04
41 #define MC_DDOT_DIV_8 0x06
42 #define MC_DDOT_DIV_16 0x08
43 #define MC_DDOT_DIV_MASK 0x0e
44 #define MC_PLL_ENABLE 0x01
45
46
47 #define IBM525_SYNC 0x03
48 #define S_CSYN_INVERT 0x40
49 #define S_VSYN_INVERT 0x20
50 #define S_HSYN_INVERT 0x10
51 #define S_VSYN_NORMAL 0x00
52 #define S_VSYN_HIGH 0x04
53 #define S_VSYN_LOW 0x08
54 #define S_VSYN_DISABLE 0x0c
55 #define S_VSYN_MASK 0x0c
56 #define S_HSYN_NORMAL 0x00
57 #define S_HSYN_HIGH 0x01
58 #define S_HSYN_LOW 0x02
59 #define S_HSYN_DISABLE 0x03
60 #define S_HSYN_MASK 0x03
61
62
63 #define IBM525_HSYNC_POS 0x04
64
65
66 #define IBM525_POWER 0x05
67 #define P_SCLK_DISABLE 0x10
68 #define P_DDOT_DISABLE 0x08
69 #define P_SYNC_DISABLE 0x04
70 #define P_ICLK_DISABLE 0x02
71 #define P_DAC_PWR_DISABLE 0x01
72
73
74 #define IBM525_DAC_OP 0x06
75 #define DO_SOG 0x08
76 #define DO_FAST_SLEW 0x02
77 #define DO_BLANK_BR 0x04
78 #define DO_PEDESTAL 0x01
79
80
81 #define IBM525_PALETTE 0x07
82
83
84 #define IBM525_SYSCLK 0x08
85 #define SC_ENABLE 0x01
86
87
88 #define IBM525_PIXEL 0x0a
89 #define PIX_4BPP 0x02
90 #define PIX_8BPP 0x03
91 #define PIX_16BPP 0x04
92 #define PIX_24BPP 0x05
93 #define PIX_32BPP 0x06
94
95
96 #define IBM525_PF8 0x0b
97 #define PF8_INDIRECT 0x00
98 #define PF8_DIRECT 0x01
99
100
101 #define IBM525_PF16 0x0c
102 #define PF16_INDIRECT 0x00
103 #define PF16_DIRECT 0xc0
104 #define PF16_LINEAR 0x04
105 #define PF16_555 0x00
106 #define PF16_565 0x02
107
108
109 #define IBM525_PF24 0x0d
110 #define PF24_INDIRECT 0x00
111 #define PF24_DIRECT 0x01
112
113
114 #define IBM525_PF32 0x0e
115 #define PF32_INDIRECT 0x00
116 #define PF32_DIRECT 0x03
117 #define PF32_BYPASS 0x00
118 #define PF32_LOOKUP 0x04
119
120
121 #define IBM525_PLL1 0x10
122 #define P1_CLK_REF 0x00
123 #define P1_CLK_EXT 0x10
124 #define P1_SRC_EXT_F 0x00
125 #define P1_SRC_EXT_MN 0x01
126 #define P1_SRC_DIRECT_F 0x02
127 #define P1_SRC_DIRECT_MN 0x03
128
129
130 #define IBM525_PLL2 0x11
131
132
133 #define IBM525_PLL_FIXED_REF 0x14
134
135
136 #define IBM525_PLL_REF_DIV 0x15
137
138
139 #define IBM525_PLL_VCO_DIV 0x16
140
141
142 #define IBM525_F(n) (0x20 + (n))
143
144
145 #define IBM525_MISC1 0x70
146 #define M1_VRAM_32 0x00
147 #define M1_VRAM_64 0x01
148 #define M1_VRAM_SIZE_MASK 0x01
149 #define M1_SENSE_DISABLE 0x10
150
151
152 #define IBM525_MISC2 0x71
153 #define M2_PCLK_LOCAL 0x00
154 #define M2_PCLK_PLL 0x40
155 #define M2_PCLK_EXT 0x80
156 #define M2_PCLK_MASK 0xc0
157 #define M2_PALETTE_6 0x00
158 #define M2_PALETTE_8 0x04
159 #define M2_PALETTE_MASK 0x04
160 #define M2_MODE_VRAM 0x01
161 #define M2_MODE_VGA 0x00
162 #define M2_MODE_MASK 0x01
163
164
165 #define IBM525_MISC3 0x72
166 #define M3_SWAP_BR 0x80
167 #define M3_SWAP_WORDS 0x10
168 #define M3_SWAP_NIBBLES 0x02
169
170
171 #define IBM525_MISC4 0x73
172 #define M4_INVERT_DCLK 0x10
173 #define M4_FAST 0x20
174
175
176
177
178 #define MHZ_TO_PLL(m) \
179 (m) < 32 ? 0x00 | (4 * (m) - 65) : \
180 (m) < 64 ? 0x40 | (2 * (m) - 65) : \
181 (m) < 128 ? 0x80 | ((m) - 65) : \
182 0xc0 | ((m) / 2 - 65)