Merge branch 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux into drm...
authorDave Airlie <airlied@redhat.com>
Wed, 27 Jul 2016 19:51:39 +0000 (05:51 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 27 Jul 2016 19:51:39 +0000 (05:51 +1000)
A few more patches for 4.8.  Mostly bug fixes and some prep work
for iceland powerplay support.  I have a couple polaris patches and
Edward's misc cleanups that require a merge with Linus'.  I don't know
if you are planning a merge anytime soon.

[airlied: fixed up endian vs 32-bit change in ppatomctrl]

* 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux: (26 commits)
  drm/amdgpu: comment out unused defaults_bonaire_pro static const structures to fix the build
  drm/amdgpu: temporary comment out unused static const structures to fix the build
  drm/amdgpu: S3 resume fail on Polaris10
  drm/amd/powerplay: add pp_tables_get_response_times function in process pptables
  drm/amd/powerplay: fix the incorrect return value
  drm/amd/powerplay: add atomctrl_get_voltage_evv function in ppatomctrl
  drm/amdgpu: add new definitions into ppsmc.h for iceland
  drm/amd/powerplay: add SMU register macro for future use
  drm/amdgpu: add ucode_start_address into cgs_firmware_info
  drm/amdgpu: no need load microcode at sdma if powerplay is enabled
  drm/amdgpu: rename smumgr to smum for dpm
  drm/amdgpu: disable GFX PG on CZ/BR/ST
  drivers: gpu: drm: amd: powerplay: hwmgr: Remove unused variable
  drm/amdgpu: return -ENOSPC when running out of UVD handles
  drm/amdgpu: trace need_flush in grab_vm as well
  drm/amdgpu: always signal all fences
  drm/amdgpu: check flush fence context instead of same ring v2
  drm/radeon: support backlight control for UNIPHY3
  drm/amdgpu: support backlight control for UNIPHY3
  drm/amdgpu: remove usec timeout loop from IB tests
  ...

1  2 
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.h

index d9c88d13f8db5efbc958b1571ac844bc091a76f4,b1bbe50f93e1a2c4aed439d4ca0dcf485ecd798b..a46a64c125d1f2200727b7aa0e886c8b0aae0abb
@@@ -40,7 -40,7 +40,7 @@@
  #include "uvd/uvd_4_2_d.h"
  
  /* 1 second timeout */
- #define UVD_IDLE_TIMEOUT_MS   1000
+ #define UVD_IDLE_TIMEOUT      msecs_to_jiffies(1000)
  /* Polaris10/11 firmware version */
  #define FW_1_66_16 ((1 << 24) | (66 << 16) | (16 << 8))
  
@@@ -662,7 -662,7 +662,7 @@@ static int amdgpu_uvd_cs_msg(struct amd
                }
  
                DRM_ERROR("No more free UVD handles!\n");
-               return -EINVAL;
+               return -ENOSPC;
  
        case 1:
                /* it's a decode msg, calc buffer sizes */
@@@ -968,7 -968,7 +968,7 @@@ static int amdgpu_uvd_send_msg(struct a
  
        if (direct) {
                r = amdgpu_ib_schedule(ring, 1, ib, NULL, NULL, &f);
-               job->fence = f;
+               job->fence = fence_get(f);
                if (r)
                        goto err_free;
  
@@@ -1106,16 -1106,11 +1106,15 @@@ static void amdgpu_uvd_idle_work_handle
        if (fences == 0 && handles == 0) {
                if (adev->pm.dpm_enabled) {
                        amdgpu_dpm_enable_uvd(adev, false);
 +                      /* just work around for uvd clock remain high even
 +                       * when uvd dpm disabled on Polaris10 */
 +                      if (adev->asic_type == CHIP_POLARIS10)
 +                              amdgpu_asic_set_uvd_clocks(adev, 0, 0);
                } else {
                        amdgpu_asic_set_uvd_clocks(adev, 0, 0);
                }
        } else {
-               schedule_delayed_work(&adev->uvd.idle_work,
-                                     msecs_to_jiffies(UVD_IDLE_TIMEOUT_MS));
+               schedule_delayed_work(&adev->uvd.idle_work, UVD_IDLE_TIMEOUT);
        }
  }
  
@@@ -1123,7 -1118,7 +1122,7 @@@ static void amdgpu_uvd_note_usage(struc
  {
        bool set_clocks = !cancel_delayed_work_sync(&adev->uvd.idle_work);
        set_clocks &= schedule_delayed_work(&adev->uvd.idle_work,
-                                           msecs_to_jiffies(UVD_IDLE_TIMEOUT_MS));
+                                           UVD_IDLE_TIMEOUT);
  
        if (set_clocks) {
                if (adev->pm.dpm_enabled) {
index aabaf2f92575bdf9b6bdf0fc9f6708978d528e68,3ed9150cbf1556b090c72a0efec2e035f9f1878e..d97b962bc3de1a16c181ba5122eb02829890980f
@@@ -28,7 -28,6 +28,7 @@@
  #include "vid.h"
  #include "amdgpu_ucode.h"
  #include "amdgpu_atombios.h"
 +#include "atombios_i2c.h"
  #include "clearstate_vi.h"
  
  #include "gmc/gmc_8_2_d.h"
@@@ -48,8 -47,6 +48,8 @@@
  #include "dce/dce_10_0_d.h"
  #include "dce/dce_10_0_sh_mask.h"
  
 +#include "smu/smu_7_1_3_d.h"
 +
  #define GFX8_NUM_GFX_RINGS     1
  #define GFX8_NUM_COMPUTE_RINGS 8
  
@@@ -285,7 -282,6 +285,7 @@@ static const u32 golden_settings_polari
        mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f3,
        mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000,
        mmTCP_CHAN_STEER_LO, 0xffffffff, 0x00003210,
 +      mmVGT_RESET_DEBUG, 0x00000004, 0x00000004,
  };
  
  static const u32 polaris11_golden_common_all[] =
@@@ -316,7 -312,6 +316,7 @@@ static const u32 golden_settings_polari
        mmTCC_CTRL, 0x00100000, 0xf31fff7f,
        mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f7,
        mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000,
 +      mmVGT_RESET_DEBUG, 0x00000004, 0x00000004,
  };
  
  static const u32 polaris10_golden_common_all[] =
@@@ -698,11 -693,6 +698,11 @@@ static void gfx_v8_0_init_golden_regist
                amdgpu_program_register_sequence(adev,
                                                 polaris10_golden_common_all,
                                                 (const u32)ARRAY_SIZE(polaris10_golden_common_all));
 +              WREG32_SMC(ixCG_ACLK_CNTL, 0x0000001C);
 +              if (adev->pdev->revision == 0xc7) {
 +                      amdgpu_atombios_i2c_channel_trans(adev, 0x10, 0x96, 0x1E, 0xDD);
 +                      amdgpu_atombios_i2c_channel_trans(adev, 0x10, 0x96, 0x1F, 0xD0);
 +              }
                break;
        case CHIP_CARRIZO:
                amdgpu_program_register_sequence(adev,
@@@ -794,7 -784,6 +794,6 @@@ static int gfx_v8_0_ring_test_ib(struc
        struct fence *f = NULL;
        uint32_t scratch;
        uint32_t tmp = 0;
-       unsigned i;
        int r;
  
        r = amdgpu_gfx_scratch_get(adev, &scratch);
                DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
                goto err2;
        }
-       for (i = 0; i < adev->usec_timeout; i++) {
-               tmp = RREG32(scratch);
-               if (tmp == 0xDEADBEEF)
-                       break;
-               DRM_UDELAY(1);
-       }
-       if (i < adev->usec_timeout) {
-               DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
-                        ring->idx, i);
-               goto err2;
+       tmp = RREG32(scratch);
+       if (tmp == 0xDEADBEEF) {
+               DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
        } else {
                DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
                          scratch, tmp);
                r = -EINVAL;
        }
  err2:
-       fence_put(f);
        amdgpu_ib_free(adev, &ib, NULL);
        fence_put(f);
  err1:
@@@ -1729,7 -1710,6 +1720,6 @@@ static int gfx_v8_0_do_edc_gpr_workarou
                RREG32(sec_ded_counter_registers[i]);
  
  fail:
-       fence_put(f);
        amdgpu_ib_free(adev, &ib, NULL);
        fence_put(f);
  
index a6c9b4201e25b1ad678e7495e393136108e43047,57a13b1c171a9e30e7761decf2c5c382cfdd143c..d1b528b401e90350a2f979e996773505c9ecc022
@@@ -780,7 -780,7 +780,7 @@@ static int polaris10_populate_smc_mvdd_
                        table->Smio[level] |=
                                data->mvdd_voltage_table.entries[level].smio_low;
                }
 -              table->SmioMask2 = data->vddci_voltage_table.mask_low;
 +              table->SmioMask2 = data->mvdd_voltage_table.mask_low;
  
                table->MvddLevelCount = (uint32_t) PP_HOST_TO_SMC_UL(count);
        }
@@@ -1470,19 -1470,22 +1470,19 @@@ static int polaris10_populate_smc_acpi_
  
        table->ACPILevel.Flags &= ~PPSMC_SWSTATE_FLAG_DC;
  
 -      if (!data->sclk_dpm_key_disabled) {
 -              /* Get MinVoltage and Frequency from DPM0,
 -               * already converted to SMC_UL */
 -              sclk_frequency = data->dpm_table.sclk_table.dpm_levels[0].value;
 -              result = polaris10_get_dependency_volt_by_clk(hwmgr,
 -                              table_info->vdd_dep_on_sclk,
 -                              table->ACPILevel.SclkFrequency,
 -                              &table->ACPILevel.MinVoltage, &mvdd);
 -              PP_ASSERT_WITH_CODE((0 == result),
 -                              "Cannot find ACPI VDDC voltage value "
 -                              "in Clock Dependency Table", );
 -      } else {
 -              sclk_frequency = data->vbios_boot_state.sclk_bootup_value;
 -              table->ACPILevel.MinVoltage =
 -                              data->vbios_boot_state.vddc_bootup_value * VOLTAGE_SCALE;
 -      }
 +
 +      /* Get MinVoltage and Frequency from DPM0,
 +       * already converted to SMC_UL */
 +      sclk_frequency = data->dpm_table.sclk_table.dpm_levels[0].value;
 +      result = polaris10_get_dependency_volt_by_clk(hwmgr,
 +                      table_info->vdd_dep_on_sclk,
 +                      sclk_frequency,
 +                      &table->ACPILevel.MinVoltage, &mvdd);
 +      PP_ASSERT_WITH_CODE((0 == result),
 +                      "Cannot find ACPI VDDC voltage value "
 +                      "in Clock Dependency Table",
 +                      );
 +
  
        result = polaris10_calculate_sclk_params(hwmgr, sclk_frequency,  &(table->ACPILevel.SclkSetting));
        PP_ASSERT_WITH_CODE(result == 0, "Error retrieving Engine Clock dividers from VBIOS.", return result);
        CONVERT_FROM_HOST_TO_SMC_US(table->ACPILevel.SclkSetting.Fcw1_frac);
        CONVERT_FROM_HOST_TO_SMC_US(table->ACPILevel.SclkSetting.Sclk_ss_slew_rate);
  
 -      if (!data->mclk_dpm_key_disabled) {
 -              /* Get MinVoltage and Frequency from DPM0, already converted to SMC_UL */
 -              table->MemoryACPILevel.MclkFrequency =
 -                              data->dpm_table.mclk_table.dpm_levels[0].value;
 -              result = polaris10_get_dependency_volt_by_clk(hwmgr,
 -                              table_info->vdd_dep_on_mclk,
 -                              table->MemoryACPILevel.MclkFrequency,
 -                              &table->MemoryACPILevel.MinVoltage, &mvdd);
 -              PP_ASSERT_WITH_CODE((0 == result),
 -                              "Cannot find ACPI VDDCI voltage value "
 -                              "in Clock Dependency Table",
 -                              );
 -      } else {
 -              table->MemoryACPILevel.MclkFrequency =
 -                              data->vbios_boot_state.mclk_bootup_value;
 -              table->MemoryACPILevel.MinVoltage =
 -                              data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE;
 -      }
 +
 +      /* Get MinVoltage and Frequency from DPM0, already converted to SMC_UL */
 +      table->MemoryACPILevel.MclkFrequency =
 +                      data->dpm_table.mclk_table.dpm_levels[0].value;
 +      result = polaris10_get_dependency_volt_by_clk(hwmgr,
 +                      table_info->vdd_dep_on_mclk,
 +                      table->MemoryACPILevel.MclkFrequency,
 +                      &table->MemoryACPILevel.MinVoltage, &mvdd);
 +      PP_ASSERT_WITH_CODE((0 == result),
 +                      "Cannot find ACPI VDDCI voltage value "
 +                      "in Clock Dependency Table",
 +                      );
  
        us_mvdd = 0;
        if ((POLARIS10_VOLTAGE_CONTROL_NONE == data->mvdd_control) ||
@@@ -1563,7 -1572,6 +1563,7 @@@ static int polaris10_populate_smc_vce_l
        struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =
                        table_info->mm_dep_table;
        struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
 +      uint32_t vddci;
  
        table->VceLevelCount = (uint8_t)(mm_table->count);
        table->VceBootLevel = 0;
                table->VceLevel[count].MinVoltage = 0;
                table->VceLevel[count].MinVoltage |=
                                (mm_table->entries[count].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
 +
 +              if (POLARIS10_VOLTAGE_CONTROL_BY_GPIO == data->vddci_control)
 +                      vddci = (uint32_t)phm_find_closest_vddci(&(data->vddci_voltage_table),
 +                                              mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);
 +              else if (POLARIS10_VOLTAGE_CONTROL_BY_SVID2 == data->vddci_control)
 +                      vddci = mm_table->entries[count].vddc - VDDC_VDDCI_DELTA;
 +              else
 +                      vddci = (data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE) << VDDCI_SHIFT;
 +
 +
                table->VceLevel[count].MinVoltage |=
 -                              ((mm_table->entries[count].vddc - data->vddc_vddci_delta) *
 -                                              VOLTAGE_SCALE) << VDDCI_SHIFT;
 +                              (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
                table->VceLevel[count].MinVoltage |= 1 << PHASES_SHIFT;
  
                /*retrieve divider value for VBIOS */
@@@ -1613,7 -1612,6 +1613,7 @@@ static int polaris10_populate_smc_samu_
        struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =
                        table_info->mm_dep_table;
        struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
 +      uint32_t vddci;
  
        table->SamuBootLevel = 0;
        table->SamuLevelCount = (uint8_t)(mm_table->count);
                table->SamuLevel[count].Frequency = mm_table->entries[count].samclock;
                table->SamuLevel[count].MinVoltage |= (mm_table->entries[count].vddc *
                                VOLTAGE_SCALE) << VDDC_SHIFT;
 -              table->SamuLevel[count].MinVoltage |= ((mm_table->entries[count].vddc -
 -                              data->vddc_vddci_delta) * VOLTAGE_SCALE) << VDDCI_SHIFT;
 +
 +              if (POLARIS10_VOLTAGE_CONTROL_BY_GPIO == data->vddci_control)
 +                      vddci = (uint32_t)phm_find_closest_vddci(&(data->vddci_voltage_table),
 +                                              mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);
 +              else if (POLARIS10_VOLTAGE_CONTROL_BY_SVID2 == data->vddci_control)
 +                      vddci = mm_table->entries[count].vddc - VDDC_VDDCI_DELTA;
 +              else
 +                      vddci = (data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE) << VDDCI_SHIFT;
 +
 +              table->SamuLevel[count].MinVoltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
                table->SamuLevel[count].MinVoltage |= 1 << PHASES_SHIFT;
  
                /* retrieve divider value for VBIOS */
@@@ -1716,7 -1706,6 +1716,7 @@@ static int polaris10_populate_smc_uvd_l
        struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =
                        table_info->mm_dep_table;
        struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
 +      uint32_t vddci;
  
        table->UvdLevelCount = (uint8_t)(mm_table->count);
        table->UvdBootLevel = 0;
                table->UvdLevel[count].DclkFrequency = mm_table->entries[count].dclk;
                table->UvdLevel[count].MinVoltage |= (mm_table->entries[count].vddc *
                                VOLTAGE_SCALE) << VDDC_SHIFT;
 -              table->UvdLevel[count].MinVoltage |= ((mm_table->entries[count].vddc -
 -                              data->vddc_vddci_delta) * VOLTAGE_SCALE) << VDDCI_SHIFT;
 +
 +              if (POLARIS10_VOLTAGE_CONTROL_BY_GPIO == data->vddci_control)
 +                      vddci = (uint32_t)phm_find_closest_vddci(&(data->vddci_voltage_table),
 +                                              mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);
 +              else if (POLARIS10_VOLTAGE_CONTROL_BY_SVID2 == data->vddci_control)
 +                      vddci = mm_table->entries[count].vddc - VDDC_VDDCI_DELTA;
 +              else
 +                      vddci = (data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE) << VDDCI_SHIFT;
 +
 +              table->UvdLevel[count].MinVoltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
                table->UvdLevel[count].MinVoltage |= 1 << PHASES_SHIFT;
  
                /* retrieve divider value for VBIOS */
                CONVERT_FROM_HOST_TO_SMC_UL(table->UvdLevel[count].VclkFrequency);
                CONVERT_FROM_HOST_TO_SMC_UL(table->UvdLevel[count].DclkFrequency);
                CONVERT_FROM_HOST_TO_SMC_UL(table->UvdLevel[count].MinVoltage);
 -
        }
 +
        return result;
  }
  
@@@ -1828,7 -1809,7 +1828,7 @@@ static int polaris10_populate_clock_str
  {
        uint32_t ro, efuse, volt_without_cks, volt_with_cks, value, max, min;
        struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
-       uint8_t i, stretch_amount, stretch_amount2, volt_offset = 0;
+       uint8_t i, stretch_amount, volt_offset = 0;
        struct phm_ppt_v1_information *table_info =
                        (struct phm_ppt_v1_information *)(hwmgr->pptable);
        struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table =
        for (i = 0; i < sclk_table->count; i++) {
                data->smc_state_table.Sclk_CKS_masterEn0_7 |=
                                sclk_table->entries[i].cks_enable << i;
 -
 -              volt_without_cks =  (uint32_t)(((ro - 40) * 1000 - 2753594 - sclk_table->entries[i].clk/100 * 136418 /1000) / \
 -                                      (sclk_table->entries[i].clk/100 * 1132925 /10000 - 242418)/100);
 -
 -              volt_with_cks = (uint32_t)((ro * 1000 -2396351 - sclk_table->entries[i].clk/100 * 329021/1000) / \
 -                              (sclk_table->entries[i].clk/10000 * 649434 /1000  - 18005)/10);
 +              if (hwmgr->chip_id == CHIP_POLARIS10) {
 +                      volt_without_cks = (uint32_t)((2753594000U + (sclk_table->entries[i].clk/100) * 136418 -(ro - 70) * 1000000) / \
 +                                              (2424180 - (sclk_table->entries[i].clk/100) * 1132925/1000));
 +                      volt_with_cks = (uint32_t)((2797202000U + sclk_table->entries[i].clk/100 * 3232 - (ro - 65) * 1000000) / \
 +                                      (2522480 - sclk_table->entries[i].clk/100 * 115764/100));
 +              } else {
 +                      volt_without_cks = (uint32_t)((2416794800U + (sclk_table->entries[i].clk/100) * 1476925/10 -(ro - 50) * 1000000) / \
 +                                              (2625416 - (sclk_table->entries[i].clk/100) * (12586807/10000)));
 +                      volt_with_cks = (uint32_t)((2999656000U - sclk_table->entries[i].clk/100 * 392803 - (ro - 44) * 1000000) / \
 +                                      (3422454 - sclk_table->entries[i].clk/100 * (18886376/10000)));
 +              }
  
                if (volt_without_cks >= volt_with_cks)
                        volt_offset = (uint8_t)(((volt_without_cks - volt_with_cks +
 -                                      sclk_table->entries[i].cks_voffset) * 100 / 625) + 1);
 +                                      sclk_table->entries[i].cks_voffset) * 100 + 624) / 625);
  
                data->smc_state_table.Sclk_voltageOffset[i] = volt_offset;
        }
  
 +      data->smc_state_table.LdoRefSel = (table_info->cac_dtp_table->ucCKS_LDO_REFSEL != 0) ? table_info->cac_dtp_table->ucCKS_LDO_REFSEL : 6;
        /* Populate CKS Lookup Table */
-       if (stretch_amount == 1 || stretch_amount == 2 || stretch_amount == 5)
-               stretch_amount2 = 0;
-       else if (stretch_amount == 3 || stretch_amount == 4)
-               stretch_amount2 = 1;
-       else {
+       if (stretch_amount != 1 && stretch_amount != 2 && stretch_amount != 3 &&
+                       stretch_amount != 4 && stretch_amount != 5) {
                phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
                                PHM_PlatformCaps_ClockStretcher);
                PP_ASSERT_WITH_CODE(false,
@@@ -2654,8 -2626,6 +2651,8 @@@ int polaris10_enable_dpm_tasks(struct p
        PP_ASSERT_WITH_CODE((0 == tmp_result),
                        "Failed to enable VR hot GPIO interrupt!", result = tmp_result);
  
 +      smum_send_msg_to_smc(hwmgr->smumgr, (PPSMC_Msg)PPSMC_HasDisplay);
 +
        tmp_result = polaris10_enable_sclk_control(hwmgr);
        PP_ASSERT_WITH_CODE((0 == tmp_result),
                        "Failed to enable SCLK control!", result = tmp_result);
@@@ -2874,7 -2844,7 +2871,7 @@@ static int polaris10_get_evv_voltages(s
  {
        struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
        uint16_t vv_id;
 -      uint16_t vddc = 0;
 +      uint32_t vddc = 0;
        uint16_t i, j;
        uint32_t sclk = 0;
        struct phm_ppt_v1_information *table_info =
                                continue;
                        }
  
 -                      /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */
 -                      PP_ASSERT_WITH_CODE((vddc < 2000 && vddc != 0),
 +                      /* need to make sure vddc is less than 2v or else, it could burn the ASIC.
 +                       * real voltage level in unit of 0.01mv */
 +                      PP_ASSERT_WITH_CODE((vddc < 200000 && vddc != 0),
                                        "Invalid VDDC value", result = -EINVAL;);
  
                        /* the voltage should not be zero nor equal to leakage ID */
@@@ -3133,31 -3102,6 +3130,31 @@@ static int polaris10_set_private_data_b
        return 0;
  }
  
 +int polaris10_patch_voltage_workaround(struct pp_hwmgr *hwmgr)
 +{
 +      struct phm_ppt_v1_information *table_info =
 +                     (struct phm_ppt_v1_information *)(hwmgr->pptable);
 +      struct phm_ppt_v1_clock_voltage_dependency_table *dep_mclk_table =
 +                      table_info->vdd_dep_on_mclk;
 +      struct phm_ppt_v1_voltage_lookup_table *lookup_table =
 +                      table_info->vddc_lookup_table;
 +      uint32_t i;
 +
 +      if (hwmgr->chip_id == CHIP_POLARIS10 && hwmgr->hw_revision == 0xC7) {
 +              if (lookup_table->entries[dep_mclk_table->entries[dep_mclk_table->count-1].vddInd].us_vdd >= 1000)
 +                      return 0;
 +
 +              for (i = 0; i < lookup_table->count; i++) {
 +                      if (lookup_table->entries[i].us_vdd < 0xff01 && lookup_table->entries[i].us_vdd >= 1000) {
 +                              dep_mclk_table->entries[dep_mclk_table->count-1].vddInd = (uint8_t) i;
 +                              return 0;
 +                      }
 +              }
 +      }
 +      return 0;
 +}
 +
 +
  int polaris10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
  {
        struct polaris10_hwmgr *data;
  
        polaris10_set_features_platform_caps(hwmgr);
  
 +      polaris10_patch_voltage_workaround(hwmgr);
        polaris10_init_dpm_defaults(hwmgr);
  
        /* Get leakage voltage based on leakage ID. */
@@@ -4611,15 -4554,6 +4608,15 @@@ static int polaris10_notify_link_speed_
        return 0;
  }
  
 +static int polaris10_notify_smc_display(struct pp_hwmgr *hwmgr)
 +{
 +      struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend);
 +
 +      smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
 +              (PPSMC_Msg)PPSMC_MSG_SetVBITimeout, data->frame_time_x2);
 +      return (smum_send_msg_to_smc(hwmgr->smumgr, (PPSMC_Msg)PPSMC_HasDisplay) == 0) ?  0 : -EINVAL;
 +}
 +
  static int polaris10_set_power_state_tasks(struct pp_hwmgr *hwmgr, const void *input)
  {
        int tmp_result, result = 0;
                        "Failed to program memory timing parameters!",
                        result = tmp_result);
  
 +      tmp_result = polaris10_notify_smc_display(hwmgr);
 +      PP_ASSERT_WITH_CODE((0 == tmp_result),
 +                      "Failed to notify smc display settings!",
 +                      result = tmp_result);
 +
        tmp_result = polaris10_unfreeze_sclk_mclk_dpm(hwmgr);
        PP_ASSERT_WITH_CODE((0 == tmp_result),
                        "Failed to unfreeze SCLK MCLK DPM!",
@@@ -4707,7 -4636,6 +4704,7 @@@ static int polaris10_set_max_fan_pwm_ou
                        PPSMC_MSG_SetFanPwmMax, us_max_fan_pwm);
  }
  
 +
  int polaris10_notify_smc_display_change(struct pp_hwmgr *hwmgr, bool has_display)
  {
        PPSMC_Msg msg = has_display ? (PPSMC_Msg)PPSMC_HasDisplay : (PPSMC_Msg)PPSMC_NoDisplay;
@@@ -4727,6 -4655,8 +4724,6 @@@ int polaris10_notify_smc_display_config
  
        if (num_active_displays > 1)  /* to do && (pHwMgr->pPECI->displayConfiguration.bMultiMonitorInSync != TRUE)) */
                polaris10_notify_smc_display_change(hwmgr, false);
 -      else
 -              polaris10_notify_smc_display_change(hwmgr, true);
  
        return 0;
  }
@@@ -4767,8 -4697,6 +4764,8 @@@ int polaris10_program_display_gap(struc
        frame_time_in_us = 1000000 / refresh_rate;
  
        pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us;
 +      data->frame_time_x2 = frame_time_in_us * 2 / 100;
 +
        display_gap2 = pre_vbi_time_in_us * (ref_clock / 100);
  
        cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixCG_DISPLAY_GAP_CNTL2, display_gap2);
  
        cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, data->soft_regs_start + offsetof(SMU74_SoftRegisters, VBlankTimeout), (frame_time_in_us - pre_vbi_time_in_us));
  
 -      polaris10_notify_smc_display_change(hwmgr, num_active_displays != 0);
 -
        return 0;
  }
  
@@@ -4888,7 -4818,7 +4885,7 @@@ int polaris10_upload_mc_firmware(struc
                return 0;
        }
  
 -      data->need_long_memory_training = true;
 +      data->need_long_memory_training = false;
  
  /*
   *    PPMCME_FirmwareDescriptorEntry *pfd = NULL;
index a64db7ba4e0b874a6ef9a6e86712339a1e9577cf,0f5c9d09641b7cb6af563c84950ac7a523f76513..e2aece361eb0f68c14300f2807f18cc909358dc4
@@@ -179,13 -179,12 +179,12 @@@ int atomctrl_set_engine_dram_timings_rv
  
        /* They are both in 10KHz Units. */
        engine_clock_parameters.ulTargetEngineClock =
-               (uint32_t) engine_clock & SET_CLOCK_FREQ_MASK;
-       engine_clock_parameters.ulTargetEngineClock |=
-               (COMPUTE_ENGINE_PLL_PARAM << 24);
+               cpu_to_le32((engine_clock & SET_CLOCK_FREQ_MASK) |
+                           ((COMPUTE_ENGINE_PLL_PARAM << 24)));
  
        /* in 10 khz units.*/
        engine_clock_parameters.sReserved.ulClock =
-               (uint32_t) memory_clock & SET_CLOCK_FREQ_MASK;
+               cpu_to_le32(memory_clock & SET_CLOCK_FREQ_MASK);
        return cgs_atom_exec_cmd_table(hwmgr->device,
                        GetIndexIntoMasterTable(COMMAND, DynamicMemorySettings),
                        &engine_clock_parameters);
