Commit 222e0a71 authored by Candice Li's avatar Candice Li Committed by Alex Deucher

drm/amd/amdgpu: add consistent PSP FW loading size checking

Signed-off-by: default avatarCandice Li <candice.li@amd.com>
Reviewed-by: default avatarJohn Clements <John.Clements@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ff99849b
...@@ -374,8 +374,8 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, ...@@ -374,8 +374,8 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
fw_info->feature = adev->sdma.instance[query_fw->index].feature_version; fw_info->feature = adev->sdma.instance[query_fw->index].feature_version;
break; break;
case AMDGPU_INFO_FW_SOS: case AMDGPU_INFO_FW_SOS:
fw_info->ver = adev->psp.sos_fw_version; fw_info->ver = adev->psp.sos.fw_version;
fw_info->feature = adev->psp.sos_feature_version; fw_info->feature = adev->psp.sos.feature_version;
break; break;
case AMDGPU_INFO_FW_ASD: case AMDGPU_INFO_FW_ASD:
fw_info->ver = adev->psp.asd_fw_version; fw_info->ver = adev->psp.asd_fw_version;
...@@ -390,8 +390,8 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, ...@@ -390,8 +390,8 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
fw_info->feature = 0; fw_info->feature = 0;
break; break;
case AMDGPU_INFO_FW_TOC: case AMDGPU_INFO_FW_TOC:
fw_info->ver = adev->psp.toc_fw_version; fw_info->ver = adev->psp.toc.fw_version;
fw_info->feature = adev->psp.toc_feature_version; fw_info->feature = adev->psp.toc.feature_version;
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -516,9 +516,9 @@ static int psp_load_toc(struct psp_context *psp, ...@@ -516,9 +516,9 @@ static int psp_load_toc(struct psp_context *psp,
if (!cmd) if (!cmd)
return -ENOMEM; return -ENOMEM;
/* Copy toc to psp firmware private buffer */ /* Copy toc to psp firmware private buffer */
psp_copy_fw(psp, psp->toc_start_addr, psp->toc_bin_size); psp_copy_fw(psp, psp->toc.start_addr, psp->toc.size_bytes);
psp_prep_load_toc_cmd_buf(cmd, psp->fw_pri_mc_addr, psp->toc_bin_size); psp_prep_load_toc_cmd_buf(cmd, psp->fw_pri_mc_addr, psp->toc.size_bytes);
ret = psp_cmd_submit_buf(psp, NULL, cmd, ret = psp_cmd_submit_buf(psp, NULL, cmd,
psp->fence_buf_mc_addr); psp->fence_buf_mc_addr);
...@@ -548,8 +548,8 @@ static int psp_tmr_init(struct psp_context *psp) ...@@ -548,8 +548,8 @@ static int psp_tmr_init(struct psp_context *psp)
/* For ASICs support RLC autoload, psp will parse the toc /* For ASICs support RLC autoload, psp will parse the toc
* and calculate the total size of TMR needed */ * and calculate the total size of TMR needed */
if (!amdgpu_sriov_vf(psp->adev) && if (!amdgpu_sriov_vf(psp->adev) &&
psp->toc_start_addr && psp->toc.start_addr &&
psp->toc_bin_size && psp->toc.size_bytes &&
psp->fw_pri_buf) { psp->fw_pri_buf) {
ret = psp_load_toc(psp, &tmr_size); ret = psp_load_toc(psp, &tmr_size);
if (ret) { if (ret) {
...@@ -728,18 +728,18 @@ static int psp_rl_load(struct amdgpu_device *adev) ...@@ -728,18 +728,18 @@ static int psp_rl_load(struct amdgpu_device *adev)
struct psp_context *psp = &adev->psp; struct psp_context *psp = &adev->psp;
struct psp_gfx_cmd_resp *cmd = psp->cmd; struct psp_gfx_cmd_resp *cmd = psp->cmd;
if (psp->rl_bin_size == 0) if (!is_psp_fw_valid(psp->rl))
return 0; return 0;
memset(psp->fw_pri_buf, 0, PSP_1_MEG); memset(psp->fw_pri_buf, 0, PSP_1_MEG);
memcpy(psp->fw_pri_buf, psp->rl_start_addr, psp->rl_bin_size); memcpy(psp->fw_pri_buf, psp->rl.start_addr, psp->rl.size_bytes);
memset(cmd, 0, sizeof(struct psp_gfx_cmd_resp)); memset(cmd, 0, sizeof(struct psp_gfx_cmd_resp));
cmd->cmd_id = GFX_CMD_ID_LOAD_IP_FW; cmd->cmd_id = GFX_CMD_ID_LOAD_IP_FW;
cmd->cmd.cmd_load_ip_fw.fw_phy_addr_lo = lower_32_bits(psp->fw_pri_mc_addr); cmd->cmd.cmd_load_ip_fw.fw_phy_addr_lo = lower_32_bits(psp->fw_pri_mc_addr);
cmd->cmd.cmd_load_ip_fw.fw_phy_addr_hi = upper_32_bits(psp->fw_pri_mc_addr); cmd->cmd.cmd_load_ip_fw.fw_phy_addr_hi = upper_32_bits(psp->fw_pri_mc_addr);
cmd->cmd.cmd_load_ip_fw.fw_size = psp->rl_bin_size; cmd->cmd.cmd_load_ip_fw.fw_size = psp->rl.size_bytes;
cmd->cmd.cmd_load_ip_fw.fw_type = GFX_FW_TYPE_REG_LIST; cmd->cmd.cmd_load_ip_fw.fw_type = GFX_FW_TYPE_REG_LIST;
return psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); return psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
...@@ -2129,7 +2129,7 @@ static int psp_hw_start(struct psp_context *psp) ...@@ -2129,7 +2129,7 @@ static int psp_hw_start(struct psp_context *psp)
int ret; int ret;
if (!amdgpu_sriov_vf(adev)) { if (!amdgpu_sriov_vf(adev)) {
if (psp->kdb_bin_size && if ((is_psp_fw_valid(psp->kdb)) &&
(psp->funcs->bootloader_load_kdb != NULL)) { (psp->funcs->bootloader_load_kdb != NULL)) {
ret = psp_bootloader_load_kdb(psp); ret = psp_bootloader_load_kdb(psp);
if (ret) { if (ret) {
...@@ -2138,7 +2138,8 @@ static int psp_hw_start(struct psp_context *psp) ...@@ -2138,7 +2138,8 @@ static int psp_hw_start(struct psp_context *psp)
} }
} }
if (psp->spl_bin_size) { if ((is_psp_fw_valid(psp->spl)) &&
(psp->funcs->bootloader_load_spl != NULL)) {
ret = psp_bootloader_load_spl(psp); ret = psp_bootloader_load_spl(psp);
if (ret) { if (ret) {
DRM_ERROR("PSP load spl failed!\n"); DRM_ERROR("PSP load spl failed!\n");
...@@ -2146,18 +2147,24 @@ static int psp_hw_start(struct psp_context *psp) ...@@ -2146,18 +2147,24 @@ static int psp_hw_start(struct psp_context *psp)
} }
} }
if ((is_psp_fw_valid(psp->sys)) &&
(psp->funcs->bootloader_load_sysdrv != NULL)) {
ret = psp_bootloader_load_sysdrv(psp); ret = psp_bootloader_load_sysdrv(psp);
if (ret) { if (ret) {
DRM_ERROR("PSP load sysdrv failed!\n"); DRM_ERROR("PSP load sysdrv failed!\n");
return ret; return ret;
} }
}
if ((is_psp_fw_valid(psp->sos)) &&
(psp->funcs->bootloader_load_sos != NULL)) {
ret = psp_bootloader_load_sos(psp); ret = psp_bootloader_load_sos(psp);
if (ret) { if (ret) {
DRM_ERROR("PSP load sos failed!\n"); DRM_ERROR("PSP load sos failed!\n");
return ret; return ret;
} }
} }
}
ret = psp_ring_create(psp, PSP_RING_TYPE__KM); ret = psp_ring_create(psp, PSP_RING_TYPE__KM);
if (ret) { if (ret) {
...@@ -2997,10 +3004,10 @@ int psp_init_toc_microcode(struct psp_context *psp, ...@@ -2997,10 +3004,10 @@ int psp_init_toc_microcode(struct psp_context *psp,
goto out; goto out;
toc_hdr = (const struct psp_firmware_header_v1_0 *)adev->psp.toc_fw->data; toc_hdr = (const struct psp_firmware_header_v1_0 *)adev->psp.toc_fw->data;
adev->psp.toc_fw_version = le32_to_cpu(toc_hdr->header.ucode_version); adev->psp.toc.fw_version = le32_to_cpu(toc_hdr->header.ucode_version);
adev->psp.toc_feature_version = le32_to_cpu(toc_hdr->sos.fw_version); adev->psp.toc.feature_version = le32_to_cpu(toc_hdr->sos.fw_version);
adev->psp.toc_bin_size = le32_to_cpu(toc_hdr->header.ucode_size_bytes); adev->psp.toc.size_bytes = le32_to_cpu(toc_hdr->header.ucode_size_bytes);
adev->psp.toc_start_addr = (uint8_t *)toc_hdr + adev->psp.toc.start_addr = (uint8_t *)toc_hdr +
le32_to_cpu(toc_hdr->header.ucode_array_offset_bytes); le32_to_cpu(toc_hdr->header.ucode_array_offset_bytes);
return 0; return 0;
out: out:
...@@ -3021,32 +3028,32 @@ static int psp_init_sos_base_fw(struct amdgpu_device *adev) ...@@ -3021,32 +3028,32 @@ static int psp_init_sos_base_fw(struct amdgpu_device *adev)
le32_to_cpu(sos_hdr->header.ucode_array_offset_bytes); le32_to_cpu(sos_hdr->header.ucode_array_offset_bytes);
if (adev->gmc.xgmi.connected_to_cpu || (adev->asic_type != CHIP_ALDEBARAN)) { if (adev->gmc.xgmi.connected_to_cpu || (adev->asic_type != CHIP_ALDEBARAN)) {
adev->psp.sos_fw_version = le32_to_cpu(sos_hdr->header.ucode_version); adev->psp.sos.fw_version = le32_to_cpu(sos_hdr->header.ucode_version);
adev->psp.sos_feature_version = le32_to_cpu(sos_hdr->sos.fw_version); adev->psp.sos.feature_version = le32_to_cpu(sos_hdr->sos.fw_version);
adev->psp.sys_bin_size = le32_to_cpu(sos_hdr->sos.offset_bytes); adev->psp.sys.size_bytes = le32_to_cpu(sos_hdr->sos.offset_bytes);
adev->psp.sys_start_addr = ucode_array_start_addr; adev->psp.sys.start_addr = ucode_array_start_addr;
adev->psp.sos_bin_size = le32_to_cpu(sos_hdr->sos.size_bytes); adev->psp.sos.size_bytes = le32_to_cpu(sos_hdr->sos.size_bytes);
adev->psp.sos_start_addr = ucode_array_start_addr + adev->psp.sos.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr->sos.offset_bytes); le32_to_cpu(sos_hdr->sos.offset_bytes);
} else { } else {
/* Load alternate PSP SOS FW */ /* Load alternate PSP SOS FW */
sos_hdr_v1_3 = (const struct psp_firmware_header_v1_3 *)adev->psp.sos_fw->data; sos_hdr_v1_3 = (const struct psp_firmware_header_v1_3 *)adev->psp.sos_fw->data;
adev->psp.sos_fw_version = le32_to_cpu(sos_hdr_v1_3->sos_aux.fw_version); adev->psp.sos.fw_version = le32_to_cpu(sos_hdr_v1_3->sos_aux.fw_version);
adev->psp.sos_feature_version = le32_to_cpu(sos_hdr_v1_3->sos_aux.fw_version); adev->psp.sos.feature_version = le32_to_cpu(sos_hdr_v1_3->sos_aux.fw_version);
adev->psp.sys_bin_size = le32_to_cpu(sos_hdr_v1_3->sys_drv_aux.size_bytes); adev->psp.sys.size_bytes = le32_to_cpu(sos_hdr_v1_3->sys_drv_aux.size_bytes);
adev->psp.sys_start_addr = ucode_array_start_addr + adev->psp.sys.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->sys_drv_aux.offset_bytes); le32_to_cpu(sos_hdr_v1_3->sys_drv_aux.offset_bytes);
adev->psp.sos_bin_size = le32_to_cpu(sos_hdr_v1_3->sos_aux.size_bytes); adev->psp.sos.size_bytes = le32_to_cpu(sos_hdr_v1_3->sos_aux.size_bytes);
adev->psp.sos_start_addr = ucode_array_start_addr + adev->psp.sos.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->sos_aux.offset_bytes); le32_to_cpu(sos_hdr_v1_3->sos_aux.offset_bytes);
} }
if ((adev->psp.sys_bin_size == 0) || (adev->psp.sos_bin_size == 0)) { if ((adev->psp.sys.size_bytes == 0) || (adev->psp.sos.size_bytes == 0)) {
dev_warn(adev->dev, "PSP SOS FW not available"); dev_warn(adev->dev, "PSP SOS FW not available");
return -EINVAL; return -EINVAL;
} }
...@@ -3093,32 +3100,32 @@ int psp_init_sos_microcode(struct psp_context *psp, ...@@ -3093,32 +3100,32 @@ int psp_init_sos_microcode(struct psp_context *psp,
if (sos_hdr->header.header_version_minor == 1) { if (sos_hdr->header.header_version_minor == 1) {
sos_hdr_v1_1 = (const struct psp_firmware_header_v1_1 *)adev->psp.sos_fw->data; sos_hdr_v1_1 = (const struct psp_firmware_header_v1_1 *)adev->psp.sos_fw->data;
adev->psp.toc_bin_size = le32_to_cpu(sos_hdr_v1_1->toc.size_bytes); adev->psp.toc.size_bytes = le32_to_cpu(sos_hdr_v1_1->toc.size_bytes);
adev->psp.toc_start_addr = (uint8_t *)adev->psp.sys_start_addr + adev->psp.toc.start_addr = (uint8_t *)adev->psp.sys.start_addr +
le32_to_cpu(sos_hdr_v1_1->toc.offset_bytes); le32_to_cpu(sos_hdr_v1_1->toc.offset_bytes);
adev->psp.kdb_bin_size = le32_to_cpu(sos_hdr_v1_1->kdb.size_bytes); adev->psp.kdb.size_bytes = le32_to_cpu(sos_hdr_v1_1->kdb.size_bytes);
adev->psp.kdb_start_addr = (uint8_t *)adev->psp.sys_start_addr + adev->psp.kdb.start_addr = (uint8_t *)adev->psp.sys.start_addr +
le32_to_cpu(sos_hdr_v1_1->kdb.offset_bytes); le32_to_cpu(sos_hdr_v1_1->kdb.offset_bytes);
} }
if (sos_hdr->header.header_version_minor == 2) { if (sos_hdr->header.header_version_minor == 2) {
sos_hdr_v1_2 = (const struct psp_firmware_header_v1_2 *)adev->psp.sos_fw->data; sos_hdr_v1_2 = (const struct psp_firmware_header_v1_2 *)adev->psp.sos_fw->data;
adev->psp.kdb_bin_size = le32_to_cpu(sos_hdr_v1_2->kdb.size_bytes); adev->psp.kdb.size_bytes = le32_to_cpu(sos_hdr_v1_2->kdb.size_bytes);
adev->psp.kdb_start_addr = (uint8_t *)adev->psp.sys_start_addr + adev->psp.kdb.start_addr = (uint8_t *)adev->psp.sys.start_addr +
le32_to_cpu(sos_hdr_v1_2->kdb.offset_bytes); le32_to_cpu(sos_hdr_v1_2->kdb.offset_bytes);
} }
if (sos_hdr->header.header_version_minor == 3) { if (sos_hdr->header.header_version_minor == 3) {
sos_hdr_v1_3 = (const struct psp_firmware_header_v1_3 *)adev->psp.sos_fw->data; sos_hdr_v1_3 = (const struct psp_firmware_header_v1_3 *)adev->psp.sos_fw->data;
adev->psp.toc_bin_size = le32_to_cpu(sos_hdr_v1_3->v1_1.toc.size_bytes); adev->psp.toc.size_bytes = le32_to_cpu(sos_hdr_v1_3->v1_1.toc.size_bytes);
adev->psp.toc_start_addr = ucode_array_start_addr + adev->psp.toc.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->v1_1.toc.offset_bytes); le32_to_cpu(sos_hdr_v1_3->v1_1.toc.offset_bytes);
adev->psp.kdb_bin_size = le32_to_cpu(sos_hdr_v1_3->v1_1.kdb.size_bytes); adev->psp.kdb.size_bytes = le32_to_cpu(sos_hdr_v1_3->v1_1.kdb.size_bytes);
adev->psp.kdb_start_addr = ucode_array_start_addr + adev->psp.kdb.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->v1_1.kdb.offset_bytes); le32_to_cpu(sos_hdr_v1_3->v1_1.kdb.offset_bytes);
adev->psp.spl_bin_size = le32_to_cpu(sos_hdr_v1_3->spl.size_bytes); adev->psp.spl.size_bytes = le32_to_cpu(sos_hdr_v1_3->spl.size_bytes);
adev->psp.spl_start_addr = ucode_array_start_addr + adev->psp.spl.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->spl.offset_bytes); le32_to_cpu(sos_hdr_v1_3->spl.offset_bytes);
adev->psp.rl_bin_size = le32_to_cpu(sos_hdr_v1_3->rl.size_bytes); adev->psp.rl.size_bytes = le32_to_cpu(sos_hdr_v1_3->rl.size_bytes);
adev->psp.rl_start_addr = ucode_array_start_addr + adev->psp.rl.start_addr = ucode_array_start_addr +
le32_to_cpu(sos_hdr_v1_3->rl.offset_bytes); le32_to_cpu(sos_hdr_v1_3->rl.offset_bytes);
} }
break; break;
...@@ -3361,7 +3368,10 @@ static DEVICE_ATTR(usbc_pd_fw, S_IRUGO | S_IWUSR, ...@@ -3361,7 +3368,10 @@ static DEVICE_ATTR(usbc_pd_fw, S_IRUGO | S_IWUSR,
psp_usbc_pd_fw_sysfs_read, psp_usbc_pd_fw_sysfs_read,
psp_usbc_pd_fw_sysfs_write); psp_usbc_pd_fw_sysfs_write);
int is_psp_fw_valid(struct psp_bin_desc bin)
{
return bin.size_bytes;
}
const struct amd_ip_funcs psp_ip_funcs = { const struct amd_ip_funcs psp_ip_funcs = {
.name = "psp", .name = "psp",
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
struct psp_context; struct psp_context;
struct psp_xgmi_node_info; struct psp_xgmi_node_info;
struct psp_xgmi_topology_info; struct psp_xgmi_topology_info;
struct psp_bin_desc;
enum psp_bootloader_cmd { enum psp_bootloader_cmd {
PSP_BL__LOAD_SYSDRV = 0x10000, PSP_BL__LOAD_SYSDRV = 0x10000,
...@@ -283,6 +284,13 @@ struct psp_runtime_boot_cfg_entry { ...@@ -283,6 +284,13 @@ struct psp_runtime_boot_cfg_entry {
uint32_t reserved; uint32_t reserved;
}; };
struct psp_bin_desc {
uint32_t fw_version;
uint32_t feature_version;
uint32_t size_bytes;
uint8_t *start_addr;
};
struct psp_context struct psp_context
{ {
struct amdgpu_device *adev; struct amdgpu_device *adev;
...@@ -298,20 +306,12 @@ struct psp_context ...@@ -298,20 +306,12 @@ struct psp_context
/* sos firmware */ /* sos firmware */
const struct firmware *sos_fw; const struct firmware *sos_fw;
uint32_t sos_fw_version; struct psp_bin_desc sys;
uint32_t sos_feature_version; struct psp_bin_desc sos;
uint32_t sys_bin_size; struct psp_bin_desc toc;
uint32_t sos_bin_size; struct psp_bin_desc kdb;
uint32_t toc_bin_size; struct psp_bin_desc spl;
uint32_t kdb_bin_size; struct psp_bin_desc rl;
uint32_t spl_bin_size;
uint32_t rl_bin_size;
uint8_t *sys_start_addr;
uint8_t *sos_start_addr;
uint8_t *toc_start_addr;
uint8_t *kdb_start_addr;
uint8_t *spl_start_addr;
uint8_t *rl_start_addr;
/* tmr buffer */ /* tmr buffer */
struct amdgpu_bo *tmr_bo; struct amdgpu_bo *tmr_bo;
...@@ -326,8 +326,6 @@ struct psp_context ...@@ -326,8 +326,6 @@ struct psp_context
/* toc firmware */ /* toc firmware */
const struct firmware *toc_fw; const struct firmware *toc_fw;
uint32_t toc_fw_version;
uint32_t toc_feature_version;
/* fence buffer */ /* fence buffer */
struct amdgpu_bo *fence_buf_bo; struct amdgpu_bo *fence_buf_bo;
...@@ -484,4 +482,5 @@ int psp_load_fw_list(struct psp_context *psp, ...@@ -484,4 +482,5 @@ int psp_load_fw_list(struct psp_context *psp,
struct amdgpu_firmware_info **ucode_list, int ucode_count); struct amdgpu_firmware_info **ucode_list, int ucode_count);
void psp_copy_fw(struct psp_context *psp, uint8_t *start_addr, uint32_t bin_size); void psp_copy_fw(struct psp_context *psp, uint8_t *start_addr, uint32_t bin_size);
int is_psp_fw_valid(struct psp_bin_desc bin);
#endif #endif
...@@ -518,7 +518,7 @@ FW_VERSION_ATTR(rlc_srlg_fw_version, 0444, gfx.rlc_srlg_fw_version); ...@@ -518,7 +518,7 @@ FW_VERSION_ATTR(rlc_srlg_fw_version, 0444, gfx.rlc_srlg_fw_version);
FW_VERSION_ATTR(rlc_srls_fw_version, 0444, gfx.rlc_srls_fw_version); FW_VERSION_ATTR(rlc_srls_fw_version, 0444, gfx.rlc_srls_fw_version);
FW_VERSION_ATTR(mec_fw_version, 0444, gfx.mec_fw_version); FW_VERSION_ATTR(mec_fw_version, 0444, gfx.mec_fw_version);
FW_VERSION_ATTR(mec2_fw_version, 0444, gfx.mec2_fw_version); FW_VERSION_ATTR(mec2_fw_version, 0444, gfx.mec2_fw_version);
FW_VERSION_ATTR(sos_fw_version, 0444, psp.sos_fw_version); FW_VERSION_ATTR(sos_fw_version, 0444, psp.sos.fw_version);
FW_VERSION_ATTR(asd_fw_version, 0444, psp.asd_fw_version); FW_VERSION_ATTR(asd_fw_version, 0444, psp.asd_fw_version);
FW_VERSION_ATTR(ta_ras_fw_version, 0444, psp.ta_ras_ucode_version); FW_VERSION_ATTR(ta_ras_fw_version, 0444, psp.ta_ras_ucode_version);
FW_VERSION_ATTR(ta_xgmi_fw_version, 0444, psp.ta_xgmi_ucode_version); FW_VERSION_ATTR(ta_xgmi_fw_version, 0444, psp.ta_xgmi_ucode_version);
......
...@@ -531,7 +531,7 @@ static void amdgpu_virt_populate_vf2pf_ucode_info(struct amdgpu_device *adev) ...@@ -531,7 +531,7 @@ static void amdgpu_virt_populate_vf2pf_ucode_info(struct amdgpu_device *adev)
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_RLC_SRLS, adev->gfx.rlc_srls_fw_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_RLC_SRLS, adev->gfx.rlc_srls_fw_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_MEC, adev->gfx.mec_fw_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_MEC, adev->gfx.mec_fw_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_MEC2, adev->gfx.mec2_fw_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_MEC2, adev->gfx.mec2_fw_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_SOS, adev->psp.sos_fw_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_SOS, adev->psp.sos.fw_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_ASD, adev->psp.asd_fw_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_ASD, adev->psp.asd_fw_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_TA_RAS, adev->psp.ta_ras_ucode_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_TA_RAS, adev->psp.ta_ras_ucode_version);
POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_TA_XGMI, adev->psp.ta_xgmi_ucode_version); POPULATE_UCODE_INFO(vf2pf_info, AMD_SRIOV_UCODE_ID_TA_XGMI, adev->psp.ta_xgmi_ucode_version);
......
...@@ -5397,7 +5397,7 @@ static int gfx_v10_0_parse_rlc_toc(struct amdgpu_device *adev) ...@@ -5397,7 +5397,7 @@ static int gfx_v10_0_parse_rlc_toc(struct amdgpu_device *adev)
int ret; int ret;
RLC_TABLE_OF_CONTENT *rlc_toc; RLC_TABLE_OF_CONTENT *rlc_toc;
ret = amdgpu_bo_create_reserved(adev, adev->psp.toc_bin_size, PAGE_SIZE, ret = amdgpu_bo_create_reserved(adev, adev->psp.toc.size_bytes, PAGE_SIZE,
AMDGPU_GEM_DOMAIN_GTT, AMDGPU_GEM_DOMAIN_GTT,
&adev->gfx.rlc.rlc_toc_bo, &adev->gfx.rlc.rlc_toc_bo,
&adev->gfx.rlc.rlc_toc_gpu_addr, &adev->gfx.rlc.rlc_toc_gpu_addr,
...@@ -5408,7 +5408,7 @@ static int gfx_v10_0_parse_rlc_toc(struct amdgpu_device *adev) ...@@ -5408,7 +5408,7 @@ static int gfx_v10_0_parse_rlc_toc(struct amdgpu_device *adev)
} }
/* Copy toc from psp sos fw to rlc toc buffer */ /* Copy toc from psp sos fw to rlc toc buffer */
memcpy(adev->gfx.rlc.rlc_toc_buf, adev->psp.toc_start_addr, adev->psp.toc_bin_size); memcpy(adev->gfx.rlc.rlc_toc_buf, adev->psp.toc.start_addr, adev->psp.toc.size_bytes);
rlc_toc = (RLC_TABLE_OF_CONTENT *)adev->gfx.rlc.rlc_toc_buf; rlc_toc = (RLC_TABLE_OF_CONTENT *)adev->gfx.rlc.rlc_toc_buf;
while (rlc_toc && (rlc_toc->id > FIRMWARE_ID_INVALID) && while (rlc_toc && (rlc_toc->id > FIRMWARE_ID_INVALID) &&
......
...@@ -287,7 +287,7 @@ static int psp_v11_0_bootloader_load_kdb(struct psp_context *psp) ...@@ -287,7 +287,7 @@ static int psp_v11_0_bootloader_load_kdb(struct psp_context *psp)
return ret; return ret;
/* Copy PSP KDB binary to memory */ /* Copy PSP KDB binary to memory */
psp_copy_fw(psp, psp->kdb_start_addr, psp->kdb_bin_size); psp_copy_fw(psp, psp->kdb.start_addr, psp->kdb.size_bytes);
/* Provide the PSP KDB to bootloader */ /* Provide the PSP KDB to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
...@@ -318,7 +318,7 @@ static int psp_v11_0_bootloader_load_spl(struct psp_context *psp) ...@@ -318,7 +318,7 @@ static int psp_v11_0_bootloader_load_spl(struct psp_context *psp)
return ret; return ret;
/* Copy PSP SPL binary to memory */ /* Copy PSP SPL binary to memory */
psp_copy_fw(psp, psp->spl_start_addr, psp->spl_bin_size); psp_copy_fw(psp, psp->spl.start_addr, psp->spl.size_bytes);
/* Provide the PSP SPL to bootloader */ /* Provide the PSP SPL to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
...@@ -349,7 +349,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp) ...@@ -349,7 +349,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
return ret; return ret;
/* Copy PSP System Driver binary to memory */ /* Copy PSP System Driver binary to memory */
psp_copy_fw(psp, psp->sys_start_addr, psp->sys_bin_size); psp_copy_fw(psp, psp->sys.start_addr, psp->sys.size_bytes);
/* Provide the sys driver to bootloader */ /* Provide the sys driver to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
...@@ -383,7 +383,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp) ...@@ -383,7 +383,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
return ret; return ret;
/* Copy Secure OS binary to PSP memory */ /* Copy Secure OS binary to PSP memory */
psp_copy_fw(psp, psp->sos_start_addr, psp->sos_bin_size); psp_copy_fw(psp, psp->sos.start_addr, psp->sos.size_bytes);
/* Provide the PSP secure OS to bootloader */ /* Provide the PSP secure OS to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
......
...@@ -138,7 +138,7 @@ static int psp_v12_0_bootloader_load_sysdrv(struct psp_context *psp) ...@@ -138,7 +138,7 @@ static int psp_v12_0_bootloader_load_sysdrv(struct psp_context *psp)
return ret; return ret;
/* Copy PSP System Driver binary to memory */ /* Copy PSP System Driver binary to memory */
psp_copy_fw(psp, psp->sys_start_addr, psp->sys_bin_size); psp_copy_fw(psp, psp->sys.start_addr, psp->sys.size_bytes);
/* Provide the sys driver to bootloader */ /* Provide the sys driver to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
...@@ -177,7 +177,7 @@ static int psp_v12_0_bootloader_load_sos(struct psp_context *psp) ...@@ -177,7 +177,7 @@ static int psp_v12_0_bootloader_load_sos(struct psp_context *psp)
return ret; return ret;
/* Copy Secure OS binary to PSP memory */ /* Copy Secure OS binary to PSP memory */
psp_copy_fw(psp, psp->sos_start_addr, psp->sos_bin_size); psp_copy_fw(psp, psp->sos.start_addr, psp->sos.size_bytes);
/* Provide the PSP secure OS to bootloader */ /* Provide the PSP secure OS to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
......
...@@ -136,7 +136,7 @@ static int psp_v13_0_bootloader_load_kdb(struct psp_context *psp) ...@@ -136,7 +136,7 @@ static int psp_v13_0_bootloader_load_kdb(struct psp_context *psp)
memset(psp->fw_pri_buf, 0, PSP_1_MEG); memset(psp->fw_pri_buf, 0, PSP_1_MEG);
/* Copy PSP KDB binary to memory */ /* Copy PSP KDB binary to memory */
memcpy(psp->fw_pri_buf, psp->kdb_start_addr, psp->kdb_bin_size); memcpy(psp->fw_pri_buf, psp->kdb.start_addr, psp->kdb.size_bytes);
/* Provide the PSP KDB to bootloader */ /* Provide the PSP KDB to bootloader */
WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36,
...@@ -169,7 +169,7 @@ static int psp_v13_0_bootloader_load_sysdrv(struct psp_context *psp) ...@@ -169,7 +169,7 @@ static int psp_v13_0_bootloader_load_sysdrv(struct psp_context *psp)
memset(psp->fw_pri_buf, 0, PSP_1_MEG); memset(psp->fw_pri_buf, 0, PSP_1_MEG);
/* Copy PSP System Driver binary to memory */ /* Copy PSP System Driver binary to memory */
memcpy(psp->fw_pri_buf, psp->sys_start_addr, psp->sys_bin_size); memcpy(psp->fw_pri_buf, psp->sys.start_addr, psp->sys.size_bytes);
/* Provide the sys driver to bootloader */ /* Provide the sys driver to bootloader */
WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36,
...@@ -205,7 +205,7 @@ static int psp_v13_0_bootloader_load_sos(struct psp_context *psp) ...@@ -205,7 +205,7 @@ static int psp_v13_0_bootloader_load_sos(struct psp_context *psp)
memset(psp->fw_pri_buf, 0, PSP_1_MEG); memset(psp->fw_pri_buf, 0, PSP_1_MEG);
/* Copy Secure OS binary to PSP memory */ /* Copy Secure OS binary to PSP memory */
memcpy(psp->fw_pri_buf, psp->sos_start_addr, psp->sos_bin_size); memcpy(psp->fw_pri_buf, psp->sos.start_addr, psp->sos.size_bytes);
/* Provide the PSP secure OS to bootloader */ /* Provide the PSP secure OS to bootloader */
WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_36,
......
...@@ -103,7 +103,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp) ...@@ -103,7 +103,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
return ret; return ret;
/* Copy PSP System Driver binary to memory */ /* Copy PSP System Driver binary to memory */
psp_copy_fw(psp, psp->sys_start_addr, psp->sys_bin_size); psp_copy_fw(psp, psp->sys.start_addr, psp->sys.size_bytes);
/* Provide the sys driver to bootloader */ /* Provide the sys driver to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
...@@ -142,7 +142,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp) ...@@ -142,7 +142,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
return ret; return ret;
/* Copy Secure OS binary to PSP memory */ /* Copy Secure OS binary to PSP memory */
psp_copy_fw(psp, psp->sos_start_addr, psp->sos_bin_size); psp_copy_fw(psp, psp->sos.start_addr, psp->sos.size_bytes);
/* Provide the PSP secure OS to bootloader */ /* Provide the PSP secure OS to bootloader */
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
......
...@@ -575,7 +575,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev) ...@@ -575,7 +575,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
baco_reset = amdgpu_dpm_is_baco_supported(adev); baco_reset = amdgpu_dpm_is_baco_supported(adev);
break; break;
case CHIP_VEGA20: case CHIP_VEGA20:
if (adev->psp.sos_fw_version >= 0x80067) if (adev->psp.sos.fw_version >= 0x80067)
baco_reset = amdgpu_dpm_is_baco_supported(adev); baco_reset = amdgpu_dpm_is_baco_supported(adev);
/* /*
...@@ -635,7 +635,7 @@ static bool soc15_supports_baco(struct amdgpu_device *adev) ...@@ -635,7 +635,7 @@ static bool soc15_supports_baco(struct amdgpu_device *adev)
case CHIP_ARCTURUS: case CHIP_ARCTURUS:
return amdgpu_dpm_is_baco_supported(adev); return amdgpu_dpm_is_baco_supported(adev);
case CHIP_VEGA20: case CHIP_VEGA20:
if (adev->psp.sos_fw_version >= 0x80067) if (adev->psp.sos.fw_version >= 0x80067)
return amdgpu_dpm_is_baco_supported(adev); return amdgpu_dpm_is_baco_supported(adev);
return false; return false;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment