drm/amdgpu: Update PSP interface header
Subsystems (3)
PATCH v2 1/3 drm/amdgpu: Update PSP interface header
Adds FW id for P2S table.
--- drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +1 -0
@@ -296,6 +296,7 @@ enum psp_gfx_fw_type {GFX_FW_TYPE_VPEC_FW1 =100 ,/* VPEC FW1 To Save VPE */ GFX_FW_TYPE_VPEC_FW2 =101 ,/* VPEC FW2 To Save VPE */ GFX_FW_TYPE_VPE =102 , +GFX_FW_TYPE_P2S_TABLE =129 , GFX_FW_TYPE_MAX };
Signature · 1 line
2.25.1
PATCH v2 2/3 drm/amdgpu: Add support to load P2S tables
Add support to load P2S tables through PSP.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 27 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 6 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 3 files changed, 34 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +27 -0
@@ -2412,6 +2412,9 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_UMSCH_MM_CMD_BUFFER : *type =GFX_FW_TYPE_UMSCH_CMD_BUFFER ;break ; +case AMDGPU_UCODE_ID_P2S_TABLE : + *type =GFX_FW_TYPE_P2S_TABLE ; +break ;case AMDGPU_UCODE_ID_MAXIMUM :default :return -EINVAL ;
@@ -2503,6 +2506,24 @@ int psp_execute_ip_fw_load(struct psp_context *psp,return ret; } +static int psp_load_p2s_table (struct psp_context *psp) +{ +int ret; +struct amdgpu_device *adev = psp->adev; +struct amdgpu_firmware_info *ucode = + &adev->firmware.ucode[AMDGPU_UCODE_ID_P2S_TABLE ]; + +if (adev->in_runpm && (adev->pm.rpm_mode ==AMDGPU_RUNPM_BACO )) +return 0 ; + +if (!ucode->fw ||amdgpu_sriov_vf (psp->adev)) +return 0 ; + + ret =psp_execute_ip_fw_load (psp, ucode); + +return ret; +} +static int psp_load_smu_fw (struct psp_context *psp) {int ret;
@@ -2543,6 +2564,9 @@ static bool fw_load_skip_check(struct psp_context *psp,if (!ucode->fw || !ucode->ucode_size)return true; +if (ucode->ucode_id ==AMDGPU_UCODE_ID_P2S_TABLE ) +return true; + if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC && (psp_smu_reload_quirk(psp) || psp->autoload_supported ||
@@ -2591,6 +2615,9 @@ static int psp_load_non_psp_fw(struct psp_context *psp)return ret; } +/* Load P2S table first if it's available */ +psp_load_p2s_table (psp); +for (i =0 ; i < adev->firmware.max_ucodes; i++) { ucode = &adev->firmware.ucode[i];
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +6 -0
@@ -642,6 +642,8 @@ const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id)return "SMC" ;case AMDGPU_UCODE_ID_PPTABLE :return "PPTABLE" ; +case AMDGPU_UCODE_ID_P2S_TABLE : +return "P2STABLE" ;case AMDGPU_UCODE_ID_UVD :return "UVD" ;case AMDGPU_UCODE_ID_UVD1 :
@@ -922,6 +924,10 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, ucode->ucode_size = ucode->fw->size; ucode_addr = (u8 *)ucode->fw->data;break ; +case AMDGPU_UCODE_ID_P2S_TABLE : + ucode->ucode_size = ucode->fw->size; + ucode_addr = (u8 *)ucode->fw->data; +break ;case AMDGPU_UCODE_ID_IMU_I : ucode->ucode_size =le32_to_cpu (imu_hdr->imu_iram_ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
@@ -510,6 +510,7 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_UMSCH_MM_UCODE ,AMDGPU_UCODE_ID_UMSCH_MM_DATA ,AMDGPU_UCODE_ID_UMSCH_MM_CMD_BUFFER , +AMDGPU_UCODE_ID_P2S_TABLE , AMDGPU_UCODE_ID_MAXIMUM, };
Signature · 1 line
2.25.1
PATCH v2 3/3 drm/amd/pm: Add P2S tables for SMU v13.0.6
In reply to Lijo LazarAdd P2S table load support on SMU v13.0.6 ASICs.
---
v2: Fixed MP0 IP version check (Hawking)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 ++ .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71 +++++++++++++++++++ 2 files changed, 78 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -0
@@ -2516,6 +2516,13 @@ static int psp_load_p2s_table(struct psp_context *psp)if (adev->in_runpm && (adev->pm.rpm_mode ==AMDGPU_RUNPM_BACO ))return 0 ; +if (amdgpu_ip_version (adev,MP0_HWIP ,0 ) ==IP_VERSION (13 ,0 ,6 )) { +uint32_t supp_vers = adev->flags &AMD_IS_APU ?0x0036013D : +0x0036003C ; +if (psp->sos.fw_version < supp_vers) +return 0 ; + } +if (!ucode->fw ||amdgpu_sriov_vf (psp->adev))return 0 ;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +71 -0
95 lines not on this page · raw message
Signature · 1 line
2.25.1
RE: [PATCH v2 3/3] drm/amd/pm: Add P2S tables for SMU v13.0.6
[AMD Official Use Only - General]
Series is
Regards,
Hawking
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Thursday, October 12, 2023 12:58
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [PATCH v2 3/3] drm/amd/pm: Add P2S tables for SMU v13.0.6
Add P2S table load support on SMU v13.0.6 ASICs.
---
v2: Fixed MP0 IP version check (Hawking)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 ++ .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71 +++++++++++++++++++ 2 files changed, 78 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -0
@@ -2516,6 +2516,13 @@ static int psp_load_p2s_table(struct psp_context *psp)if (adev->in_runpm && (adev->pm.rpm_mode ==AMDGPU_RUNPM_BACO ))return 0 ; +if (amdgpu_ip_version (adev,MP0_HWIP ,0 ) ==IP_VERSION (13 ,0 ,6 )) { +uint32_t supp_vers = adev->flags &AMD_IS_APU ?0x0036013D : +0x0036003C ; +if (psp->sos.fw_version < supp_vers) +return 0 ; + } +if (!ucode->fw ||amdgpu_sriov_vf (psp->adev))return 0 ;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +68 -0
85 lines not on this page · raw message
.is_dpm_running = smu_v13_0_6_is_dpm_running,
.get_unique_id = smu_v13_0_6_get_unique_id,
+ .init_microcode = smu_v13_0_6_init_microcode,
+ .fini_microcode = smu_v13_0_fini_microcode,
.init_smc_tables = smu_v13_0_6_init_smc_tables,
.fini_smc_tables = smu_v13_0_fini_smc_tables,
.init_power = smu_v13_0_init_power,--
2.25.1
[AMD Official Use Only - General]
Series is.
Best Regards,
Kevin
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Thursday, October 12, 2023 12:58 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH v2 1/3] drm/amdgpu: Update PSP interface header
Adds FW id for P2S table.
--- drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +1 -0
@@ -296,6 +296,7 @@ enum psp_gfx_fw_type {GFX_FW_TYPE_VPEC_FW1 =100 ,/* VPEC FW1 To Save VPE */ GFX_FW_TYPE_VPEC_FW2 =101 ,/* VPEC FW2 To Save VPE */ GFX_FW_TYPE_VPE =102 , +GFX_FW_TYPE_P2S_TABLE =129 , GFX_FW_TYPE_MAX };
--
2.25.1