aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-08-22 17:09:06 -0400
committerChristian König <christian.koenig@amd.com>2014-02-18 10:11:35 -0500
commit5ad6bf91ef8fd265aee252982a7d6fcf78436153 (patch)
tree2bc7ef1b06b498fea3ba864f5d2eb5019f67a1a7
parent58bd2a88facbdf3c39db0f834111cd4294400814 (diff)
drm/radeon: fill in set_vce_clocks for CIK asics
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/cik.c35
-rw-r--r--drivers/gpu/drm/radeon/cikd.h6
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h1
4 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index be6eb4d91284..ecb16b14f049 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -8925,6 +8925,41 @@ int cik_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk)
8925 return r; 8925 return r;
8926} 8926}
8927 8927
8928int cik_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk)
8929{
8930 int r, i;
8931 struct atom_clock_dividers dividers;
8932 u32 tmp;
8933
8934 r = radeon_atom_get_clock_dividers(rdev, COMPUTE_GPUCLK_INPUT_FLAG_DEFAULT_GPUCLK,
8935 ecclk, false, &dividers);
8936 if (r)
8937 return r;
8938
8939 for (i = 0; i < 100; i++) {
8940 if (RREG32_SMC(CG_ECLK_STATUS) & ECLK_STATUS)
8941 break;
8942 mdelay(10);
8943 }
8944 if (i == 100)
8945 return -ETIMEDOUT;
8946
8947 tmp = RREG32_SMC(CG_ECLK_CNTL);
8948 tmp &= ~(ECLK_DIR_CNTL_EN|ECLK_DIVIDER_MASK);
8949 tmp |= dividers.post_divider;
8950 WREG32_SMC(CG_ECLK_CNTL, tmp);
8951
8952 for (i = 0; i < 100; i++) {
8953 if (RREG32_SMC(CG_ECLK_STATUS) & ECLK_STATUS)
8954 break;
8955 mdelay(10);
8956 }
8957 if (i == 100)
8958 return -ETIMEDOUT;
8959
8960 return 0;
8961}
8962
8928static void cik_pcie_gen3_enable(struct radeon_device *rdev) 8963static void cik_pcie_gen3_enable(struct radeon_device *rdev)
8929{ 8964{
8930 struct pci_dev *root = rdev->pdev->bus->self; 8965 struct pci_dev *root = rdev->pdev->bus->self;
diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h
index 459ae021d91c..ee16380ceba8 100644
--- a/drivers/gpu/drm/radeon/cikd.h
+++ b/drivers/gpu/drm/radeon/cikd.h
@@ -203,6 +203,12 @@
203#define CTF_TEMP_MASK 0x0003fe00 203#define CTF_TEMP_MASK 0x0003fe00
204#define CTF_TEMP_SHIFT 9 204#define CTF_TEMP_SHIFT 9
205 205
206#define CG_ECLK_CNTL 0xC05000AC
207# define ECLK_DIVIDER_MASK 0x7f
208# define ECLK_DIR_CNTL_EN (1 << 8)
209#define CG_ECLK_STATUS 0xC05000B0
210# define ECLK_STATUS (1 << 0)
211
206#define CG_SPLL_FUNC_CNTL 0xC0500140 212#define CG_SPLL_FUNC_CNTL 0xC0500140
207#define SPLL_RESET (1 << 0) 213#define SPLL_RESET (1 << 0)
208#define SPLL_PWRON (1 << 1) 214#define SPLL_PWRON (1 << 1)
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index 4f059b2c05fb..b8a24a75d4ff 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -2076,6 +2076,7 @@ static struct radeon_asic ci_asic = {
2076 .set_pcie_lanes = NULL, 2076 .set_pcie_lanes = NULL,
2077 .set_clock_gating = NULL, 2077 .set_clock_gating = NULL,
2078 .set_uvd_clocks = &cik_set_uvd_clocks, 2078 .set_uvd_clocks = &cik_set_uvd_clocks,
2079 .set_vce_clocks = &cik_set_vce_clocks,
2079 .get_temperature = &ci_get_temp, 2080 .get_temperature = &ci_get_temp,
2080 }, 2081 },
2081 .dpm = { 2082 .dpm = {
@@ -2180,6 +2181,7 @@ static struct radeon_asic kv_asic = {
2180 .set_pcie_lanes = NULL, 2181 .set_pcie_lanes = NULL,
2181 .set_clock_gating = NULL, 2182 .set_clock_gating = NULL,
2182 .set_uvd_clocks = &cik_set_uvd_clocks, 2183 .set_uvd_clocks = &cik_set_uvd_clocks,
2184 .set_vce_clocks = &cik_set_vce_clocks,
2183 .get_temperature = &kv_get_temp, 2185 .get_temperature = &kv_get_temp,
2184 }, 2186 },
2185 .dpm = { 2187 .dpm = {
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 13f87bf5254b..3d55a3a39e82 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -717,6 +717,7 @@ u32 cik_get_xclk(struct radeon_device *rdev);
717uint32_t cik_pciep_rreg(struct radeon_device *rdev, uint32_t reg); 717uint32_t cik_pciep_rreg(struct radeon_device *rdev, uint32_t reg);
718void cik_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 718void cik_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
719int cik_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); 719int cik_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk);
720int cik_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk);
720void cik_sdma_fence_ring_emit(struct radeon_device *rdev, 721void cik_sdma_fence_ring_emit(struct radeon_device *rdev,
721 struct radeon_fence *fence); 722 struct radeon_fence *fence);
722bool cik_sdma_semaphore_ring_emit(struct radeon_device *rdev, 723bool cik_sdma_semaphore_ring_emit(struct radeon_device *rdev,