blob: 3ad916492747ae8ff0034039e5040ac37af2d015 [file] [log] [blame]
Jerome Glisse771fe6b2009-06-05 14:42:42 +02001/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef __RADEON_ASIC_H__
29#define __RADEON_ASIC_H__
30
31/*
32 * common functions
33 */
34void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
35void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
36
37void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
38void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
39void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
40
41/*
42 * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280
43 */
Jerome Glissed4550902009-10-01 10:12:06 +020044extern int r100_init(struct radeon_device *rdev);
45extern void r100_fini(struct radeon_device *rdev);
46extern int r100_suspend(struct radeon_device *rdev);
47extern int r100_resume(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +020048uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg);
49void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
Jerome Glisse771fe6b2009-06-05 14:42:42 +020050int r100_gpu_reset(struct radeon_device *rdev);
Michel Dänzer7ed220d2009-08-13 11:10:51 +020051u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
Jerome Glisse771fe6b2009-06-05 14:42:42 +020052void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
53int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
Jerome Glisse3ce0a232009-09-08 10:10:24 +100054void r100_cp_commit(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +020055void r100_ring_start(struct radeon_device *rdev);
56int r100_irq_set(struct radeon_device *rdev);
57int r100_irq_process(struct radeon_device *rdev);
58void r100_fence_ring_emit(struct radeon_device *rdev,
59 struct radeon_fence *fence);
60int r100_cs_parse(struct radeon_cs_parser *p);
61void r100_pll_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
62uint32_t r100_pll_rreg(struct radeon_device *rdev, uint32_t reg);
63int r100_copy_blit(struct radeon_device *rdev,
64 uint64_t src_offset,
65 uint64_t dst_offset,
66 unsigned num_pages,
67 struct radeon_fence *fence);
Dave Airliee024e112009-06-24 09:48:08 +100068int r100_set_surface_reg(struct radeon_device *rdev, int reg,
69 uint32_t tiling_flags, uint32_t pitch,
70 uint32_t offset, uint32_t obj_size);
71int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
Jerome Glissec93bb852009-07-13 21:04:08 +020072void r100_bandwidth_update(struct radeon_device *rdev);
Jerome Glisse3ce0a232009-09-08 10:10:24 +100073void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
74int r100_ib_test(struct radeon_device *rdev);
75int r100_ring_test(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +020076
77static struct radeon_asic r100_asic = {
Jerome Glisse068a1172009-06-17 13:28:30 +020078 .init = &r100_init,
Jerome Glissed4550902009-10-01 10:12:06 +020079 .fini = &r100_fini,
80 .suspend = &r100_suspend,
81 .resume = &r100_resume,
82 .errata = NULL,
83 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +020084 .gpu_reset = &r100_gpu_reset,
Jerome Glissed4550902009-10-01 10:12:06 +020085 .mc_init = NULL,
86 .mc_fini = NULL,
87 .wb_init = NULL,
88 .wb_fini = NULL,
89 .gart_init = NULL,
90 .gart_fini = NULL,
91 .gart_enable = NULL,
92 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +020093 .gart_tlb_flush = &r100_pci_gart_tlb_flush,
94 .gart_set_page = &r100_pci_gart_set_page,
Jerome Glissed4550902009-10-01 10:12:06 +020095 .cp_init = NULL,
96 .cp_fini = NULL,
97 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +100098 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +020099 .ring_start = &r100_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000100 .ring_test = &r100_ring_test,
101 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glissed4550902009-10-01 10:12:06 +0200102 .ib_test = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200103 .irq_set = &r100_irq_set,
104 .irq_process = &r100_irq_process,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200105 .get_vblank_counter = &r100_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200106 .fence_ring_emit = &r100_fence_ring_emit,
107 .cs_parse = &r100_cs_parse,
108 .copy_blit = &r100_copy_blit,
109 .copy_dma = NULL,
110 .copy = &r100_copy_blit,
111 .set_engine_clock = &radeon_legacy_set_engine_clock,
112 .set_memory_clock = NULL,
113 .set_pcie_lanes = NULL,
114 .set_clock_gating = &radeon_legacy_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000115 .set_surface_reg = r100_set_surface_reg,
116 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200117 .bandwidth_update = &r100_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200118};
119
120
121/*
122 * r300,r350,rv350,rv380
123 */
Jerome Glisse207bf9e2009-09-30 15:35:32 +0200124extern int r300_init(struct radeon_device *rdev);
125extern void r300_fini(struct radeon_device *rdev);
126extern int r300_suspend(struct radeon_device *rdev);
127extern int r300_resume(struct radeon_device *rdev);
128extern int r300_gpu_reset(struct radeon_device *rdev);
129extern void r300_ring_start(struct radeon_device *rdev);
130extern void r300_fence_ring_emit(struct radeon_device *rdev,
131 struct radeon_fence *fence);
132extern int r300_cs_parse(struct radeon_cs_parser *p);
133extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
134extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
135extern uint32_t rv370_pcie_rreg(struct radeon_device *rdev, uint32_t reg);
136extern void rv370_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
137extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
138extern int r300_copy_dma(struct radeon_device *rdev,
139 uint64_t src_offset,
140 uint64_t dst_offset,
141 unsigned num_pages,
142 struct radeon_fence *fence);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200143static struct radeon_asic r300_asic = {
Jerome Glisse068a1172009-06-17 13:28:30 +0200144 .init = &r300_init,
Jerome Glisse207bf9e2009-09-30 15:35:32 +0200145 .fini = &r300_fini,
146 .suspend = &r300_suspend,
147 .resume = &r300_resume,
148 .errata = NULL,
149 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200150 .gpu_reset = &r300_gpu_reset,
Jerome Glisse207bf9e2009-09-30 15:35:32 +0200151 .mc_init = NULL,
152 .mc_fini = NULL,
153 .wb_init = NULL,
154 .wb_fini = NULL,
155 .gart_init = NULL,
156 .gart_fini = NULL,
157 .gart_enable = NULL,
158 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200159 .gart_tlb_flush = &r100_pci_gart_tlb_flush,
160 .gart_set_page = &r100_pci_gart_set_page,
Jerome Glisse207bf9e2009-09-30 15:35:32 +0200161 .cp_init = NULL,
162 .cp_fini = NULL,
163 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000164 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200165 .ring_start = &r300_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000166 .ring_test = &r100_ring_test,
167 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glisse207bf9e2009-09-30 15:35:32 +0200168 .ib_test = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200169 .irq_set = &r100_irq_set,
170 .irq_process = &r100_irq_process,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200171 .get_vblank_counter = &r100_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200172 .fence_ring_emit = &r300_fence_ring_emit,
173 .cs_parse = &r300_cs_parse,
174 .copy_blit = &r100_copy_blit,
175 .copy_dma = &r300_copy_dma,
176 .copy = &r100_copy_blit,
177 .set_engine_clock = &radeon_legacy_set_engine_clock,
178 .set_memory_clock = NULL,
179 .set_pcie_lanes = &rv370_set_pcie_lanes,
180 .set_clock_gating = &radeon_legacy_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000181 .set_surface_reg = r100_set_surface_reg,
182 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200183 .bandwidth_update = &r100_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200184};
185
186/*
187 * r420,r423,rv410
188 */
Jerome Glisse9f022dd2009-09-11 15:35:22 +0200189extern int r420_init(struct radeon_device *rdev);
190extern void r420_fini(struct radeon_device *rdev);
191extern int r420_suspend(struct radeon_device *rdev);
192extern int r420_resume(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200193static struct radeon_asic r420_asic = {
Jerome Glisse9f022dd2009-09-11 15:35:22 +0200194 .init = &r420_init,
195 .fini = &r420_fini,
196 .suspend = &r420_suspend,
197 .resume = &r420_resume,
198 .errata = NULL,
199 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200200 .gpu_reset = &r300_gpu_reset,
Jerome Glisse9f022dd2009-09-11 15:35:22 +0200201 .mc_init = NULL,
202 .mc_fini = NULL,
203 .wb_init = NULL,
204 .wb_fini = NULL,
Jerome Glisse4aac0472009-09-14 18:29:49 +0200205 .gart_enable = NULL,
206 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200207 .gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
208 .gart_set_page = &rv370_pcie_gart_set_page,
Jerome Glisse9f022dd2009-09-11 15:35:22 +0200209 .cp_init = NULL,
210 .cp_fini = NULL,
211 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000212 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200213 .ring_start = &r300_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000214 .ring_test = &r100_ring_test,
215 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glisse9f022dd2009-09-11 15:35:22 +0200216 .ib_test = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200217 .irq_set = &r100_irq_set,
218 .irq_process = &r100_irq_process,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200219 .get_vblank_counter = &r100_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200220 .fence_ring_emit = &r300_fence_ring_emit,
221 .cs_parse = &r300_cs_parse,
222 .copy_blit = &r100_copy_blit,
223 .copy_dma = &r300_copy_dma,
224 .copy = &r100_copy_blit,
225 .set_engine_clock = &radeon_atom_set_engine_clock,
226 .set_memory_clock = &radeon_atom_set_memory_clock,
227 .set_pcie_lanes = &rv370_set_pcie_lanes,
228 .set_clock_gating = &radeon_atom_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000229 .set_surface_reg = r100_set_surface_reg,
230 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200231 .bandwidth_update = &r100_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200232};
233
234
235/*
236 * rs400,rs480
237 */
Jerome Glisseca6ffc62009-10-01 10:20:52 +0200238extern int rs400_init(struct radeon_device *rdev);
239extern void rs400_fini(struct radeon_device *rdev);
240extern int rs400_suspend(struct radeon_device *rdev);
241extern int rs400_resume(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200242void rs400_gart_tlb_flush(struct radeon_device *rdev);
243int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
244uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg);
245void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
246static struct radeon_asic rs400_asic = {
Jerome Glisseca6ffc62009-10-01 10:20:52 +0200247 .init = &rs400_init,
248 .fini = &rs400_fini,
249 .suspend = &rs400_suspend,
250 .resume = &rs400_resume,
251 .errata = NULL,
252 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200253 .gpu_reset = &r300_gpu_reset,
Jerome Glisseca6ffc62009-10-01 10:20:52 +0200254 .mc_init = NULL,
255 .mc_fini = NULL,
256 .wb_init = NULL,
257 .wb_fini = NULL,
258 .gart_init = NULL,
259 .gart_fini = NULL,
260 .gart_enable = NULL,
261 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200262 .gart_tlb_flush = &rs400_gart_tlb_flush,
263 .gart_set_page = &rs400_gart_set_page,
Jerome Glisseca6ffc62009-10-01 10:20:52 +0200264 .cp_init = NULL,
265 .cp_fini = NULL,
266 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000267 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200268 .ring_start = &r300_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000269 .ring_test = &r100_ring_test,
270 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glisseca6ffc62009-10-01 10:20:52 +0200271 .ib_test = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200272 .irq_set = &r100_irq_set,
273 .irq_process = &r100_irq_process,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200274 .get_vblank_counter = &r100_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200275 .fence_ring_emit = &r300_fence_ring_emit,
276 .cs_parse = &r300_cs_parse,
277 .copy_blit = &r100_copy_blit,
278 .copy_dma = &r300_copy_dma,
279 .copy = &r100_copy_blit,
280 .set_engine_clock = &radeon_legacy_set_engine_clock,
281 .set_memory_clock = NULL,
282 .set_pcie_lanes = NULL,
283 .set_clock_gating = &radeon_legacy_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000284 .set_surface_reg = r100_set_surface_reg,
285 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200286 .bandwidth_update = &r100_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200287};
288
289
290/*
291 * rs600.
292 */
Dave Airlie3f7dc91a2009-08-27 11:10:15 +1000293int rs600_init(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200294void rs600_errata(struct radeon_device *rdev);
295void rs600_vram_info(struct radeon_device *rdev);
296int rs600_mc_init(struct radeon_device *rdev);
297void rs600_mc_fini(struct radeon_device *rdev);
298int rs600_irq_set(struct radeon_device *rdev);
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200299int rs600_irq_process(struct radeon_device *rdev);
300u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
Jerome Glisse4aac0472009-09-14 18:29:49 +0200301int rs600_gart_init(struct radeon_device *rdev);
302void rs600_gart_fini(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200303int rs600_gart_enable(struct radeon_device *rdev);
304void rs600_gart_disable(struct radeon_device *rdev);
305void rs600_gart_tlb_flush(struct radeon_device *rdev);
306int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
307uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg);
308void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
Jerome Glissec93bb852009-07-13 21:04:08 +0200309void rs600_bandwidth_update(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200310static struct radeon_asic rs600_asic = {
Dave Airlie3f7dc91a2009-08-27 11:10:15 +1000311 .init = &rs600_init,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200312 .errata = &rs600_errata,
313 .vram_info = &rs600_vram_info,
314 .gpu_reset = &r300_gpu_reset,
315 .mc_init = &rs600_mc_init,
316 .mc_fini = &rs600_mc_fini,
317 .wb_init = &r100_wb_init,
318 .wb_fini = &r100_wb_fini,
Jerome Glisse4aac0472009-09-14 18:29:49 +0200319 .gart_init = &rs600_gart_init,
320 .gart_fini = &rs600_gart_fini,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200321 .gart_enable = &rs600_gart_enable,
322 .gart_disable = &rs600_gart_disable,
323 .gart_tlb_flush = &rs600_gart_tlb_flush,
324 .gart_set_page = &rs600_gart_set_page,
325 .cp_init = &r100_cp_init,
326 .cp_fini = &r100_cp_fini,
327 .cp_disable = &r100_cp_disable,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000328 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200329 .ring_start = &r300_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000330 .ring_test = &r100_ring_test,
331 .ring_ib_execute = &r100_ring_ib_execute,
332 .ib_test = &r100_ib_test,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200333 .irq_set = &rs600_irq_set,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200334 .irq_process = &rs600_irq_process,
335 .get_vblank_counter = &rs600_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200336 .fence_ring_emit = &r300_fence_ring_emit,
337 .cs_parse = &r300_cs_parse,
338 .copy_blit = &r100_copy_blit,
339 .copy_dma = &r300_copy_dma,
340 .copy = &r100_copy_blit,
341 .set_engine_clock = &radeon_atom_set_engine_clock,
342 .set_memory_clock = &radeon_atom_set_memory_clock,
343 .set_pcie_lanes = NULL,
344 .set_clock_gating = &radeon_atom_set_clock_gating,
Jerome Glissec93bb852009-07-13 21:04:08 +0200345 .bandwidth_update = &rs600_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200346};
347
348
349/*
350 * rs690,rs740
351 */
Jerome Glisse3bc68532009-10-01 09:39:24 +0200352int rs690_init(struct radeon_device *rdev);
353void rs690_fini(struct radeon_device *rdev);
354int rs690_resume(struct radeon_device *rdev);
355int rs690_suspend(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200356uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg);
357void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
Jerome Glissec93bb852009-07-13 21:04:08 +0200358void rs690_bandwidth_update(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200359static struct radeon_asic rs690_asic = {
Jerome Glisse3bc68532009-10-01 09:39:24 +0200360 .init = &rs690_init,
361 .fini = &rs690_fini,
362 .suspend = &rs690_suspend,
363 .resume = &rs690_resume,
364 .errata = NULL,
365 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200366 .gpu_reset = &r300_gpu_reset,
Jerome Glisse3bc68532009-10-01 09:39:24 +0200367 .mc_init = NULL,
368 .mc_fini = NULL,
369 .wb_init = NULL,
370 .wb_fini = NULL,
371 .gart_init = NULL,
372 .gart_fini = NULL,
373 .gart_enable = NULL,
374 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200375 .gart_tlb_flush = &rs400_gart_tlb_flush,
376 .gart_set_page = &rs400_gart_set_page,
Jerome Glisse3bc68532009-10-01 09:39:24 +0200377 .cp_init = NULL,
378 .cp_fini = NULL,
379 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000380 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200381 .ring_start = &r300_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000382 .ring_test = &r100_ring_test,
383 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glisse3bc68532009-10-01 09:39:24 +0200384 .ib_test = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200385 .irq_set = &rs600_irq_set,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200386 .irq_process = &rs600_irq_process,
387 .get_vblank_counter = &rs600_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200388 .fence_ring_emit = &r300_fence_ring_emit,
389 .cs_parse = &r300_cs_parse,
390 .copy_blit = &r100_copy_blit,
391 .copy_dma = &r300_copy_dma,
392 .copy = &r300_copy_dma,
393 .set_engine_clock = &radeon_atom_set_engine_clock,
394 .set_memory_clock = &radeon_atom_set_memory_clock,
395 .set_pcie_lanes = NULL,
396 .set_clock_gating = &radeon_atom_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000397 .set_surface_reg = r100_set_surface_reg,
398 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200399 .bandwidth_update = &rs690_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200400};
401
402
403/*
404 * rv515
405 */
Jerome Glisse068a1172009-06-17 13:28:30 +0200406int rv515_init(struct radeon_device *rdev);
Jerome Glissed39c3b82009-09-28 18:34:43 +0200407void rv515_fini(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200408int rv515_gpu_reset(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200409uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg);
410void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
411void rv515_ring_start(struct radeon_device *rdev);
412uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg);
413void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
Jerome Glissec93bb852009-07-13 21:04:08 +0200414void rv515_bandwidth_update(struct radeon_device *rdev);
Jerome Glissed39c3b82009-09-28 18:34:43 +0200415int rv515_resume(struct radeon_device *rdev);
416int rv515_suspend(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200417static struct radeon_asic rv515_asic = {
Jerome Glisse068a1172009-06-17 13:28:30 +0200418 .init = &rv515_init,
Jerome Glissed39c3b82009-09-28 18:34:43 +0200419 .fini = &rv515_fini,
420 .suspend = &rv515_suspend,
421 .resume = &rv515_resume,
422 .errata = NULL,
423 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200424 .gpu_reset = &rv515_gpu_reset,
Jerome Glissed39c3b82009-09-28 18:34:43 +0200425 .mc_init = NULL,
426 .mc_fini = NULL,
427 .wb_init = NULL,
428 .wb_fini = NULL,
Jerome Glisse4aac0472009-09-14 18:29:49 +0200429 .gart_init = &rv370_pcie_gart_init,
430 .gart_fini = &rv370_pcie_gart_fini,
Jerome Glissed39c3b82009-09-28 18:34:43 +0200431 .gart_enable = NULL,
432 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200433 .gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
434 .gart_set_page = &rv370_pcie_gart_set_page,
Jerome Glissed39c3b82009-09-28 18:34:43 +0200435 .cp_init = NULL,
436 .cp_fini = NULL,
437 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000438 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200439 .ring_start = &rv515_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000440 .ring_test = &r100_ring_test,
441 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glissed39c3b82009-09-28 18:34:43 +0200442 .ib_test = NULL,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200443 .irq_set = &rs600_irq_set,
444 .irq_process = &rs600_irq_process,
445 .get_vblank_counter = &rs600_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200446 .fence_ring_emit = &r300_fence_ring_emit,
Jerome Glisse068a1172009-06-17 13:28:30 +0200447 .cs_parse = &r300_cs_parse,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200448 .copy_blit = &r100_copy_blit,
449 .copy_dma = &r300_copy_dma,
450 .copy = &r100_copy_blit,
451 .set_engine_clock = &radeon_atom_set_engine_clock,
452 .set_memory_clock = &radeon_atom_set_memory_clock,
453 .set_pcie_lanes = &rv370_set_pcie_lanes,
454 .set_clock_gating = &radeon_atom_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000455 .set_surface_reg = r100_set_surface_reg,
456 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissec93bb852009-07-13 21:04:08 +0200457 .bandwidth_update = &rv515_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200458};
459
460
461/*
462 * r520,rv530,rv560,rv570,r580
463 */
Jerome Glissed39c3b82009-09-28 18:34:43 +0200464int r520_init(struct radeon_device *rdev);
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200465int r520_resume(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200466static struct radeon_asic r520_asic = {
Jerome Glissed39c3b82009-09-28 18:34:43 +0200467 .init = &r520_init,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200468 .fini = &rv515_fini,
469 .suspend = &rv515_suspend,
470 .resume = &r520_resume,
471 .errata = NULL,
472 .vram_info = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200473 .gpu_reset = &rv515_gpu_reset,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200474 .mc_init = NULL,
475 .mc_fini = NULL,
476 .wb_init = NULL,
477 .wb_fini = NULL,
478 .gart_init = NULL,
479 .gart_fini = NULL,
480 .gart_enable = NULL,
481 .gart_disable = NULL,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200482 .gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
483 .gart_set_page = &rv370_pcie_gart_set_page,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200484 .cp_init = NULL,
485 .cp_fini = NULL,
486 .cp_disable = NULL,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000487 .cp_commit = &r100_cp_commit,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200488 .ring_start = &rv515_ring_start,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000489 .ring_test = &r100_ring_test,
490 .ring_ib_execute = &r100_ring_ib_execute,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200491 .ib_test = NULL,
Michel Dänzer7ed220d2009-08-13 11:10:51 +0200492 .irq_set = &rs600_irq_set,
493 .irq_process = &rs600_irq_process,
494 .get_vblank_counter = &rs600_get_vblank_counter,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200495 .fence_ring_emit = &r300_fence_ring_emit,
Jerome Glisse068a1172009-06-17 13:28:30 +0200496 .cs_parse = &r300_cs_parse,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200497 .copy_blit = &r100_copy_blit,
498 .copy_dma = &r300_copy_dma,
499 .copy = &r100_copy_blit,
500 .set_engine_clock = &radeon_atom_set_engine_clock,
501 .set_memory_clock = &radeon_atom_set_memory_clock,
502 .set_pcie_lanes = &rv370_set_pcie_lanes,
503 .set_clock_gating = &radeon_atom_set_clock_gating,
Dave Airliee024e112009-06-24 09:48:08 +1000504 .set_surface_reg = r100_set_surface_reg,
505 .clear_surface_reg = r100_clear_surface_reg,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200506 .bandwidth_update = &rv515_bandwidth_update,
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200507};
508
509/*
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000510 * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200511 */
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000512int r600_init(struct radeon_device *rdev);
513void r600_fini(struct radeon_device *rdev);
514int r600_suspend(struct radeon_device *rdev);
515int r600_resume(struct radeon_device *rdev);
516int r600_wb_init(struct radeon_device *rdev);
517void r600_wb_fini(struct radeon_device *rdev);
518void r600_cp_commit(struct radeon_device *rdev);
519void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200520uint32_t r600_pciep_rreg(struct radeon_device *rdev, uint32_t reg);
521void r600_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000522int r600_cs_parse(struct radeon_cs_parser *p);
523void r600_fence_ring_emit(struct radeon_device *rdev,
524 struct radeon_fence *fence);
525int r600_copy_dma(struct radeon_device *rdev,
526 uint64_t src_offset,
527 uint64_t dst_offset,
528 unsigned num_pages,
529 struct radeon_fence *fence);
530int r600_irq_process(struct radeon_device *rdev);
531int r600_irq_set(struct radeon_device *rdev);
532int r600_gpu_reset(struct radeon_device *rdev);
533int r600_set_surface_reg(struct radeon_device *rdev, int reg,
534 uint32_t tiling_flags, uint32_t pitch,
535 uint32_t offset, uint32_t obj_size);
536int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
537void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
538int r600_ib_test(struct radeon_device *rdev);
539int r600_ring_test(struct radeon_device *rdev);
540int r600_copy_blit(struct radeon_device *rdev,
541 uint64_t src_offset, uint64_t dst_offset,
542 unsigned num_pages, struct radeon_fence *fence);
543
544static struct radeon_asic r600_asic = {
545 .errata = NULL,
546 .init = &r600_init,
547 .fini = &r600_fini,
548 .suspend = &r600_suspend,
549 .resume = &r600_resume,
550 .cp_commit = &r600_cp_commit,
551 .vram_info = NULL,
552 .gpu_reset = &r600_gpu_reset,
553 .mc_init = NULL,
554 .mc_fini = NULL,
555 .wb_init = &r600_wb_init,
556 .wb_fini = &r600_wb_fini,
557 .gart_enable = NULL,
558 .gart_disable = NULL,
559 .gart_tlb_flush = &r600_pcie_gart_tlb_flush,
560 .gart_set_page = &rs600_gart_set_page,
561 .cp_init = NULL,
562 .cp_fini = NULL,
563 .cp_disable = NULL,
564 .ring_start = NULL,
565 .ring_test = &r600_ring_test,
566 .ring_ib_execute = &r600_ring_ib_execute,
567 .ib_test = &r600_ib_test,
568 .irq_set = &r600_irq_set,
569 .irq_process = &r600_irq_process,
570 .fence_ring_emit = &r600_fence_ring_emit,
571 .cs_parse = &r600_cs_parse,
572 .copy_blit = &r600_copy_blit,
573 .copy_dma = &r600_copy_blit,
Alex Deuchera3812872009-09-10 15:54:35 -0400574 .copy = &r600_copy_blit,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000575 .set_engine_clock = &radeon_atom_set_engine_clock,
576 .set_memory_clock = &radeon_atom_set_memory_clock,
577 .set_pcie_lanes = NULL,
578 .set_clock_gating = &radeon_atom_set_clock_gating,
579 .set_surface_reg = r600_set_surface_reg,
580 .clear_surface_reg = r600_clear_surface_reg,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200581 .bandwidth_update = &rv515_bandwidth_update,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000582};
583
584/*
585 * rv770,rv730,rv710,rv740
586 */
587int rv770_init(struct radeon_device *rdev);
588void rv770_fini(struct radeon_device *rdev);
589int rv770_suspend(struct radeon_device *rdev);
590int rv770_resume(struct radeon_device *rdev);
591int rv770_gpu_reset(struct radeon_device *rdev);
592
593static struct radeon_asic rv770_asic = {
594 .errata = NULL,
595 .init = &rv770_init,
596 .fini = &rv770_fini,
597 .suspend = &rv770_suspend,
598 .resume = &rv770_resume,
599 .cp_commit = &r600_cp_commit,
600 .vram_info = NULL,
601 .gpu_reset = &rv770_gpu_reset,
602 .mc_init = NULL,
603 .mc_fini = NULL,
604 .wb_init = &r600_wb_init,
605 .wb_fini = &r600_wb_fini,
606 .gart_enable = NULL,
607 .gart_disable = NULL,
608 .gart_tlb_flush = &r600_pcie_gart_tlb_flush,
609 .gart_set_page = &rs600_gart_set_page,
610 .cp_init = NULL,
611 .cp_fini = NULL,
612 .cp_disable = NULL,
613 .ring_start = NULL,
614 .ring_test = &r600_ring_test,
615 .ring_ib_execute = &r600_ring_ib_execute,
616 .ib_test = &r600_ib_test,
617 .irq_set = &r600_irq_set,
618 .irq_process = &r600_irq_process,
619 .fence_ring_emit = &r600_fence_ring_emit,
620 .cs_parse = &r600_cs_parse,
621 .copy_blit = &r600_copy_blit,
622 .copy_dma = &r600_copy_blit,
Alex Deuchera3812872009-09-10 15:54:35 -0400623 .copy = &r600_copy_blit,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000624 .set_engine_clock = &radeon_atom_set_engine_clock,
625 .set_memory_clock = &radeon_atom_set_memory_clock,
626 .set_pcie_lanes = NULL,
627 .set_clock_gating = &radeon_atom_set_clock_gating,
628 .set_surface_reg = r600_set_surface_reg,
629 .clear_surface_reg = r600_clear_surface_reg,
Jerome Glissef0ed1f62009-09-28 20:39:19 +0200630 .bandwidth_update = &rv515_bandwidth_update,
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000631};
Jerome Glisse771fe6b2009-06-05 14:42:42 +0200632
633#endif