diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-04-03 19:28:32 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-06-26 16:11:48 -0400 |
commit | 6e2c3c0ae70ccac2e8d8f2c932e72fe9866930ca (patch) | |
tree | efeb05d460c604cdb657bdc0f1e995bab19551fd /drivers/gpu/drm/radeon/cik.c | |
parent | 2c67912c439ca501c7a23d69183bf71eab167d35 (diff) | |
download | lwn-6e2c3c0ae70ccac2e8d8f2c932e72fe9866930ca.tar.gz lwn-6e2c3c0ae70ccac2e8d8f2c932e72fe9866930ca.zip |
drm/radeon/cik: add pcie_port indirect register accessors
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/cik.c')
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 445f497c7fc9..4c8407df175b 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -78,6 +78,27 @@ extern void si_rlc_fini(struct radeon_device *rdev); extern int si_rlc_init(struct radeon_device *rdev); static void cik_rlc_stop(struct radeon_device *rdev); +/* + * Indirect registers accessor + */ +u32 cik_pciep_rreg(struct radeon_device *rdev, u32 reg) +{ + u32 r; + + WREG32(PCIE_INDEX, reg); + (void)RREG32(PCIE_INDEX); + r = RREG32(PCIE_DATA); + return r; +} + +void cik_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v) +{ + WREG32(PCIE_INDEX, reg); + (void)RREG32(PCIE_INDEX); + WREG32(PCIE_DATA, v); + (void)RREG32(PCIE_DATA); +} + /** * cik_get_xclk - get the xclk * |