drm/amdgpu: Implement PSP cmd UAL_SET_NPA_CONFIG

To set NPA translation configuration to PSP.

Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Felix Kuehling 2026-04-07 19:48:08 -04:00 committed by Alex Deucher
parent c53a91c275
commit 698ed831fe
2 changed files with 33 additions and 0 deletions

View File

@ -843,6 +843,8 @@ static const char *psp_gfx_cmd_name(enum psp_gfx_cmd_id cmd_id)
return "UAL_SET_VPOD_CONFIG";
case GFX_CMD_ID_UAL_SET_STATION_CONFIG:
return "UAL_SET_STATION_CONFIG";
case GFX_CMD_ID_UAL_SET_NPA_CONFIG:
return "UAL_SET_NPA_CONFIG";
default:
return "UNKNOWN CMD";
}
@ -1398,6 +1400,34 @@ int psp_ual_set_station_config(struct psp_context *psp, uint32_t intf_ver,
return ret;
}
int psp_ual_set_npa_config(struct psp_context *psp, uint32_t intf_ver,
unsigned int vmid, bool enable)
{
struct psp_gfx_cmd_resp *cmd;
int ret;
/* TBD check interface version 1.x */
if (intf_ver > 0x1ffff) {
pr_warn("PSP UAL interface version mismatch: 0x%x\n", intf_ver);
return -EOPNOTSUPP;
}
cmd = acquire_psp_cmd_buf(psp);
cmd->cmd_id = GFX_CMD_ID_UAL_SET_NPA_CONFIG;
cmd->cmd.cmd_set_npa_config_ual.vmid = vmid;
cmd->cmd.cmd_set_npa_config_ual.enable_npa_translation = enable;
ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
if (!ret && cmd->resp.status)
ret = -EINVAL;
release_psp_cmd_buf(psp);
return ret;
}
int psp_update_fw_reservation(struct psp_context *psp)
{
int ret;

View File

@ -725,4 +725,7 @@ int psp_ual_set_vpod_config(struct psp_context *psp, uint32_t intf_ver,
int psp_ual_set_station_config(struct psp_context *psp, uint32_t intf_ver,
const struct amdgpu_ualink_station_config *stations);
int psp_ual_set_npa_config(struct psp_context *psp, uint32_t intf_ver,
unsigned int vmid, bool enable);
#endif