@@@ -252,7 -251,7 +251,7 @@@ int atomctrl_get_memory_pll_dividers_si
        COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1 mpll_parameters;
        int result;
  
-       mpll_parameters.ulClock = (uint32_t) clock_value;
+       mpll_parameters.ulClock = cpu_to_le32(clock_value);
        mpll_parameters.ucInputFlag = (uint8_t)((strobe_mode) ? 1 : 0);
  
        result = cgs_atom_exec_cmd_table
  
        if (0 == result) {
                mpll_param->mpll_fb_divider.clk_frac =
-                       mpll_parameters.ulFbDiv.usFbDivFrac;
+                       le16_to_cpu(mpll_parameters.ulFbDiv.usFbDivFrac);
                mpll_param->mpll_fb_divider.cl_kf =
-                       mpll_parameters.ulFbDiv.usFbDiv;
+                       le16_to_cpu(mpll_parameters.ulFbDiv.usFbDiv);
                mpll_param->mpll_post_divider =
                        (uint32_t)mpll_parameters.ucPostDiv;
                mpll_param->vco_mode =
@@@ -300,7 -299,7 +299,7 @@@ int atomctrl_get_memory_pll_dividers_vi
        COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_2 mpll_parameters;
        int result;
  
-       mpll_parameters.ulClock.ulClock = (uint32_t)clock_value;
+       mpll_parameters.ulClock.ulClock = cpu_to_le32(clock_value);
  
        result = cgs_atom_exec_cmd_table(hwmgr->device,
                        GetIndexIntoMasterTable(COMMAND, ComputeMemoryClockParam),
@@@ -320,7 -319,7 +319,7 @@@ int atomctrl_get_engine_pll_dividers_ko
        COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4 pll_parameters;
        int result;
  
-       pll_parameters.ulClock = clock_value;
+       pll_parameters.ulClock = cpu_to_le32(clock_value);
  
        result = cgs_atom_exec_cmd_table
                (hwmgr->device,
  
        if (0 == result) {
                dividers->pll_post_divider = pll_parameters.ucPostDiv;
-               dividers->real_clock = pll_parameters.ulClock;
+               dividers->real_clock = le32_to_cpu(pll_parameters.ulClock);
        }
  
        return result;
@@@ -343,7 -342,7 +342,7 @@@ int atomctrl_get_engine_pll_dividers_vi
        COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6 pll_patameters;
        int result;
  
-       pll_patameters.ulClock.ulClock = clock_value;
+       pll_patameters.ulClock.ulClock = cpu_to_le32(clock_value);
        pll_patameters.ulClock.ucPostDiv = COMPUTE_GPUCLK_INPUT_FLAG_SCLK;
  
        result = cgs_atom_exec_cmd_table
                dividers->pll_post_divider =
                        pll_patameters.ulClock.ucPostDiv;
                dividers->real_clock =
-                       pll_patameters.ulClock.ulClock;
+                       le32_to_cpu(pll_patameters.ulClock.ulClock);
  
                dividers->ul_fb_div.ul_fb_div_frac =
-                       pll_patameters.ulFbDiv.usFbDivFrac;
+                       le16_to_cpu(pll_patameters.ulFbDiv.usFbDivFrac);
                dividers->ul_fb_div.ul_fb_div =
-                       pll_patameters.ulFbDiv.usFbDiv;
+                       le16_to_cpu(pll_patameters.ulFbDiv.usFbDiv);
  
                dividers->uc_pll_ref_div =
                        pll_patameters.ucPllRefDiv;
@@@ -380,7 -379,7 +379,7 @@@ int atomctrl_get_engine_pll_dividers_ai
        COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_7 pll_patameters;
        int result;
  
-       pll_patameters.ulClock.ulClock = clock_value;
+       pll_patameters.ulClock.ulClock = cpu_to_le32(clock_value);
        pll_patameters.ulClock.ucPostDiv = COMPUTE_GPUCLK_INPUT_FLAG_SCLK;
  
        result = cgs_atom_exec_cmd_table
@@@ -412,7 -411,7 +411,7 @@@ int atomctrl_get_dfs_pll_dividers_vi
        COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6 pll_patameters;
        int result;
  
-       pll_patameters.ulClock.ulClock = clock_value;
+       pll_patameters.ulClock.ulClock = cpu_to_le32(clock_value);
        pll_patameters.ulClock.ucPostDiv =
                COMPUTE_GPUCLK_INPUT_FLAG_DEFAULT_GPUCLK;
  
                dividers->pll_post_divider =
                        pll_patameters.ulClock.ucPostDiv;
                dividers->real_clock =
-                       pll_patameters.ulClock.ulClock;
+                       le32_to_cpu(pll_patameters.ulClock.ulClock);
  
                dividers->ul_fb_div.ul_fb_div_frac =
-                       pll_patameters.ulFbDiv.usFbDivFrac;
+                       le16_to_cpu(pll_patameters.ulFbDiv.usFbDivFrac);
                dividers->ul_fb_div.ul_fb_div =
-                       pll_patameters.ulFbDiv.usFbDiv;
+                       le16_to_cpu(pll_patameters.ulFbDiv.usFbDiv);
  
                dividers->uc_pll_ref_div =
                        pll_patameters.ucPllRefDiv;
@@@ -519,13 -518,13 +518,13 @@@ int atomctrl_get_voltage_table_v3
  
        for (i = 0; i < voltage_object->asGpioVoltageObj.ucGpioEntryNum; i++) {
                voltage_table->entries[i].value =
-                       voltage_object->asGpioVoltageObj.asVolGpioLut[i].usVoltageValue;
+                       le16_to_cpu(voltage_object->asGpioVoltageObj.asVolGpioLut[i].usVoltageValue);
                voltage_table->entries[i].smio_low =
-                       voltage_object->asGpioVoltageObj.asVolGpioLut[i].ulVoltageId;
+                       le32_to_cpu(voltage_object->asGpioVoltageObj.asVolGpioLut[i].ulVoltageId);
        }
  
        voltage_table->mask_low    =
-               voltage_object->asGpioVoltageObj.ulGpioMaskVal;
+               le32_to_cpu(voltage_object->asGpioVoltageObj.ulGpioMaskVal);
        voltage_table->count      =
                voltage_object->asGpioVoltageObj.ucGpioEntryNum;
        voltage_table->phase_delay =
@@@ -592,12 -591,12 +591,12 @@@ bool atomctrl_get_pp_assign_pin
                const uint32_t pinId,
                pp_atomctrl_gpio_pin_assignment *gpio_pin_assignment)
  {
-       bool bRet = 0;
+       bool bRet = false;
        ATOM_GPIO_PIN_LUT *gpio_lookup_table =
                get_gpio_lookup_table(hwmgr->device);
  
        PP_ASSERT_WITH_CODE((NULL != gpio_lookup_table),
-                       "Could not find GPIO lookup Table in BIOS.", return -1);
+                       "Could not find GPIO lookup Table in BIOS.", return false);
  
        bRet = atomctrl_lookup_gpio_pin(gpio_lookup_table, pinId,
                gpio_pin_assignment);
@@@ -650,8 -649,8 +649,8 @@@ int atomctrl_calculate_voltage_evv_on_s
                return -1;
  
        if (getASICProfilingInfo->asHeader.ucTableFormatRevision < 3 ||
-                       (getASICProfilingInfo->asHeader.ucTableFormatRevision == 3 &&
-                       getASICProfilingInfo->asHeader.ucTableContentRevision < 4))
+           (getASICProfilingInfo->asHeader.ucTableFormatRevision == 3 &&
+            getASICProfilingInfo->asHeader.ucTableContentRevision < 4))
                return -1;
  
        /*-----------------------------------------------------------
  
        switch (dpm_level) {
        case 1:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm1);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM1, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm1));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM1), 1000);
                break;
        case 2:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm2);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM2, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm2));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM2), 1000);
                break;
        case 3:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm3);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM3, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm3));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM3), 1000);
                break;
        case 4:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm4);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM4, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm4));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM4), 1000);
                break;
        case 5:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm5);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM5, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm5));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM5), 1000);
                break;
        case 6:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm6);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM6, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm6));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM6), 1000);
                break;
        case 7:
-               fPowerDPMx = Convert_ULONG_ToFraction(getASICProfilingInfo->usPowerDpm7);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM7, 1000);
+               fPowerDPMx = Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm7));
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM7), 1000);
                break;
        default:
                printk(KERN_ERR "DPM Level not supported\n");
                fPowerDPMx = Convert_ULONG_ToFraction(1);
-               fDerateTDP = GetScaledFraction(getASICProfilingInfo->ulTdpDerateDPM0, 1000);
+               fDerateTDP = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM0), 1000);
        }
  
        /*-------------------------
                return result;
  
        /* Finally, the actual fuse value */
-       ul_RO_fused = sOutput_FuseValues.ulEfuseValue;
-       fMin = GetScaledFraction(sRO_fuse.ulEfuseMin, 1);
-       fRange = GetScaledFraction(sRO_fuse.ulEfuseEncodeRange, 1);
+       ul_RO_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fMin = GetScaledFraction(le32_to_cpu(sRO_fuse.ulEfuseMin), 1);
+       fRange = GetScaledFraction(le32_to_cpu(sRO_fuse.ulEfuseEncodeRange), 1);
        fRO_fused = fDecodeLinearFuse(ul_RO_fused, fMin, fRange, sRO_fuse.ucEfuseLength);
  
        sCACm_fuse = getASICProfilingInfo->sCACm;
        if (result)
                return result;
  
-       ul_CACm_fused = sOutput_FuseValues.ulEfuseValue;
-       fMin = GetScaledFraction(sCACm_fuse.ulEfuseMin, 1000);
-       fRange = GetScaledFraction(sCACm_fuse.ulEfuseEncodeRange, 1000);
+       ul_CACm_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fMin = GetScaledFraction(le32_to_cpu(sCACm_fuse.ulEfuseMin), 1000);
+       fRange = GetScaledFraction(le32_to_cpu(sCACm_fuse.ulEfuseEncodeRange), 1000);
  
        fCACm_fused = fDecodeLinearFuse(ul_CACm_fused, fMin, fRange, sCACm_fuse.ucEfuseLength);
  
        if (result)
                return result;
  
-       ul_CACb_fused = sOutput_FuseValues.ulEfuseValue;
-       fMin = GetScaledFraction(sCACb_fuse.ulEfuseMin, 1000);
-       fRange = GetScaledFraction(sCACb_fuse.ulEfuseEncodeRange, 1000);
+       ul_CACb_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fMin = GetScaledFraction(le32_to_cpu(sCACb_fuse.ulEfuseMin), 1000);
+       fRange = GetScaledFraction(le32_to_cpu(sCACb_fuse.ulEfuseEncodeRange), 1000);
  
        fCACb_fused = fDecodeLinearFuse(ul_CACb_fused, fMin, fRange, sCACb_fuse.ucEfuseLength);
  
        if (result)
                return result;
  
-       ul_Kt_Beta_fused = sOutput_FuseValues.ulEfuseValue;
-       fAverage = GetScaledFraction(sKt_Beta_fuse.ulEfuseEncodeAverage, 1000);
-       fRange = GetScaledFraction(sKt_Beta_fuse.ulEfuseEncodeRange, 1000);
+       ul_Kt_Beta_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fAverage = GetScaledFraction(le32_to_cpu(sKt_Beta_fuse.ulEfuseEncodeAverage), 1000);
+       fRange = GetScaledFraction(le32_to_cpu(sKt_Beta_fuse.ulEfuseEncodeRange), 1000);
  
        fKt_Beta_fused = fDecodeLogisticFuse(ul_Kt_Beta_fused,
                        fAverage, fRange, sKt_Beta_fuse.ucEfuseLength);
        if (result)
                return result;
  
-       ul_Kv_m_fused = sOutput_FuseValues.ulEfuseValue;
-       fAverage = GetScaledFraction(sKv_m_fuse.ulEfuseEncodeAverage, 1000);
-       fRange = GetScaledFraction((sKv_m_fuse.ulEfuseEncodeRange & 0x7fffffff), 1000);
+       ul_Kv_m_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fAverage = GetScaledFraction(le32_to_cpu(sKv_m_fuse.ulEfuseEncodeAverage), 1000);
+       fRange = GetScaledFraction((le32_to_cpu(sKv_m_fuse.ulEfuseEncodeRange) & 0x7fffffff), 1000);
        fRange = fMultiply(fRange, ConvertToFraction(-1));
  
        fKv_m_fused = fDecodeLogisticFuse(ul_Kv_m_fused,
        if (result)
                return result;
  
-       ul_Kv_b_fused = sOutput_FuseValues.ulEfuseValue;
-       fAverage = GetScaledFraction(sKv_b_fuse.ulEfuseEncodeAverage, 1000);
-       fRange = GetScaledFraction(sKv_b_fuse.ulEfuseEncodeRange, 1000);
+       ul_Kv_b_fused = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fAverage = GetScaledFraction(le32_to_cpu(sKv_b_fuse.ulEfuseEncodeAverage), 1000);
+       fRange = GetScaledFraction(le32_to_cpu(sKv_b_fuse.ulEfuseEncodeRange), 1000);
  
        fKv_b_fused = fDecodeLogisticFuse(ul_Kv_b_fused,
                        fAverage, fRange, sKv_b_fuse.ucEfuseLength);
        if (result)
                return result;
  
-       ul_FT_Lkg_V0NORM = sOutput_FuseValues.ulEfuseValue;
-       fLn_MaxDivMin = GetScaledFraction(getASICProfilingInfo->ulLkgEncodeLn_MaxDivMin, 10000);
-       fMin = GetScaledFraction(getASICProfilingInfo->ulLkgEncodeMin, 10000);
+       ul_FT_Lkg_V0NORM = le32_to_cpu(sOutput_FuseValues.ulEfuseValue);
+       fLn_MaxDivMin = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulLkgEncodeLn_MaxDivMin), 10000);
+       fMin = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulLkgEncodeMin), 10000);
  
        fFT_Lkg_V0NORM = fDecodeLeakageID(ul_FT_Lkg_V0NORM,
                        fLn_MaxDivMin, fMin, getASICProfilingInfo->ucLkgEfuseLength);
         * PART 2 - Grabbing all required values
         *-------------------------------------------
         */
-       fSM_A0 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A0, 1000000),
+       fSM_A0 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A0), 1000000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A0_sign)));
-       fSM_A1 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A1, 1000000),
+       fSM_A1 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A1), 1000000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A1_sign)));
-       fSM_A2 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A2, 100000),
+       fSM_A2 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A2), 100000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A2_sign)));
-       fSM_A3 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A3, 1000000),
+       fSM_A3 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A3), 1000000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A3_sign)));
-       fSM_A4 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A4, 1000000),
+       fSM_A4 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A4), 1000000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A4_sign)));
-       fSM_A5 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A5, 1000),
+       fSM_A5 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A5), 1000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A5_sign)));
-       fSM_A6 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A6, 1000),
+       fSM_A6 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A6), 1000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A6_sign)));
-       fSM_A7 = fMultiply(GetScaledFraction(getASICProfilingInfo->ulSM_A7, 1000),
+       fSM_A7 = fMultiply(GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulSM_A7), 1000),
                        ConvertToFraction(uPow(-1, getASICProfilingInfo->ucSM_A7_sign)));
  
-       fMargin_RO_a = ConvertToFraction(getASICProfilingInfo->ulMargin_RO_a);
-       fMargin_RO_b = ConvertToFraction(getASICProfilingInfo->ulMargin_RO_b);
-       fMargin_RO_c = ConvertToFraction(getASICProfilingInfo->ulMargin_RO_c);
+       fMargin_RO_a = ConvertToFraction(le32_to_cpu(getASICProfilingInfo->ulMargin_RO_a));
+       fMargin_RO_b = ConvertToFraction(le32_to_cpu(getASICProfilingInfo->ulMargin_RO_b));
+       fMargin_RO_c = ConvertToFraction(le32_to_cpu(getASICProfilingInfo->ulMargin_RO_c));
  
