drm/amdgpu/powerplay: enable LEDs on Fiji boards
Subsystems (2)
PATCH 1/1 drm/amdgpu/powerplay: enable LEDs on Fiji boards
This enables the LEDs that light up based on DPM states on some Fiji boards.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=97590
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h | 1 + drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 34 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h +1 -0
@@ -377,6 +377,7 @@ typedef uint16_t PPSMC_Result;#define PPSMC_MSG_DisableAvfs ((uint16_t) 0x26B)#define PPSMC_MSG_PerformBtc ((uint16_t) 0x26C) +#define PPSMC_MSG_LedConfig ((uint16_t) 0x274)#define PPSMC_MSG_VftTableIsValid ((uint16_t) 0x275)#define PPSMC_MSG_UseNewGPIOScheme ((uint16_t) 0x277)#define PPSMC_MSG_GetEnabledPsm ((uint16_t) 0x400)
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +34 -0
@@ -1721,6 +1721,35 @@ static int fiji_init_arb_table_index(struct pp_smumgr *smumgr) smu_data->smu7_data.arb_table_start, tmp, SMC_RAM_END); } +static int fiji_setup_dpm_led_config (struct pp_hwmgr *hwmgr) +{ +pp_atomctrl_voltage_table param_led_dpm; +int result =0 ; +u32 mask =0 ; + + result =atomctrl_get_voltage_table_v3 (hwmgr, +VOLTAGE_TYPE_LEDDPM ,VOLTAGE_OBJ_GPIO_LUT , + ¶m_led_dpm); +if (result ==0 ) { +int i, j; +u32 tmp = param_led_dpm.mask_low; + +for (i =0 , j =0 ; i <32 ; i++) { +if (tmp &1 ) { + mask |= (i << (8 * j)); +if (++j >=3 ) +break ; + } + tmp >>=1 ; + } + } +if (mask) +smum_send_msg_to_smc_with_parameter (hwmgr->smumgr, + PPSMC_MSG_LedConfig, + mask); +return 0 ; +} +/** * Initializes the SMC table and uploads it *
@@ -1934,6 +1963,11 @@ int fiji_init_smc_table(struct pp_hwmgr *hwmgr) result =fiji_populate_pm_fuses (hwmgr);PP_ASSERT_WITH_CODE (0 == result, "Failed to populate PM fuses to SMC memory!", return result); + + result =fiji_setup_dpm_led_config (hwmgr); +PP_ASSERT_WITH_CODE (0 == result, + "Failed to setup dpm led config", return result); +return 0 ; }
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1487780555-17446-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Huang Rui
Reviewed-byQuoted 7 lines · Alex Deucher
This enables the LEDs that light up based on DPM states on some Fiji boards.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=97590Signed-off-by Alex Deucher <[email protected]>
Reviewed-by Huang Rui <[email protected]>
Quoted 76 lines
--- drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h | 1 + drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 34 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+)drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h +1
-0@@ -377,6 +377,7 @@ typedef uint16_t PPSMC_Result;#define PPSMC_MSG_DisableAvfs ((uint16_t) 0x26B)#define PPSMC_MSG_PerformBtc ((uint16_t) 0x26C) +#define PPSMC_MSG_LedConfig ((uint16_t) 0x274)#define PPSMC_MSG_VftTableIsValid ((uint16_t) 0x275)#define PPSMC_MSG_UseNewGPIOScheme ((uint16_t) 0x277)#define PPSMC_MSG_GetEnabledPsm ((uint16_t) 0x400)drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +34
-0@@ -1721,6 +1721,35 @@ static int fiji_init_arb_table_index(struct pp_smumgr *smumgr) smu_data->smu7_data.arb_table_start, tmp, SMC_RAM_END); } +static int fiji_setup_dpm_led_config (struct pp_hwmgr *hwmgr) +{ +pp_atomctrl_voltage_table param_led_dpm; +int result =0 ; +u32 mask =0 ; + + result =atomctrl_get_voltage_table_v3 (hwmgr, +VOLTAGE_TYPE_LEDDPM ,VOLTAGE_OBJ_GPIO_LUT , + ¶m_led_dpm); +if (result ==0 ) { +int i, j; +u32 tmp = param_led_dpm.mask_low; + +for (i =0 , j =0 ; i <32 ; i++) { +if (tmp &1 ) { + mask |= (i << (8 * j)); +if (++j >=3 ) +break ; + } + tmp >>=1 ; + } + } +if (mask) +smum_send_msg_to_smc_with_parameter (hwmgr->smumgr, + PPSMC_MSG_LedConfig, + mask); +return 0 ; +} +/** * Initializes the SMC table and uploads it * @@ -1934,6 +1963,11 @@ int fiji_init_smc_table(struct pp_hwmgr *hwmgr) result =fiji_populate_pm_fuses (hwmgr);PP_ASSERT_WITH_CODE (0 == result, "Failed to populate PM fuses to SMC memory!", return result); + + result =fiji_setup_dpm_led_config (hwmgr); +PP_ASSERT_WITH_CODE (0 == result, + "Failed to setup dpm led config", return result); +return 0 ; }Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx