Rev 1321 | Rev 1404 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1321 | Rev 1403 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | #include |
28 | #include |
29 | #include "drmP.h" |
29 | #include "drmP.h" |
30 | #include "radeon_reg.h" |
30 | #include "radeon_reg.h" |
31 | #include "radeon.h" |
31 | #include "radeon.h" |
32 | #include "atom.h" |
32 | #include "atom.h" |
- | 33 | #include "r100d.h" |
|
33 | #include "r420d.h" |
34 | #include "r420d.h" |
- | 35 | #include "r420_reg_safe.h" |
|
- | 36 | ||
- | 37 | static void r420_set_reg_safe(struct radeon_device *rdev) |
|
- | 38 | { |
|
- | 39 | rdev->config.r300.reg_safe_bm = r420_reg_safe_bm; |
|
- | 40 | rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(r420_reg_safe_bm); |
|
- | 41 | } |
|
Line 34... | Line 42... | ||
34 | 42 | ||
35 | int r420_mc_init(struct radeon_device *rdev) |
43 | int r420_mc_init(struct radeon_device *rdev) |
36 | { |
44 | { |
Line 40... | Line 48... | ||
40 | rdev->mc.vram_location = 0xFFFFFFFFUL; |
48 | rdev->mc.vram_location = 0xFFFFFFFFUL; |
41 | rdev->mc.gtt_location = 0xFFFFFFFFUL; |
49 | rdev->mc.gtt_location = 0xFFFFFFFFUL; |
42 | if (rdev->flags & RADEON_IS_AGP) { |
50 | if (rdev->flags & RADEON_IS_AGP) { |
43 | r = radeon_agp_init(rdev); |
51 | r = radeon_agp_init(rdev); |
44 | if (r) { |
52 | if (r) { |
45 | printk(KERN_WARNING "[drm] Disabling AGP\n"); |
- | |
46 | rdev->flags &= ~RADEON_IS_AGP; |
53 | radeon_agp_disable(rdev); |
47 | rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; |
- | |
48 | } else { |
54 | } else { |
49 | rdev->mc.gtt_location = rdev->mc.agp_base; |
55 | rdev->mc.gtt_location = rdev->mc.agp_base; |
50 | } |
56 | } |
51 | } |
57 | } |
52 | r = radeon_mc_setup(rdev); |
58 | r = radeon_mc_setup(rdev); |
Line 163... | Line 169... | ||
163 | if (rdev->family == CHIP_R420) |
169 | if (rdev->family == CHIP_R420) |
164 | sclk_cntl |= S_00000D_FORCE_PX(1) | S_00000D_FORCE_TX(1); |
170 | sclk_cntl |= S_00000D_FORCE_PX(1) | S_00000D_FORCE_TX(1); |
165 | WREG32_PLL(R_00000D_SCLK_CNTL, sclk_cntl); |
171 | WREG32_PLL(R_00000D_SCLK_CNTL, sclk_cntl); |
166 | } |
172 | } |
Line -... | Line 173... | ||
- | 173 | ||
- | 174 | static void r420_cp_errata_init(struct radeon_device *rdev) |
|
- | 175 | { |
|
- | 176 | /* RV410 and R420 can lock up if CP DMA to host memory happens |
|
- | 177 | * while the 2D engine is busy. |
|
- | 178 | * |
|
- | 179 | * The proper workaround is to queue a RESYNC at the beginning |
|
- | 180 | * of the CP init, apparently. |
|
- | 181 | */ |
|
- | 182 | radeon_scratch_get(rdev, &rdev->config.r300.resync_scratch); |
|
- | 183 | radeon_ring_lock(rdev, 8); |
|
- | 184 | radeon_ring_write(rdev, PACKET0(R300_CP_RESYNC_ADDR, 1)); |
|
- | 185 | radeon_ring_write(rdev, rdev->config.r300.resync_scratch); |
|
- | 186 | radeon_ring_write(rdev, 0xDEADBEEF); |
|
- | 187 | radeon_ring_unlock_commit(rdev); |
|
- | 188 | } |
|
- | 189 | ||
- | 190 | static void r420_cp_errata_fini(struct radeon_device *rdev) |
|
- | 191 | { |
|
- | 192 | /* Catch the RESYNC we dispatched all the way back, |
|
- | 193 | * at the very beginning of the CP init. |
|
- | 194 | */ |
|
- | 195 | radeon_ring_lock(rdev, 8); |
|
- | 196 | radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); |
|
- | 197 | radeon_ring_write(rdev, R300_RB3D_DC_FINISH); |
|
- | 198 | radeon_ring_unlock_commit(rdev); |
|
- | 199 | radeon_scratch_free(rdev, rdev->config.r300.resync_scratch); |
|
- | 200 | } |
|
167 | 201 | ||
168 | static int r420_startup(struct radeon_device *rdev) |
202 | static int r420_startup(struct radeon_device *rdev) |
169 | { |
203 | { |
Line 170... | Line 204... | ||
170 | int r; |
204 | int r; |
Line 188... | Line 222... | ||
188 | return r; |
222 | return r; |
189 | } |
223 | } |
190 | r420_pipes_init(rdev); |
224 | r420_pipes_init(rdev); |
191 | /* Enable IRQ */ |
225 | /* Enable IRQ */ |
192 | // r100_irq_set(rdev); |
226 | // r100_irq_set(rdev); |
- | 227 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
|
193 | /* 1M ring buffer */ |
228 | /* 1M ring buffer */ |
194 | // r = r100_cp_init(rdev, 1024 * 1024); |
229 | // r = r100_cp_init(rdev, 1024 * 1024); |
195 | // if (r) { |
230 | // if (r) { |
196 | // dev_err(rdev->dev, "failled initializing CP (%d).\n", r); |
231 | // dev_err(rdev->dev, "failled initializing CP (%d).\n", r); |
197 | // return r; |
232 | // return r; |