-       fMargin_fixed = ConvertToFraction(getASICProfilingInfo->ulMargin_fixed);
+       fMargin_fixed = ConvertToFraction(le32_to_cpu(getASICProfilingInfo->ulMargin_fixed));
  
        fMargin_FMAX_mean = GetScaledFraction(
-                       getASICProfilingInfo->ulMargin_Fmax_mean, 10000);
+               le32_to_cpu(getASICProfilingInfo->ulMargin_Fmax_mean), 10000);
        fMargin_Plat_mean = GetScaledFraction(
-                       getASICProfilingInfo->ulMargin_plat_mean, 10000);
+               le32_to_cpu(getASICProfilingInfo->ulMargin_plat_mean), 10000);
        fMargin_FMAX_sigma = GetScaledFraction(
-                       getASICProfilingInfo->ulMargin_Fmax_sigma, 10000);
+               le32_to_cpu(getASICProfilingInfo->ulMargin_Fmax_sigma), 10000);
        fMargin_Plat_sigma = GetScaledFraction(
-                       getASICProfilingInfo->ulMargin_plat_sigma, 10000);
+               le32_to_cpu(getASICProfilingInfo->ulMargin_plat_sigma), 10000);
  
        fMargin_DC_sigma = GetScaledFraction(
-                       getASICProfilingInfo->ulMargin_DC_sigma, 100);
+               le32_to_cpu(getASICProfilingInfo->ulMargin_DC_sigma), 100);
        fMargin_DC_sigma = fDivide(fMargin_DC_sigma, ConvertToFraction(1000));
  
        fCACm_fused = fDivide(fCACm_fused, ConvertToFraction(100));
        fSclk = GetScaledFraction(sclk, 100);
  
        fV_max = fDivide(GetScaledFraction(
-                       getASICProfilingInfo->ulMaxVddc, 1000), ConvertToFraction(4));
-       fT_prod = GetScaledFraction(getASICProfilingInfo->ulBoardCoreTemp, 10);
-       fLKG_Factor = GetScaledFraction(getASICProfilingInfo->ulEvvLkgFactor, 100);
-       fT_FT = GetScaledFraction(getASICProfilingInfo->ulLeakageTemp, 10);
+                                le32_to_cpu(getASICProfilingInfo->ulMaxVddc), 1000), ConvertToFraction(4));
+       fT_prod = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulBoardCoreTemp), 10);
+       fLKG_Factor = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulEvvLkgFactor), 100);
+       fT_FT = GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulLeakageTemp), 10);
        fV_FT = fDivide(GetScaledFraction(
-                       getASICProfilingInfo->ulLeakageVoltage, 1000), ConvertToFraction(4));
+                               le32_to_cpu(getASICProfilingInfo->ulLeakageVoltage), 1000), ConvertToFraction(4));
        fV_min = fDivide(GetScaledFraction(
-                       getASICProfilingInfo->ulMinVddc, 1000), ConvertToFraction(4));
+                                le32_to_cpu(getASICProfilingInfo->ulMinVddc), 1000), ConvertToFraction(4));
  
        /*-----------------------
         * PART 3
        fA_Term = fAdd(fMargin_RO_a, fAdd(fMultiply(fSM_A4, fSclk), fSM_A5));
        fB_Term = fAdd(fAdd(fMultiply(fSM_A2, fSclk), fSM_A6), fMargin_RO_b);
        fC_Term = fAdd(fMargin_RO_c,
-                       fAdd(fMultiply(fSM_A0,fLkg_FT),
+                       fAdd(fMultiply(fSM_A0, fLkg_FT),
                        fAdd(fMultiply(fSM_A1, fMultiply(fLkg_FT, fSclk)),
                        fAdd(fMultiply(fSM_A3, fSclk),
                        fSubtract(fSM_A7, fRO_fused)))));
@@@ -1063,9 -1062,55 +1062,55 @@@ int atomctrl_get_voltage_evv_on_sclk
        get_voltage_info_param_space.ucVoltageMode   =
                ATOM_GET_VOLTAGE_EVV_VOLTAGE;
        get_voltage_info_param_space.usVoltageLevel  =
-               virtual_voltage_Id;
+               cpu_to_le16(virtual_voltage_Id);
        get_voltage_info_param_space.ulSCLKFreq      =
-               sclk;
+               cpu_to_le32(sclk);
+       result = cgs_atom_exec_cmd_table(hwmgr->device,
+                       GetIndexIntoMasterTable(COMMAND, GetVoltageInfo),
+                       &get_voltage_info_param_space);
+       if (0 != result)
+               return result;
+       *voltage = le16_to_cpu(((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2 *)
+                               (&get_voltage_info_param_space))->usVoltageLevel);
+       return result;
+ }
+ /**
+  * atomctrl_get_voltage_evv gets voltage via call to ATOM COMMAND table.
+  * @param hwmgr       input: pointer to hwManager
+  * @param virtual_voltage_id      input: voltage id which match per voltage DPM state: 0xff01, 0xff02.. 0xff08
+  * @param voltage                    output: real voltage level in unit of mv
+  */
+ int atomctrl_get_voltage_evv(struct pp_hwmgr *hwmgr,
+                            uint16_t virtual_voltage_id,
+                            uint16_t *voltage)
+ {
+       int result;
+       int entry_id;
+       GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2 get_voltage_info_param_space;
+       /* search for leakage voltage ID 0xff01 ~ 0xff08 and sckl */
+       for (entry_id = 0; entry_id < hwmgr->dyn_state.vddc_dependency_on_sclk->count; entry_id++) {
+               if (hwmgr->dyn_state.vddc_dependency_on_sclk->entries[entry_id].v == virtual_voltage_id) {
+                       /* found */
+                       break;
+               }
+       }
+       PP_ASSERT_WITH_CODE(entry_id < hwmgr->dyn_state.vddc_dependency_on_sclk->count,
+               "Can't find requested voltage id in vddc_dependency_on_sclk table!",
+               return -EINVAL;
+       );
+       get_voltage_info_param_space.ucVoltageType = VOLTAGE_TYPE_VDDC;
+       get_voltage_info_param_space.ucVoltageMode = ATOM_GET_VOLTAGE_EVV_VOLTAGE;
+       get_voltage_info_param_space.usVoltageLevel = virtual_voltage_id;
+       get_voltage_info_param_space.ulSCLKFreq =
+               cpu_to_le32(hwmgr->dyn_state.vddc_dependency_on_sclk->entries[entry_id].clk);
  
        result = cgs_atom_exec_cmd_table(hwmgr->device,
                        GetIndexIntoMasterTable(COMMAND, GetVoltageInfo),
        if (0 != result)
                return result;
  
-       *voltage = ((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2 *)
-                       (&get_voltage_info_param_space))->usVoltageLevel;
+       *voltage = le16_to_cpu(((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2 *)
+                               (&get_voltage_info_param_space))->usVoltageLevel);
  
        return result;
  }
@@@ -1165,8 -1210,8 +1210,8 @@@ static int asic_internal_ss_get_ss_asig
  
        if (entry_found) {
                ssEntry->speed_spectrum_percentage =
-                       ssInfo->usSpreadSpectrumPercentage;
-               ssEntry->speed_spectrum_rate = ssInfo->usSpreadRateInKhz;
+                       le16_to_cpu(ssInfo->usSpreadSpectrumPercentage);
+               ssEntry->speed_spectrum_rate = le16_to_cpu(ssInfo->usSpreadRateInKhz);
  
                if (((GET_DATA_TABLE_MAJOR_REVISION(table) == 2) &&
                        (GET_DATA_TABLE_MINOR_REVISION(table) >= 2)) ||
@@@ -1222,7 -1267,7 +1267,7 @@@ int atomctrl_read_efuse(void *device, u
        int result;
        READ_EFUSE_VALUE_PARAMETER efuse_param;
  
-       efuse_param.sEfuse.usEfuseIndex = (start_index / 32) * 4;
+       efuse_param.sEfuse.usEfuseIndex = cpu_to_le16((start_index / 32) * 4);
        efuse_param.sEfuse.ucBitShift = (uint8_t)
                        (start_index - ((start_index / 32) * 32));
        efuse_param.sEfuse.ucBitLength  = (uint8_t)
                        GetIndexIntoMasterTable(COMMAND, ReadEfuseValue),
                        &efuse_param);
        if (!result)
-               *efuse = efuse_param.ulEfuseValue & mask;
+               *efuse = le32_to_cpu(efuse_param.ulEfuseValue) & mask;
  
        return result;
  }
  
  int atomctrl_set_ac_timing_ai(struct pp_hwmgr *hwmgr, uint32_t memory_clock,
-                                                               uint8_t level)
+                             uint8_t level)
  {
        DYNAMICE_MEMORY_SETTINGS_PARAMETER_V2_1 memory_clock_parameters;
        int result;
  
-       memory_clock_parameters.asDPMMCReg.ulClock.ulClockFreq = memory_clock & SET_CLOCK_FREQ_MASK;
-       memory_clock_parameters.asDPMMCReg.ulClock.ulComputeClockFlag = ADJUST_MC_SETTING_PARAM;
+       memory_clock_parameters.asDPMMCReg.ulClock.ulClockFreq =
+               cpu_to_le32(memory_clock & SET_CLOCK_FREQ_MASK);
+       memory_clock_parameters.asDPMMCReg.ulClock.ulComputeClockFlag =
+               cpu_to_le32(ADJUST_MC_SETTING_PARAM);
        memory_clock_parameters.asDPMMCReg.ucMclkDPMState = level;
  
        result = cgs_atom_exec_cmd_table
  }
  
  int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type,
 -                              uint32_t sclk, uint16_t virtual_voltage_Id, uint16_t *voltage)
 +                              uint32_t sclk, uint16_t virtual_voltage_Id, uint32_t *voltage)
  {
  
        int result;
  
        get_voltage_info_param_space.ucVoltageType = voltage_type;
        get_voltage_info_param_space.ucVoltageMode = ATOM_GET_VOLTAGE_EVV_VOLTAGE;
-       get_voltage_info_param_space.usVoltageLevel = virtual_voltage_Id;
-       get_voltage_info_param_space.ulSCLKFreq = sclk;
+       get_voltage_info_param_space.usVoltageLevel = cpu_to_le16(virtual_voltage_Id);
+       get_voltage_info_param_space.ulSCLKFreq = cpu_to_le32(sclk);
  
        result = cgs_atom_exec_cmd_table(hwmgr->device,
                        GetIndexIntoMasterTable(COMMAND, GetVoltageInfo),
        if (0 != result)
                return result;
  
-       *voltage = ((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_3 *)(&get_voltage_info_param_space))->ulVoltageLevel;
 -      *voltage = le16_to_cpu(get_voltage_info_param_space.usVoltageLevel);
++      *voltage = le32_to_cpu(((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_3 *)(&get_voltage_info_param_space))->ulVoltageLevel);
  
        return result;
  }
@@@ -1295,15 -1342,19 +1342,19 @@@ int atomctrl_get_smc_sclk_range_table(s
        for (i = 0; i < psmu_info->ucSclkEntryNum; i++) {
                table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
                table->entry[i].ucPostdiv = psmu_info->asSclkFcwRangeEntry[i].ucPostdiv;
-               table->entry[i].usFcw_pcc = psmu_info->asSclkFcwRangeEntry[i].ucFcw_pcc;
-               table->entry[i].usFcw_trans_upper = psmu_info->asSclkFcwRangeEntry[i].ucFcw_trans_upper;
-               table->entry[i].usRcw_trans_lower = psmu_info->asSclkFcwRangeEntry[i].ucRcw_trans_lower;
+               table->entry[i].usFcw_pcc =
+                       le16_to_cpu(psmu_info->asSclkFcwRangeEntry[i].ucFcw_pcc);
+               table->entry[i].usFcw_trans_upper =
+                       le16_to_cpu(psmu_info->asSclkFcwRangeEntry[i].ucFcw_trans_upper);
+               table->entry[i].usRcw_trans_lower =
+                       le16_to_cpu(psmu_info->asSclkFcwRangeEntry[i].ucRcw_trans_lower);
        }
  
        return 0;
  }
  
- int atomctrl_get_avfs_information(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl__avfs_parameters *param)
+ int atomctrl_get_avfs_information(struct pp_hwmgr *hwmgr,
+                                 struct pp_atom_ctrl__avfs_parameters *param)
  {
        ATOM_ASIC_PROFILING_INFO_V3_6 *profile = NULL;
  
        if (!profile)
                return -1;
  
-       param->ulAVFS_meanNsigma_Acontant0 = profile->ulAVFS_meanNsigma_Acontant0;
-       param->ulAVFS_meanNsigma_Acontant1 = profile->ulAVFS_meanNsigma_Acontant1;
-       param->ulAVFS_meanNsigma_Acontant2 = profile->ulAVFS_meanNsigma_Acontant2;
-       param->usAVFS_meanNsigma_DC_tol_sigma = profile->usAVFS_meanNsigma_DC_tol_sigma;
-       param->usAVFS_meanNsigma_Platform_mean = profile->usAVFS_meanNsigma_Platform_mean;
-       param->usAVFS_meanNsigma_Platform_sigma = profile->usAVFS_meanNsigma_Platform_sigma;
-       param->ulGB_VDROOP_TABLE_CKSOFF_a0 = profile->ulGB_VDROOP_TABLE_CKSOFF_a0;
-       param->ulGB_VDROOP_TABLE_CKSOFF_a1 = profile->ulGB_VDROOP_TABLE_CKSOFF_a1;
-       param->ulGB_VDROOP_TABLE_CKSOFF_a2 = profile->ulGB_VDROOP_TABLE_CKSOFF_a2;
-       param->ulGB_VDROOP_TABLE_CKSON_a0 = profile->ulGB_VDROOP_TABLE_CKSON_a0;
-       param->ulGB_VDROOP_TABLE_CKSON_a1 = profile->ulGB_VDROOP_TABLE_CKSON_a1;
-       param->ulGB_VDROOP_TABLE_CKSON_a2 = profile->ulGB_VDROOP_TABLE_CKSON_a2;
-       param->ulAVFSGB_FUSE_TABLE_CKSOFF_m1 = profile->ulAVFSGB_FUSE_TABLE_CKSOFF_m1;
-       param->usAVFSGB_FUSE_TABLE_CKSOFF_m2 = profile->usAVFSGB_FUSE_TABLE_CKSOFF_m2;
-       param->ulAVFSGB_FUSE_TABLE_CKSOFF_b = profile->ulAVFSGB_FUSE_TABLE_CKSOFF_b;
-       param->ulAVFSGB_FUSE_TABLE_CKSON_m1 = profile->ulAVFSGB_FUSE_TABLE_CKSON_m1;
-       param->usAVFSGB_FUSE_TABLE_CKSON_m2 = profile->usAVFSGB_FUSE_TABLE_CKSON_m2;
-       param->ulAVFSGB_FUSE_TABLE_CKSON_b = profile->ulAVFSGB_FUSE_TABLE_CKSON_b;
-       param->usMaxVoltage_0_25mv = profile->usMaxVoltage_0_25mv;
+       param->ulAVFS_meanNsigma_Acontant0 = le32_to_cpu(profile->ulAVFS_meanNsigma_Acontant0);
+       param->ulAVFS_meanNsigma_Acontant1 = le32_to_cpu(profile->ulAVFS_meanNsigma_Acontant1);
+       param->ulAVFS_meanNsigma_Acontant2 = le32_to_cpu(profile->ulAVFS_meanNsigma_Acontant2);
+       param->usAVFS_meanNsigma_DC_tol_sigma = le16_to_cpu(profile->usAVFS_meanNsigma_DC_tol_sigma);
+       param->usAVFS_meanNsigma_Platform_mean = le16_to_cpu(profile->usAVFS_meanNsigma_Platform_mean);
+       param->usAVFS_meanNsigma_Platform_sigma = le16_to_cpu(profile->usAVFS_meanNsigma_Platform_sigma);
+       param->ulGB_VDROOP_TABLE_CKSOFF_a0 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSOFF_a0);
+       param->ulGB_VDROOP_TABLE_CKSOFF_a1 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSOFF_a1);
+       param->ulGB_VDROOP_TABLE_CKSOFF_a2 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSOFF_a2);
+       param->ulGB_VDROOP_TABLE_CKSON_a0 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSON_a0);
+       param->ulGB_VDROOP_TABLE_CKSON_a1 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSON_a1);
+       param->ulGB_VDROOP_TABLE_CKSON_a2 = le32_to_cpu(profile->ulGB_VDROOP_TABLE_CKSON_a2);
+       param->ulAVFSGB_FUSE_TABLE_CKSOFF_m1 = le32_to_cpu(profile->ulAVFSGB_FUSE_TABLE_CKSOFF_m1);
+       param->usAVFSGB_FUSE_TABLE_CKSOFF_m2 = le16_to_cpu(profile->usAVFSGB_FUSE_TABLE_CKSOFF_m2);
+       param->ulAVFSGB_FUSE_TABLE_CKSOFF_b = le32_to_cpu(profile->ulAVFSGB_FUSE_TABLE_CKSOFF_b);
+       param->ulAVFSGB_FUSE_TABLE_CKSON_m1 = le32_to_cpu(profile->ulAVFSGB_FUSE_TABLE_CKSON_m1);
+       param->usAVFSGB_FUSE_TABLE_CKSON_m2 = le16_to_cpu(profile->usAVFSGB_FUSE_TABLE_CKSON_m2);
+       param->ulAVFSGB_FUSE_TABLE_CKSON_b = le32_to_cpu(profile->ulAVFSGB_FUSE_TABLE_CKSON_b);
+       param->usMaxVoltage_0_25mv = le16_to_cpu(profile->usMaxVoltage_0_25mv);
        param->ucEnableGB_VDROOP_TABLE_CKSOFF = profile->ucEnableGB_VDROOP_TABLE_CKSOFF;
        param->ucEnableGB_VDROOP_TABLE_CKSON = profile->ucEnableGB_VDROOP_TABLE_CKSON;
        param->ucEnableGB_FUSE_TABLE_CKSOFF = profile->ucEnableGB_FUSE_TABLE_CKSOFF;
        param->ucEnableGB_FUSE_TABLE_CKSON = profile->ucEnableGB_FUSE_TABLE_CKSON;
-       param->usPSM_Age_ComFactor = profile->usPSM_Age_ComFactor;
+       param->usPSM_Age_ComFactor = le16_to_cpu(profile->usPSM_Age_ComFactor);
        param->ucEnableApplyAVFS_CKS_OFF_Voltage = profile->ucEnableApplyAVFS_CKS_OFF_Voltage;
  
        return 0;
index 1e35a9625baf913ab8733604ad3a67a4e86ee2e4,3300623966e88c5050923fb95bdb9212547446b1..fc898afce002fe1c681effcb5ef603de854c2745
@@@ -281,6 -281,7 +281,7 @@@ struct pp_atom_ctrl__avfs_parameters 
  
  extern bool atomctrl_get_pp_assign_pin(struct pp_hwmgr *hwmgr, const uint32_t pinId, pp_atomctrl_gpio_pin_assignment *gpio_pin_assignment);
  extern int atomctrl_get_voltage_evv_on_sclk(struct pp_hwmgr *hwmgr, uint8_t voltage_type, uint32_t sclk, uint16_t virtual_voltage_Id, uint16_t *voltage);
+ extern int atomctrl_get_voltage_evv(struct pp_hwmgr *hwmgr, uint16_t virtual_voltage_id, uint16_t *voltage);
  extern uint32_t atomctrl_get_mpll_reference_clock(struct pp_hwmgr *hwmgr);
  extern int atomctrl_get_memory_clock_spread_spectrum(struct pp_hwmgr *hwmgr, const uint32_t memory_clock, pp_atomctrl_internal_ss_info *ssInfo);
  extern int atomctrl_get_engine_clock_spread_spectrum(struct pp_hwmgr *hwmgr, const uint32_t engine_clock, pp_atomctrl_internal_ss_info *ssInfo);
@@@ -305,7 -306,7 +306,7 @@@ extern int atomctrl_get_engine_pll_divi
  extern int atomctrl_set_ac_timing_ai(struct pp_hwmgr *hwmgr, uint32_t memory_clock,
                                                                uint8_t level);
  extern int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type,
 -                              uint32_t sclk, uint16_t virtual_voltage_Id, uint16_t *voltage);
 +                              uint32_t sclk, uint16_t virtual_voltage_Id, uint32_t *voltage);
  extern int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl_sclk_range_table *table);
  
  extern int atomctrl_get_avfs_information(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl__avfs_parameters *param);