drm/amd/pm: correct the gpo control for sienna cichlid
Subsystems (3)
PATCH 1/5 drm/amd/pm: correct the gpo control for sienna cichlid
New SMC message was introduced for gpo control on sienna cichlid.
--- drivers/gpu/drm/amd/pm/inc/smu_types.h | 1 + .../gpu/drm/amd/pm/inc/smu_v11_0_7_ppsmc.h | 4 +- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 42 ++++++++++++++----- 3 files changed, 36 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/inc/smu_types.h +1 -0
@@ -209,6 +209,7 @@__SMU_DUMMY_MAP (SetSoftMinCclk), \__SMU_DUMMY_MAP (SetSoftMaxCclk), \__SMU_DUMMY_MAP (SetGpoFeaturePMask), \ +__SMU_DUMMY_MAP (DisallowGpo), \ #undef __SMU_DUMMY_MAP#define __SMU_DUMMY_MAP (type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/inc/smu_v11_0_7_ppsmc.h +3 -1
@@ -134,6 +134,8 @@#define PPSMC_MSG_SetGpoFeaturePMask 0x45#define PPSMC_MSG_SetSMBUSInterrupt 0x46 -#define PPSMC_Message_Count 0x47 +#define PPSMC_MSG_DisallowGpo 0x56 + +#define PPSMC_Message_Count 0x58#endif
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +32 -10
57 lines not on this page · raw message
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/5 drm/amd/pm: expose the firmware_capability from firmware_info table
That will help to determine whether 2ND_USB20_PORT workaround is needed for Sienna Cichlid.
--- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +1 -0
@@ -227,6 +227,7 @@ struct smu_bios_boot_up_valuesuint32_t content_revision;uint32_t fclk;uint32_t lclk; +uint32_t firmware_caps; };enum smu_table_id
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -0
@@ -554,6 +554,7 @@ int smu_v11_0_get_vbios_bootup_values(struct smu_context *smu) smu->smu_table.boot_values.vdd_gfx = v_3_1->bootup_vddgfx_mv; smu->smu_table.boot_values.cooling_id = v_3_1->coolingsolution_id; smu->smu_table.boot_values.pp_table_id =0 ; + smu->smu_table.boot_values.firmware_caps = v_3_1->firmware_capability;break ;case 3 :default :
@@ -569,6 +570,7 @@ int smu_v11_0_get_vbios_bootup_values(struct smu_context *smu) smu->smu_table.boot_values.vdd_gfx = v_3_3->bootup_vddgfx_mv; smu->smu_table.boot_values.cooling_id = v_3_3->coolingsolution_id; smu->smu_table.boot_values.pp_table_id = v_3_3->pplib_pptable_id; + smu->smu_table.boot_values.firmware_caps = v_3_3->firmware_capability; } smu->smu_table.boot_values.format_revision = header->format_revision;
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/5 drm/amdgpu: new macro for determining 2ND_USB20PORT support
In reply to Evan QuanUsed for determining 2ND_USB20PORT support from firmware_capability.
--- drivers/gpu/drm/amd/include/atomfirmware.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/include/atomfirmware.h +1 -0
@@ -499,6 +499,7 @@ enum atombios_firmware_capabilityATOM_FIRMWARE_CAP_HWEMU_UMC_CFG =0x00000100 ,ATOM_FIRMWARE_CAP_SRAM_ECC =0x00000200 ,ATOM_FIRMWARE_CAP_ENABLE_2STAGE_BIST_TRAINING =0x00000400 , + ATOM_FIRMWARE_CAP_ENABLE_2ND_USB20PORT = 0x0008000, }; enum atom_cooling_solution_id{
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/5 drm/amd/pm: new SMC message for 2nd usb2.0 port workaround
In reply to Evan QuanThe workaround is needed by sienna cichlid.
--- drivers/gpu/drm/amd/pm/inc/smu_types.h | 1 + drivers/gpu/drm/amd/pm/inc/smu_v11_0_7_ppsmc.h | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 1 + 3 files changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/inc/smu_types.h +1 -0
@@ -210,6 +210,7 @@__SMU_DUMMY_MAP (SetSoftMaxCclk), \__SMU_DUMMY_MAP (SetGpoFeaturePMask), \__SMU_DUMMY_MAP (DisallowGpo), \ +__SMU_DUMMY_MAP (Enable2ndUSB20Port), \ #undef __SMU_DUMMY_MAP#define __SMU_DUMMY_MAP (type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/inc/smu_v11_0_7_ppsmc.h +2 -0
@@ -136,6 +136,8 @@#define PPSMC_MSG_DisallowGpo 0x56 +#define PPSMC_MSG_Enable2ndUSB20Port 0x57 +#define PPSMC_Message_Count 0x58#endif
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1 -0
@@ -129,6 +129,7 @@ static struct cmn2asic_msg_mapping sienna_cichlid_message_map[SMU_MSG_MAX_COUNT]MSG_MAP (SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm,0 ),MSG_MAP (SetGpoFeaturePMask, PPSMC_MSG_SetGpoFeaturePMask,0 ),MSG_MAP (DisallowGpo, PPSMC_MSG_DisallowGpo,0 ), + MSG_MAP(Enable2ndUSB20Port, PPSMC_MSG_Enable2ndUSB20Port, 0), }; static struct cmn2asic_mapping sienna_cichlid_clk_map[SMU_CLK_COUNT] = {
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/5 drm/amd/pm: fulfill sienna cichlid 2nd usb2.0 port workaround
In reply to Evan QuanFulfill the 2nd usb2.0 port workaround for sienna cichlid.
--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +37 -1
@@ -3247,6 +3247,42 @@ static int sienna_cichlid_gpo_control(struct smu_context *smu,return ret; } + +static int sienna_cichlid_notify_2nd_usb20_port (struct smu_context *smu) +{ +uint32_t smu_version; +int ret =0 ; + + ret =smu_cmn_get_smc_version (smu,NULL , &smu_version); +if (ret) +return ret; + +/* +* Message SMU_MSG_Enable2ndUSB20Port is supported by 58.45 +* onwards PMFWs. +*/ +if (smu_version <0x003A2D00 ) +return 0 ; + +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_Enable2ndUSB20Port, + smu->smu_table.boot_values.firmware_caps &ATOM_FIRMWARE_CAP_ENABLE_2ND_USB20PORT ? +1 :0 , +NULL ); +} + +static int sienna_cichlid_system_features_control (struct smu_context *smu, +bool en) +{ +int ret =0 ; + + ret =sienna_cichlid_notify_2nd_usb20_port (smu); +if (ret) +return ret; + +return smu_v11_0_system_features_control (smu, en); +} +static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .get_allowed_feature_mask = sienna_cichlid_get_allowed_feature_mask, .set_default_dpm_table = sienna_cichlid_set_default_dpm_table,
@@ -3287,7 +3323,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .set_driver_table_location = smu_v11_0_set_driver_table_location, .set_tool_table_location = smu_v11_0_set_tool_table_location, .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location, - .system_features_control = smu_v11_0_system_features_control, + .system_features_control = sienna_cichlid_system_features_control, .send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param, .send_smc_msg = smu_cmn_send_smc_msg, .init_display_count = NULL,
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 5/5] drm/amd/pm: fulfill sienna cichlid 2nd usb2.0 port workaround
[AMD Public Use]
Nitpick - you may want to send the message only during enable workflow. Apart from that,
Series is Reviewed-by: Lijo Lazar <[email protected]>
-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Wednesday, December 9, 2020 9:49 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH 5/5] drm/amd/pm: fulfill sienna cichlid 2nd usb2.0 port workaround
Fulfill the 2nd usb2.0 port workaround for sienna cichlid.
--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +36 -1
@@ -3247,6 +3247,42 @@ static int sienna_cichlid_gpo_control(struct smu_context *smu,return ret; } + +static int sienna_cichlid_notify_2nd_usb20_port (struct smu_context +*smu) { +uint32_t smu_version; +int ret =0 ; + + ret =smu_cmn_get_smc_version (smu,NULL , &smu_version); +if (ret) +return ret; + +/* +* Message SMU_MSG_Enable2ndUSB20Port is supported by 58.45 +* onwards PMFWs. +*/ +if (smu_version <0x003A2D00 ) +return 0 ; + +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_Enable2ndUSB20Port, + smu->smu_table.boot_values.firmware_caps &ATOM_FIRMWARE_CAP_ENABLE_2ND_USB20PORT ? +1 :0 , +NULL ); +} + +static int sienna_cichlid_system_features_control (struct smu_context *smu, +bool en) +{ +int ret =0 ; + + ret =sienna_cichlid_notify_2nd_usb20_port (smu); +if (ret) +return ret; + +return smu_v11_0_system_features_control (smu, en); } +static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .get_allowed_feature_mask = sienna_cichlid_get_allowed_feature_mask, .set_default_dpm_table = sienna_cichlid_set_default_dpm_table,
@@ -3287,7 +3323,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .set_driver_table_location = smu_v11_0_set_driver_table_location, .set_tool_table_location = smu_v11_0_set_tool_table_location, .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location, - .system_features_control = smu_v11_0_system_features_control, + .system_features_control = sienna_cichlid_system_features_control, .send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param, .send_smc_msg = smu_cmn_send_smc_msg, .init_display_count = NULL,
--
2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 5/5] drm/amd/pm: fulfill sienna cichlid 2nd usb2.0 port workaround
In reply to Evan Quan[AMD Official Use Only - Internal Distribution Only]
Hi Evan,
Besides Navi21, other Navi2x Asics reuse sienna_cichlid_ppt.c and the callbacks, have you taken their user cases into consideration? Thanks!
Regards,
Jiansong
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Wednesday, December 9, 2020 12:19 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH 5/5] drm/amd/pm: fulfill sienna cichlid 2nd usb2.0 port workaround
Fulfill the 2nd usb2.0 port workaround for sienna cichlid.
--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +36 -1
@@ -3247,6 +3247,42 @@ static int sienna_cichlid_gpo_control(struct smu_context *smu,return ret; } + +static int sienna_cichlid_notify_2nd_usb20_port (struct smu_context +*smu) { +uint32_t smu_version; +int ret =0 ; + +ret =smu_cmn_get_smc_version (smu,NULL , &smu_version); +if (ret) +return ret; + +/* +* Message SMU_MSG_Enable2ndUSB20Port is supported by 58.45 +* onwards PMFWs. +*/ +if (smu_version <0x003A2D00 ) +return 0 ; + +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_Enable2ndUSB20Port, + smu->smu_table.boot_values.firmware_caps &ATOM_FIRMWARE_CAP_ENABLE_2ND_USB20PORT ? +1 :0 , +NULL ); +} + +static int sienna_cichlid_system_features_control (struct smu_context *smu, +bool en) +{ +int ret =0 ; + +ret =sienna_cichlid_notify_2nd_usb20_port (smu); +if (ret) +return ret; + +return smu_v11_0_system_features_control (smu, en); } +static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .get_allowed_feature_mask = sienna_cichlid_get_allowed_feature_mask, .set_default_dpm_table = sienna_cichlid_set_default_dpm_table,
@@ -3287,7 +3323,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .set_driver_table_location = smu_v11_0_set_driver_table_location, .set_tool_table_location = smu_v11_0_set_tool_table_location, .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location, -.system_features_control = smu_v11_0_system_features_control, +.system_features_control = sienna_cichlid_system_features_control, .send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param, .send_smc_msg = smu_cmn_send_smc_msg, .init_display_count = NULL,
--
2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJiansong.Chen%40amd.com%7Ca41215f008134335e07908d89bf9976d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637430843582059660%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ymwXfGcmzTVSEU4k83ePinKcXk4ExzkWxiMAZlH5u30%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx