drm/amdgpu: removed duplicate line
Subsystems (2)
PATCH 1/7 drm/amdgpu: removed duplicate line
From: John Clements <[email protected]>
Remove duplicate break.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
@@ -1330,7 +1330,6 @@ static int gfx_v9_0_init_microcode(struct amdgpu_device *adev)else chip_name ="raven" ;break ; -break ;case CHIP_ARCTURUS : chip_name ="arcturus" ;break ;
Signature · 6 lines
2.20.1 _______________________________________________ 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): 20190801195044.10331-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/7 drm/amdgpu: add PSP SW init support for Arcturus
From: John Clements <[email protected]>
Add arcturus cases to psp init sewquence.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 1 + drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 3 +++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
@@ -53,6 +53,7 @@ static int psp_early_init(void *handle) psp->autoload_supported = false;break ;case CHIP_VEGA20 : +case CHIP_ARCTURUS :psp_v11_0_set_psp_funcs (psp); psp->autoload_supported = false;break ;
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +3 -0
@@ -43,6 +43,8 @@ MODULE_FIRMWARE("amdgpu/navi10_sos.bin");MODULE_FIRMWARE ("amdgpu/navi10_asd.bin" );MODULE_FIRMWARE ("amdgpu/navi14_sos.bin" );MODULE_FIRMWARE ("amdgpu/navi14_asd.bin" ); +MODULE_FIRMWARE ("amdgpu/arcturus_sos.bin" ); +MODULE_FIRMWARE ("amdgpu/arcturus_asd.bin" );/* address block */ #define smnMP1_FIRMWARE_FLAGS 0x3010024
@@ -162,6 +164,7 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)break ;case CHIP_NAVI10 :case CHIP_NAVI14 : +case CHIP_ARCTURUS :break ;default :BUG ();
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amdgpu: add PSP KDB loading support for Arcturus
In reply to a message not in the archiveFrom: John Clements <[email protected]>
Add support for the arcturus specific psp metadata to the amdgpu firmware and properly parse it when loading it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 9 +++++++++ drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 10 ++++++++++ 3 files changed, 29 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +10 -0
@@ -269,6 +269,16 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)DRM_DEBUG ("kdb_size_bytes: %u\n" ,le32_to_cpu (psp_hdr_v1_1->kdb_size_bytes)); } +if (version_minor ==2 ) { +const struct psp_firmware_header_v1_2 *psp_hdr_v1_2 = + container_of(psp_hdr, struct psp_firmware_header_v1_2, v1_0); +DRM_DEBUG ("kdb_header_version: %u\n" , +le32_to_cpu (psp_hdr_v1_2->kdb_header_version)); +DRM_DEBUG ("kdb_offset_bytes: %u\n" , +le32_to_cpu (psp_hdr_v1_2->kdb_offset_bytes)); +DRM_DEBUG ("kdb_size_bytes: %u\n" , +le32_to_cpu (psp_hdr_v1_2->kdb_size_bytes)); + } }else {DRM_ERROR ("Unknown PSP ucode version: %u.%u\n" , version_major, version_minor);
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +9 -0
@@ -90,6 +90,15 @@ struct psp_firmware_header_v1_1 {uint32_t kdb_size_bytes; }; +/* version_major=1, version_minor=2 */ +struct psp_firmware_header_v1_2 { +struct psp_firmware_header_v1_0 v1_0; +uint32_t reserve[3 ]; +uint32_t kdb_header_version; +uint32_t kdb_offset_bytes; +uint32_t kdb_size_bytes; +}; +/* version_major=1, version_minor=0 */ struct ta_firmware_header_v1_0 {struct common_firmware_header header;
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +10 -0
@@ -62,6 +62,7 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)int err =0 ;const struct psp_firmware_header_v1_0 *sos_hdr;const struct psp_firmware_header_v1_1 *sos_hdr_v1_1; +const struct psp_firmware_header_v1_2 *sos_hdr_v1_2;const struct psp_firmware_header_v1_0 *asd_hdr;const struct ta_firmware_header_v1_0 *ta_hdr;
@@ -77,6 +78,9 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)case CHIP_NAVI14 : chip_name ="navi14" ;break ; +case CHIP_ARCTURUS : + chip_name ="arcturus" ; +break ;default :BUG (); }
@@ -112,6 +116,12 @@ static int psp_v11_0_init_microcode(struct psp_context *psp) adev->psp.kdb_start_addr = (uint8_t *)adev->psp.sys_start_addr +le32_to_cpu (sos_hdr_v1_1->kdb_offset_bytes); } +if (sos_hdr->header.header_version_minor ==2 ) { + sos_hdr_v1_2 = (const struct psp_firmware_header_v1_2 *)adev->psp.sos_fw->data; + adev->psp.kdb_bin_size =le32_to_cpu (sos_hdr_v1_2->kdb_size_bytes); + adev->psp.kdb_start_addr = (uint8_t *)adev->psp.sys_start_addr + +le32_to_cpu (sos_hdr_v1_2->kdb_offset_bytes); + }break ;default : dev_err(adev->dev,
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amdgpu: update PSP CMD fail response status print
In reply to a message not in the archiveFrom: John Clements <[email protected]>
Print the response in hex with the apprpriate mask.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -2
@@ -164,8 +164,8 @@ psp_cmd_submit_buf(struct psp_context *psp,if (ucode)DRM_WARN ("failed to load ucode id (%d) " , ucode->ucode_id); -DRM_WARN ("psp command failed and response status is (%d)\n" , - psp->cmd_buf_mem->resp.status); +DRM_WARN ("psp command failed and response status is (0x%X)\n" , + psp->cmd_buf_mem->resp.status &GFX_CMD_STATUS_MASK );if (!timeout) {mutex_unlock (&psp->mutex);return -EINVAL ;
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amdgpu: disable MEC2 JT context init for Arcturus
In reply to a message not in the archiveFrom: John Clements <[email protected]>
We don't need to handle it like other asics.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11 -5
@@ -1282,11 +1282,17 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev, cp_hdr = (const struct gfx_firmware_header_v1_0 *)info->fw->data; adev->firmware.fw_size +=ALIGN (le32_to_cpu (header->ucode_size_bytes) -le32_to_cpu (cp_hdr->jt_size) *4 ,PAGE_SIZE ); - info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2_JT ]; - info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2_JT ; - info->fw = adev->gfx.mec2_fw; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (cp_hdr->jt_size) *4 ,PAGE_SIZE ); + +/* TODO: Determine if MEC2 JT FW loading can be removed +for all GFX V9 asic and above */ +if (adev->asic_type !=CHIP_ARCTURUS ) { + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2_JT ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2_JT ; + info->fw = adev->gfx.mec2_fw; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (cp_hdr->jt_size) *4 , +PAGE_SIZE ); + } } }
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amdgpu: extend PSP FW loading support to 8 SDMA instances
In reply to a message not in the archiveFrom: John Clements <[email protected]>
Arcturus has 8 instances of SDMA. Update host to PSP interface to handle it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 27 ++++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 6 +++++ drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h | 11 +++++++-- 3 files changed, 41 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +26 -1
@@ -833,7 +833,6 @@ static int psp_hw_start(struct psp_context *psp) "XGMI: Failed to initialize XGMI session\n"); } -if (psp->adev->psp.ta_fw) { ret =psp_ras_initialize (psp);if (ret)
@@ -854,6 +853,24 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_SDMA1 : *type =GFX_FW_TYPE_SDMA1 ;break ; +case AMDGPU_UCODE_ID_SDMA2 : + *type =GFX_FW_TYPE_SDMA2 ; +break ; +case AMDGPU_UCODE_ID_SDMA3 : + *type =GFX_FW_TYPE_SDMA3 ; +break ; +case AMDGPU_UCODE_ID_SDMA4 : + *type =GFX_FW_TYPE_SDMA4 ; +break ; +case AMDGPU_UCODE_ID_SDMA5 : + *type =GFX_FW_TYPE_SDMA5 ; +break ; +case AMDGPU_UCODE_ID_SDMA6 : + *type =GFX_FW_TYPE_SDMA6 ; +break ; +case AMDGPU_UCODE_ID_SDMA7 : + *type =GFX_FW_TYPE_SDMA7 ; +break ;case AMDGPU_UCODE_ID_CP_CE : *type =GFX_FW_TYPE_CP_CE ;break ;
@@ -982,12 +999,20 @@ static int psp_np_fw_load(struct psp_context *psp)if (ucode->ucode_id ==AMDGPU_UCODE_ID_SMC && (psp_smu_reload_quirk (psp) || psp->autoload_supported))continue ; +if (amdgpu_sriov_vf (adev) && (ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA0 || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA1 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA2 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA3 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA4 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA5 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA6 + || ucode->ucode_id ==AMDGPU_UCODE_ID_SDMA7 || ucode->ucode_id ==AMDGPU_UCODE_ID_RLC_G ))/*skip ucode loading in SRIOV VF */ continue ; +if (psp->autoload_supported && (ucode->ucode_id ==AMDGPU_UCODE_ID_CP_MEC1_JT || ucode->ucode_id ==AMDGPU_UCODE_ID_CP_MEC2_JT ))
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +6 -0
@@ -271,6 +271,12 @@ union amdgpu_firmware_header {enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_SDMA0 =0 ,AMDGPU_UCODE_ID_SDMA1 , +AMDGPU_UCODE_ID_SDMA2 , +AMDGPU_UCODE_ID_SDMA3 , +AMDGPU_UCODE_ID_SDMA4 , +AMDGPU_UCODE_ID_SDMA5 , +AMDGPU_UCODE_ID_SDMA6 , +AMDGPU_UCODE_ID_SDMA7 ,AMDGPU_UCODE_ID_CP_CE ,AMDGPU_UCODE_ID_CP_PFP ,AMDGPU_UCODE_ID_CP_ME ,
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +9 -2
@@ -233,8 +233,15 @@ enum psp_gfx_fw_type {GFX_FW_TYPE_RLCP_CAM =46 ,/* RLCP CAM NV */ GFX_FW_TYPE_RLC_SPP_CAM_EXT =47 ,/* RLC SPP CAM EXT NV */ GFX_FW_TYPE_RLX6_DRAM_BOOT =48 ,/* RLX6 DRAM BOOT NV */ -GFX_FW_TYPE_VCN0_RAM =49 ,/* VCN_RAM NV */ -GFX_FW_TYPE_VCN1_RAM =50 ,/* VCN_RAM NV */ +GFX_FW_TYPE_VCN0_RAM =49 ,/* VCN_RAM NV + RN */ +GFX_FW_TYPE_VCN1_RAM =50 ,/* VCN_RAM NV + RN */ +GFX_FW_TYPE_DMUB =51 ,/* DMUB RN */ +GFX_FW_TYPE_SDMA2 =52 ,/* SDMA2 MI */ +GFX_FW_TYPE_SDMA3 =53 ,/* SDMA3 MI */ +GFX_FW_TYPE_SDMA4 =54 ,/* SDMA4 MI */ +GFX_FW_TYPE_SDMA5 =55 ,/* SDMA5 MI */ +GFX_FW_TYPE_SDMA6 =56 ,/* SDMA6 MI */ +GFX_FW_TYPE_SDMA7 =57 ,/* SDMA7 MI */ GFX_FW_TYPE_MAX };
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amdgpu: update SDMA V4 microcode init
In reply to a message not in the archiveFrom: John Clements <[email protected]>
Removed loading duplicate instances of SDMA FW for Arcturus. We use a single image for all instances.
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 110 +++++++++++++++++-------- 1 file changed, 75 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +75 -35
@@ -65,13 +65,6 @@ MODULE_FIRMWARE("amdgpu/raven_sdma.bin");MODULE_FIRMWARE ("amdgpu/picasso_sdma.bin" );MODULE_FIRMWARE ("amdgpu/raven2_sdma.bin" );MODULE_FIRMWARE ("amdgpu/arcturus_sdma.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma1.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma2.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma3.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma4.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma5.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma6.bin" ); -MODULE_FIRMWARE ("amdgpu/arcturus_sdma7.bin" );#define SDMA0_POWER_CNTL__ON_OFF_CONDITION_HOLD_TIME_MASK 0x000000F8L#define SDMA0_POWER_CNTL__ON_OFF_STATUS_DURATION_TIME_MASK 0xFC000000L
@@ -376,6 +369,43 @@ static void sdma_v4_0_init_golden_registers(struct amdgpu_device *adev) } } +static int sdma_v4_0_init_inst_ctx (struct amdgpu_sdma_instance *sdma_inst) +{ +int err =0 ; +const struct sdma_firmware_header_v1_0 *hdr; + + err =amdgpu_ucode_validate (sdma_inst->fw); +if (err) +return err; + + hdr = (const struct sdma_firmware_header_v1_0 *)sdma_inst->fw->data; + sdma_inst->fw_version =le32_to_cpu (hdr->header.ucode_version); + sdma_inst->feature_version =le32_to_cpu (hdr->ucode_feature_version); + +if (sdma_inst->feature_version >=20 ) + sdma_inst->burst_nop = true; + +return 0 ; +} + +static void sdma_v4_0_destroy_inst_ctx (struct amdgpu_device *adev) +{ +int i; + +for (i =0 ; i < adev->sdma.num_instances; i++) { +if (adev->sdma.instance[i].fw !=NULL ) +release_firmware (adev->sdma.instance[i].fw); + +/* arcturus shares the same FW memory across +all SDMA isntances */ +if (adev->asic_type ==CHIP_ARCTURUS ) +break ; + } + +memset ((void *)adev->sdma.instance,0 , +sizeof (struct amdgpu_sdma_instance ) *AMDGPU_MAX_SDMA_INSTANCES ); +} +/** * sdma_v4_0_init_microcode - load ucode images from disk *
@@ -395,7 +425,6 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)int err =0 , i;struct amdgpu_firmware_info *info =NULL ;const struct common_firmware_header *header =NULL ; -const struct sdma_firmware_header_v1_0 *hdr;DRM_DEBUG ("\n" );
@@ -424,26 +453,42 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)BUG (); } -for (i =0 ; i < adev->sdma.num_instances; i++) { -if (i ==0 ) -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_sdma.bin" , chip_name); -else +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_sdma.bin" , chip_name); + + err =request_firmware (&adev->sdma.instance[0 ].fw, fw_name, adev->dev); +if (err) + goto out; + + err =sdma_v4_0_init_inst_ctx (&adev->sdma.instance[0 ]); +if (err) + goto out; + +for (i =1 ; i < adev->sdma.num_instances; i++) { +if (adev->asic_type ==CHIP_ARCTURUS ) { +/* Acturus will leverage the same FW memory +for every SDMA instance */ +memcpy ((void *)&adev->sdma.instance[i], + (void *)&adev->sdma.instance[0 ], +sizeof (struct amdgpu_sdma_instance )); + } +else {snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_sdma%d.bin" , chip_name, i); - err =request_firmware (&adev->sdma.instance[i].fw, fw_name, adev->dev); -if (err) - goto out; - err =amdgpu_ucode_validate (adev->sdma.instance[i].fw); -if (err) - goto out; - hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma.instance[i].fw->data; - adev->sdma.instance[i].fw_version =le32_to_cpu (hdr->header.ucode_version); - adev->sdma.instance[i].feature_version =le32_to_cpu (hdr->ucode_feature_version); -if (adev->sdma.instance[i].feature_version >=20 ) - adev->sdma.instance[i].burst_nop = true; -DRM_DEBUG ("psp_load == '%s'\n" , - adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ?"true" :"false" ); - -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) { + + err =request_firmware (&adev->sdma.instance[i].fw, fw_name, adev->dev); +if (err) + goto out; + + err =sdma_v4_0_init_inst_ctx (&adev->sdma.instance[i]); +if (err) + goto out; + } + } + +DRM_DEBUG ("psp_load == '%s'\n" , + adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ?"true" :"false" ); + +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) { +for (i =0 ; i < adev->sdma.num_instances; i++) { info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; info->ucode_id =AMDGPU_UCODE_ID_SDMA0 + i; info->fw = adev->sdma.instance[i].fw;
@@ -452,13 +497,11 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); } } + out:if (err) {DRM_ERROR ("sdma_v4_0: Failed to load firmware \"%s\"\n" , fw_name); -for (i =0 ; i < adev->sdma.num_instances; i++) { -release_firmware (adev->sdma.instance[i].fw); - adev->sdma.instance[i].fw =NULL ; - } +sdma_v4_0_destroy_inst_ctx (adev); }return err; }
@@ -1811,10 +1854,7 @@ static int sdma_v4_0_sw_fini(void *handle)amdgpu_ring_fini (&adev->sdma.instance[i].page); } -for (i =0 ; i < adev->sdma.num_instances; i++) { -release_firmware (adev->sdma.instance[i].fw); - adev->sdma.instance[i].fw =NULL ; - } +sdma_v4_0_destroy_inst_ctx (adev);return 0 ; }
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx