Skip to content

Commit 14ab292

Browse files
Likun Gaoalexdeucher
authored andcommitted
drm/amdgpu: support RS64 CP fw front door load
Support to load RS64 CP firmware front door load. Signed-off-by: Likun Gao <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8e07083 commit 14ab292

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,
672672
{
673673
const struct common_firmware_header *header = NULL;
674674
const struct gfx_firmware_header_v1_0 *cp_hdr = NULL;
675+
const struct gfx_firmware_header_v2_0 *cpv2_hdr = NULL;
675676
const struct dmcu_firmware_header_v1_0 *dmcu_hdr = NULL;
676677
const struct dmcub_firmware_header_v1_0 *dmcub_hdr = NULL;
677678
const struct mes_firmware_header_v1_0 *mes_hdr = NULL;
@@ -690,6 +691,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,
690691

691692
header = (const struct common_firmware_header *)ucode->fw->data;
692693
cp_hdr = (const struct gfx_firmware_header_v1_0 *)ucode->fw->data;
694+
cpv2_hdr = (const struct gfx_firmware_header_v2_0 *)ucode->fw->data;
693695
dmcu_hdr = (const struct dmcu_firmware_header_v1_0 *)ucode->fw->data;
694696
dmcub_hdr = (const struct dmcub_firmware_header_v1_0 *)ucode->fw->data;
695697
mes_hdr = (const struct mes_firmware_header_v1_0 *)ucode->fw->data;
@@ -802,6 +804,61 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,
802804
le32_to_cpu(imu_hdr->header.ucode_array_offset_bytes) +
803805
le32_to_cpu(imu_hdr->imu_iram_ucode_size_bytes);
804806
break;
807+
case AMDGPU_UCODE_ID_CP_RS64_PFP:
808+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->ucode_size_bytes);
809+
ucode_addr = (u8 *)ucode->fw->data +
810+
le32_to_cpu(header->ucode_array_offset_bytes);
811+
break;
812+
case AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK:
813+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
814+
ucode_addr = (u8 *)ucode->fw->data +
815+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
816+
break;
817+
case AMDGPU_UCODE_ID_CP_RS64_PFP_P1_STACK:
818+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
819+
ucode_addr = (u8 *)ucode->fw->data +
820+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
821+
break;
822+
case AMDGPU_UCODE_ID_CP_RS64_ME:
823+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->ucode_size_bytes);
824+
ucode_addr = (u8 *)ucode->fw->data +
825+
le32_to_cpu(header->ucode_array_offset_bytes);
826+
break;
827+
case AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK:
828+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
829+
ucode_addr = (u8 *)ucode->fw->data +
830+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
831+
break;
832+
case AMDGPU_UCODE_ID_CP_RS64_ME_P1_STACK:
833+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
834+
ucode_addr = (u8 *)ucode->fw->data +
835+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
836+
break;
837+
case AMDGPU_UCODE_ID_CP_RS64_MEC:
838+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->ucode_size_bytes);
839+
ucode_addr = (u8 *)ucode->fw->data +
840+
le32_to_cpu(header->ucode_array_offset_bytes);
841+
break;
842+
case AMDGPU_UCODE_ID_CP_RS64_MEC_P0_STACK:
843+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
844+
ucode_addr = (u8 *)ucode->fw->data +
845+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
846+
break;
847+
case AMDGPU_UCODE_ID_CP_RS64_MEC_P1_STACK:
848+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
849+
ucode_addr = (u8 *)ucode->fw->data +
850+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
851+
break;
852+
case AMDGPU_UCODE_ID_CP_RS64_MEC_P2_STACK:
853+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
854+
ucode_addr = (u8 *)ucode->fw->data +
855+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
856+
break;
857+
case AMDGPU_UCODE_ID_CP_RS64_MEC_P3_STACK:
858+
ucode->ucode_size = le32_to_cpu(cpv2_hdr->data_size_bytes);
859+
ucode_addr = (u8 *)ucode->fw->data +
860+
le32_to_cpu(cpv2_hdr->data_offset_bytes);
861+
break;
805862
default:
806863
ucode->ucode_size = le32_to_cpu(header->ucode_size_bytes);
807864
ucode_addr = (u8 *)ucode->fw->data +

0 commit comments

Comments
 (0)