drm/amdgpu: Added support for added psp driver binaries FW
Detect psp driver binaries packed into FW and try to load the FW Signed-off-by: John Clements <john.clements@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
f8e487ce83
commit
6ff34fd690
|
@ -2158,7 +2158,34 @@ static int psp_hw_start(struct psp_context *psp)
|
|||
(psp->funcs->bootloader_load_sysdrv != NULL)) {
|
||||
ret = psp_bootloader_load_sysdrv(psp);
|
||||
if (ret) {
|
||||
DRM_ERROR("PSP load sysdrv failed!\n");
|
||||
DRM_ERROR("PSP load sys drv failed!\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((is_psp_fw_valid(psp->soc_drv)) &&
|
||||
(psp->funcs->bootloader_load_soc_drv != NULL)) {
|
||||
ret = psp_bootloader_load_soc_drv(psp);
|
||||
if (ret) {
|
||||
DRM_ERROR("PSP load soc drv failed!\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((is_psp_fw_valid(psp->intf_drv)) &&
|
||||
(psp->funcs->bootloader_load_intf_drv != NULL)) {
|
||||
ret = psp_bootloader_load_intf_drv(psp);
|
||||
if (ret) {
|
||||
DRM_ERROR("PSP load intf drv failed!\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((is_psp_fw_valid(psp->dbg_drv)) &&
|
||||
(psp->funcs->bootloader_load_dbg_drv != NULL)) {
|
||||
ret = psp_bootloader_load_dbg_drv(psp);
|
||||
if (ret) {
|
||||
DRM_ERROR("PSP load dbg drv failed!\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -3074,6 +3101,24 @@ static int parse_sos_bin_descriptor(struct psp_context *psp,
|
|||
psp->rl.size_bytes = le32_to_cpu(desc->size_bytes);
|
||||
psp->rl.start_addr = ucode_start_addr;
|
||||
break;
|
||||
case PSP_FW_TYPE_PSP_SOC_DRV:
|
||||
psp->soc_drv.fw_version = le32_to_cpu(desc->fw_version);
|
||||
psp->soc_drv.feature_version = le32_to_cpu(desc->fw_version);
|
||||
psp->soc_drv.size_bytes = le32_to_cpu(desc->size_bytes);
|
||||
psp->soc_drv.start_addr = ucode_start_addr;
|
||||
break;
|
||||
case PSP_FW_TYPE_PSP_INTF_DRV:
|
||||
psp->intf_drv.fw_version = le32_to_cpu(desc->fw_version);
|
||||
psp->intf_drv.feature_version = le32_to_cpu(desc->fw_version);
|
||||
psp->intf_drv.size_bytes = le32_to_cpu(desc->size_bytes);
|
||||
psp->intf_drv.start_addr = ucode_start_addr;
|
||||
break;
|
||||
case PSP_FW_TYPE_PSP_DBG_DRV:
|
||||
psp->dbg_drv.fw_version = le32_to_cpu(desc->fw_version);
|
||||
psp->dbg_drv.feature_version = le32_to_cpu(desc->fw_version);
|
||||
psp->dbg_drv.size_bytes = le32_to_cpu(desc->size_bytes);
|
||||
psp->dbg_drv.start_addr = ucode_start_addr;
|
||||
break;
|
||||
default:
|
||||
dev_warn(psp->adev->dev, "Unsupported PSP FW type: %d\n", desc->fw_type);
|
||||
break;
|
||||
|
|
|
@ -54,6 +54,9 @@ enum psp_bootloader_cmd {
|
|||
PSP_BL__LOAD_SYSDRV = 0x10000,
|
||||
PSP_BL__LOAD_SOSDRV = 0x20000,
|
||||
PSP_BL__LOAD_KEY_DATABASE = 0x80000,
|
||||
PSP_BL__LOAD_SOCDRV = 0x90000,
|
||||
PSP_BL__LOAD_INTFDRV = 0xA0000,
|
||||
PSP_BL__LOAD_DBGDRV = 0xB0000,
|
||||
PSP_BL__DRAM_LONG_TRAIN = 0x100000,
|
||||
PSP_BL__DRAM_SHORT_TRAIN = 0x200000,
|
||||
PSP_BL__LOAD_TOS_SPL_TABLE = 0x10000000,
|
||||
|
@ -94,6 +97,9 @@ struct psp_funcs
|
|||
int (*bootloader_load_kdb)(struct psp_context *psp);
|
||||
int (*bootloader_load_spl)(struct psp_context *psp);
|
||||
int (*bootloader_load_sysdrv)(struct psp_context *psp);
|
||||
int (*bootloader_load_soc_drv)(struct psp_context *psp);
|
||||
int (*bootloader_load_intf_drv)(struct psp_context *psp);
|
||||
int (*bootloader_load_dbg_drv)(struct psp_context *psp);
|
||||
int (*bootloader_load_sos)(struct psp_context *psp);
|
||||
int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type);
|
||||
int (*ring_create)(struct psp_context *psp,
|
||||
|
@ -306,12 +312,15 @@ struct psp_context
|
|||
|
||||
/* sos firmware */
|
||||
const struct firmware *sos_fw;
|
||||
struct psp_bin_desc sys;
|
||||
struct psp_bin_desc sos;
|
||||
struct psp_bin_desc toc;
|
||||
struct psp_bin_desc kdb;
|
||||
struct psp_bin_desc spl;
|
||||
struct psp_bin_desc rl;
|
||||
struct psp_bin_desc sys;
|
||||
struct psp_bin_desc sos;
|
||||
struct psp_bin_desc toc;
|
||||
struct psp_bin_desc kdb;
|
||||
struct psp_bin_desc spl;
|
||||
struct psp_bin_desc rl;
|
||||
struct psp_bin_desc soc_drv;
|
||||
struct psp_bin_desc intf_drv;
|
||||
struct psp_bin_desc dbg_drv;
|
||||
|
||||
/* tmr buffer */
|
||||
struct amdgpu_bo *tmr_bo;
|
||||
|
@ -401,6 +410,12 @@ struct amdgpu_psp_funcs {
|
|||
((psp)->funcs->bootloader_load_spl ? (psp)->funcs->bootloader_load_spl((psp)) : 0)
|
||||
#define psp_bootloader_load_sysdrv(psp) \
|
||||
((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0)
|
||||
#define psp_bootloader_load_soc_drv(psp) \
|
||||
((psp)->funcs->bootloader_load_soc_drv ? (psp)->funcs->bootloader_load_soc_drv((psp)) : 0)
|
||||
#define psp_bootloader_load_intf_drv(psp) \
|
||||
((psp)->funcs->bootloader_load_intf_drv ? (psp)->funcs->bootloader_load_intf_drv((psp)) : 0)
|
||||
#define psp_bootloader_load_dbg_drv(psp) \
|
||||
((psp)->funcs->bootloader_load_dbg_drv ? (psp)->funcs->bootloader_load_dbg_drv((psp)) : 0)
|
||||
#define psp_bootloader_load_sos(psp) \
|
||||
((psp)->funcs->bootloader_load_sos ? (psp)->funcs->bootloader_load_sos((psp)) : 0)
|
||||
#define psp_smu_reload_quirk(psp) \
|
||||
|
|
|
@ -121,6 +121,9 @@ enum psp_fw_type {
|
|||
PSP_FW_TYPE_PSP_TOC,
|
||||
PSP_FW_TYPE_PSP_SPL,
|
||||
PSP_FW_TYPE_PSP_RL,
|
||||
PSP_FW_TYPE_PSP_SOC_DRV,
|
||||
PSP_FW_TYPE_PSP_INTF_DRV,
|
||||
PSP_FW_TYPE_PSP_DBG_DRV,
|
||||
};
|
||||
|
||||
/* version_major=2, version_minor=0 */
|
||||
|
|
Loading…
Reference in New Issue