Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
w100fb.h
Go to the documentation of this file.
1 /*
2  * linux/drivers/video/w100fb.h
3  *
4  * Frame Buffer Device for ATI w100 (Wallaby)
5  *
6  * Copyright (C) 2002, ATI Corp.
7  * Copyright (C) 2004-2005 Richard Purdie
8  * Copyright (c) 2005 Ian Molton <[email protected]>
9  *
10  * Modified to work with 2.6 by Richard Purdie <[email protected]>
11  *
12  * w32xx support by Ian Molton
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License version 2 as
16  * published by the Free Software Foundation.
17  *
18  */
19 
20 #if !defined (_W100FB_H)
21 #define _W100FB_H
22 
23 /* Block CIF Start: */
24 #define mmCHIP_ID 0x0000
25 #define mmREVISION_ID 0x0004
26 #define mmWRAP_BUF_A 0x0008
27 #define mmWRAP_BUF_B 0x000C
28 #define mmWRAP_TOP_DIR 0x0010
29 #define mmWRAP_START_DIR 0x0014
30 #define mmCIF_CNTL 0x0018
31 #define mmCFGREG_BASE 0x001C
32 #define mmCIF_IO 0x0020
33 #define mmCIF_READ_DBG 0x0024
34 #define mmCIF_WRITE_DBG 0x0028
35 #define cfgIND_ADDR_A_0 0x0000
36 #define cfgIND_ADDR_A_1 0x0001
37 #define cfgIND_ADDR_A_2 0x0002
38 #define cfgIND_DATA_A 0x0003
39 #define cfgREG_BASE 0x0004
40 #define cfgINTF_CNTL 0x0005
41 #define cfgSTATUS 0x0006
42 #define cfgCPU_DEFAULTS 0x0007
43 #define cfgIND_ADDR_B_0 0x0008
44 #define cfgIND_ADDR_B_1 0x0009
45 #define cfgIND_ADDR_B_2 0x000A
46 #define cfgIND_DATA_B 0x000B
47 #define cfgPM4_RPTR 0x000C
48 #define cfgSCRATCH 0x000D
49 #define cfgPM4_WRPTR_0 0x000E
50 #define cfgPM4_WRPTR_1 0x000F
51 /* Block CIF End: */
52 
53 /* Block CP Start: */
54 #define mmSCRATCH_UMSK 0x0280
55 #define mmSCRATCH_ADDR 0x0284
56 #define mmGEN_INT_CNTL 0x0200
57 #define mmGEN_INT_STATUS 0x0204
58 /* Block CP End: */
59 
60 /* Block DISPLAY Start: */
61 #define mmLCD_FORMAT 0x0410
62 #define mmGRAPHIC_CTRL 0x0414
63 #define mmGRAPHIC_OFFSET 0x0418
64 #define mmGRAPHIC_PITCH 0x041C
65 #define mmCRTC_TOTAL 0x0420
66 #define mmACTIVE_H_DISP 0x0424
67 #define mmACTIVE_V_DISP 0x0428
68 #define mmGRAPHIC_H_DISP 0x042C
69 #define mmGRAPHIC_V_DISP 0x0430
70 #define mmVIDEO_CTRL 0x0434
71 #define mmGRAPHIC_KEY 0x0438
72 #define mmBRIGHTNESS_CNTL 0x045C
73 #define mmDISP_INT_CNTL 0x0488
74 #define mmCRTC_SS 0x048C
75 #define mmCRTC_LS 0x0490
76 #define mmCRTC_REV 0x0494
77 #define mmCRTC_DCLK 0x049C
78 #define mmCRTC_GS 0x04A0
79 #define mmCRTC_VPOS_GS 0x04A4
80 #define mmCRTC_GCLK 0x04A8
81 #define mmCRTC_GOE 0x04AC
82 #define mmCRTC_FRAME 0x04B0
83 #define mmCRTC_FRAME_VPOS 0x04B4
84 #define mmGPIO_DATA 0x04B8
85 #define mmGPIO_CNTL1 0x04BC
86 #define mmGPIO_CNTL2 0x04C0
87 #define mmLCDD_CNTL1 0x04C4
88 #define mmLCDD_CNTL2 0x04C8
89 #define mmGENLCD_CNTL1 0x04CC
90 #define mmGENLCD_CNTL2 0x04D0
91 #define mmDISP_DEBUG 0x04D4
92 #define mmDISP_DB_BUF_CNTL 0x04D8
93 #define mmDISP_CRC_SIG 0x04DC
94 #define mmCRTC_DEFAULT_COUNT 0x04E0
95 #define mmLCD_BACKGROUND_COLOR 0x04E4
96 #define mmCRTC_PS2 0x04E8
97 #define mmCRTC_PS2_VPOS 0x04EC
98 #define mmCRTC_PS1_ACTIVE 0x04F0
99 #define mmCRTC_PS1_NACTIVE 0x04F4
100 #define mmCRTC_GCLK_EXT 0x04F8
101 #define mmCRTC_ALW 0x04FC
102 #define mmCRTC_ALW_VPOS 0x0500
103 #define mmCRTC_PSK 0x0504
104 #define mmCRTC_PSK_HPOS 0x0508
105 #define mmCRTC_CV4_START 0x050C
106 #define mmCRTC_CV4_END 0x0510
107 #define mmCRTC_CV4_HPOS 0x0514
108 #define mmCRTC_ECK 0x051C
109 #define mmREFRESH_CNTL 0x0520
110 #define mmGENLCD_CNTL3 0x0524
111 #define mmGPIO_DATA2 0x0528
112 #define mmGPIO_CNTL3 0x052C
113 #define mmGPIO_CNTL4 0x0530
114 #define mmCHIP_STRAP 0x0534
115 #define mmDISP_DEBUG2 0x0538
116 #define mmDEBUG_BUS_CNTL 0x053C
117 #define mmGAMMA_VALUE1 0x0540
118 #define mmGAMMA_VALUE2 0x0544
119 #define mmGAMMA_SLOPE 0x0548
120 #define mmGEN_STATUS 0x054C
121 #define mmHW_INT 0x0550
122 /* Block DISPLAY End: */
123 
124 /* Block GFX Start: */
125 #define mmDST_OFFSET 0x1004
126 #define mmDST_PITCH 0x1008
127 #define mmDST_Y_X 0x1038
128 #define mmDST_WIDTH_HEIGHT 0x1198
129 #define mmDP_GUI_MASTER_CNTL 0x106C
130 #define mmBRUSH_OFFSET 0x108C
131 #define mmBRUSH_Y_X 0x1074
132 #define mmDP_BRUSH_FRGD_CLR 0x107C
133 #define mmSRC_OFFSET 0x11AC
134 #define mmSRC_PITCH 0x11B0
135 #define mmSRC_Y_X 0x1034
136 #define mmDEFAULT_PITCH_OFFSET 0x10A0
137 #define mmDEFAULT_SC_BOTTOM_RIGHT 0x10A8
138 #define mmDEFAULT2_SC_BOTTOM_RIGHT 0x10AC
139 #define mmSC_TOP_LEFT 0x11BC
140 #define mmSC_BOTTOM_RIGHT 0x11C0
141 #define mmSRC_SC_BOTTOM_RIGHT 0x11C4
142 #define mmGLOBAL_ALPHA 0x1210
143 #define mmFILTER_COEF 0x1214
144 #define mmMVC_CNTL_START 0x11E0
145 #define mmE2_ARITHMETIC_CNTL 0x1220
146 #define mmDP_CNTL 0x11C8
147 #define mmDP_CNTL_DST_DIR 0x11CC
148 #define mmDP_DATATYPE 0x12C4
149 #define mmDP_MIX 0x12C8
150 #define mmDP_WRITE_MSK 0x12CC
151 #define mmENG_CNTL 0x13E8
152 #define mmENG_PERF_CNT 0x13F0
153 /* Block GFX End: */
154 
155 /* Block IDCT Start: */
156 #define mmIDCT_RUNS 0x0C00
157 #define mmIDCT_LEVELS 0x0C04
158 #define mmIDCT_CONTROL 0x0C3C
159 #define mmIDCT_AUTH_CONTROL 0x0C08
160 #define mmIDCT_AUTH 0x0C0C
161 /* Block IDCT End: */
162 
163 /* Block MC Start: */
164 #define mmMEM_CNTL 0x0180
165 #define mmMEM_ARB 0x0184
166 #define mmMC_FB_LOCATION 0x0188
167 #define mmMEM_EXT_CNTL 0x018C
168 #define mmMC_EXT_MEM_LOCATION 0x0190
169 #define mmMEM_EXT_TIMING_CNTL 0x0194
170 #define mmMEM_SDRAM_MODE_REG 0x0198
171 #define mmMEM_IO_CNTL 0x019C
172 #define mmMC_DEBUG 0x01A0
173 #define mmMC_BIST_CTRL 0x01A4
174 #define mmMC_BIST_COLLAR_READ 0x01A8
175 #define mmTC_MISMATCH 0x01AC
176 #define mmMC_PERF_MON_CNTL 0x01B0
177 #define mmMC_PERF_COUNTERS 0x01B4
178 /* Block MC End: */
179 
180 /* Block BM Start: */
181 #define mmBM_EXT_MEM_BANDWIDTH 0x0A00
182 #define mmBM_OFFSET 0x0A04
183 #define mmBM_MEM_EXT_TIMING_CNTL 0x0A08
184 #define mmBM_MEM_EXT_CNTL 0x0A0C
185 #define mmBM_MEM_MODE_REG 0x0A10
186 #define mmBM_MEM_IO_CNTL 0x0A18
187 #define mmBM_CONFIG 0x0A1C
188 #define mmBM_STATUS 0x0A20
189 #define mmBM_DEBUG 0x0A24
190 #define mmBM_PERF_MON_CNTL 0x0A28
191 #define mmBM_PERF_COUNTERS 0x0A2C
192 #define mmBM_PERF2_MON_CNTL 0x0A30
193 #define mmBM_PERF2_COUNTERS 0x0A34
194 /* Block BM End: */
195 
196 /* Block RBBM Start: */
197 #define mmWAIT_UNTIL 0x1400
198 #define mmISYNC_CNTL 0x1404
199 #define mmRBBM_STATUS 0x0140
200 #define mmRBBM_CNTL 0x0144
201 #define mmNQWAIT_UNTIL 0x0150
202 /* Block RBBM End: */
203 
204 /* Block CG Start: */
205 #define mmCLK_PIN_CNTL 0x0080
206 #define mmPLL_REF_FB_DIV 0x0084
207 #define mmPLL_CNTL 0x0088
208 #define mmSCLK_CNTL 0x008C
209 #define mmPCLK_CNTL 0x0090
210 #define mmCLK_TEST_CNTL 0x0094
211 #define mmPWRMGT_CNTL 0x0098
212 #define mmPWRMGT_STATUS 0x009C
213 /* Block CG End: */
214 
215 /* default value definitions */
216 #define defWRAP_TOP_DIR 0x00000000
217 #define defWRAP_START_DIR 0x00000000
218 #define defCFGREG_BASE 0x00000000
219 #define defCIF_IO 0x000C0902
220 #define defINTF_CNTL 0x00000011
221 #define defCPU_DEFAULTS 0x00000006
222 #define defHW_INT 0x00000000
223 #define defMC_EXT_MEM_LOCATION 0x07ff0000
224 #define defTC_MISMATCH 0x00000000
225 
226 #define W100_CFG_BASE 0x0
227 #define W100_CFG_LEN 0x10
228 #define W100_REG_BASE 0x10000
229 #define W100_REG_LEN 0x2000
230 #define MEM_INT_BASE_VALUE 0x100000
231 #define MEM_EXT_BASE_VALUE 0x800000
232 #define MEM_INT_SIZE 0x05ffff
233 #define MEM_WINDOW_BASE 0x100000
234 #define MEM_WINDOW_SIZE 0xf00000
235 
236 #define WRAP_BUF_BASE_VALUE 0x80000
237 #define WRAP_BUF_TOP_VALUE 0xbffff
238 
239 #define CHIP_ID_W100 0x57411002
240 #define CHIP_ID_W3200 0x56441002
241 #define CHIP_ID_W3220 0x57441002
242 
243 /* Register structure definitions */
244 
246  u32 top_addr : 23;
247  u32 : 9;
248 } __attribute__((packed));
251  u32 val : 32;
253 } __attribute__((packed));
257  u32 : 9;
258 } __attribute__((packed));
261  u32 val : 32;
263 } __attribute__((packed));
264 
265 struct cif_cntl_t {
285  u32 dis_mr : 1;
287 } __attribute__((packed));
289 union cif_cntl_u {
290  u32 val : 32;
291  struct cif_cntl_t f;
292 } __attribute__((packed));
296  u32 : 8;
297 } __attribute__((packed));
300  u32 val : 32;
301  struct cfgreg_base_t f;
302 } __attribute__((packed));
304 struct cif_io_t {
305  u32 dq_srp : 1;
306  u32 dq_srn : 1;
307  u32 dq_sp : 4;
308  u32 dq_sn : 4;
317  u32 : 2;
318 } __attribute__((packed));
320 union cif_io_u {
321  u32 val : 32;
322  struct cif_io_t f;
323 } __attribute__((packed));
345  u32 clr_w : 1;
349  u32 : 7;
350 } __attribute__((packed));
353  u32 val : 32;
355 } __attribute__((packed));
382  u32 : 1;
383 } __attribute__((packed));
386  u32 val : 32;
388 } __attribute__((packed));
391 struct intf_cntl_t {
392  unsigned char ad_inc_a : 1;
393  unsigned char ring_buf_a : 1;
394  unsigned char rd_fetch_trigger_a : 1;
395  unsigned char rd_data_rdy_a : 1;
396  unsigned char ad_inc_b : 1;
397  unsigned char ring_buf_b : 1;
398  unsigned char rd_fetch_trigger_b : 1;
399  unsigned char rd_data_rdy_b : 1;
400 } __attribute__((packed));
402 union intf_cntl_u {
403  unsigned char val : 8;
404  struct intf_cntl_t f;
405 } __attribute__((packed));
408  unsigned char unpack_rd_data : 1;
409  unsigned char access_ind_addr_a : 1;
410  unsigned char access_ind_addr_b : 1;
411  unsigned char access_scratch_reg : 1;
412  unsigned char pack_wr_data : 1;
413  unsigned char transition_size : 1;
414  unsigned char en_read_buf_mode : 1;
415  unsigned char rd_fetch_scratch : 1;
416 } __attribute__((packed));
419  unsigned char val : 8;
421 } __attribute__((packed));
423 struct crtc_total_t {
425  u32 : 6;
427  u32 : 6;
428 } __attribute__((packed));
431  u32 val : 32;
432  struct crtc_total_t f;
433 } __attribute__((packed));
434 
435 struct crtc_ss_t {
436  u32 ss_start : 10;
437  u32 : 6;
438  u32 ss_end : 10;
439  u32 : 2;
441  u32 ss_pol : 1;
443  u32 ss_en : 1;
444 } __attribute__((packed));
446 union crtc_ss_u {
447  u32 val : 32;
448  struct crtc_ss_t f;
449 } __attribute__((packed));
453  u32 : 6;
455  u32 : 6;
456 } __attribute__((packed));
459  u32 val : 32;
461 } __attribute__((packed));
462 
465  u32 : 6;
467  u32 : 6;
468 } __attribute__((packed));
471  u32 val : 32;
473 } __attribute__((packed));
474 
477  u32 : 6;
479  u32 : 6;
480 } __attribute__((packed));
483  u32 val : 32;
485 } __attribute__((packed));
486 
489  u32 : 6;
491  u32 : 6;
492 } __attribute__((packed));
495  u32 val : 32;
497 } __attribute__((packed));
498 
512  u32 : 6;
513 } __attribute__((packed));
528  u32 : 5;
529 } __attribute__((packed));
530 
532  u32 val : 32;
535 } __attribute__((packed));
536 
537 struct video_ctrl_t {
557 } __attribute__((packed));
560  u32 val : 32;
561  struct video_ctrl_t f;
562 } __attribute__((packed));
568  u32 : 24;
569 } __attribute__((packed));
572  u32 val : 32;
574 } __attribute__((packed));
580  u32 : 24;
581 } __attribute__((packed));
582 
584  u32 val : 32;
586 } __attribute__((packed));
587 
589  u32 gamma1 : 8;
590  u32 gamma2 : 8;
591  u32 gamma3 : 8;
592  u32 gamma4 : 8;
593 } __attribute__((packed));
596  u32 val : 32;
598 } __attribute__((packed));
599 
601  u32 gamma5 : 8;
602  u32 gamma6 : 8;
603  u32 gamma7 : 8;
604  u32 gamma8 : 8;
605 } __attribute__((packed));
608  u32 val : 32;
610 } __attribute__((packed));
611 
613  u32 slope1 : 3;
614  u32 slope2 : 3;
615  u32 slope3 : 3;
616  u32 slope4 : 3;
617  u32 slope5 : 3;
618  u32 slope6 : 3;
619  u32 slope7 : 3;
620  u32 slope8 : 3;
621  u32 : 8;
622 } __attribute__((packed));
625  u32 val : 32;
626  struct gamma_slope_t f;
627 } __attribute__((packed));
632 } __attribute__((packed));
635  u32 val : 32;
637 } __attribute__((packed));
638 
642 } __attribute__((packed));
645  u32 val : 32;
647 } __attribute__((packed));
648 
650  u32 osc_en : 1;
655  u32 : 7;
656  u32 cg_debug : 16;
657 } __attribute__((packed));
660  u32 val : 32;
662 } __attribute__((packed));
663 
666  u32 : 4;
668  u32 : 2;
670  u32 : 1;
673 } __attribute__((packed));
676  u32 val : 32;
678 } __attribute__((packed));
680 struct pll_cntl_t {
699 } __attribute__((packed));
701 union pll_cntl_u {
702  u32 val : 32;
703  struct pll_cntl_t f;
704 } __attribute__((packed));
706 struct sclk_cntl_t {
708  u32 : 2;
726  u32 : 3;
727 } __attribute__((packed));
729 union sclk_cntl_u {
730  u32 val : 32;
731  struct sclk_cntl_t f;
732 } __attribute__((packed));
734 struct pclk_cntl_t {
736  u32 : 2;
738  u32 : 8;
740  u32 : 15;
741 } __attribute__((packed));
743 union pclk_cntl_u {
744  u32 val : 32;
745  struct pclk_cntl_t f;
746 } __attribute__((packed));
747 
748 
749 #define TESTCLK_SRC_PLL 0x01
750 #define TESTCLK_SRC_SCLK 0x02
751 #define TESTCLK_SRC_PCLK 0x03
752 /* 4 and 5 seem to by XTAL/M */
753 #define TESTCLK_SRC_XTAL 0x06
754 
757  u32 : 3;
760  u32 : 15;
762 } __attribute__((packed));
765  u32 val : 32;
767 } __attribute__((packed));
771  u32 : 1;
780 } __attribute__((packed));
783  u32 val : 32;
784  struct pwrmgt_cntl_t f;
785 } __attribute__((packed));
787 #define SRC_DATATYPE_EQU_DST 3
789 #define ROP3_SRCCOPY 0xcc
790 #define ROP3_PATCOPY 0xf0
791 
792 #define GMC_BRUSH_SOLID_COLOR 13
793 #define GMC_BRUSH_NONE 15
794 
795 #define DP_SRC_MEM_RECTANGULAR 2
796 
797 #define DP_OP_ROP 0
798 
812  u32 : 1;
815 } __attribute__((packed));
818  u32 val : 32;
820 } __attribute__((packed));
824  u32 : 1;
842  u32 : 6;
844 } __attribute__((packed));
847  u32 val : 32;
848  struct rbbm_status_t f;
849 } __attribute__((packed));
853  u32 : 4;
858  u32 : 11;
860  u32 : 1;
861 } __attribute__((packed));
864  u32 val : 32;
865  struct dp_datatype_t f;
866 } __attribute__((packed));
868 struct dp_mix_t {
869  u32 : 8;
872  u32 : 2;
874  u32 dp_op : 1;
875  u32 : 7;
876 } __attribute__((packed));
877 
878 union dp_mix_u {
879  u32 val : 32;
880  struct dp_mix_t f;
881 } __attribute__((packed));
883 struct eng_cntl_t {
890  u32 : 6;
892  u32 : 19;
893 } __attribute__((packed));
895 union eng_cntl_u {
896  u32 val : 32;
897  struct eng_cntl_t f;
898 } __attribute__((packed));
900 struct dp_cntl_t {
907  u32 : 26;
908 } __attribute__((packed));
910 union dp_cntl_u {
911  u32 val : 32;
912  struct dp_cntl_t f;
913 } __attribute__((packed));
916  u32 : 15;
918  u32 : 15;
920 } __attribute__((packed));
921 
923  u32 val : 32;
925 } __attribute__((packed));
926 
927 #endif
928