From 905b68223be18937159a29b354e6a332952ff952 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Wed, 9 Sep 2009 22:24:20 +0200 Subject: drm/radeon/kms: add R4XX mc register access helper. Atombios will use the mc register access helper and R4XX hw have a bigger mc range than R3XX so add R4XX specific mc register access helper. Signed-off-by: Jerome Glisse Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/r420.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/gpu/drm/radeon/r420.c') diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 97426a6f370f..96303f064db7 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -29,6 +29,7 @@ #include "drmP.h" #include "radeon_reg.h" #include "radeon.h" +#include "r420d.h" /* r420,r423,rv410 depends on : */ void r100_pci_gart_disable(struct radeon_device *rdev); @@ -232,3 +233,19 @@ int r420_debugfs_pipes_info_init(struct radeon_device *rdev) return 0; #endif } + +u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg) +{ + u32 r; + + WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg)); + r = RREG32(R_0001FC_MC_IND_DATA); + return r; +} + +void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v) +{ + WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg) | + S_0001F8_MC_IND_WR_EN(1)); + WREG32(R_0001FC_MC_IND_DATA, v); +} -- cgit v1.2.3