aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/olpc/files/drivers/video/geode/geode_regs.h
blob: 9e75505a880e5e1550cf0187a9466ea36bc895c3 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/* This header file defines the registers and suspend/resume
   structures for the Geode GX and LX.   The lxfb driver defines
   _GEODELX_ before including this file, which will unlock the
   extra registers that are only valid for LX.
*/

#ifndef _GEODE_REGS_H_
#define _GEODE_REGS_H_

/* MSRs */

#define GX_VP_MSR_PAD_SELECT    0xC0002011
#define LX_VP_MSR_PAD_SELECT    0x48000011

#define GEODE_MSR_GLCP_DOTPLL   0x4c000015

#define GLCP_DOTPLL_RESET    (1 << 0)
#define GLCP_DOTPLL_BYPASS   (1 << 15)
#define GLCP_DOTPLL_HALFPIX  (1 << 24)
#define GLCP_DOTPLL_LOCK     (1 << 25)

/* Registers */
#define VP_FP_START          0x400


#ifdef _GEODELX_

#define GP_REG_SIZE  0x7C
#define DC_REG_SIZE  0xF0
#define VP_REG_SIZE  0x158
#define FP_REG_SIZE  0x70

#else

#define GP_REG_SIZE 0x50
#define DC_REG_SIZE 0x90
#define VP_REG_SIZE 0x138
#define FP_REG_SIZE 0x70

#endif

#define DC_PAL_SIZE 0x105

struct geoderegs {

	struct {
		u64 padsel;
		u64 dotpll;

#ifdef _GEODELX_
		u64 dfglcfg;
		u64 dcspare;
#else
		u64 rstpll;
#endif
	} msr;

	union {
		unsigned char b[GP_REG_SIZE];
		struct {
			u32 dst_offset;         /* 0x00 */
			u32 src_offset;         /* 0x04 */
			u32 stride;             /* 0x08 */
			u32 wid_height;         /* 0x0C */
			u32 src_color_fg;       /* 0x10 */
			u32 src_color_bg;       /* 0x14 */
			u32 pat_color_0;        /* 0x18 */
			u32 pat_color_1;        /* 0x1C */
			u32 pat_color_2;        /* 0x20 */
			u32 pat_color_3;        /* 0x24 */
			u32 pat_color_4;        /* 0x28 */
			u32 pat_color_5;        /* 0x2C */
			u32 pat_data_0;         /* 0x30 */
			u32 pat_data_1;         /* 0x34 */
			u32 raster_mode;        /* 0x38 */
			u32 vector_mode;        /* 0x3C */
			u32 blt_mode;           /* 0x40 */
			u32 blit_status;        /* 0x4C */
			u32 hst_src;            /* 0x48 */
			u32 base_offset;        /* 0x4C */

#ifdef _GEODELX_
			u32 cmd_top;            /* 0x50 */
			u32 cmd_bot;            /* 0x54 */
			u32 cmd_read;           /* 0x58 */
			u32 cmd_write;          /* 0x5C */
			u32 ch3_offset;         /* 0x60 */
			u32 ch3_mode_str;       /* 0x64 */
			u32 ch3_width;          /* 0x68 */
			u32 ch3_hsrc;           /* 0x6C */
			u32 lut_index;          /* 0x70 */
			u32 lut_data;           /* 0x74 */
			u32 int_cntrl;          /* 0x78 */
#endif
		} r;
	} gp;

	union {
		unsigned char b[DC_REG_SIZE];

