diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/rs400.c')
-rw-r--r-- | drivers/gpu/drm/radeon/rs400.c | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 287fcebfb4e6..626d51891ee9 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -113,6 +113,7 @@ int rs400_gart_enable(struct radeon_device *rdev) | |||
113 | uint32_t size_reg; | 113 | uint32_t size_reg; |
114 | uint32_t tmp; | 114 | uint32_t tmp; |
115 | 115 | ||
116 | radeon_gart_restore(rdev); | ||
116 | tmp = RREG32_MC(RS690_AIC_CTRL_SCRATCH); | 117 | tmp = RREG32_MC(RS690_AIC_CTRL_SCRATCH); |
117 | tmp |= RS690_DIS_OUT_OF_PCI_GART_ACCESS; | 118 | tmp |= RS690_DIS_OUT_OF_PCI_GART_ACCESS; |
118 | WREG32_MC(RS690_AIC_CTRL_SCRATCH, tmp); | 119 | WREG32_MC(RS690_AIC_CTRL_SCRATCH, tmp); |
@@ -150,9 +151,8 @@ int rs400_gart_enable(struct radeon_device *rdev) | |||
150 | WREG32(RADEON_AGP_BASE, 0xFFFFFFFF); | 151 | WREG32(RADEON_AGP_BASE, 0xFFFFFFFF); |
151 | WREG32(RS480_AGP_BASE_2, 0); | 152 | WREG32(RS480_AGP_BASE_2, 0); |
152 | } | 153 | } |
153 | tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1; | 154 | tmp = REG_SET(RS690_MC_AGP_TOP, rdev->mc.gtt_end >> 16); |
154 | tmp = REG_SET(RS690_MC_AGP_TOP, tmp >> 16); | 155 | tmp |= REG_SET(RS690_MC_AGP_START, rdev->mc.gtt_start >> 16); |
155 | tmp |= REG_SET(RS690_MC_AGP_START, rdev->mc.gtt_location >> 16); | ||
156 | if ((rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS740)) { | 156 | if ((rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS740)) { |
157 | WREG32_MC(RS690_MCCFG_AGP_LOCATION, tmp); | 157 | WREG32_MC(RS690_MCCFG_AGP_LOCATION, tmp); |
158 | tmp = RREG32(RADEON_BUS_CNTL) & ~RS600_BUS_MASTER_DIS; | 158 | tmp = RREG32(RADEON_BUS_CNTL) & ~RS600_BUS_MASTER_DIS; |
@@ -251,14 +251,19 @@ void rs400_gpu_init(struct radeon_device *rdev) | |||
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | void rs400_vram_info(struct radeon_device *rdev) | 254 | void rs400_mc_init(struct radeon_device *rdev) |
255 | { | 255 | { |
256 | u64 base; | ||
257 | |||
256 | rs400_gart_adjust_size(rdev); | 258 | rs400_gart_adjust_size(rdev); |
259 | rdev->mc.igp_sideport_enabled = radeon_combios_sideport_present(rdev); | ||
257 | /* DDR for all card after R300 & IGP */ | 260 | /* DDR for all card after R300 & IGP */ |
258 | rdev->mc.vram_is_ddr = true; | 261 | rdev->mc.vram_is_ddr = true; |
259 | rdev->mc.vram_width = 128; | 262 | rdev->mc.vram_width = 128; |
260 | |||
261 | r100_vram_init_sizes(rdev); | 263 | r100_vram_init_sizes(rdev); |
264 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; | ||
265 | radeon_vram_location(rdev, &rdev->mc, base); | ||
266 | radeon_gtt_location(rdev, &rdev->mc); | ||
262 | } | 267 | } |
263 | 268 | ||
264 | uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg) | 269 | uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg) |
@@ -362,22 +367,6 @@ static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) | |||
362 | #endif | 367 | #endif |
363 | } | 368 | } |
364 | 369 | ||
365 | static int rs400_mc_init(struct radeon_device *rdev) | ||
366 | { | ||
367 | int r; | ||
368 | u32 tmp; | ||
369 | |||
370 | /* Setup GPU memory space */ | ||
371 | tmp = RREG32(R_00015C_NB_TOM); | ||
372 | rdev->mc.vram_location = G_00015C_MC_FB_START(tmp) << 16; | ||
373 | rdev->mc.gtt_location = 0xFFFFFFFFUL; | ||
374 | r = radeon_mc_setup(rdev); | ||
375 | rdev->mc.igp_sideport_enabled = radeon_combios_sideport_present(rdev); | ||
376 | if (r) | ||
377 | return r; | ||
378 | return 0; | ||
379 | } | ||
380 | |||
381 | void rs400_mc_program(struct radeon_device *rdev) | 370 | void rs400_mc_program(struct radeon_device *rdev) |
382 | { | 371 | { |
383 | struct r100_mc_save save; | 372 | struct r100_mc_save save; |
@@ -516,12 +505,8 @@ int rs400_init(struct radeon_device *rdev) | |||
516 | radeon_get_clock_info(rdev->ddev); | 505 | radeon_get_clock_info(rdev->ddev); |
517 | /* Initialize power management */ | 506 | /* Initialize power management */ |
518 | radeon_pm_init(rdev); | 507 | radeon_pm_init(rdev); |
519 | /* Get vram informations */ | 508 | /* initialize memory controller */ |
520 | rs400_vram_info(rdev); | 509 | rs400_mc_init(rdev); |
521 | /* Initialize memory controller (also test AGP) */ | ||
522 | r = rs400_mc_init(rdev); | ||
523 | if (r) | ||
524 | return r; | ||
525 | /* Fence driver */ | 510 | /* Fence driver */ |
526 | r = radeon_fence_driver_init(rdev); | 511 | r = radeon_fence_driver_init(rdev); |
527 | if (r) | 512 | if (r) |