Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Add ucode support for DMCUB

The DMCUB is a secondary DMCU (Display MicroController Unit) that has
its own separate firmware. It's required for DMCU support on Renoir.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
02350f0b 320f6d81

+19 -1
+10 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
··· 447 447 const struct common_firmware_header *header = NULL; 448 448 const struct gfx_firmware_header_v1_0 *cp_hdr = NULL; 449 449 const struct dmcu_firmware_header_v1_0 *dmcu_hdr = NULL; 450 + const struct dmcub_firmware_header_v1_0 *dmcub_hdr = NULL; 450 451 451 452 if (NULL == ucode->fw) 452 453 return 0; ··· 461 460 header = (const struct common_firmware_header *)ucode->fw->data; 462 461 cp_hdr = (const struct gfx_firmware_header_v1_0 *)ucode->fw->data; 463 462 dmcu_hdr = (const struct dmcu_firmware_header_v1_0 *)ucode->fw->data; 463 + dmcub_hdr = (const struct dmcub_firmware_header_v1_0 *)ucode->fw->data; 464 464 465 465 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP || 466 466 (ucode->ucode_id != AMDGPU_UCODE_ID_CP_MEC1 && ··· 472 470 ucode->ucode_id != AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM && 473 471 ucode->ucode_id != AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM && 474 472 ucode->ucode_id != AMDGPU_UCODE_ID_DMCU_ERAM && 475 - ucode->ucode_id != AMDGPU_UCODE_ID_DMCU_INTV)) { 473 + ucode->ucode_id != AMDGPU_UCODE_ID_DMCU_INTV && 474 + ucode->ucode_id != AMDGPU_UCODE_ID_DMCUB)) { 476 475 ucode->ucode_size = le32_to_cpu(header->ucode_size_bytes); 477 476 478 477 memcpy(ucode->kaddr, (void *)((uint8_t *)ucode->fw->data + ··· 508 505 memcpy(ucode->kaddr, (void *)((uint8_t *)ucode->fw->data + 509 506 le32_to_cpu(header->ucode_array_offset_bytes) + 510 507 le32_to_cpu(dmcu_hdr->intv_offset_bytes)), 508 + ucode->ucode_size); 509 + } else if (ucode->ucode_id == AMDGPU_UCODE_ID_DMCUB) { 510 + ucode->ucode_size = le32_to_cpu(dmcub_hdr->inst_const_bytes); 511 + memcpy(ucode->kaddr, 512 + (void *)((uint8_t *)ucode->fw->data + 513 + le32_to_cpu(header->ucode_array_offset_bytes)), 511 514 ucode->ucode_size); 512 515 } else if (ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL) { 513 516 ucode->ucode_size = adev->gfx.rlc.save_restore_list_cntl_size_bytes;
+9
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
··· 251 251 uint32_t intv_size_bytes; /* size of interrupt vectors, in bytes */ 252 252 }; 253 253 254 + /* version_major=1, version_minor=0 */ 255 + struct dmcub_firmware_header_v1_0 { 256 + struct common_firmware_header header; 257 + uint32_t inst_const_bytes; /* size of instruction region, in bytes */ 258 + uint32_t bss_data_bytes; /* size of bss/data region, in bytes */ 259 + }; 260 + 254 261 /* header is fixed size */ 255 262 union amdgpu_firmware_header { 256 263 struct common_firmware_header common; ··· 275 268 struct sdma_firmware_header_v1_1 sdma_v1_1; 276 269 struct gpu_info_firmware_header_v1_0 gpu_info; 277 270 struct dmcu_firmware_header_v1_0 dmcu; 271 + struct dmcub_firmware_header_v1_0 dmcub; 278 272 uint8_t raw[0x100]; 279 273 }; 280 274 ··· 315 307 AMDGPU_UCODE_ID_DMCU_INTV, 316 308 AMDGPU_UCODE_ID_VCN0_RAM, 317 309 AMDGPU_UCODE_ID_VCN1_RAM, 310 + AMDGPU_UCODE_ID_DMCUB, 318 311 AMDGPU_UCODE_ID_MAXIMUM, 319 312 }; 320 313