Rev 877 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 877 | Rev 881 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | typedef void *pointer; |
1 | typedef void *pointer; |
Line 2... | Line -... | ||
2 | - | ||
Line 3... | Line 2... | ||
3 | typedef unsigned int Bool; |
2 | |
Line 4... | Line 3... | ||
4 | 3 | ||
Line 5... | Line -... | ||
5 | typedef unsigned int memType; |
- | |
6 | - | ||
7 | typedef struct { float hi, lo; } range; |
- | |
8 | - | ||
9 | - | ||
10 | #include "pci.h" |
- | |
11 | #include "rhd_regs.h" |
4 | typedef unsigned int memType; |
Line 12... | Line 5... | ||
12 | 5 | ||
- | 6 | typedef struct { float hi, lo; } range; |
|
13 | #define IS_R300_3D 0 |
7 | |
- | 8 | ||
14 | #define IS_R500_3D 1 |
9 | #define R300_PIO 1 |
15 | 10 | ||
16 | #define R300_PIO 1 |
11 | #define PCI_CMD_STAT_REG 0x04 |
17 | 12 | ||
- | 13 | typedef enum |
|
18 | enum RHD_CHIPSETS { |
14 | { |
19 | RHD_UNKNOWN = 0, |
15 | CHIP_FAMILY_UNKNOW, |
20 | RHD_R300, |
16 | CHIP_FAMILY_LEGACY, |
21 | RHD_R350, |
17 | CHIP_FAMILY_RADEON, |
22 | RHD_RV350, |
18 | CHIP_FAMILY_RV100, |
23 | RHD_RV370, |
19 | CHIP_FAMILY_RS100, /* U1 (IGP320M) or A3 (IGP320)*/ |
24 | RHD_RV380, |
20 | CHIP_FAMILY_RV200, |
25 | /* R500 */ |
21 | CHIP_FAMILY_RS200, /* U2 (IGP330M/340M/350M) or A4 (IGP330/340/345/350), RS250 (IGP 7000) */ |
26 | RHD_RV505, |
22 | CHIP_FAMILY_R200, |
27 | RHD_RV515, |
23 | CHIP_FAMILY_RV250, |
28 | RHD_RV516, |
24 | CHIP_FAMILY_RS300, /* RS300/RS350 */ |
29 | RHD_R520, |
25 | CHIP_FAMILY_RV280, |
30 | RHD_RV530, |
26 | CHIP_FAMILY_R300, |
- | 27 | CHIP_FAMILY_R350, |
|
31 | RHD_RV535, |
28 | CHIP_FAMILY_RV350, |
32 | RHD_RV550, |
29 | CHIP_FAMILY_RV380, /* RV370/RV380/M22/M24 */ |
33 | RHD_RV560, |
30 | CHIP_FAMILY_R420, /* R420/R423/M18 */ |
34 | RHD_RV570, |
31 | CHIP_FAMILY_RV410, /* RV410, M26 */ |
35 | RHD_R580, |
32 | CHIP_FAMILY_RS400, /* xpress 200, 200m (RS400) Intel */ |
36 | /* R500 Mobility */ |
33 | CHIP_FAMILY_RS480, /* xpress 200, 200m (RS410/480/482/485) AMD */ |
37 | RHD_M52, |
34 | CHIP_FAMILY_RV515, /* rv515 */ |
38 | RHD_M54, |
35 | CHIP_FAMILY_R520, /* r520 */ |
39 | RHD_M56, |
36 | CHIP_FAMILY_RV530, /* rv530 */ |
40 | RHD_M58, |
37 | CHIP_FAMILY_R580, /* r580 */ |
41 | RHD_M62, |
38 | CHIP_FAMILY_RV560, /* rv560 */ |
42 | RHD_M64, |
39 | CHIP_FAMILY_RV570, /* rv570 */ |
43 | RHD_M66, |
40 | CHIP_FAMILY_RS600, |
44 | RHD_M68, |
- | |
45 | RHD_M71, |
41 | CHIP_FAMILY_RS690, |
46 | /* R500 integrated */ |
42 | CHIP_FAMILY_RS740, |
47 | RHD_RS600, |
43 | CHIP_FAMILY_R600, /* r600 */ |
48 | RHD_RS690, |
44 | CHIP_FAMILY_R630, |
49 | RHD_RS740, |
45 | CHIP_FAMILY_RV610, |
50 | /* R600 */ |
46 | CHIP_FAMILY_RV630, |
51 | RHD_R600, |
47 | CHIP_FAMILY_RV670, |
- | 48 | CHIP_FAMILY_RV620, |
|
- | 49 | CHIP_FAMILY_RV635, |
|
- | 50 | CHIP_FAMILY_RS780, |
|
- | 51 | CHIP_FAMILY_RV770, |
|
- | 52 | CHIP_FAMILY_LAST |
|
- | 53 | } RADEONChipFamily; |
|
52 | RHD_RV610, |
54 | |
- | 55 | #define IS_RV100_VARIANT ((rhdPtr->ChipFamily == CHIP_FAMILY_RV100) || \ |
|
- | 56 | (rhdPtr->ChipFamily == CHIP_FAMILY_RV200) || \ |
|
- | 57 | (rhdPtr->ChipFamily == CHIP_FAMILY_RS100) || \ |
|
- | 58 | (rhdPtr->ChipFamily == CHIP_FAMILY_RS200) || \ |
|
- | 59 | (rhdPtr->ChipFamily == CHIP_FAMILY_RV250) || \ |
|
- | 60 | (rhdPtr->ChipFamily == CHIP_FAMILY_RV280) || \ |
|
- | 61 | (rhdPtr->ChipFamily == CHIP_FAMILY_RS300)) |
|
- | 62 | ||
- | 63 | ||
- | 64 | #define IS_R300_VARIANT ((info->ChipFamily == CHIP_FAMILY_R300) || \ |
|
- | 65 | (info->ChipFamily == CHIP_FAMILY_RV350) || \ |
|
- | 66 | (info->ChipFamily == CHIP_FAMILY_R350) || \ |
|
- | 67 | (info->ChipFamily == CHIP_FAMILY_RV380) || \ |
|
- | 68 | (info->ChipFamily == CHIP_FAMILY_R420) || \ |
|
- | 69 | (info->ChipFamily == CHIP_FAMILY_RV410) || \ |
|
- | 70 | (info->ChipFamily == CHIP_FAMILY_RS400) || \ |
|
- | 71 | (info->ChipFamily == CHIP_FAMILY_RS480)) |
|
- | 72 | ||
- | 73 | #define IS_AVIVO_VARIANT ((info->ChipFamily >= CHIP_FAMILY_RV515)) |
|
- | 74 | ||
- | 75 | #define IS_DCE3_VARIANT ((info->ChipFamily >= CHIP_FAMILY_RV620)) |
|
53 | RHD_RV630, |
76 | |
- | 77 | #define IS_R500_3D ((info->ChipFamily == CHIP_FAMILY_RV515) || \ |
|
- | 78 | (info->ChipFamily == CHIP_FAMILY_R520) || \ |
|
- | 79 | (info->ChipFamily == CHIP_FAMILY_RV530) || \ |
|
- | 80 | (info->ChipFamily == CHIP_FAMILY_R580) || \ |
|
- | 81 | (info->ChipFamily == CHIP_FAMILY_RV560) || \ |
|
- | 82 | (info->ChipFamily == CHIP_FAMILY_RV570)) |
|
- | 83 | ||
- | 84 | #define IS_R300_3D ((info->ChipFamily == CHIP_FAMILY_R300) || \ |
|
- | 85 | (info->ChipFamily == CHIP_FAMILY_RV350) || \ |
|
- | 86 | (info->ChipFamily == CHIP_FAMILY_R350) || \ |
|
- | 87 | (info->ChipFamily == CHIP_FAMILY_RV380) || \ |
|
54 | /* R600 Mobility */ |
88 | (info->ChipFamily == CHIP_FAMILY_R420) || \ |
- | 89 | (info->ChipFamily == CHIP_FAMILY_RV410) || \ |
|
- | 90 | (info->ChipFamily == CHIP_FAMILY_RS690) || \ |
|
- | 91 | (info->ChipFamily == CHIP_FAMILY_RS600) || \ |
|
55 | RHD_M72, |
92 | (info->ChipFamily == CHIP_FAMILY_RS740) || \ |
56 | RHD_M74, |
93 | (info->ChipFamily == CHIP_FAMILY_RS400) || \ |
57 | RHD_M76, |
94 | (info->ChipFamily == CHIP_FAMILY_RS480)) |
58 | /* RV670 came into existence after RV6x0 and M7x */ |
95 | |
59 | RHD_RV670, |
96 | |
- | 97 | ||
- | 98 | typedef enum { |
|
60 | RHD_R680, |
99 | CARD_PCI, |
61 | RHD_RV620, |
100 | CARD_AGP, |
- | 101 | CARD_PCIE |
|
- | 102 | } RADEONCardType; |
|
- | 103 | ||
- | 104 | /* |
|
- | 105 | * Errata workarounds |
|
Line -... | Line 106... | ||
- | 106 | */ |
|
- | 107 | typedef enum { |
|
62 | RHD_M82, |
108 | CHIP_ERRATA_R300_CG = 0x00000001, |
63 | RHD_RV635, |
109 | CHIP_ERRATA_PLL_DUMMYREADS = 0x00000002, |
- | 110 | CHIP_ERRATA_PLL_DELAY = 0x00000004 |
|
- | 111 | } RADEONErrata; |
|
- | 112 | ||
- | 113 | typedef struct |
|
- | 114 | { |
|
- | 115 | u32_t pci_device_id; |
|
Line 64... | Line -... | ||
64 | RHD_M86, |
- | |
Line 65... | Line -... | ||
65 | RHD_RS780, |
- | |
66 | RHD_CHIP_END |
- | |
67 | }; |
- | |
68 | - | ||
69 | enum RHD_FAMILIES { |
- | |
70 | RHD_FAMILY_UNKNOWN = 0, |
- | |
71 | - | ||
72 | RHD_FAMILY_RADEON, |
- | |
73 | - | ||
74 | RHD_FAMILY_RV100, |
- | |
75 | RHD_FAMILY_RS100, /* U1 (IGP320M) or A3 (IGP320)*/ |
- | |
76 | RHD_FAMILY_RV200, |
- | |
77 | RHD_FAMILY_RS200, /* U2 (IGP330M/340M/350M) or A4 (IGP330/340/345/350), RS250 (IGP 7000) */ |
- | |
78 | RHD_FAMILY_R200, |
- | |
79 | RHD_FAMILY_RV250, |
- | |
80 | RHD_FAMILY_RS300, /* RS300/RS350 */ |
- | |
81 | RHD_FAMILY_RV280, |
- | |
82 | - | ||
83 | RHD_FAMILY_R300, |
- | |
84 | RHD_FAMILY_R350, |
- | |
85 | RHD_FAMILY_RV350, |
- | |
86 | RHD_FAMILY_RV380, /* RV370/RV380/M22/M24 */ |
- | |
87 | RHD_FAMILY_R420, /* R420/R423/M18 */ |
- | |
88 | RHD_FAMILY_RV410, /* RV410, M26 */ |
- | |
89 | RHD_FAMILY_RS400, /* xpress 200, 200m (RS400) Intel */ |
- | |
90 | RHD_FAMILY_RS480, /* xpress 200, 200m (RS410/480/482/485) AMD */ |
- | |
91 | - | ||
92 | RHD_FAMILY_RV515, |
- | |
93 | RHD_FAMILY_R520, |
- | |
94 | RHD_FAMILY_RV530, |
- | |
95 | RHD_FAMILY_RV560, |
- | |
96 | RHD_FAMILY_RV570, |
- | |
97 | RHD_FAMILY_R580, |
- | |
Line 98... | Line 116... | ||
98 | RHD_FAMILY_RS690, |
116 | RADEONChipFamily chip_family; |
99 | RHD_FAMILY_R600, |
117 | int mobility; |
Line 100... | Line 118... | ||
100 | RHD_FAMILY_RV610, |
118 | int igp; |
Line 114... | Line 132... | ||
114 | typedef struct RHDRec |
132 | typedef struct RHDRec |
115 | { |
133 | { |
116 | u32_t MMIOBase; |
134 | u32_t MMIOBase; |
117 | u32_t MMIOMapSize; |
135 | u32_t MMIOMapSize; |
118 | u32_t videoRam; |
- | |
Line 119... | Line 136... | ||
119 | 136 | ||
120 | // CARD32 FbBase; /* map base of fb */ |
137 | // CARD32 FbBase; /* map base of fb */ |
121 | u32_t PhisBase; |
138 | // u32_t PhisBase; |
122 | u32_t FbIntAddress; /* card internal address of FB */ |
139 | // u32_t FbIntAddress; /* card internal address of FB */ |
Line 123... | Line 140... | ||
123 | u32_t FbMapSize; |
140 | // u32_t FbMapSize; |
124 | 141 | ||
Line 125... | Line 142... | ||
125 | u32_t FbFreeStart; |
142 | u32_t FbFreeStart; |
126 | u32_t FbFreeSize; |
143 | u32_t FbFreeSize; |
127 | 144 | ||
Line 128... | Line -... | ||
128 | /* visible part of the framebuffer */ |
- | |
129 | unsigned int FbScanoutStart; |
145 | /* visible part of the framebuffer */ |
Line -... | Line 146... | ||
- | 146 | // unsigned int FbScanoutStart; |
|
- | 147 | // unsigned int FbScanoutSize; |
|
- | 148 | ||
- | 149 | u32_t LinearAddr; /* Frame buffer physical address */ |
|
- | 150 | ||
130 | unsigned int FbScanoutSize; |
151 | u32_t fbLocation; |
Line -... | Line 152... | ||
- | 152 | u32_t mc_fb_location; |
|
- | 153 | u32_t mc_agp_location; |
|
- | 154 | u32_t mc_agp_location_hi; |
|
- | 155 | ||
- | 156 | u32_t videoRam; |
|
- | 157 | ||
- | 158 | u32_t MemCntl; |
|
- | 159 | u32_t BusCntl; |
|
- | 160 | unsigned long FbMapSize; /* Size of frame buffer, in bytes */ |
|
- | 161 | unsigned long FbSecureSize; /* Size of secured fb area at end of |
|
- | 162 | framebuffer */ |
|
- | 163 | ||
131 | 164 | ||
- | 165 | RADEONChipFamily ChipFamily; |
|
Line 132... | Line 166... | ||
132 | enum RHD_CHIPSETS ChipSet; |
166 | RADEONErrata ChipErrata; |
133 | enum RHD_FAMILIES ChipFamily; |
167 | |
Line 134... | Line 168... | ||
134 | 168 | char *chipset; |
|
135 | char *ChipName; |
169 | |
Line 136... | Line 170... | ||
136 | 170 | int IsIGP; |
|
137 | Bool IsIGP; |
171 | int IsMobility; |
Line -... | Line 172... | ||
- | 172 | ||
- | 173 | u32_t bus; |
|
138 | 174 | u32_t devfn; |
|
139 | u32_t bus; |
175 | |
140 | u32_t devfn; |
176 | PCITAG PciTag; |
141 | 177 | u16_t PciDeviceID; |
|
Line 168... | Line 204... | ||
168 | u32_t *ring_base; |
204 | u32_t *ring_base; |
169 | u32_t ring_rp; |
205 | u32_t ring_rp; |
170 | u32_t ring_wp; |
206 | u32_t ring_wp; |
Line -... | Line 207... | ||
- | 207 | ||
- | 208 | int RamWidth; |
|
- | 209 | Bool IsDDR; |
|
171 | 210 | ||
172 | int num_gb_pipes; |
211 | int num_gb_pipes; |
173 | Bool has_tcl; |
212 | int has_tcl; |
Line 174... | Line 213... | ||
174 | }RHD_t, *RHDPtr; |
213 | }RHD_t, *RHDPtr; |
Line 271... | Line 310... | ||
271 | { |
310 | { |
272 | return *(volatile u32_t *)((u8_t*)(rhd.MMIOBase + offset)); |
311 | return *(volatile u32_t *)((u8_t*)(rhd.MMIOBase + offset)); |
273 | } |
312 | } |
274 | 313 | ||
Line 275... | Line -... | ||
275 | //#define INREG(offset) *(volatile CARD32 *)((CARD8*)(rhd.MMIOBase + (offset))) |
- | |
Line 276... | Line -... | ||
276 | - | ||
277 | extern inline void |
314 | |
278 | OUTREG(u16_t offset, u32_t value) |
315 | extern inline void OUTREG(u16_t offset, u32_t value) |
279 | { |
316 | { |
280 | *(volatile u32_t *)((u8_t *)(rhd.MMIOBase + offset)) = value; |
317 | *(volatile u32_t *)((u8_t *)(rhd.MMIOBase + offset)) = value; |
Line -... | Line 318... | ||
- | 318 | } |
|
281 | } |
319 | |
282 | 320 | ||
283 | extern inline u32_t _RHDRegRead(RHDPtr rhdPtr, u16_t offset) |
321 | extern inline u32_t _RHDRegRead(RHDPtr rhdPtr, u16_t offset) |
284 | { |
322 | { |
Line 312... | Line 350... | ||
312 | tmp |= (value & mask); |
350 | tmp |= (value & mask); |
313 | _RHDRegWrite(rhdPtr, offset, tmp); |
351 | _RHDRegWrite(rhdPtr, offset, tmp); |
314 | }; |
352 | }; |
315 | 353 | ||
Line 316... | Line -... | ||
316 | enum RHD_FAMILIES RHDFamily(enum RHD_CHIPSETS chipset); |
- | |
317 | - | ||
318 | #define RHDRegRead(ptr, offset) _RHDRegRead((ptr)->rhdPtr, (offset)) |
354 | #define RHDRegRead(ptr, offset) _RHDRegRead((ptr)->rhdPtr, (offset)) |
319 | #define RHDRegWrite(ptr, offset, value) _RHDRegWrite((ptr)->rhdPtr, (offset), (value)) |
355 | #define RHDRegWrite(ptr, offset, value) _RHDRegWrite((ptr)->rhdPtr, (offset), (value)) |
320 | #define RHDRegMask(ptr, offset, value, mask) _RHDRegMask((ptr)->rhdPtr, (offset), (value), (mask)) |
356 | #define RHDRegMask(ptr, offset, value, mask) _RHDRegMask((ptr)->rhdPtr, (offset), (value), (mask)) |