Lines Matching refs:ni_pi

1101 	struct ni_power_info *ni_pi = ni_get_pi(rdev);  in ni_process_firmware_header()  local
1143 ni_pi->fan_table_start = (u16)tmp; in ni_process_firmware_header()
1153 ni_pi->arb_table_start = (u16)tmp; in ni_process_firmware_header()
1163 ni_pi->cac_table_start = (u16)tmp; in ni_process_firmware_header()
1173 ni_pi->spll_table_start = (u16)tmp; in ni_process_firmware_header()
1181 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_read_clock_registers() local
1183 ni_pi->clock_registers.cg_spll_func_cntl = RREG32(CG_SPLL_FUNC_CNTL); in ni_read_clock_registers()
1184 ni_pi->clock_registers.cg_spll_func_cntl_2 = RREG32(CG_SPLL_FUNC_CNTL_2); in ni_read_clock_registers()
1185 ni_pi->clock_registers.cg_spll_func_cntl_3 = RREG32(CG_SPLL_FUNC_CNTL_3); in ni_read_clock_registers()
1186 ni_pi->clock_registers.cg_spll_func_cntl_4 = RREG32(CG_SPLL_FUNC_CNTL_4); in ni_read_clock_registers()
1187 ni_pi->clock_registers.cg_spll_spread_spectrum = RREG32(CG_SPLL_SPREAD_SPECTRUM); in ni_read_clock_registers()
1188 ni_pi->clock_registers.cg_spll_spread_spectrum_2 = RREG32(CG_SPLL_SPREAD_SPECTRUM_2); in ni_read_clock_registers()
1189 ni_pi->clock_registers.mpll_ad_func_cntl = RREG32(MPLL_AD_FUNC_CNTL); in ni_read_clock_registers()
1190 ni_pi->clock_registers.mpll_ad_func_cntl_2 = RREG32(MPLL_AD_FUNC_CNTL_2); in ni_read_clock_registers()
1191 ni_pi->clock_registers.mpll_dq_func_cntl = RREG32(MPLL_DQ_FUNC_CNTL); in ni_read_clock_registers()
1192 ni_pi->clock_registers.mpll_dq_func_cntl_2 = RREG32(MPLL_DQ_FUNC_CNTL_2); in ni_read_clock_registers()
1193 ni_pi->clock_registers.mclk_pwrmgt_cntl = RREG32(MCLK_PWRMGT_CNTL); in ni_read_clock_registers()
1194 ni_pi->clock_registers.dll_cntl = RREG32(DLL_CNTL); in ni_read_clock_registers()
1195 ni_pi->clock_registers.mpll_ss1 = RREG32(MPLL_SS1); in ni_read_clock_registers()
1196 ni_pi->clock_registers.mpll_ss2 = RREG32(MPLL_SS2); in ni_read_clock_registers()
1386 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_calculate_power_boost_limit() local
1390 if (ni_pi->enable_power_containment && in ni_calculate_power_boost_limit()
1391 ni_pi->use_power_boost_limit) { in ni_calculate_power_boost_limit()
1456 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_smc_tdp_limits() local
1458 if (ni_pi->enable_power_containment) { in ni_populate_smc_tdp_limits()
1459 NISLANDS_SMC_STATETABLE *smc_table = &ni_pi->smc_statetable; in ni_populate_smc_tdp_limits()
1572 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_init_arb_table_index() local
1576 ret = rv770_read_smc_sram_dword(rdev, ni_pi->arb_table_start, in ni_init_arb_table_index()
1584 return rv770_write_smc_sram_dword(rdev, ni_pi->arb_table_start, in ni_init_arb_table_index()
1596 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_force_switch_to_arb_f0() local
1600 ret = rv770_read_smc_sram_dword(rdev, ni_pi->arb_table_start, in ni_force_switch_to_arb_f0()
1640 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_do_program_memory_timing_parameters() local
1651 (u16)(ni_pi->arb_table_start + in ni_do_program_memory_timing_parameters()
1686 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_smc_initial_state() local
1691 cpu_to_be32(ni_pi->clock_registers.mpll_ad_func_cntl); in ni_populate_smc_initial_state()
1693 cpu_to_be32(ni_pi->clock_registers.mpll_ad_func_cntl_2); in ni_populate_smc_initial_state()
1695 cpu_to_be32(ni_pi->clock_registers.mpll_dq_func_cntl); in ni_populate_smc_initial_state()
1697 cpu_to_be32(ni_pi->clock_registers.mpll_dq_func_cntl_2); in ni_populate_smc_initial_state()
1699 cpu_to_be32(ni_pi->clock_registers.mclk_pwrmgt_cntl); in ni_populate_smc_initial_state()
1701 cpu_to_be32(ni_pi->clock_registers.dll_cntl); in ni_populate_smc_initial_state()
1703 cpu_to_be32(ni_pi->clock_registers.mpll_ss1); in ni_populate_smc_initial_state()
1705 cpu_to_be32(ni_pi->clock_registers.mpll_ss2); in ni_populate_smc_initial_state()
1710 cpu_to_be32(ni_pi->clock_registers.cg_spll_func_cntl); in ni_populate_smc_initial_state()
1712 cpu_to_be32(ni_pi->clock_registers.cg_spll_func_cntl_2); in ni_populate_smc_initial_state()
1714 cpu_to_be32(ni_pi->clock_registers.cg_spll_func_cntl_3); in ni_populate_smc_initial_state()
1716 cpu_to_be32(ni_pi->clock_registers.cg_spll_func_cntl_4); in ni_populate_smc_initial_state()
1718 cpu_to_be32(ni_pi->clock_registers.cg_spll_spread_spectrum); in ni_populate_smc_initial_state()
1720 cpu_to_be32(ni_pi->clock_registers.cg_spll_spread_spectrum_2); in ni_populate_smc_initial_state()
1795 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_smc_acpi_state() local
1796 u32 mpll_ad_func_cntl = ni_pi->clock_registers.mpll_ad_func_cntl; in ni_populate_smc_acpi_state()
1797 u32 mpll_ad_func_cntl_2 = ni_pi->clock_registers.mpll_ad_func_cntl_2; in ni_populate_smc_acpi_state()
1798 u32 mpll_dq_func_cntl = ni_pi->clock_registers.mpll_dq_func_cntl; in ni_populate_smc_acpi_state()
1799 u32 mpll_dq_func_cntl_2 = ni_pi->clock_registers.mpll_dq_func_cntl_2; in ni_populate_smc_acpi_state()
1800 u32 spll_func_cntl = ni_pi->clock_registers.cg_spll_func_cntl; in ni_populate_smc_acpi_state()
1801 u32 spll_func_cntl_2 = ni_pi->clock_registers.cg_spll_func_cntl_2; in ni_populate_smc_acpi_state()
1802 u32 spll_func_cntl_3 = ni_pi->clock_registers.cg_spll_func_cntl_3; in ni_populate_smc_acpi_state()
1803 u32 spll_func_cntl_4 = ni_pi->clock_registers.cg_spll_func_cntl_4; in ni_populate_smc_acpi_state()
1804 u32 mclk_pwrmgt_cntl = ni_pi->clock_registers.mclk_pwrmgt_cntl; in ni_populate_smc_acpi_state()
1805 u32 dll_cntl = ni_pi->clock_registers.dll_cntl; in ni_populate_smc_acpi_state()
1941 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_init_smc_table() local
1944 NISLANDS_SMC_STATETABLE *table = &ni_pi->smc_statetable; in ni_init_smc_table()
2003 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_calculate_sclk_params() local
2005 u32 spll_func_cntl = ni_pi->clock_registers.cg_spll_func_cntl; in ni_calculate_sclk_params()
2006 u32 spll_func_cntl_2 = ni_pi->clock_registers.cg_spll_func_cntl_2; in ni_calculate_sclk_params()
2007 u32 spll_func_cntl_3 = ni_pi->clock_registers.cg_spll_func_cntl_3; in ni_calculate_sclk_params()
2008 u32 spll_func_cntl_4 = ni_pi->clock_registers.cg_spll_func_cntl_4; in ni_calculate_sclk_params()
2009 u32 cg_spll_spread_spectrum = ni_pi->clock_registers.cg_spll_spread_spectrum; in ni_calculate_sclk_params()
2010 u32 cg_spll_spread_spectrum_2 = ni_pi->clock_registers.cg_spll_spread_spectrum_2; in ni_calculate_sclk_params()
2093 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_init_smc_spll_table() local
2104 if (ni_pi->spll_table_start == 0) in ni_init_smc_spll_table()
2152 ret = rv770_copy_bytes_to_smc(rdev, ni_pi->spll_table_start, (u8 *)spll_table, in ni_init_smc_spll_table()
2168 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_mclk_value() local
2169 u32 mpll_ad_func_cntl = ni_pi->clock_registers.mpll_ad_func_cntl; in ni_populate_mclk_value()
2170 u32 mpll_ad_func_cntl_2 = ni_pi->clock_registers.mpll_ad_func_cntl_2; in ni_populate_mclk_value()
2171 u32 mpll_dq_func_cntl = ni_pi->clock_registers.mpll_dq_func_cntl; in ni_populate_mclk_value()
2172 u32 mpll_dq_func_cntl_2 = ni_pi->clock_registers.mpll_dq_func_cntl_2; in ni_populate_mclk_value()
2173 u32 mclk_pwrmgt_cntl = ni_pi->clock_registers.mclk_pwrmgt_cntl; in ni_populate_mclk_value()
2174 u32 dll_cntl = ni_pi->clock_registers.dll_cntl; in ni_populate_mclk_value()
2175 u32 mpll_ss1 = ni_pi->clock_registers.mpll_ss1; in ni_populate_mclk_value()
2176 u32 mpll_ss2 = ni_pi->clock_registers.mpll_ss2; in ni_populate_mclk_value()
2315 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_convert_power_level_to_smc() local
2352 if (pl->mclk > ni_pi->mclk_rtt_mode_threshold) in ni_convert_power_level_to_smc()
2456 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_power_containment_values() local
2467 if (ni_pi->enable_power_containment == false) in ni_populate_power_containment_values()
2540 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_sq_ramping_values() local
2544 bool enable_sq_ramping = ni_pi->enable_sq_ramping; in ni_populate_sq_ramping_values()
2598 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_enable_power_containment() local
2602 if (ni_pi->enable_power_containment) { in ni_enable_power_containment()
2608 ni_pi->pc_enabled = false; in ni_enable_power_containment()
2610 ni_pi->pc_enabled = true; in ni_enable_power_containment()
2617 ni_pi->pc_enabled = false; in ni_enable_power_containment()
2629 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_convert_power_state_to_smc() local
2651 if (ni_pi->enable_power_containment) in ni_convert_power_state_to_smc()
2674 ni_pi->enable_power_containment = false; in ni_convert_power_state_to_smc()
2678 ni_pi->enable_sq_ramping = false; in ni_convert_power_state_to_smc()
2872 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_initialize_mc_reg_table() local
2875 struct ni_mc_reg_table *ni_table = &ni_pi->mc_reg_table; in ni_initialize_mc_reg_table()
2924 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_mc_reg_addresses() local
2927 for (i = 0, j = 0; j < ni_pi->mc_reg_table.last; j++) { in ni_populate_mc_reg_addresses()
2928 if (ni_pi->mc_reg_table.valid_flag & (1 << j)) { in ni_populate_mc_reg_addresses()
2932 cpu_to_be16(ni_pi->mc_reg_table.mc_reg_address[j].s0); in ni_populate_mc_reg_addresses()
2934 cpu_to_be16(ni_pi->mc_reg_table.mc_reg_address[j].s1); in ni_populate_mc_reg_addresses()
2960 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_convert_mc_reg_table_entry_to_smc() local
2963 for (i = 0; i < ni_pi->mc_reg_table.num_entries; i++) { in ni_convert_mc_reg_table_entry_to_smc()
2964 if (pl->mclk <= ni_pi->mc_reg_table.mc_reg_table_entry[i].mclk_max) in ni_convert_mc_reg_table_entry_to_smc()
2968 if ((i == ni_pi->mc_reg_table.num_entries) && (i > 0)) in ni_convert_mc_reg_table_entry_to_smc()
2971 ni_convert_mc_registers(&ni_pi->mc_reg_table.mc_reg_table_entry[i], in ni_convert_mc_reg_table_entry_to_smc()
2973 ni_pi->mc_reg_table.last, in ni_convert_mc_reg_table_entry_to_smc()
2974 ni_pi->mc_reg_table.valid_flag); in ni_convert_mc_reg_table_entry_to_smc()
2996 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_populate_mc_reg_table() local
2998 SMC_NIslands_MCRegisters *mc_reg_table = &ni_pi->smc_mc_reg_table; in ni_populate_mc_reg_table()
3009 ni_convert_mc_registers(&ni_pi->mc_reg_table.mc_reg_table_entry[0], in ni_populate_mc_reg_table()
3011 ni_pi->mc_reg_table.last, in ni_populate_mc_reg_table()
3012 ni_pi->mc_reg_table.valid_flag); in ni_populate_mc_reg_table()
3027 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_upload_mc_reg_table() local
3029 SMC_NIslands_MCRegisters *mc_reg_table = &ni_pi->smc_mc_reg_table; in ni_upload_mc_reg_table()
3048 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_init_driver_calculated_leakage_table() local
3067 if (t < ni_pi->cac_data.leakage_minimum_temperature) in ni_init_driver_calculated_leakage_table()
3068 t = ni_pi->cac_data.leakage_minimum_temperature; in ni_init_driver_calculated_leakage_table()
3071 &ni_pi->cac_data.leakage_coefficients, in ni_init_driver_calculated_leakage_table()
3074 ni_pi->cac_data.i_leakage, in ni_init_driver_calculated_leakage_table()
3141 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_initialize_smc_cac_tables() local
3146 if (ni_pi->enable_cac == false) in ni_initialize_smc_cac_tables()
3154 reg |= (TID_CNT(ni_pi->cac_weights->tid_cnt) | in ni_initialize_smc_cac_tables()
3155 TID_UNIT(ni_pi->cac_weights->tid_unit)); in ni_initialize_smc_cac_tables()
3159 ni_pi->dc_cac_table[i] = ni_pi->cac_weights->dc_cac[i]; in ni_initialize_smc_cac_tables()
3162 cac_tables->cac_bif_lut[i] = ni_pi->cac_weights->pcie_cac[i]; in ni_initialize_smc_cac_tables()
3164 ni_pi->cac_data.i_leakage = rdev->pm.dpm.cac_leakage; in ni_initialize_smc_cac_tables()
3165 ni_pi->cac_data.pwr_const = 0; in ni_initialize_smc_cac_tables()
3166 ni_pi->cac_data.dc_cac_value = ni_pi->dc_cac_table[NISLANDS_DCCAC_LEVEL_0]; in ni_initialize_smc_cac_tables()
3167 ni_pi->cac_data.bif_cac_value = 0; in ni_initialize_smc_cac_tables()
3168 ni_pi->cac_data.mc_wr_weight = ni_pi->cac_weights->mc_write_weight; in ni_initialize_smc_cac_tables()
3169 ni_pi->cac_data.mc_rd_weight = ni_pi->cac_weights->mc_read_weight; in ni_initialize_smc_cac_tables()
3170 ni_pi->cac_data.allow_ovrflw = 0; in ni_initialize_smc_cac_tables()
3171 ni_pi->cac_data.l2num_win_tdp = ni_pi->lta_window_size; in ni_initialize_smc_cac_tables()
3172 ni_pi->cac_data.num_win_tdp = 0; in ni_initialize_smc_cac_tables()
3173 ni_pi->cac_data.lts_truncate_n = ni_pi->lts_truncate; in ni_initialize_smc_cac_tables()
3175 if (ni_pi->driver_calculate_cac_leakage) in ni_initialize_smc_cac_tables()
3183 cac_tables->pwr_const = cpu_to_be32(ni_pi->cac_data.pwr_const); in ni_initialize_smc_cac_tables()
3184 cac_tables->dc_cacValue = cpu_to_be32(ni_pi->cac_data.dc_cac_value); in ni_initialize_smc_cac_tables()
3185 cac_tables->bif_cacValue = cpu_to_be32(ni_pi->cac_data.bif_cac_value); in ni_initialize_smc_cac_tables()
3186 cac_tables->AllowOvrflw = ni_pi->cac_data.allow_ovrflw; in ni_initialize_smc_cac_tables()
3187 cac_tables->MCWrWeight = ni_pi->cac_data.mc_wr_weight; in ni_initialize_smc_cac_tables()
3188 cac_tables->MCRdWeight = ni_pi->cac_data.mc_rd_weight; in ni_initialize_smc_cac_tables()
3189 cac_tables->numWin_TDP = ni_pi->cac_data.num_win_tdp; in ni_initialize_smc_cac_tables()
3190 cac_tables->l2numWin_TDP = ni_pi->cac_data.l2num_win_tdp; in ni_initialize_smc_cac_tables()
3191 cac_tables->lts_truncate_n = ni_pi->cac_data.lts_truncate_n; in ni_initialize_smc_cac_tables()
3193 ret = rv770_copy_bytes_to_smc(rdev, ni_pi->cac_table_start, (u8 *)cac_tables, in ni_initialize_smc_cac_tables()
3198 ni_pi->enable_cac = false; in ni_initialize_smc_cac_tables()
3199 ni_pi->enable_power_containment = false; in ni_initialize_smc_cac_tables()
3209 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_initialize_hardware_cac_manager() local
3212 if (!ni_pi->enable_cac || in ni_initialize_hardware_cac_manager()
3213 !ni_pi->cac_configuration_required) in ni_initialize_hardware_cac_manager()
3216 if (ni_pi->cac_weights == NULL) in ni_initialize_hardware_cac_manager()
3222 reg |= (WEIGHT_TCP_SIG0(ni_pi->cac_weights->weight_tcp_sig0) | in ni_initialize_hardware_cac_manager()
3223 WEIGHT_TCP_SIG1(ni_pi->cac_weights->weight_tcp_sig1) | in ni_initialize_hardware_cac_manager()
3224 WEIGHT_TA_SIG(ni_pi->cac_weights->weight_ta_sig)); in ni_initialize_hardware_cac_manager()
3230 reg |= (WEIGHT_TCC_EN0(ni_pi->cac_weights->weight_tcc_en0) | in ni_initialize_hardware_cac_manager()
3231 WEIGHT_TCC_EN1(ni_pi->cac_weights->weight_tcc_en1) | in ni_initialize_hardware_cac_manager()
3232 WEIGHT_TCC_EN2(ni_pi->cac_weights->weight_tcc_en2)); in ni_initialize_hardware_cac_manager()
3239 reg |= (WEIGHT_CB_EN0(ni_pi->cac_weights->weight_cb_en0) | in ni_initialize_hardware_cac_manager()
3240 WEIGHT_CB_EN1(ni_pi->cac_weights->weight_cb_en1) | in ni_initialize_hardware_cac_manager()
3241 WEIGHT_CB_EN2(ni_pi->cac_weights->weight_cb_en2) | in ni_initialize_hardware_cac_manager()
3242 WEIGHT_CB_EN3(ni_pi->cac_weights->weight_cb_en3)); in ni_initialize_hardware_cac_manager()
3249 reg |= (WEIGHT_DB_SIG0(ni_pi->cac_weights->weight_db_sig0) | in ni_initialize_hardware_cac_manager()
3250 WEIGHT_DB_SIG1(ni_pi->cac_weights->weight_db_sig1) | in ni_initialize_hardware_cac_manager()
3251 WEIGHT_DB_SIG2(ni_pi->cac_weights->weight_db_sig2) | in ni_initialize_hardware_cac_manager()
3252 WEIGHT_DB_SIG3(ni_pi->cac_weights->weight_db_sig3)); in ni_initialize_hardware_cac_manager()
3260 reg |= (WEIGHT_SXM_SIG0(ni_pi->cac_weights->weight_sxm_sig0) | in ni_initialize_hardware_cac_manager()
3261 WEIGHT_SXM_SIG1(ni_pi->cac_weights->weight_sxm_sig1) | in ni_initialize_hardware_cac_manager()
3262 WEIGHT_SXM_SIG2(ni_pi->cac_weights->weight_sxm_sig2) | in ni_initialize_hardware_cac_manager()
3263 WEIGHT_SXS_SIG0(ni_pi->cac_weights->weight_sxs_sig0) | in ni_initialize_hardware_cac_manager()
3264 WEIGHT_SXS_SIG1(ni_pi->cac_weights->weight_sxs_sig1)); in ni_initialize_hardware_cac_manager()
3271 reg |= (WEIGHT_XBR_0(ni_pi->cac_weights->weight_xbr_0) | in ni_initialize_hardware_cac_manager()
3272 WEIGHT_XBR_1(ni_pi->cac_weights->weight_xbr_1) | in ni_initialize_hardware_cac_manager()
3273 WEIGHT_XBR_2(ni_pi->cac_weights->weight_xbr_2) | in ni_initialize_hardware_cac_manager()
3274 WEIGHT_SPI_SIG0(ni_pi->cac_weights->weight_spi_sig0)); in ni_initialize_hardware_cac_manager()
3282 reg |= (WEIGHT_SPI_SIG1(ni_pi->cac_weights->weight_spi_sig1) | in ni_initialize_hardware_cac_manager()
3283 WEIGHT_SPI_SIG2(ni_pi->cac_weights->weight_spi_sig2) | in ni_initialize_hardware_cac_manager()
3284 WEIGHT_SPI_SIG3(ni_pi->cac_weights->weight_spi_sig3) | in ni_initialize_hardware_cac_manager()
3285 WEIGHT_SPI_SIG4(ni_pi->cac_weights->weight_spi_sig4) | in ni_initialize_hardware_cac_manager()
3286 WEIGHT_SPI_SIG5(ni_pi->cac_weights->weight_spi_sig5)); in ni_initialize_hardware_cac_manager()
3292 reg |= (WEIGHT_LDS_SIG0(ni_pi->cac_weights->weight_lds_sig0) | in ni_initialize_hardware_cac_manager()
3293 WEIGHT_LDS_SIG1(ni_pi->cac_weights->weight_lds_sig1) | in ni_initialize_hardware_cac_manager()
3294 WEIGHT_SC(ni_pi->cac_weights->weight_sc)); in ni_initialize_hardware_cac_manager()
3302 reg |= (WEIGHT_BIF(ni_pi->cac_weights->weight_bif) | in ni_initialize_hardware_cac_manager()
3303 WEIGHT_CP(ni_pi->cac_weights->weight_cp) | in ni_initialize_hardware_cac_manager()
3304 WEIGHT_PA_SIG0(ni_pi->cac_weights->weight_pa_sig0) | in ni_initialize_hardware_cac_manager()
3305 WEIGHT_PA_SIG1(ni_pi->cac_weights->weight_pa_sig1) | in ni_initialize_hardware_cac_manager()
3306 WEIGHT_VGT_SIG0(ni_pi->cac_weights->weight_vgt_sig0)); in ni_initialize_hardware_cac_manager()
3314 reg |= (WEIGHT_VGT_SIG1(ni_pi->cac_weights->weight_vgt_sig1) | in ni_initialize_hardware_cac_manager()
3315 WEIGHT_VGT_SIG2(ni_pi->cac_weights->weight_vgt_sig2) | in ni_initialize_hardware_cac_manager()
3316 WEIGHT_DC_SIG0(ni_pi->cac_weights->weight_dc_sig0) | in ni_initialize_hardware_cac_manager()
3317 WEIGHT_DC_SIG1(ni_pi->cac_weights->weight_dc_sig1) | in ni_initialize_hardware_cac_manager()
3318 WEIGHT_DC_SIG2(ni_pi->cac_weights->weight_dc_sig2)); in ni_initialize_hardware_cac_manager()
3326 reg |= (WEIGHT_DC_SIG3(ni_pi->cac_weights->weight_dc_sig3) | in ni_initialize_hardware_cac_manager()
3327 WEIGHT_UVD_SIG0(ni_pi->cac_weights->weight_uvd_sig0) | in ni_initialize_hardware_cac_manager()
3328 WEIGHT_UVD_SIG1(ni_pi->cac_weights->weight_uvd_sig1) | in ni_initialize_hardware_cac_manager()
3329 WEIGHT_SPARE0(ni_pi->cac_weights->weight_spare0) | in ni_initialize_hardware_cac_manager()
3330 WEIGHT_SPARE1(ni_pi->cac_weights->weight_spare1)); in ni_initialize_hardware_cac_manager()
3335 reg |= (WEIGHT_SQ_VSP(ni_pi->cac_weights->weight_sq_vsp) | in ni_initialize_hardware_cac_manager()
3336 WEIGHT_SQ_VSP0(ni_pi->cac_weights->weight_sq_vsp0)); in ni_initialize_hardware_cac_manager()
3340 reg |= WEIGHT_SQ_GPR(ni_pi->cac_weights->weight_sq_gpr); in ni_initialize_hardware_cac_manager()
3347 reg |= (OVR_MODE_SPARE_0(ni_pi->cac_weights->ovr_mode_spare_0) | in ni_initialize_hardware_cac_manager()
3348 OVR_VAL_SPARE_0(ni_pi->cac_weights->ovr_val_spare_0) | in ni_initialize_hardware_cac_manager()
3349 OVR_MODE_SPARE_1(ni_pi->cac_weights->ovr_mode_spare_1) | in ni_initialize_hardware_cac_manager()
3350 OVR_VAL_SPARE_1(ni_pi->cac_weights->ovr_val_spare_1)); in ni_initialize_hardware_cac_manager()
3356 reg |= (VSP(ni_pi->cac_weights->vsp) | in ni_initialize_hardware_cac_manager()
3357 VSP0(ni_pi->cac_weights->vsp0) | in ni_initialize_hardware_cac_manager()
3358 GPR(ni_pi->cac_weights->gpr)); in ni_initialize_hardware_cac_manager()
3368 reg = (READ_WEIGHT(ni_pi->cac_weights->mc_read_weight) | in ni_initialize_hardware_cac_manager()
3369 WRITE_WEIGHT(ni_pi->cac_weights->mc_write_weight) | in ni_initialize_hardware_cac_manager()
3380 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_enable_smc_cac() local
3384 if (ni_pi->enable_cac) { in ni_enable_smc_cac()
3389 if (ni_pi->support_cac_long_term_average) { in ni_enable_smc_cac()
3392 ni_pi->support_cac_long_term_average = false; in ni_enable_smc_cac()
3399 ni_pi->cac_enabled = (PPSMC_Result_OK == smc_result) ? true : false; in ni_enable_smc_cac()
3401 } else if (ni_pi->cac_enabled) { in ni_enable_smc_cac()
3404 ni_pi->cac_enabled = false; in ni_enable_smc_cac()
3406 if (ni_pi->support_cac_long_term_average) { in ni_enable_smc_cac()
3409 ni_pi->support_cac_long_term_average = false; in ni_enable_smc_cac()
3565 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_update_current_ps() local
3568 ni_pi->current_ps = *new_ps; in ni_update_current_ps()
3569 eg_pi->current_rps.ps_priv = &ni_pi->current_ps; in ni_update_current_ps()
3577 struct ni_power_info *ni_pi = ni_get_pi(rdev); in ni_update_requested_ps() local
3580 ni_pi->requested_ps = *new_ps; in ni_update_requested_ps()
3581 eg_pi->requested_rps.ps_priv = &ni_pi->requested_ps; in ni_update_requested_ps()
4049 struct ni_power_info *ni_pi; in ni_dpm_init() local
4053 ni_pi = kzalloc(sizeof(struct ni_power_info), GFP_KERNEL); in ni_dpm_init()
4054 if (ni_pi == NULL) in ni_dpm_init()
4056 rdev->pm.dpm.priv = ni_pi; in ni_dpm_init()
4057 eg_pi = &ni_pi->eg; in ni_dpm_init()
4137 ni_pi->mclk_rtt_mode_threshold = eg_pi->mclk_edc_wr_enable_threshold; in ni_dpm_init()
4205 ni_pi->cac_data.leakage_coefficients.at = 516; in ni_dpm_init()
4206 ni_pi->cac_data.leakage_coefficients.bt = 18; in ni_dpm_init()
4207 ni_pi->cac_data.leakage_coefficients.av = 51; in ni_dpm_init()
4208 ni_pi->cac_data.leakage_coefficients.bv = 2957; in ni_dpm_init()
4216 ni_pi->cac_weights = &cac_weights_cayman_xt; in ni_dpm_init()
4223 ni_pi->cac_weights = &cac_weights_cayman_pro; in ni_dpm_init()
4230 ni_pi->cac_weights = &cac_weights_cayman_le; in ni_dpm_init()
4234 if (ni_pi->cac_weights->enable_power_containment_by_default) { in ni_dpm_init()
4235 ni_pi->enable_power_containment = true; in ni_dpm_init()
4236 ni_pi->enable_cac = true; in ni_dpm_init()
4237 ni_pi->enable_sq_ramping = true; in ni_dpm_init()
4239 ni_pi->enable_power_containment = false; in ni_dpm_init()
4240 ni_pi->enable_cac = false; in ni_dpm_init()
4241 ni_pi->enable_sq_ramping = false; in ni_dpm_init()
4244 ni_pi->driver_calculate_cac_leakage = false; in ni_dpm_init()
4245 ni_pi->cac_configuration_required = true; in ni_dpm_init()
4247 if (ni_pi->cac_configuration_required) { in ni_dpm_init()
4248 ni_pi->support_cac_long_term_average = true; in ni_dpm_init()
4249 ni_pi->lta_window_size = ni_pi->cac_weights->l2_lta_window_size; in ni_dpm_init()
4250 ni_pi->lts_truncate = ni_pi->cac_weights->lts_truncate; in ni_dpm_init()
4252 ni_pi->support_cac_long_term_average = false; in ni_dpm_init()
4253 ni_pi->lta_window_size = 0; in ni_dpm_init()
4254 ni_pi->lts_truncate = 0; in ni_dpm_init()
4257 ni_pi->use_power_boost_limit = true; in ni_dpm_init()