		struct {
			u32 unlock;             /* 0x00 */
			u32 gcfg;               /* 0x04 */
			u32 dcfg;               /* 0x08 */
			u32 arb;                /* 0x0C */
			u32 fb_st_offset;       /* 0x10 */
			u32 cb_st_offset;       /* 0x14 */
			u32 curs_st_offset;     /* 0x18 */
			u32 icon_st_offset;     /* 0x1C */
			u32 vid_y_st_offset;    /* 0x20 */
			u32 vid_u_st_offset;    /* 0x24 */
			u32 vid_v_st_offset;    /* 0x28 */
			u32 dctop;              /* 0x2c */
			u32 line_size;          /* 0x30 */
			u32 gfx_pitch;          /* 0x34 */
			u32 vid_yuv_pitch;      /* 0x38 */
			u32 rsvd2;              /* 0x3C */
			u32 h_active_timing;    /* 0x40 */
			u32 h_blank_timing;     /* 0x44 */
			u32 h_sync_timing;      /* 0x48 */
			u32 rsvd3;              /* 0x4C */
			u32 v_active_timing;    /* 0x50 */
			u32 v_blank_timing;     /* 0x54 */
			u32 v_sync_timing;      /* 0x58 */
			u32 fbactive;           /* 0x5C */
			u32 dc_cursor_x;        /* 0x60 */
			u32 dc_cursor_y;        /* 0x64 */
			u32 dc_icon_x;          /* 0x68 */
			u32 dc_line_cnt;        /* 0x6C */
			u32 rsvd5;              /* 0x70 - palette address */
			u32 rsvd6;              /* 0x74 - palette data */
			u32 dfifo_diag;         /* 0x78 */
			u32 cfifo_diag;         /* 0x7C */
			u32 dc_vid_ds_delta;    /* 0x80 */
			u32 gliu0_mem_offset;   /* 0x84 */
			u32 dv_ctl;             /* 0x88 - added by LX */
			u32 dv_acc;             /* 0x8C */

#ifdef _GEODELX_
			u32 gfx_scale;
			u32 irq_filt_ctl;
			u32 filt_coeff1;
			u32 filt_coeff2;
			u32 vbi_event_ctl;
			u32 vbi_odd_ctl;
			u32 vbi_hor;
			u32 vbi_ln_odd;
			u32 vbi_ln_event;
			u32 vbi_pitch;
			u32 clr_key;
			u32 clr_key_mask;
			u32 clr_key_x;
			u32 clr_key_y;
			u32 irq;
			u32 rsvd8;
			u32 genlk_ctrl;
			u32 vid_even_y_st_offset;    /* 0xD8 */
			u32 vid_even_u_st_offset;    /* 0xDC */
			u32 vid_even_v_st_offset;    /* 0xE0 */
			u32 v_active_even_timing;    /* 0xE4 */
			u32 v_blank_even_timing;     /* 0xE8 */
			u32 v_sync_even_timing;      /* 0xEC */
#endif
		} r;
	} dc;

	union {
		unsigned char b[VP_REG_SIZE];

		struct {
			u64 vcfg;               /* 0x00 */
			u64 dcfg;               /* 0x08 */
			u64 vx;                 /* 0x10 */
			u64 vy;                 /* 0x18 */
			u64 vs;                 /* 0x20 */
			u64 vck;                /* 0x28 */
			u64 vcm;                /* 0x30 */
			u64 rsvd1;              /* 0x38 - Gamma address*/
			u64 rsvd2;              /* 0x40 - Gamma data*/
			u64 rsvd3;              /* 0x48 */
			u64 misc;               /* 0x50 */
			u64 ccs;                /* 0x58 */
			u64 rsvd4[3];           /* 0x60-0x70 */
			u64 vdc;                /* 0x78 */
			u64 vco;                /* 0x80 */
			u64 crc;                /* 0x88 */
			u64 crc32;              /* 0x90 */
			u64 vde;                /* 0x98 */
			u64 cck;                /* 0xA0 */
			u64 ccm;                /* 0xA8 */
			u64 cc1;                /* 0xB0 */
			u64 cc2;                /* 0xB8 */
			u64 a1x;                /* 0xC0 */
			u64 a1y;                /* 0xC8 */
			u64 a1c;                /* 0xD0 */
			u64 a1t;                /* 0xD8 */
			u64 a2x;                /* 0xE0 */
			u64 a2y;                /* 0xE8 */
			u64 a2c;                /* 0xF0 */
			u64 a2t;                /* 0xF8 */
			u64 a3x;                /* 0x100 */
			u64 a3y;                /* 0x108 */
			u64 a3c;                /* 0x110 */
			u64 a3t;                /* 0x118 */
			u64 vrr;                /* 0x120 */
			u64 awt;                /* 0x128 */
			u64 vtm;                /* 0x130 */
#ifdef _GEODELX_
			u64 vye;                /* 0x138 */
			u64 a1ye;               /* 0x140 */
			u32 a2ye;               /* 0x148 */
			u32 a3ye;	        /* 0x150 */
#endif
		} r;
	} vp;

	union {
		unsigned char b[FP_REG_SIZE];

		struct {
			u64 pt1;                /* 0x400 */
			u64 pt2;                /* 0x408 */
			u64 pm;                 /* 0x410 */
			u64 dfc;                /* 0x418 */
			u64 blfsr;              /* 0x420 */
			u64 rlfsr;              /* 0x428 */
			u64 fmi;                /* 0x430 */
			u64 fmd;                /* 0x438 */
			u64 rsvd;               /* 0x440 */
			u64 dca;                /* 0x448 */
			u64 dmd;                /* 0x450 */
			u64 crc;                /* 0x458 */
			u64 fbb;                /* 0x460 */
			u64 crc32;              /* 0x468 */
		} r;
	} fp;

	u32 pal[DC_PAL_SIZE];
	u32 gamma[256];
};

#endif