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 | |
parent | 2c67912c439ca501c7a23d69183bf71eab167d35 (diff) |
drm/radeon/cik: add pcie_port indirect register accessors
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/cikd.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 2 |
4 files changed, 31 insertions, 1 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); | |||
78 | extern int si_rlc_init(struct radeon_device *rdev); | 78 | extern int si_rlc_init(struct radeon_device *rdev); |
79 | static void cik_rlc_stop(struct radeon_device *rdev); | 79 | static void cik_rlc_stop(struct radeon_device *rdev); |
80 | 80 | ||
81 | /* | ||
82 | * Indirect registers accessor | ||
83 | */ | ||
84 | u32 cik_pciep_rreg(struct radeon_device *rdev, u32 reg) | ||
85 | { | ||
86 | u32 r; | ||
87 | |||
88 | WREG32(PCIE_INDEX, reg); | ||
89 | (void)RREG32(PCIE_INDEX); | ||
90 | r = RREG32(PCIE_DATA); | ||
91 | return r; | ||
92 | } | ||
93 | |||
94 | void cik_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v) | ||
95 | { | ||
96 | WREG32(PCIE_INDEX, reg); | ||
97 | (void)RREG32(PCIE_INDEX); | ||
98 | WREG32(PCIE_DATA, v); | ||
99 | (void)RREG32(PCIE_DATA); | ||
100 | } | ||
101 | |||
81 | /** | 102 | /** |
82 | * cik_get_xclk - get the xclk | 103 | * cik_get_xclk - get the xclk |
83 | * | 104 | * |
diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h index f00e273134a8..d23809a557a6 100644 --- a/drivers/gpu/drm/radeon/cikd.h +++ b/drivers/gpu/drm/radeon/cikd.h | |||
@@ -35,6 +35,9 @@ | |||
35 | #define CG_CLKPIN_CNTL 0xC05001A0 | 35 | #define CG_CLKPIN_CNTL 0xC05001A0 |
36 | # define XTALIN_DIVIDE (1 << 1) | 36 | # define XTALIN_DIVIDE (1 << 1) |
37 | 37 | ||
38 | #define PCIE_INDEX 0x38 | ||
39 | #define PCIE_DATA 0x3C | ||
40 | |||
38 | #define VGA_HDP_CONTROL 0x328 | 41 | #define VGA_HDP_CONTROL 0x328 |
39 | #define VGA_MEMORY_DISABLE (1 << 4) | 42 | #define VGA_MEMORY_DISABLE (1 << 4) |
40 | 43 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index a2802b47ee95..717b5373d2b0 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -126,7 +126,11 @@ static void radeon_register_accessor_init(struct radeon_device *rdev) | |||
126 | rdev->mc_rreg = &rs780_mc_rreg; | 126 | rdev->mc_rreg = &rs780_mc_rreg; |
127 | rdev->mc_wreg = &rs780_mc_wreg; | 127 | rdev->mc_wreg = &rs780_mc_wreg; |
128 | } | 128 | } |
129 | if (rdev->family >= CHIP_R600) { | 129 | |
130 | if (rdev->family >= CHIP_BONAIRE) { | ||
131 | rdev->pciep_rreg = &cik_pciep_rreg; | ||
132 | rdev->pciep_wreg = &cik_pciep_wreg; | ||
133 | } else if (rdev->family >= CHIP_R600) { | ||
130 | rdev->pciep_rreg = &r600_pciep_rreg; | 134 | rdev->pciep_rreg = &r600_pciep_rreg; |
131 | rdev->pciep_wreg = &r600_pciep_wreg; | 135 | rdev->pciep_wreg = &r600_pciep_wreg; |
132 | } | 136 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 05f75f753468..8c19e3646256 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -558,5 +558,7 @@ int si_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); | |||
558 | */ | 558 | */ |
559 | uint64_t cik_get_gpu_clock_counter(struct radeon_device *rdev); | 559 | uint64_t cik_get_gpu_clock_counter(struct radeon_device *rdev); |
560 | u32 cik_get_xclk(struct radeon_device *rdev); | 560 | u32 cik_get_xclk(struct radeon_device *rdev); |
561 | uint32_t cik_pciep_rreg(struct radeon_device *rdev, uint32_t reg); | ||
562 | void cik_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); | ||
561 | 563 | ||
562 | #endif | 564 | #endif |