@@ -672,6 +672,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,
672
672
{
673
673
const struct common_firmware_header * header = NULL ;
674
674
const struct gfx_firmware_header_v1_0 * cp_hdr = NULL ;
675
+ const struct gfx_firmware_header_v2_0 * cpv2_hdr = NULL ;
675
676
const struct dmcu_firmware_header_v1_0 * dmcu_hdr = NULL ;
676
677
const struct dmcub_firmware_header_v1_0 * dmcub_hdr = NULL ;
677
678
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,
690
691
691
692
header = (const struct common_firmware_header * )ucode -> fw -> data ;
692
693
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 ;
693
695
dmcu_hdr = (const struct dmcu_firmware_header_v1_0 * )ucode -> fw -> data ;
694
696
dmcub_hdr = (const struct dmcub_firmware_header_v1_0 * )ucode -> fw -> data ;
695
697
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,
802
804
le32_to_cpu (imu_hdr -> header .ucode_array_offset_bytes ) +
803
805
le32_to_cpu (imu_hdr -> imu_iram_ucode_size_bytes );
804
806
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 ;
805
862
default :
806
863
ucode -> ucode_size = le32_to_cpu (header -> ucode_size_bytes );
807
864
ucode_addr = (u8 * )ucode -> fw -> data +
0 commit comments