mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 15:01:44 +00:00
drm/amdgpu: add atomfirmware helper funciton to query reserved fb size
fw_reserved_size_in_kb is introduced for driver to query the TMR region reserved by PSP BL in Sienna_Cichlid and onwards Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
718715e6a4
commit
9a244ebe81
2 changed files with 39 additions and 0 deletions
|
@ -325,6 +325,9 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
|
||||||
|
|
||||||
union firmware_info {
|
union firmware_info {
|
||||||
struct atom_firmware_info_v3_1 v31;
|
struct atom_firmware_info_v3_1 v31;
|
||||||
|
struct atom_firmware_info_v3_2 v32;
|
||||||
|
struct atom_firmware_info_v3_3 v33;
|
||||||
|
struct atom_firmware_info_v3_4 v34;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -590,3 +593,38 @@ int amdgpu_atomfirmware_get_mem_train_info(struct amdgpu_device *adev)
|
||||||
adev->fw_vram_usage.mem_train_support = true;
|
adev->fw_vram_usage.mem_train_support = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev)
|
||||||
|
{
|
||||||
|
struct atom_context *ctx = adev->mode_info.atom_context;
|
||||||
|
union firmware_info *firmware_info;
|
||||||
|
int index;
|
||||||
|
u16 data_offset, size;
|
||||||
|
u8 frev, crev;
|
||||||
|
int fw_reserved_fb_size;
|
||||||
|
|
||||||
|
index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
|
||||||
|
firmwareinfo);
|
||||||
|
|
||||||
|
if (!amdgpu_atom_parse_data_header(ctx, index, &size,
|
||||||
|
&frev, &crev, &data_offset))
|
||||||
|
/* fail to parse data_header */
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
firmware_info = (union firmware_info *)(ctx->bios + data_offset);
|
||||||
|
|
||||||
|
if (frev !=3)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
switch (crev) {
|
||||||
|
case 4:
|
||||||
|
fw_reserved_fb_size =
|
||||||
|
(firmware_info->v34.fw_reserved_size_in_kb << 10);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fw_reserved_fb_size = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fw_reserved_fb_size;
|
||||||
|
}
|
||||||
|
|
|
@ -36,5 +36,6 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
|
||||||
int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
|
int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
|
||||||
bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
|
bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
|
||||||
bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev);
|
bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev);
|
||||||
|
int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue