Lines Matching full:table

255 	/* clock - voltage dependency table is empty table */  in tonga_get_dependency_volt_by_clk()
286 /* sclk is bigger than max sclk in the dependence table */ in tonga_get_dependency_volt_by_clk()
303 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_vddc_table() argument
309 table->VddcLevelCount = data->vddc_voltage_table.count; in tonga_populate_smc_vddc_table()
310 for (count = 0; count < table->VddcLevelCount; count++) { in tonga_populate_smc_vddc_table()
311 table->VddcTable[count] = in tonga_populate_smc_vddc_table()
314 CONVERT_FROM_HOST_TO_SMC_UL(table->VddcLevelCount); in tonga_populate_smc_vddc_table()
320 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_vdd_gfx_table() argument
326 table->VddGfxLevelCount = data->vddgfx_voltage_table.count; in tonga_populate_smc_vdd_gfx_table()
328 table->VddGfxTable[count] = in tonga_populate_smc_vdd_gfx_table()
331 CONVERT_FROM_HOST_TO_SMC_UL(table->VddGfxLevelCount); in tonga_populate_smc_vdd_gfx_table()
337 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_vdd_ci_table() argument
342 table->VddciLevelCount = data->vddci_voltage_table.count; in tonga_populate_smc_vdd_ci_table()
343 for (count = 0; count < table->VddciLevelCount; count++) { in tonga_populate_smc_vdd_ci_table()
345 table->VddciTable[count] = in tonga_populate_smc_vdd_ci_table()
348 table->SmioTable1.Pattern[count].Voltage = in tonga_populate_smc_vdd_ci_table()
351 table->SmioTable1.Pattern[count].Smio = in tonga_populate_smc_vdd_ci_table()
353 table->Smio[count] |= in tonga_populate_smc_vdd_ci_table()
355 table->VddciTable[count] = in tonga_populate_smc_vdd_ci_table()
360 table->SmioMask1 = data->vddci_voltage_table.mask_low; in tonga_populate_smc_vdd_ci_table()
361 CONVERT_FROM_HOST_TO_SMC_UL(table->VddciLevelCount); in tonga_populate_smc_vdd_ci_table()
367 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_mvdd_table() argument
373 table->MvddLevelCount = data->mvdd_voltage_table.count; in tonga_populate_smc_mvdd_table()
374 for (count = 0; count < table->MvddLevelCount; count++) { in tonga_populate_smc_mvdd_table()
375 table->SmioTable2.Pattern[count].Voltage = in tonga_populate_smc_mvdd_table()
378 table->SmioTable2.Pattern[count].Smio = in tonga_populate_smc_mvdd_table()
380 table->Smio[count] |= in tonga_populate_smc_mvdd_table()
383 table->SmioMask2 = data->mvdd_voltage_table.mask_low; in tonga_populate_smc_mvdd_table()
385 CONVERT_FROM_HOST_TO_SMC_UL(table->MvddLevelCount); in tonga_populate_smc_mvdd_table()
392 SMU72_Discrete_DpmTable *table) in tonga_populate_cac_tables() argument
404 /* table is already swapped, so in order to use the value from it in tonga_populate_cac_tables()
407 uint32_t vddc_level_count = PP_SMC_TO_HOST_UL(table->VddcLevelCount); in tonga_populate_cac_tables()
408 uint32_t vddgfx_level_count = PP_SMC_TO_HOST_UL(table->VddGfxLevelCount); in tonga_populate_cac_tables()
411 /* We are populating vddc CAC data to BapmVddc table in split and merged mode */ in tonga_populate_cac_tables()
414 table->BapmVddcVidLoSidd[count] = in tonga_populate_cac_tables()
416 table->BapmVddcVidHiSidd[count] = in tonga_populate_cac_tables()
418 table->BapmVddcVidHiSidd2[count] = in tonga_populate_cac_tables()
423 /* We are populating vddgfx CAC data to BapmVddgfx table in split mode */ in tonga_populate_cac_tables()
427 table->BapmVddGfxVidHiSidd2[count] = in tonga_populate_cac_tables()
434 table->BapmVddGfxVidLoSidd[count] = in tonga_populate_cac_tables()
436 table->BapmVddGfxVidHiSidd[count] = in tonga_populate_cac_tables()
438 table->BapmVddGfxVidHiSidd2[count] = in tonga_populate_cac_tables()
447 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_voltage_tables() argument
451 result = tonga_populate_smc_vddc_table(hwmgr, table); in tonga_populate_smc_voltage_tables()
453 "can not populate VDDC voltage table to SMC", in tonga_populate_smc_voltage_tables()
456 result = tonga_populate_smc_vdd_ci_table(hwmgr, table); in tonga_populate_smc_voltage_tables()
458 "can not populate VDDCI voltage table to SMC", in tonga_populate_smc_voltage_tables()
461 result = tonga_populate_smc_vdd_gfx_table(hwmgr, table); in tonga_populate_smc_voltage_tables()
463 "can not populate VDDGFX voltage table to SMC", in tonga_populate_smc_voltage_tables()
466 result = tonga_populate_smc_mvdd_table(hwmgr, table); in tonga_populate_smc_voltage_tables()
468 "can not populate MVDD voltage table to SMC", in tonga_populate_smc_voltage_tables()
471 result = tonga_populate_cac_tables(hwmgr, table); in tonga_populate_smc_voltage_tables()
502 struct SMU72_Discrete_DpmTable *table) in tonga_populate_ulv_state() argument
504 return tonga_populate_ulv_level(hwmgr, &table->Ulv); in tonga_populate_ulv_state()
507 static int tonga_populate_smc_link_level(struct pp_hwmgr *hwmgr, SMU72_Discrete_DpmTable *table) in tonga_populate_smc_link_level() argument
516 table->LinkLevel[i].PcieGenSpeed = in tonga_populate_smc_link_level()
518 table->LinkLevel[i].PcieLaneCount = in tonga_populate_smc_link_level()
520 table->LinkLevel[i].EnabledForActivity = in tonga_populate_smc_link_level()
522 table->LinkLevel[i].SPC = in tonga_populate_smc_link_level()
524 table->LinkLevel[i].DownThreshold = in tonga_populate_smc_link_level()
526 table->LinkLevel[i].UpThreshold = in tonga_populate_smc_link_level()
640 "engine clock dependency table", return result); in tonga_populate_single_graphic_level()
779 /* level count will send to smc once at init smc table and never change*/ in tonga_populate_all_graphic_levels()
990 "voltage dependency table", in tonga_populate_single_memory_level()
1094 /* populate MCLK dpm table to SMU7 */ in tonga_populate_all_memory_levels()
1135 /* level count will send to smc once at init smc table and never change*/ in tonga_populate_all_memory_levels()
1174 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_acpi_level() argument
1189 table->ACPILevel.Flags &= ~PPSMC_SWSTATE_FLAG_DC; in tonga_populate_smc_acpi_level()
1191 table->ACPILevel.MinVoltage = in tonga_populate_smc_acpi_level()
1195 table->ACPILevel.SclkFrequency = atomctrl_get_reference_clock(hwmgr); in tonga_populate_smc_acpi_level()
1199 table->ACPILevel.SclkFrequency, &dividers); in tonga_populate_smc_acpi_level()
1206 table->ACPILevel.SclkDid = (uint8_t)dividers.pll_post_divider; in tonga_populate_smc_acpi_level()
1207 table->ACPILevel.DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW; in tonga_populate_smc_acpi_level()
1208 table->ACPILevel.DeepSleepDivId = 0; in tonga_populate_smc_acpi_level()
1217 table->ACPILevel.CgSpllFuncCntl = spll_func_cntl; in tonga_populate_smc_acpi_level()
1218 table->ACPILevel.CgSpllFuncCntl2 = spll_func_cntl_2; in tonga_populate_smc_acpi_level()
1219 table->ACPILevel.CgSpllFuncCntl3 = data->clock_registers.vCG_SPLL_FUNC_CNTL_3; in tonga_populate_smc_acpi_level()
1220 table->ACPILevel.CgSpllFuncCntl4 = data->clock_registers.vCG_SPLL_FUNC_CNTL_4; in tonga_populate_smc_acpi_level()
1221 table->ACPILevel.SpllSpreadSpectrum = data->clock_registers.vCG_SPLL_SPREAD_SPECTRUM; in tonga_populate_smc_acpi_level()
1222 table->ACPILevel.SpllSpreadSpectrum2 = data->clock_registers.vCG_SPLL_SPREAD_SPECTRUM_2; in tonga_populate_smc_acpi_level()
1223 table->ACPILevel.CcPwrDynRm = 0; in tonga_populate_smc_acpi_level()
1224 table->ACPILevel.CcPwrDynRm1 = 0; in tonga_populate_smc_acpi_level()
1228 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.Flags); in tonga_populate_smc_acpi_level()
1230 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.SclkFrequency); in tonga_populate_smc_acpi_level()
1231 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl); in tonga_populate_smc_acpi_level()
1232 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl2); in tonga_populate_smc_acpi_level()
1233 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl3); in tonga_populate_smc_acpi_level()
1234 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl4); in tonga_populate_smc_acpi_level()
1235 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.SpllSpreadSpectrum); in tonga_populate_smc_acpi_level()
1236 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.SpllSpreadSpectrum2); in tonga_populate_smc_acpi_level()
1237 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CcPwrDynRm); in tonga_populate_smc_acpi_level()
1238 CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CcPwrDynRm1); in tonga_populate_smc_acpi_level()
1240 /* table->MemoryACPILevel.MinVddcPhases = table->ACPILevel.MinVddcPhases;*/ in tonga_populate_smc_acpi_level()
1241 table->MemoryACPILevel.MinVoltage = in tonga_populate_smc_acpi_level()
1244 /* CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MinVoltage);*/ in tonga_populate_smc_acpi_level()
1247 table->MemoryACPILevel.MinMvdd = in tonga_populate_smc_acpi_level()
1250 table->MemoryACPILevel.MinMvdd = 0; in tonga_populate_smc_acpi_level()
1270 table->MemoryACPILevel.DllCntl = in tonga_populate_smc_acpi_level()
1272 table->MemoryACPILevel.MclkPwrmgtCntl = in tonga_populate_smc_acpi_level()
1274 table->MemoryACPILevel.MpllAdFuncCntl = in tonga_populate_smc_acpi_level()
1276 table->MemoryACPILevel.MpllDqFuncCntl = in tonga_populate_smc_acpi_level()
1278 table->MemoryACPILevel.MpllFuncCntl = in tonga_populate_smc_acpi_level()
1280 table->MemoryACPILevel.MpllFuncCntl_1 = in tonga_populate_smc_acpi_level()
1282 table->MemoryACPILevel.MpllFuncCntl_2 = in tonga_populate_smc_acpi_level()
1284 table->MemoryACPILevel.MpllSs1 = in tonga_populate_smc_acpi_level()
1286 table->MemoryACPILevel.MpllSs2 = in tonga_populate_smc_acpi_level()
1289 table->MemoryACPILevel.EnabledForThrottle = 0; in tonga_populate_smc_acpi_level()
1290 table->MemoryACPILevel.EnabledForActivity = 0; in tonga_populate_smc_acpi_level()
1291 table->MemoryACPILevel.UpHyst = 0; in tonga_populate_smc_acpi_level()
1292 table->MemoryACPILevel.DownHyst = 100; in tonga_populate_smc_acpi_level()
1293 table->MemoryACPILevel.VoltageDownHyst = 0; in tonga_populate_smc_acpi_level()
1295 table->MemoryACPILevel.ActivityLevel = in tonga_populate_smc_acpi_level()
1298 table->MemoryACPILevel.StutterEnable = 0; in tonga_populate_smc_acpi_level()
1299 table->MemoryACPILevel.StrobeEnable = 0; in tonga_populate_smc_acpi_level()
1300 table->MemoryACPILevel.EdcReadEnable = 0; in tonga_populate_smc_acpi_level()
1301 table->MemoryACPILevel.EdcWriteEnable = 0; in tonga_populate_smc_acpi_level()
1302 table->MemoryACPILevel.RttEnable = 0; in tonga_populate_smc_acpi_level()
1308 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_uvd_level() argument
1320 table->UvdLevelCount = (uint8_t) (mm_table->count); in tonga_populate_smc_uvd_level()
1321 table->UvdBootLevel = 0; in tonga_populate_smc_uvd_level()
1323 for (count = 0; count < table->UvdLevelCount; count++) { in tonga_populate_smc_uvd_level()
1324 table->UvdLevel[count].VclkFrequency = mm_table->entries[count].vclk; in tonga_populate_smc_uvd_level()
1325 table->UvdLevel[count].DclkFrequency = mm_table->entries[count].dclk; in tonga_populate_smc_uvd_level()
1326 table->UvdLevel[count].MinVoltage.Vddc = in tonga_populate_smc_uvd_level()
1329 table->UvdLevel[count].MinVoltage.VddGfx = in tonga_populate_smc_uvd_level()
1333 table->UvdLevel[count].MinVoltage.Vddci = in tonga_populate_smc_uvd_level()
1336 table->UvdLevel[count].MinVoltage.Phases = 1; in tonga_populate_smc_uvd_level()
1341 table->UvdLevel[count].VclkFrequency, in tonga_populate_smc_uvd_level()
1348 table->UvdLevel[count].VclkDivider = (uint8_t)dividers.pll_post_divider; in tonga_populate_smc_uvd_level()
1351 table->UvdLevel[count].DclkFrequency, &dividers); in tonga_populate_smc_uvd_level()
1356 table->UvdLevel[count].DclkDivider = in tonga_populate_smc_uvd_level()
1359 CONVERT_FROM_HOST_TO_SMC_UL(table->UvdLevel[count].VclkFrequency); in tonga_populate_smc_uvd_level()
1360 CONVERT_FROM_HOST_TO_SMC_UL(table->UvdLevel[count].DclkFrequency); in tonga_populate_smc_uvd_level()
1368 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_vce_level() argument
1380 table->VceLevelCount = (uint8_t) (mm_table->count); in tonga_populate_smc_vce_level()
1381 table->VceBootLevel = 0; in tonga_populate_smc_vce_level()
1383 for (count = 0; count < table->VceLevelCount; count++) { in tonga_populate_smc_vce_level()
1384 table->VceLevel[count].Frequency = in tonga_populate_smc_vce_level()
1386 table->VceLevel[count].MinVoltage.Vddc = in tonga_populate_smc_vce_level()
1389 table->VceLevel[count].MinVoltage.VddGfx = in tonga_populate_smc_vce_level()
1393 table->VceLevel[count].MinVoltage.Vddci = in tonga_populate_smc_vce_level()
1396 table->VceLevel[count].MinVoltage.Phases = 1; in tonga_populate_smc_vce_level()
1400 table->VceLevel[count].Frequency, &dividers); in tonga_populate_smc_vce_level()
1405 table->VceLevel[count].Divider = (uint8_t)dividers.pll_post_divider; in tonga_populate_smc_vce_level()
1407 CONVERT_FROM_HOST_TO_SMC_UL(table->VceLevel[count].Frequency); in tonga_populate_smc_vce_level()
1414 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_acp_level() argument
1425 table->AcpLevelCount = (uint8_t) (mm_table->count); in tonga_populate_smc_acp_level()
1426 table->AcpBootLevel = 0; in tonga_populate_smc_acp_level()
1428 for (count = 0; count < table->AcpLevelCount; count++) { in tonga_populate_smc_acp_level()
1429 table->AcpLevel[count].Frequency = in tonga_populate_smc_acp_level()
1431 table->AcpLevel[count].MinVoltage.Vddc = in tonga_populate_smc_acp_level()
1434 table->AcpLevel[count].MinVoltage.VddGfx = in tonga_populate_smc_acp_level()
1438 table->AcpLevel[count].MinVoltage.Vddci = in tonga_populate_smc_acp_level()
1441 table->AcpLevel[count].MinVoltage.Phases = 1; in tonga_populate_smc_acp_level()
1445 table->AcpLevel[count].Frequency, &dividers); in tonga_populate_smc_acp_level()
1449 table->AcpLevel[count].Divider = (uint8_t)dividers.pll_post_divider; in tonga_populate_smc_acp_level()
1451 CONVERT_FROM_HOST_TO_SMC_UL(table->AcpLevel[count].Frequency); in tonga_populate_smc_acp_level()
1523 SMU72_Discrete_DpmTable *table) in tonga_populate_smc_boot_level() argument
1529 table->GraphicsBootLevel = 0; in tonga_populate_smc_boot_level()
1530 table->MemoryBootLevel = 0; in tonga_populate_smc_boot_level()
1532 /* find boot level from dpm table*/ in tonga_populate_smc_boot_level()
1540 "clock value in dependency table. " in tonga_populate_smc_boot_level()
1552 "engine clock value in dependency table." in tonga_populate_smc_boot_level()
1557 table->BootVoltage.Vddc = in tonga_populate_smc_boot_level()
1560 table->BootVoltage.VddGfx = in tonga_populate_smc_boot_level()
1563 table->BootVoltage.Vddci = in tonga_populate_smc_boot_level()
1566 table->BootMVdd = data->vbios_boot_state.mvdd_bootup_value; in tonga_populate_smc_boot_level()
1568 CONVERT_FROM_HOST_TO_SMC_US(table->BootMVdd); in tonga_populate_smc_boot_level()
1653 /* Populate CKS Lookup Table */ in tonga_populate_clock_stretcher_data_table()
1701 /* Populate DDT Lookup Table */ in tonga_populate_clock_stretcher_data_table()
1704 * in the last row of Clock Stretcher Voltage Table. in tonga_populate_clock_stretcher_data_table()
1722 * as opposed to Data table, which is in Mhz unit. in tonga_populate_clock_stretcher_data_table()
1747 SMU72_Discrete_DpmTable *table) in tonga_populate_vr_config() argument
1755 table->VRConfig |= (config<<VRCONF_VDDGFX_SHIFT); in tonga_populate_vr_config()
1759 table->VRConfig |= config; in tonga_populate_vr_config()
1767 table->VRConfig |= (config<<VRCONF_VDDGFX_SHIFT); in tonga_populate_vr_config()
1772 table->VRConfig |= config; in tonga_populate_vr_config()
1782 table->VRConfig |= (config<<VRCONF_VDDCI_SHIFT); in tonga_populate_vr_config()
1785 table->VRConfig |= (config<<VRCONF_VDDCI_SHIFT); in tonga_populate_vr_config()
1791 table->VRConfig |= (config<<VRCONF_MVDD_SHIFT); in tonga_populate_vr_config()
1804 * This is a read-modify-write on the first byte of the ARB table. in tonga_init_arb_table_index()
1807 * This solution is ugly, but we never write the whole table only in tonga_init_arb_table_index()
2226 SMU72_Discrete_DpmTable *table = &(smu_data->smc_state_table); in tonga_init_smc_table() local
2239 tonga_populate_smc_voltage_tables(hwmgr, table); in tonga_init_smc_table()
2243 table->SystemFlags |= PPSMC_SYSTEMFLAG_GPIO_DC; in tonga_init_smc_table()
2248 table->SystemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC; in tonga_init_smc_table()
2251 table->SystemFlags |= PPSMC_SYSTEMFLAG_GDDR5; in tonga_init_smc_table()
2256 table->SystemFlags |= 0x40; in tonga_init_smc_table()
2259 result = tonga_populate_ulv_state(hwmgr, table); in tonga_init_smc_table()
2268 result = tonga_populate_smc_link_level(hwmgr, table); in tonga_init_smc_table()
2280 result = tonga_populate_smc_acpi_level(hwmgr, table); in tonga_init_smc_table()
2284 result = tonga_populate_smc_vce_level(hwmgr, table); in tonga_init_smc_table()
2288 result = tonga_populate_smc_acp_level(hwmgr, table); in tonga_init_smc_table()
2301 result = tonga_populate_smc_uvd_level(hwmgr, table); in tonga_init_smc_table()
2305 result = tonga_populate_smc_boot_level(hwmgr, table); in tonga_init_smc_table()
2317 "Failed to populate Clock Stretcher Data Table !", in tonga_init_smc_table()
2320 table->GraphicsVoltageChangeEnable = 1; in tonga_init_smc_table()
2321 table->GraphicsThermThrottleEnable = 1; in tonga_init_smc_table()
2322 table->GraphicsInterval = 1; in tonga_init_smc_table()
2323 table->VoltageInterval = 1; in tonga_init_smc_table()
2324 table->ThermalInterval = 1; in tonga_init_smc_table()
2325 table->TemperatureLimitHigh = in tonga_init_smc_table()
2328 table->TemperatureLimitLow = in tonga_init_smc_table()
2331 table->MemoryVoltageChangeEnable = 1; in tonga_init_smc_table()
2332 table->MemoryInterval = 1; in tonga_init_smc_table()
2333 table->VoltageResponseTime = 0; in tonga_init_smc_table()
2334 table->PhaseResponseTime = 0; in tonga_init_smc_table()
2335 table->MemoryThermThrottleEnable = 1; in tonga_init_smc_table()
2350 table->PCIeBootLinkLevel = (uint8_t) (data->dpm_table.pcie_speed_table.count); in tonga_init_smc_table()
2352 table->PCIeGenInterval = 1; in tonga_init_smc_table()
2354 result = tonga_populate_vr_config(hwmgr, table); in tonga_init_smc_table()
2357 data->vr_config = table->VRConfig; in tonga_init_smc_table()
2358 table->ThermGpio = 17; in tonga_init_smc_table()
2359 table->SclkStepSize = 0x4000; in tonga_init_smc_table()
2363 table->VRHotGpio = gpio_pin_assignment.uc_gpio_pin_bit_shift; in tonga_init_smc_table()
2367 table->VRHotGpio = SMU7_UNUSED_GPIO_PIN; in tonga_init_smc_table()
2374 table->AcDcGpio = gpio_pin_assignment.uc_gpio_pin_bit_shift; in tonga_init_smc_table()
2378 table->AcDcGpio = SMU7_UNUSED_GPIO_PIN; in tonga_init_smc_table()
2398 table->ThermOutGpio = gpio_pin_assignment.uc_gpio_pin_bit_shift; in tonga_init_smc_table()
2400 table->ThermOutPolarity = in tonga_init_smc_table()
2404 table->ThermOutMode = SMU7_THERM_OUT_MODE_THERM_ONLY; in tonga_init_smc_table()
2411 table->ThermOutMode = SMU7_THERM_OUT_MODE_THERM_VRHOT; in tonga_init_smc_table()
2417 table->ThermOutGpio = 17; in tonga_init_smc_table()
2418 table->ThermOutPolarity = 1; in tonga_init_smc_table()
2419 table->ThermOutMode = SMU7_THERM_OUT_MODE_DISABLE; in tonga_init_smc_table()
2423 table->Smio[i] = PP_HOST_TO_SMC_UL(table->Smio[i]); in tonga_init_smc_table()
2424 CONVERT_FROM_HOST_TO_SMC_UL(table->SystemFlags); in tonga_init_smc_table()
2425 CONVERT_FROM_HOST_TO_SMC_UL(table->VRConfig); in tonga_init_smc_table()
2426 CONVERT_FROM_HOST_TO_SMC_UL(table->SmioMask1); in tonga_init_smc_table()
2427 CONVERT_FROM_HOST_TO_SMC_UL(table->SmioMask2); in tonga_init_smc_table()
2428 CONVERT_FROM_HOST_TO_SMC_UL(table->SclkStepSize); in tonga_init_smc_table()
2429 CONVERT_FROM_HOST_TO_SMC_US(table->TemperatureLimitHigh); in tonga_init_smc_table()
2430 CONVERT_FROM_HOST_TO_SMC_US(table->TemperatureLimitLow); in tonga_init_smc_table()
2431 CONVERT_FROM_HOST_TO_SMC_US(table->VoltageResponseTime); in tonga_init_smc_table()
2432 CONVERT_FROM_HOST_TO_SMC_US(table->PhaseResponseTime); in tonga_init_smc_table()
2438 (uint8_t *)&(table->SystemFlags), in tonga_init_smc_table()
2455 "Failed to populate initialize MC Reg table !", return result); in tonga_init_smc_table()
2593 "Failed to upload MC reg table !", in tonga_update_sclk_threshold()
2928 static int tonga_set_s0_mc_reg_index(struct tonga_mc_reg_table *table) in tonga_set_s0_mc_reg_index() argument
2933 for (i = 0; i < table->last; i++) { in tonga_set_s0_mc_reg_index()
2934 table->mc_reg_address[i].s0 = in tonga_set_s0_mc_reg_index()
2935 tonga_check_s0_mc_reg_index(table->mc_reg_address[i].s1, in tonga_set_s0_mc_reg_index()
2938 table->mc_reg_address[i].s1; in tonga_set_s0_mc_reg_index()
2943 static int tonga_copy_vbios_smc_reg_table(const pp_atomctrl_mc_reg_table *table, in tonga_copy_vbios_smc_reg_table() argument
2948 PP_ASSERT_WITH_CODE((table->last <= SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE), in tonga_copy_vbios_smc_reg_table()
2949 "Invalid VramInfo table.", return -EINVAL); in tonga_copy_vbios_smc_reg_table()
2950 PP_ASSERT_WITH_CODE((table->num_entries <= MAX_AC_TIMING_ENTRIES), in tonga_copy_vbios_smc_reg_table()
2951 "Invalid VramInfo table.", return -EINVAL); in tonga_copy_vbios_smc_reg_table()
2953 for (i = 0; i < table->last; i++) in tonga_copy_vbios_smc_reg_table()
2954 ni_table->mc_reg_address[i].s1 = table->mc_reg_address[i].s1; in tonga_copy_vbios_smc_reg_table()
2956 ni_table->last = table->last; in tonga_copy_vbios_smc_reg_table()
2958 for (i = 0; i < table->num_entries; i++) { in tonga_copy_vbios_smc_reg_table()
2960 table->mc_reg_table_entry[i].mclk_max; in tonga_copy_vbios_smc_reg_table()
2961 for (j = 0; j < table->last; j++) { in tonga_copy_vbios_smc_reg_table()
2963 table->mc_reg_table_entry[i].mc_data[j]; in tonga_copy_vbios_smc_reg_table()
2967 ni_table->num_entries = table->num_entries; in tonga_copy_vbios_smc_reg_table()
2973 struct tonga_mc_reg_table *table) in tonga_set_mc_special_registers() argument
2979 for (i = 0, j = table->last; i < table->last; i++) { in tonga_set_mc_special_registers()
2981 "Invalid VramInfo table.", return -EINVAL); in tonga_set_mc_special_registers()
2983 switch (table->mc_reg_address[i].s1) { in tonga_set_mc_special_registers()
2988 table->mc_reg_address[j].s1 = mmMC_PMG_CMD_EMRS; in tonga_set_mc_special_registers()
2989 table->mc_reg_address[j].s0 = mmMC_SEQ_PMG_CMD_EMRS_LP; in tonga_set_mc_special_registers()
2990 for (k = 0; k < table->num_entries; k++) { in tonga_set_mc_special_registers()
2991 table->mc_reg_table_entry[k].mc_data[j] = in tonga_set_mc_special_registers()
2993 ((table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16); in tonga_set_mc_special_registers()
2998 "Invalid VramInfo table.", return -EINVAL); in tonga_set_mc_special_registers()
3000 table->mc_reg_address[j].s1 = mmMC_PMG_CMD_MRS; in tonga_set_mc_special_registers()
3001 table->mc_reg_address[j].s0 = mmMC_SEQ_PMG_CMD_MRS_LP; in tonga_set_mc_special_registers()
3002 for (k = 0; k < table->num_entries; k++) { in tonga_set_mc_special_registers()
3003 table->mc_reg_table_entry[k].mc_data[j] = in tonga_set_mc_special_registers()
3005 (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); in tonga_set_mc_special_registers()
3008 table->mc_reg_table_entry[k].mc_data[j] |= 0x100; in tonga_set_mc_special_registers()
3014 "Invalid VramInfo table.", return -EINVAL); in tonga_set_mc_special_registers()
3015 table->mc_reg_address[j].s1 = mmMC_PMG_AUTO_CMD; in tonga_set_mc_special_registers()
3016 table->mc_reg_address[j].s0 = mmMC_PMG_AUTO_CMD; in tonga_set_mc_special_registers()
3017 for (k = 0; k < table->num_entries; k++) in tonga_set_mc_special_registers()
3018 table->mc_reg_table_entry[k].mc_data[j] = in tonga_set_mc_special_registers()
3019 (table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16; in tonga_set_mc_special_registers()
3027 table->mc_reg_address[j].s1 = mmMC_PMG_CMD_MRS1; in tonga_set_mc_special_registers()
3028 table->mc_reg_address[j].s0 = mmMC_SEQ_PMG_CMD_MRS1_LP; in tonga_set_mc_special_registers()
3029 for (k = 0; k < table->num_entries; k++) { in tonga_set_mc_special_registers()
3030 table->mc_reg_table_entry[k].mc_data[j] = in tonga_set_mc_special_registers()
3032 (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); in tonga_set_mc_special_registers()
3043 table->last = j; in tonga_set_mc_special_registers()
3048 static int tonga_set_valid_flag(struct tonga_mc_reg_table *table) in tonga_set_valid_flag() argument
3052 for (i = 0; i < table->last; i++) { in tonga_set_valid_flag()
3053 for (j = 1; j < table->num_entries; j++) { in tonga_set_valid_flag()
3054 if (table->mc_reg_table_entry[j-1].mc_data[i] != in tonga_set_valid_flag()
3055 table->mc_reg_table_entry[j].mc_data[i]) { in tonga_set_valid_flag()
3056 table->validflag |= (1<<i); in tonga_set_valid_flag()
3069 pp_atomctrl_mc_reg_table *table; in tonga_initialize_mc_reg_table() local
3073 table = kzalloc(sizeof(pp_atomctrl_mc_reg_table), GFP_KERNEL); in tonga_initialize_mc_reg_table()
3075 if (table == NULL) in tonga_initialize_mc_reg_table()
3120 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); in tonga_initialize_mc_reg_table()
3123 result = tonga_copy_vbios_smc_reg_table(table, ni_table); in tonga_initialize_mc_reg_table()
3133 kfree(table); in tonga_initialize_mc_reg_table()