提交 0bf7f2dc 编写于 作者: L Likun Gao 提交者: Alex Deucher

drm/amdgpu: switch to use smuio callbacks for NV family

Switch to smuio callbacks: use smuio v11_0_6 callbacks for
Sienna_cichlid and forward ASIC, use smuio v11_0 callbacks for the
other NV family ASIC.
Signed-off-by: NLikun Gao <Likun.Gao@amd.com>
Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 1deb9853
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "gc/gc_10_1_0_offset.h" #include "gc/gc_10_1_0_offset.h"
#include "gc/gc_10_1_0_sh_mask.h" #include "gc/gc_10_1_0_sh_mask.h"
#include "smuio/smuio_11_0_0_offset.h"
#include "mp/mp_11_0_offset.h" #include "mp/mp_11_0_offset.h"
#include "soc15.h" #include "soc15.h"
...@@ -61,6 +60,8 @@ ...@@ -61,6 +60,8 @@
#include "dce_virtual.h" #include "dce_virtual.h"
#include "mes_v10_1.h" #include "mes_v10_1.h"
#include "mxgpu_nv.h" #include "mxgpu_nv.h"
#include "smuio_v11_0.h"
#include "smuio_v11_0_6.h"
static const struct amd_ip_funcs nv_common_ip_funcs; static const struct amd_ip_funcs nv_common_ip_funcs;
...@@ -202,6 +203,7 @@ static bool nv_read_bios_from_rom(struct amdgpu_device *adev, ...@@ -202,6 +203,7 @@ static bool nv_read_bios_from_rom(struct amdgpu_device *adev,
{ {
u32 *dw_ptr; u32 *dw_ptr;
u32 i, length_dw; u32 i, length_dw;
u32 rom_index_offset, rom_data_offset;
if (bios == NULL) if (bios == NULL)
return false; return false;
...@@ -214,11 +216,16 @@ static bool nv_read_bios_from_rom(struct amdgpu_device *adev, ...@@ -214,11 +216,16 @@ static bool nv_read_bios_from_rom(struct amdgpu_device *adev,
dw_ptr = (u32 *)bios; dw_ptr = (u32 *)bios;
length_dw = ALIGN(length_bytes, 4) / 4; length_dw = ALIGN(length_bytes, 4) / 4;
rom_index_offset =
adev->smuio.funcs->get_rom_index_offset(adev);
rom_data_offset =
adev->smuio.funcs->get_rom_data_offset(adev);
/* set rom index to 0 */ /* set rom index to 0 */
WREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX), 0); WREG32(rom_index_offset, 0);
/* read out the rom data */ /* read out the rom data */
for (i = 0; i < length_dw; i++) for (i = 0; i < length_dw; i++)
dw_ptr[i] = RREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA)); dw_ptr[i] = RREG32(rom_data_offset);
return true; return true;
} }
...@@ -564,6 +571,11 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) ...@@ -564,6 +571,11 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
} }
adev->hdp.funcs = &hdp_v5_0_funcs; adev->hdp.funcs = &hdp_v5_0_funcs;
if (adev->asic_type >= CHIP_SIENNA_CICHLID)
adev->smuio.funcs = &smuio_v11_0_6_funcs;
else
adev->smuio.funcs = &smuio_v11_0_funcs;
if (adev->asic_type == CHIP_SIENNA_CICHLID) if (adev->asic_type == CHIP_SIENNA_CICHLID)
adev->gmc.xgmi.supported = true; adev->gmc.xgmi.supported = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册