diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2020-11-13 18:03:07 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-03-23 22:54:59 -0400 |
commit | f31c4a11b4692122fa385790e95a0d355cfc4475 (patch) | |
tree | 0204f94c0d210437b5d6fe5e383c05660aa71697 | |
parent | ea9097d921d4f848cc6f80a9846635a0f5d5a98f (diff) |
drm/amdgpu: support get_vram_info atomfirmware i/f for aldebaran
Query vram_type, channel_num, channel_width
information through atomfirmware i/f
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/include/atomfirmware.h | 16 |
2 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c index 6107ac91db25..266d949759fe 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c @@ -123,6 +123,7 @@ union vram_info { struct atom_vram_info_header_v2_3 v23; struct atom_vram_info_header_v2_4 v24; struct atom_vram_info_header_v2_5 v25; + struct atom_vram_info_header_v2_5 v26; }; union vram_module { @@ -315,6 +316,26 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, if (vram_vendor) *vram_vendor = mem_vendor; break; + case 6: + if (module_id > vram_info->v26.vram_module_num) + module_id = 0; + vram_module = (union vram_module *)vram_info->v26.vram_module; + while (i < module_id) { + vram_module = (union vram_module *) + ((u8 *)vram_module + vram_module->v11.vram_module_size); + i++; + } + mem_type = vram_module->v9.memory_type; + if (vram_type) + *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type); + mem_channel_number = vram_module->v9.channel_num; + mem_channel_width = vram_module->v9.channel_width; + if (vram_width) + *vram_width = mem_channel_number * (1 << mem_channel_width); + mem_vendor = (vram_module->v9.vender_rev_id) & 0xF; + if (vram_vendor) + *vram_vendor = mem_vendor; + break; default: return -EINVAL; } diff --git a/drivers/gpu/drm/amd/include/atomfirmware.h b/drivers/gpu/drm/amd/include/atomfirmware.h index 3cb8d4c5c1a3..ec43a4fb761a 100644 --- a/drivers/gpu/drm/amd/include/atomfirmware.h +++ b/drivers/gpu/drm/amd/include/atomfirmware.h @@ -2789,6 +2789,22 @@ struct atom_vram_info_header_v2_5 { struct atom_vram_module_v11 vram_module[16]; // just for allocation, real number of blocks is in ucNumOfVRAMModule; }; +struct atom_vram_info_header_v2_6 { + struct atom_common_table_header table_header; + uint16_t mem_adjust_tbloffset; + uint16_t mem_clk_patch_tbloffset; + uint16_t mc_adjust_pertile_tbloffset; + uint16_t mc_phyinit_tbloffset; + uint16_t dram_data_remap_tbloffset; + uint16_t tmrs_seq_offset; + uint16_t post_ucode_init_offset; + uint16_t vram_rsd2; + uint8_t vram_module_num; + uint8_t umcip_min_ver; + uint8_t umcip_max_ver; + uint8_t mc_phy_tile_num; + struct atom_vram_module_v9 vram_module[16]; +}; /* *************************************************************************** Data Table voltageobject_info structure |