diff options
author | Junwei Zhang <Jerry.Zhang@amd.com> | 2016-03-10 01:20:39 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:53:34 -0400 |
commit | 8fe733289bc00914e9ace101088857cda20a1c51 (patch) | |
tree | a0a11011cf3694ebea7805e19bb4d95593fb70fb /drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |
parent | 04e30c9c8667494847f3876fe3e6c8b39fa6fd1b (diff) |
drm/amdgpu: init aperture definitions (v2)
v2: agd: move apertures to mc structure
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index e471c08dd249..1b8b4941dcf3 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -1889,7 +1889,8 @@ static void gfx_v7_0_config_init(struct amdgpu_device *adev) | |||
1889 | */ | 1889 | */ |
1890 | static void gfx_v7_0_gpu_init(struct amdgpu_device *adev) | 1890 | static void gfx_v7_0_gpu_init(struct amdgpu_device *adev) |
1891 | { | 1891 | { |
1892 | u32 tmp, sh_mem_cfg; | 1892 | u32 sh_mem_cfg, sh_static_mem_cfg, sh_mem_base; |
1893 | u32 tmp; | ||
1893 | int i; | 1894 | int i; |
1894 | 1895 | ||
1895 | WREG32(mmGRBM_CNTL, (0xff << GRBM_CNTL__READ_TIMEOUT__SHIFT)); | 1896 | WREG32(mmGRBM_CNTL, (0xff << GRBM_CNTL__READ_TIMEOUT__SHIFT)); |
@@ -1920,15 +1921,32 @@ static void gfx_v7_0_gpu_init(struct amdgpu_device *adev) | |||
1920 | /* where to put LDS, scratch, GPUVM in FSA64 space */ | 1921 | /* where to put LDS, scratch, GPUVM in FSA64 space */ |
1921 | sh_mem_cfg = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE, | 1922 | sh_mem_cfg = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE, |
1922 | SH_MEM_ALIGNMENT_MODE_UNALIGNED); | 1923 | SH_MEM_ALIGNMENT_MODE_UNALIGNED); |
1924 | sh_mem_cfg = REG_SET_FIELD(sh_mem_cfg, SH_MEM_CONFIG, DEFAULT_MTYPE, | ||
1925 | MTYPE_NC); | ||
1926 | sh_mem_cfg = REG_SET_FIELD(sh_mem_cfg, SH_MEM_CONFIG, APE1_MTYPE, | ||
1927 | MTYPE_UC); | ||
1928 | sh_mem_cfg = REG_SET_FIELD(sh_mem_cfg, SH_MEM_CONFIG, PRIVATE_ATC, 0); | ||
1929 | |||
1930 | sh_static_mem_cfg = REG_SET_FIELD(0, SH_STATIC_MEM_CONFIG, | ||
1931 | SWIZZLE_ENABLE, 1); | ||
1932 | sh_static_mem_cfg = REG_SET_FIELD(sh_static_mem_cfg, SH_STATIC_MEM_CONFIG, | ||
1933 | ELEMENT_SIZE, 1); | ||
1934 | sh_static_mem_cfg = REG_SET_FIELD(sh_static_mem_cfg, SH_STATIC_MEM_CONFIG, | ||
1935 | INDEX_STRIDE, 3); | ||
1923 | 1936 | ||
1924 | mutex_lock(&adev->srbm_mutex); | 1937 | mutex_lock(&adev->srbm_mutex); |
1925 | for (i = 0; i < 16; i++) { | 1938 | for (i = 0; i < adev->vm_manager.num_ids; i++) { |
1939 | if (i == 0) | ||
1940 | sh_mem_base = 0; | ||
1941 | else | ||
1942 | sh_mem_base = adev->mc.shared_aperture_start >> 48; | ||
1926 | cik_srbm_select(adev, 0, 0, 0, i); | 1943 | cik_srbm_select(adev, 0, 0, 0, i); |
1927 | /* CP and shaders */ | 1944 | /* CP and shaders */ |
1928 | WREG32(mmSH_MEM_CONFIG, sh_mem_cfg); | 1945 | WREG32(mmSH_MEM_CONFIG, sh_mem_cfg); |
1929 | WREG32(mmSH_MEM_APE1_BASE, 1); | 1946 | WREG32(mmSH_MEM_APE1_BASE, 1); |
1930 | WREG32(mmSH_MEM_APE1_LIMIT, 0); | 1947 | WREG32(mmSH_MEM_APE1_LIMIT, 0); |
1931 | WREG32(mmSH_MEM_BASES, 0); | 1948 | WREG32(mmSH_MEM_BASES, sh_mem_base); |
1949 | WREG32(mmSH_STATIC_MEM_CONFIG, sh_static_mem_cfg); | ||
1932 | } | 1950 | } |
1933 | cik_srbm_select(adev, 0, 0, 0, 0); | 1951 | cik_srbm_select(adev, 0, 0, 0, 0); |
1934 | mutex_unlock(&adev->srbm_mutex); | 1952 | mutex_unlock(&adev->srbm_mutex); |