summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-06-22 18:26:33 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-06-29 12:43:48 -0400
commitf03defe0b70c8c3e19c267fa27f094ce6503c30f (patch)
treeaed98e94744bee8bdc2aad5dc050aa1e138a2a11 /drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
parent14b05f8a012a319cd58d25b4564da98a7b9b7303 (diff)
drm/amdgpu/psp: upper_32_bits/lower_32_bits for address setup
Rather than casting and shifting. Fixes sparse cast warnings. Reviewed-by: Samuel Li <samuel.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/psp_v10_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_v10_0.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
index 20c1e539ff35..2258323a3c26 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
@@ -96,8 +96,8 @@ int psp_v10_0_prep_cmd_buf(struct amdgpu_firmware_info *ucode, struct psp_gfx_cm
header = (struct common_firmware_header *)ucode->fw;
cmd->cmd_id = GFX_CMD_ID_LOAD_IP_FW;
- cmd->cmd.cmd_load_ip_fw.fw_phy_addr_lo = (uint32_t)fw_mem_mc_addr;
- cmd->cmd.cmd_load_ip_fw.fw_phy_addr_hi = (uint32_t)((uint64_t)fw_mem_mc_addr >> 32);
+ cmd->cmd.cmd_load_ip_fw.fw_phy_addr_lo = lower_32_bits(fw_mem_mc_addr);
+ cmd->cmd.cmd_load_ip_fw.fw_phy_addr_hi = upper_32_bits(fw_mem_mc_addr);
cmd->cmd.cmd_load_ip_fw.fw_size = le32_to_cpu(header->ucode_size_bytes);
ret = psp_v10_0_get_fw_type(ucode, &cmd->cmd.cmd_load_ip_fw.fw_type);
@@ -172,10 +172,10 @@ int psp_v10_0_cmd_submit(struct psp_context *psp,
write_frame = ring->ring_mem + (psp_write_ptr_reg / (sizeof(struct psp_gfx_rb_frame) / 4));
/* Update KM RB frame */
- write_frame->cmd_buf_addr_hi = (unsigned int)(cmd_buf_mc_addr >> 32);
- write_frame->cmd_buf_addr_lo = (unsigned int)(cmd_buf_mc_addr);
- write_frame->fence_addr_hi = (unsigned int)(fence_mc_addr >> 32);
- write_frame->fence_addr_lo = (unsigned int)(fence_mc_addr);
+ write_frame->cmd_buf_addr_hi = upper_32_bits(cmd_buf_mc_addr);
+ write_frame->cmd_buf_addr_lo = lower_32_bits(cmd_buf_mc_addr);
+ write_frame->fence_addr_hi = upper_32_bits(fence_mc_addr);
+ write_frame->fence_addr_lo = lower_32_bits(fence_mc_addr);
write_frame->fence_value = index;
/* Update the write Pointer in DWORDs */