aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c228
1 files changed, 127 insertions, 101 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index 1400bc420881..64ee78f7d41e 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -1296,7 +1296,6 @@ static int polaris10_populate_single_memory_level(struct pp_hwmgr *hwmgr,
1296 } 1296 }
1297 1297
1298 mem_level->MclkFrequency = clock; 1298 mem_level->MclkFrequency = clock;
1299 mem_level->StutterEnable = 0;
1300 mem_level->EnabledForThrottle = 1; 1299 mem_level->EnabledForThrottle = 1;
1301 mem_level->EnabledForActivity = 0; 1300 mem_level->EnabledForActivity = 0;
1302 mem_level->UpHyst = 0; 1301 mem_level->UpHyst = 0;
@@ -1304,7 +1303,6 @@ static int polaris10_populate_single_memory_level(struct pp_hwmgr *hwmgr,
1304 mem_level->VoltageDownHyst = 0; 1303 mem_level->VoltageDownHyst = 0;
1305 mem_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1304 mem_level->ActivityLevel = (uint16_t)data->mclk_activity_target;
1306 mem_level->StutterEnable = false; 1305 mem_level->StutterEnable = false;
1307
1308 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW; 1306 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;
1309 1307
1310 data->display_timing.num_existing_displays = info.display_count; 1308 data->display_timing.num_existing_displays = info.display_count;
@@ -1363,7 +1361,7 @@ static int polaris10_populate_all_memory_levels(struct pp_hwmgr *hwmgr)
1363 * a higher state by default such that we are not effected by 1361 * a higher state by default such that we are not effected by
1364 * up threshold or and MCLK DPM latency. 1362 * up threshold or and MCLK DPM latency.
1365 */ 1363 */
1366 levels[0].ActivityLevel = (uint16_t)data->mclk_dpm0_activity_target; 1364 levels[0].ActivityLevel = 0x1f;
1367 CONVERT_FROM_HOST_TO_SMC_US(levels[0].ActivityLevel); 1365 CONVERT_FROM_HOST_TO_SMC_US(levels[0].ActivityLevel);
1368 1366
1369 data->smc_state_table.MemoryDpmLevelCount = 1367 data->smc_state_table.MemoryDpmLevelCount =
@@ -1761,12 +1759,9 @@ static int polaris10_populate_smc_initailial_state(struct pp_hwmgr *hwmgr)
1761 1759
1762static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr) 1760static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
1763{ 1761{
1764 uint32_t ro, efuse, efuse2, clock_freq, volt_without_cks, 1762 uint32_t ro, efuse, volt_without_cks, volt_with_cks, value, max, min;
1765 volt_with_cks, value;
1766 uint16_t clock_freq_u16;
1767 struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); 1763 struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
1768 uint8_t type, i, j, cks_setting, stretch_amount, stretch_amount2, 1764 uint8_t i, stretch_amount, stretch_amount2, volt_offset = 0;
1769 volt_offset = 0;
1770 struct phm_ppt_v1_information *table_info = 1765 struct phm_ppt_v1_information *table_info =
1771 (struct phm_ppt_v1_information *)(hwmgr->pptable); 1766 (struct phm_ppt_v1_information *)(hwmgr->pptable);
1772 struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table = 1767 struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table =
@@ -1778,50 +1773,38 @@ static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
1778 * if the part is SS or FF. if RO >= 1660MHz, part is FF. 1773 * if the part is SS or FF. if RO >= 1660MHz, part is FF.
1779 */ 1774 */
1780 efuse = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, 1775 efuse = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC,
1781 ixSMU_EFUSE_0 + (146 * 4)); 1776 ixSMU_EFUSE_0 + (67 * 4));
1782 efuse2 = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC,
1783 ixSMU_EFUSE_0 + (148 * 4));
1784 efuse &= 0xFF000000; 1777 efuse &= 0xFF000000;
1785 efuse = efuse >> 24; 1778 efuse = efuse >> 24;
1786 efuse2 &= 0xF;
1787
1788 if (efuse2 == 1)
1789 ro = (2300 - 1350) * efuse / 255 + 1350;
1790 else
1791 ro = (2500 - 1000) * efuse / 255 + 1000;
1792 1779
1793 if (ro >= 1660) 1780 if (hwmgr->chip_id == CHIP_POLARIS10) {
1794 type = 0; 1781 min = 1000;
1795 else 1782 max = 2300;
1796 type = 1; 1783 } else {
1784 min = 1100;
1785 max = 2100;
1786 }
1797 1787
1798 /* Populate Stretch amount */ 1788 ro = efuse * (max -min)/255 + min;
1799 data->smc_state_table.ClockStretcherAmount = stretch_amount;
1800 1789
1801 /* Populate Sclk_CKS_masterEn0_7 and Sclk_voltageOffset */ 1790 /* Populate Sclk_CKS_masterEn0_7 and Sclk_voltageOffset */
1802 for (i = 0; i < sclk_table->count; i++) { 1791 for (i = 0; i < sclk_table->count; i++) {
1803 data->smc_state_table.Sclk_CKS_masterEn0_7 |= 1792 data->smc_state_table.Sclk_CKS_masterEn0_7 |=
1804 sclk_table->entries[i].cks_enable << i; 1793 sclk_table->entries[i].cks_enable << i;
1805 volt_without_cks = (uint32_t)((14041 * 1794
1806 (sclk_table->entries[i].clk/100) / 10000 + 3571 + 75 - ro) * 1000 / 1795 volt_without_cks = (uint32_t)(((ro - 40) * 1000 - 2753594 - sclk_table->entries[i].clk/100 * 136418 /1000) / \
1807 (4026 - (13924 * (sclk_table->entries[i].clk/100) / 10000))); 1796 (sclk_table->entries[i].clk/100 * 1132925 /10000 - 242418)/100);
1808 volt_with_cks = (uint32_t)((13946 * 1797
1809 (sclk_table->entries[i].clk/100) / 10000 + 3320 + 45 - ro) * 1000 / 1798 volt_with_cks = (uint32_t)((ro * 1000 -2396351 - sclk_table->entries[i].clk/100 * 329021/1000) / \
1810 (3664 - (11454 * (sclk_table->entries[i].clk/100) / 10000))); 1799 (sclk_table->entries[i].clk/10000 * 649434 /1000 - 18005)/10);
1800
1811 if (volt_without_cks >= volt_with_cks) 1801 if (volt_without_cks >= volt_with_cks)
1812 volt_offset = (uint8_t)(((volt_without_cks - volt_with_cks + 1802 volt_offset = (uint8_t)(((volt_without_cks - volt_with_cks +
1813 sclk_table->entries[i].cks_voffset) * 100 / 625) + 1); 1803 sclk_table->entries[i].cks_voffset) * 100 / 625) + 1);
1804
1814 data->smc_state_table.Sclk_voltageOffset[i] = volt_offset; 1805 data->smc_state_table.Sclk_voltageOffset[i] = volt_offset;
1815 } 1806 }
1816 1807
1817 PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, PWR_CKS_ENABLE,
1818 STRETCH_ENABLE, 0x0);
1819 PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, PWR_CKS_ENABLE,
1820 masterReset, 0x1);
1821 /* PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, PWR_CKS_ENABLE, staticEnable, 0x1); */
1822 PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, PWR_CKS_ENABLE,
1823 masterReset, 0x0);
1824
1825 /* Populate CKS Lookup Table */ 1808 /* Populate CKS Lookup Table */
1826 if (stretch_amount == 1 || stretch_amount == 2 || stretch_amount == 5) 1809 if (stretch_amount == 1 || stretch_amount == 2 || stretch_amount == 5)
1827 stretch_amount2 = 0; 1810 stretch_amount2 = 0;
@@ -1835,69 +1818,6 @@ static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
1835 return -EINVAL); 1818 return -EINVAL);
1836 } 1819 }
1837 1820
1838 value = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC,
1839 ixPWR_CKS_CNTL);
1840 value &= 0xFFC2FF87;
1841 data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].minFreq =
1842 polaris10_clock_stretcher_lookup_table[stretch_amount2][0];
1843 data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].maxFreq =
1844 polaris10_clock_stretcher_lookup_table[stretch_amount2][1];
1845 clock_freq_u16 = (uint16_t)(PP_SMC_TO_HOST_UL(data->smc_state_table.
1846 GraphicsLevel[data->smc_state_table.GraphicsDpmLevelCount - 1].SclkSetting.SclkFrequency) / 100);
1847 if (polaris10_clock_stretcher_lookup_table[stretch_amount2][0] < clock_freq_u16
1848 && polaris10_clock_stretcher_lookup_table[stretch_amount2][1] > clock_freq_u16) {
1849 /* Program PWR_CKS_CNTL. CKS_USE_FOR_LOW_FREQ */
1850 value |= (polaris10_clock_stretcher_lookup_table[stretch_amount2][3]) << 16;
1851 /* Program PWR_CKS_CNTL. CKS_LDO_REFSEL */
1852 value |= (polaris10_clock_stretcher_lookup_table[stretch_amount2][2]) << 18;
1853 /* Program PWR_CKS_CNTL. CKS_STRETCH_AMOUNT */
1854 value |= (polaris10_clock_stretch_amount_conversion
1855 [polaris10_clock_stretcher_lookup_table[stretch_amount2][3]]
1856 [stretch_amount]) << 3;
1857 }
1858 CONVERT_FROM_HOST_TO_SMC_US(data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].minFreq);
1859 CONVERT_FROM_HOST_TO_SMC_US(data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].maxFreq);
1860 data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].setting =
1861 polaris10_clock_stretcher_lookup_table[stretch_amount2][2] & 0x7F;
1862 data->smc_state_table.CKS_LOOKUPTable.CKS_LOOKUPTableEntry[0].setting |=
1863 (polaris10_clock_stretcher_lookup_table[stretch_amount2][3]) << 7;
1864
1865 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
1866 ixPWR_CKS_CNTL, value);
1867
1868 /* Populate DDT Lookup Table */
1869 for (i = 0; i < 4; i++) {
1870 /* Assign the minimum and maximum VID stored
1871 * in the last row of Clock Stretcher Voltage Table.
1872 */
1873 data->smc_state_table.ClockStretcherDataTable.ClockStretcherDataTableEntry[i].minVID =
1874 (uint8_t) polaris10_clock_stretcher_ddt_table[type][i][2];
1875 data->smc_state_table.ClockStretcherDataTable.ClockStretcherDataTableEntry[i].maxVID =
1876 (uint8_t) polaris10_clock_stretcher_ddt_table[type][i][3];
1877 /* Loop through each SCLK and check the frequency
1878 * to see if it lies within the frequency for clock stretcher.
1879 */
1880 for (j = 0; j < data->smc_state_table.GraphicsDpmLevelCount; j++) {
1881 cks_setting = 0;
1882 clock_freq = PP_SMC_TO_HOST_UL(
1883 data->smc_state_table.GraphicsLevel[j].SclkSetting.SclkFrequency);
1884 /* Check the allowed frequency against the sclk level[j].
1885 * Sclk's endianness has already been converted,
1886 * and it's in 10Khz unit,
1887 * as opposed to Data table, which is in Mhz unit.
1888 */
1889 if (clock_freq >= (polaris10_clock_stretcher_ddt_table[type][i][0]) * 100) {
1890 cks_setting |= 0x2;
1891 if (clock_freq < (polaris10_clock_stretcher_ddt_table[type][i][1]) * 100)
1892 cks_setting |= 0x1;
1893 }
1894 data->smc_state_table.ClockStretcherDataTable.ClockStretcherDataTableEntry[i].setting
1895 |= cks_setting << (j * 2);
1896 }
1897 CONVERT_FROM_HOST_TO_SMC_US(
1898 data->smc_state_table.ClockStretcherDataTable.ClockStretcherDataTableEntry[i].setting);
1899 }
1900
1901 value = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL); 1821 value = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL);
1902 value &= 0xFFFFFFFE; 1822 value &= 0xFFFFFFFE;
1903 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL, value); 1823 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL, value);
@@ -1956,6 +1876,90 @@ static int polaris10_populate_vr_config(struct pp_hwmgr *hwmgr,
1956 return 0; 1876 return 0;
1957} 1877}
1958 1878
1879
1880int polaris10_populate_avfs_parameters(struct pp_hwmgr *hwmgr)
1881{
1882 struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
1883 SMU74_Discrete_DpmTable *table = &(data->smc_state_table);
1884 int result = 0;
1885 struct pp_atom_ctrl__avfs_parameters avfs_params = {0};
1886 AVFS_meanNsigma_t AVFS_meanNsigma = { {0} };
1887 AVFS_Sclk_Offset_t AVFS_SclkOffset = { {0} };
1888 uint32_t tmp, i;
1889 struct pp_smumgr *smumgr = hwmgr->smumgr;
1890 struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(smumgr->backend);
1891
1892 struct phm_ppt_v1_information *table_info =
1893 (struct phm_ppt_v1_information *)hwmgr->pptable;
1894 struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table =
1895 table_info->vdd_dep_on_sclk;
1896
1897
1898 if (smu_data->avfs.avfs_btc_status == AVFS_BTC_NOTSUPPORTED)
1899 return result;
1900
1901 result = atomctrl_get_avfs_information(hwmgr, &avfs_params);
1902
1903 if (0 == result) {
1904 table->BTCGB_VDROOP_TABLE[0].a0 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a0);
1905 table->BTCGB_VDROOP_TABLE[0].a1 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a1);
1906 table->BTCGB_VDROOP_TABLE[0].a2 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSON_a2);
1907 table->BTCGB_VDROOP_TABLE[1].a0 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a0);
1908 table->BTCGB_VDROOP_TABLE[1].a1 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a1);
1909 table->BTCGB_VDROOP_TABLE[1].a2 = PP_HOST_TO_SMC_UL(avfs_params.ulGB_VDROOP_TABLE_CKSOFF_a2);
1910 table->AVFSGB_VDROOP_TABLE[0].m1 = PP_HOST_TO_SMC_UL(avfs_params.ulAVFSGB_FUSE_TABLE_CKSON_m1);
1911 table->AVFSGB_VDROOP_TABLE[0].m2 = PP_HOST_TO_SMC_US(avfs_params.usAVFSGB_FUSE_TABLE_CKSON_m2);
1912 table->AVFSGB_VDROOP_TABLE[0].b = PP_HOST_TO_SMC_UL(avfs_params.ulAVFSGB_FUSE_TABLE_CKSON_b);
1913 table->AVFSGB_VDROOP_TABLE[0].m1_shift = 24;
1914 table->AVFSGB_VDROOP_TABLE[0].m2_shift = 12;
1915 table->AVFSGB_VDROOP_TABLE[1].m1 = PP_HOST_TO_SMC_UL(avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_m1);
1916 table->AVFSGB_VDROOP_TABLE[1].m2 = PP_HOST_TO_SMC_US(avfs_params.usAVFSGB_FUSE_TABLE_CKSOFF_m2);
1917 table->AVFSGB_VDROOP_TABLE[1].b = PP_HOST_TO_SMC_UL(avfs_params.ulAVFSGB_FUSE_TABLE_CKSOFF_b);
1918 table->AVFSGB_VDROOP_TABLE[1].m1_shift = 24;
1919 table->AVFSGB_VDROOP_TABLE[1].m2_shift = 12;
1920 table->MaxVoltage = PP_HOST_TO_SMC_US(avfs_params.usMaxVoltage_0_25mv);
1921 AVFS_meanNsigma.Aconstant[0] = PP_HOST_TO_SMC_UL(avfs_params.ulAVFS_meanNsigma_Acontant0);
1922 AVFS_meanNsigma.Aconstant[1] = PP_HOST_TO_SMC_UL(avfs_params.ulAVFS_meanNsigma_Acontant1);
1923 AVFS_meanNsigma.Aconstant[2] = PP_HOST_TO_SMC_UL(avfs_params.ulAVFS_meanNsigma_Acontant2);
1924 AVFS_meanNsigma.DC_tol_sigma = PP_HOST_TO_SMC_US(avfs_params.usAVFS_meanNsigma_DC_tol_sigma);
1925 AVFS_meanNsigma.Platform_mean = PP_HOST_TO_SMC_US(avfs_params.usAVFS_meanNsigma_Platform_mean);
1926 AVFS_meanNsigma.PSM_Age_CompFactor = PP_HOST_TO_SMC_US(avfs_params.usPSM_Age_ComFactor);
1927 AVFS_meanNsigma.Platform_sigma = PP_HOST_TO_SMC_US(avfs_params.usAVFS_meanNsigma_Platform_sigma);
1928
1929 for (i = 0; i < NUM_VFT_COLUMNS; i++) {
1930 AVFS_meanNsigma.Static_Voltage_Offset[i] = (uint8_t)(sclk_table->entries[i].cks_voffset * 100 / 625);
1931 AVFS_SclkOffset.Sclk_Offset[i] = PP_HOST_TO_SMC_US((uint16_t)(sclk_table->entries[i].sclk_offset) / 100);
1932 }
1933
1934 result = polaris10_read_smc_sram_dword(smumgr,
1935 SMU7_FIRMWARE_HEADER_LOCATION + offsetof(SMU74_Firmware_Header, AvfsMeanNSigma),
1936 &tmp, data->sram_end);
1937
1938 polaris10_copy_bytes_to_smc(smumgr,
1939 tmp,
1940 (uint8_t *)&AVFS_meanNsigma,
1941 sizeof(AVFS_meanNsigma_t),
1942 data->sram_end);
1943
1944 result = polaris10_read_smc_sram_dword(smumgr,
1945 SMU7_FIRMWARE_HEADER_LOCATION + offsetof(SMU74_Firmware_Header, AvfsSclkOffsetTable),
1946 &tmp, data->sram_end);
1947 polaris10_copy_bytes_to_smc(smumgr,
1948 tmp,
1949 (uint8_t *)&AVFS_SclkOffset,
1950 sizeof(AVFS_Sclk_Offset_t),
1951 data->sram_end);
1952
1953 data->avfs_vdroop_override_setting = (avfs_params.ucEnableGB_VDROOP_TABLE_CKSON << BTCGB0_Vdroop_Enable_SHIFT) |
1954 (avfs_params.ucEnableGB_VDROOP_TABLE_CKSOFF << BTCGB1_Vdroop_Enable_SHIFT) |
1955 (avfs_params.ucEnableGB_FUSE_TABLE_CKSON << AVFSGB0_Vdroop_Enable_SHIFT) |
1956 (avfs_params.ucEnableGB_FUSE_TABLE_CKSOFF << AVFSGB1_Vdroop_Enable_SHIFT);
1957 data->apply_avfs_cks_off_voltage = (avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage == 1) ? true : false;
1958 }
1959 return result;
1960}
1961
1962
1959/** 1963/**
1960* Initializes the SMC table and uploads it 1964* Initializes the SMC table and uploads it
1961* 1965*
@@ -2056,6 +2060,10 @@ static int polaris10_init_smc_table(struct pp_hwmgr *hwmgr)
2056 "Failed to populate Clock Stretcher Data Table!", 2060 "Failed to populate Clock Stretcher Data Table!",
2057 return result); 2061 return result);
2058 } 2062 }
2063
2064 result = polaris10_populate_avfs_parameters(hwmgr);
2065 PP_ASSERT_WITH_CODE(0 == result, "Failed to populate AVFS Parameters!", return result;);
2066
2059 table->CurrSclkPllRange = 0xff; 2067 table->CurrSclkPllRange = 0xff;
2060 table->GraphicsVoltageChangeEnable = 1; 2068 table->GraphicsVoltageChangeEnable = 1;
2061 table->GraphicsThermThrottleEnable = 1; 2069 table->GraphicsThermThrottleEnable = 1;
@@ -2252,6 +2260,9 @@ static int polaris10_enable_deep_sleep_master_switch(struct pp_hwmgr *hwmgr)
2252static int polaris10_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr) 2260static int polaris10_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr)
2253{ 2261{
2254 struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); 2262 struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
2263 uint32_t soft_register_value = 0;
2264 uint32_t handshake_disables_offset = data->soft_regs_start
2265 + offsetof(SMU74_SoftRegisters, HandshakeDisables);
2255 2266
2256 /* enable SCLK dpm */ 2267 /* enable SCLK dpm */
2257 if (!data->sclk_dpm_key_disabled) 2268 if (!data->sclk_dpm_key_disabled)
@@ -2262,6 +2273,12 @@ static int polaris10_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr)
2262 2273
2263 /* enable MCLK dpm */ 2274 /* enable MCLK dpm */
2264 if (0 == data->mclk_dpm_key_disabled) { 2275 if (0 == data->mclk_dpm_key_disabled) {
2276/* Disable UVD - SMU handshake for MCLK. */
2277 soft_register_value = cgs_read_ind_register(hwmgr->device,
2278 CGS_IND_REG__SMC, handshake_disables_offset);
2279 soft_register_value |= SMU7_UVD_MCLK_HANDSHAKE_DISABLE;
2280 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
2281 handshake_disables_offset, soft_register_value);
2265 2282
2266 PP_ASSERT_WITH_CODE( 2283 PP_ASSERT_WITH_CODE(
2267 (0 == smum_send_msg_to_smc(hwmgr->smumgr, 2284 (0 == smum_send_msg_to_smc(hwmgr->smumgr,
@@ -2269,7 +2286,6 @@ static int polaris10_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr)
2269 "Failed to enable MCLK DPM during DPM Start Function!", 2286 "Failed to enable MCLK DPM during DPM Start Function!",
2270 return -1); 2287 return -1);
2271 2288
2272
2273 PHM_WRITE_FIELD(hwmgr->device, MC_SEQ_CNTL_3, CAC_EN, 0x1); 2289 PHM_WRITE_FIELD(hwmgr->device, MC_SEQ_CNTL_3, CAC_EN, 0x1);
2274 2290
2275 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixLCAC_MC0_CNTL, 0x5); 2291 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixLCAC_MC0_CNTL, 0x5);
@@ -2606,6 +2622,7 @@ int polaris10_set_features_platform_caps(struct pp_hwmgr *hwmgr)
2606 2622
2607 phm_cap_set(hwmgr->platform_descriptor.platformCaps, 2623 phm_cap_set(hwmgr->platform_descriptor.platformCaps,
2608 PHM_PlatformCaps_FanSpeedInTableIsRPM); 2624 PHM_PlatformCaps_FanSpeedInTableIsRPM);
2625
2609 if (hwmgr->chip_id == CHIP_POLARIS11) 2626 if (hwmgr->chip_id == CHIP_POLARIS11)
2610 phm_cap_set(hwmgr->platform_descriptor.platformCaps, 2627 phm_cap_set(hwmgr->platform_descriptor.platformCaps,
2611 PHM_PlatformCaps_SPLLShutdownSupport); 2628 PHM_PlatformCaps_SPLLShutdownSupport);
@@ -2938,6 +2955,11 @@ int polaris10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
2938 data->vddci_control = POLARIS10_VOLTAGE_CONTROL_NONE; 2955 data->vddci_control = POLARIS10_VOLTAGE_CONTROL_NONE;
2939 data->mvdd_control = POLARIS10_VOLTAGE_CONTROL_NONE; 2956 data->mvdd_control = POLARIS10_VOLTAGE_CONTROL_NONE;
2940 2957
2958 data->enable_tdc_limit_feature = true;
2959 data->enable_pkg_pwr_tracking_feature = true;
2960 data->force_pcie_gen = PP_PCIEGenInvalid;
2961 data->mclk_stutter_mode_threshold = 40000;
2962
2941 if (atomctrl_is_voltage_controled_by_gpio_v3(hwmgr, 2963 if (atomctrl_is_voltage_controled_by_gpio_v3(hwmgr,
2942 VOLTAGE_TYPE_VDDC, VOLTAGE_OBJ_SVID2)) 2964 VOLTAGE_TYPE_VDDC, VOLTAGE_OBJ_SVID2))
2943 data->voltage_control = POLARIS10_VOLTAGE_CONTROL_BY_SVID2; 2965 data->voltage_control = POLARIS10_VOLTAGE_CONTROL_BY_SVID2;
@@ -2962,6 +2984,10 @@ int polaris10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
2962 data->vddci_control = POLARIS10_VOLTAGE_CONTROL_BY_SVID2; 2984 data->vddci_control = POLARIS10_VOLTAGE_CONTROL_BY_SVID2;
2963 } 2985 }
2964 2986
2987 if (table_info->cac_dtp_table->usClockStretchAmount != 0)
2988 phm_cap_set(hwmgr->platform_descriptor.platformCaps,
2989 PHM_PlatformCaps_ClockStretcher);
2990
2965 polaris10_set_features_platform_caps(hwmgr); 2991 polaris10_set_features_platform_caps(hwmgr);
2966 2992
2967 polaris10_init_dpm_defaults(hwmgr); 2993 polaris10_init_dpm_defaults(hwmgr);