diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2018-12-06 10:41:27 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-10 15:33:01 -0500 |
commit | 816b6931315b641c5864cf33a9363cb89da05d0b (patch) | |
tree | 180be609dce00d39c9c57089a33b24e0061b05a9 /drivers | |
parent | 2e431a1788c52d510bb24229cef93ba935f5785b (diff) |
drm/amdgpu/powerplay: Add special avfs cases for some polaris asics (v3)
Add special avfs handling for some polaris variants.
v2: fix copy paste typo.
v3: fix asic rid check
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c index 94898b2da282..b3e06e498834 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | |||
@@ -1639,6 +1639,7 @@ static int polaris10_populate_avfs_parameters(struct pp_hwmgr *hwmgr) | |||
1639 | { | 1639 | { |
1640 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); | 1640 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); |
1641 | struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend); | 1641 | struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend); |
1642 | struct amdgpu_device *adev = hwmgr->adev; | ||
1642 | 1643 | ||
1643 | SMU74_Discrete_DpmTable *table = &(smu_data->smc_state_table); | 1644 | SMU74_Discrete_DpmTable *table = &(smu_data->smc_state_table); |
1644 | int result = 0; | 1645 | int result = 0; |
@@ -1659,6 +1660,59 @@ static int polaris10_populate_avfs_parameters(struct pp_hwmgr *hwmgr) | |||
1659 | result = atomctrl_get_avfs_information(hwmgr, &avfs_params); | 1660 | result = atomctrl_get_avfs_information(hwmgr, &avfs_params); |
1660 | 1661 | ||
1661 | if (0 == result) { | 1662 | if (0 == result) { |
1663 | if (((adev->pdev->device == 0x67ef) && | ||
1664 | ((adev->pdev->revision == 0xe0) || | ||
1665 | (adev->pdev->revision == 0xe5))) || | ||
1666 | ((adev->pdev->device == 0x67ff) && | ||
1667 | ((adev->pdev->revision == 0xcf) || | ||
1668 | (adev->pdev->revision == 0xef) || | ||
1669 | (adev->pdev->revision == 0xff)))) { | ||
1670 | avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage = 1; | ||
1671 | if ((adev->pdev->device == 0x67ef && adev->pdev->revision == 0xe5) || | ||
1672 | (adev->pdev->device == 0x67ff && adev->pdev->revision == 0xef)) { | ||
1673 | if ((avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a0 == 0xEA522DD3) && | ||
1674 | (avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a1 == 0x5645A) && | ||
1675 | (avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a2 == 0x33F9E) && | ||
1676 | (avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_m1 == 0xFFFFC5CC) && | ||
1677 | (avfs_params.usAVFSGB_FUSE_TABLE_CKSOFF_m2 == 0x1B1A) && | ||
1678 | (avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_b == 0xFFFFFCED)) { | ||
1679 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a0 = 0xF718F1D4; | ||
1680 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a1 = 0x323FD; | ||
1681 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a2 = 0x1E455; | ||
1682 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_m1 = 0; | ||
1683 | avfs_params.usAVFSGB_FUSE_TABLE_CKSOFF_m2 = 0; | ||
1684 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_b = 0x23; | ||
1685 | } | ||
1686 | } | ||
1687 | } else if (hwmgr->chip_id == CHIP_POLARIS12 && !hwmgr->is_kicker) { | ||
1688 | avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage = 1; | ||
1689 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a0 = 0xF6B024DD; | ||
1690 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a1 = 0x3005E; | ||
1691 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a2 = 0x18A5F; | ||
1692 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_m1 = 0x315; | ||
1693 | avfs_params.usAVFSGB_FUSE_TABLE_CKSOFF_m2 = 0xFED1; | ||
1694 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_b = 0x3B; | ||
1695 | } else if (((adev->pdev->device == 0x67df) && | ||
1696 | ((adev->pdev->revision == 0xe0) || | ||
1697 | (adev->pdev->revision == 0xe3) || | ||
1698 | (adev->pdev->revision == 0xe4) || | ||
1699 | (adev->pdev->revision == 0xe5) || | ||
1700 | (adev->pdev->revision == 0xe7) || | ||
1701 | (adev->pdev->revision == 0xef))) || | ||
1702 | ((adev->pdev->device == 0x6fdf) && | ||
1703 | ((adev->pdev->revision == 0xef) || | ||
1704 | (adev->pdev->revision == 0xff)))) { | ||
1705 | avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage = 1; | ||
1706 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a0 = 0xF843B66B; | ||
1707 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a1 = 0x59CB5; | ||
1708 | avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a2 = 0xFFFF287F; | ||
1709 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_m1 = 0; | ||
1710 | avfs_params.usAVFSGB_FUSE_TABLE_CKSOFF_m2 = 0xFF23; | ||
1711 | avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_b = 0x58; | ||
1712 | } | ||
1713 | } | ||
1714 | |||
1715 | if (0 == result) { | ||
1662 | table->BTCGB_VDROOP_TABLE[0].a0 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a0); | 1716 | table->BTCGB_VDROOP_TABLE[0].a0 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a0); |
1663 | table->BTCGB_VDROOP_TABLE[0].a1 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a1); | 1717 | table->BTCGB_VDROOP_TABLE[0].a1 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a1); |
1664 | table->BTCGB_VDROOP_TABLE[0].a2 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a2); | 1718 | table->BTCGB_VDROOP_TABLE[0].a2 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a2); |