Skip to content

Commit f209485

Browse files
committed
gfx10 successful init
1 parent 07ba801 commit f209485

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ psp_cmd_submit_buf(struct psp_context *psp,
672672
if (psp->adev->no_hw_access)
673673
return 0;
674674

675-
memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
675+
memset_io(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
676676

677-
memcpy(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp));
677+
memcpy_toio(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp));
678678

679679
index = atomic_inc_return(&psp->fence_value);
680680
ret = psp_ring_cmd_submit(psp, psp->cmd_buf_mc_addr, fence_mc_addr, index);
@@ -703,7 +703,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
703703
skip_unsupport = (psp->cmd_buf_mem->resp.status == TEE_ERROR_NOT_SUPPORTED ||
704704
psp->cmd_buf_mem->resp.status == PSP_ERR_UNKNOWN_COMMAND) && amdgpu_sriov_vf(psp->adev);
705705

706-
memcpy(&cmd->resp, &psp->cmd_buf_mem->resp, sizeof(struct psp_gfx_resp));
706+
memcpy_fromio(&cmd->resp, &psp->cmd_buf_mem->resp, sizeof(struct psp_gfx_resp));
707707

708708
/* In some cases, psp response status is not 0 even there is no
709709
* problem while the command is submitted. Some version of PSP FW
@@ -1027,8 +1027,8 @@ static int psp_rl_load(struct amdgpu_device *adev)
10271027

10281028
cmd = acquire_psp_cmd_buf(psp);
10291029

1030-
memset(psp->fw_pri_buf, 0, PSP_1_MEG);
1031-
memcpy(psp->fw_pri_buf, psp->rl.start_addr, psp->rl.size_bytes);
1030+
memset_io(psp->fw_pri_buf, 0, PSP_1_MEG);
1031+
memcpy_toio(psp->fw_pri_buf, psp->rl.start_addr, psp->rl.size_bytes);
10321032

10331033
cmd->cmd_id = GFX_CMD_ID_LOAD_IP_FW;
10341034
cmd->cmd.cmd_load_ip_fw.fw_phy_addr_lo = lower_32_bits(psp->fw_pri_mc_addr);
@@ -2876,7 +2876,7 @@ static int psp_load_fw(struct amdgpu_device *adev)
28762876
/* should not destroy ring, only stop */
28772877
psp_ring_stop(psp, PSP_RING_TYPE__KM);
28782878
} else {
2879-
memset(psp->fence_buf, 0, PSP_FENCE_BUFFER_SIZE);
2879+
memset_io(psp->fence_buf, 0, PSP_FENCE_BUFFER_SIZE);
28802880

28812881
ret = psp_ring_init(psp, PSP_RING_TYPE__KM);
28822882
if (ret) {
@@ -3224,7 +3224,7 @@ int psp_ring_cmd_submit(struct psp_context *psp,
32243224
}
32253225

32263226
/* Initialize KM RB frame */
3227-
memset(write_frame, 0, sizeof(struct psp_gfx_rb_frame));
3227+
memset_io(write_frame, 0, sizeof(struct psp_gfx_rb_frame));
32283228

32293229
/* Update KM RB frame */
32303230
write_frame->cmd_buf_addr_hi = upper_32_bits(cmd_buf_mc_addr);
@@ -3836,8 +3836,8 @@ void psp_copy_fw(struct psp_context *psp, uint8_t *start_addr, uint32_t bin_size
38363836
if (!drm_dev_enter(adev_to_drm(psp->adev), &idx))
38373837
return;
38383838

3839-
memset(psp->fw_pri_buf, 0, PSP_1_MEG);
3840-
memcpy(psp->fw_pri_buf, start_addr, bin_size);
3839+
memset_io(psp->fw_pri_buf, 0, PSP_1_MEG);
3840+
memcpy_toio(psp->fw_pri_buf, start_addr, bin_size);
38413841

38423842
drm_dev_exit(idx);
38433843
}

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static int amdgpu_vcn_dec_get_create_msg(struct amdgpu_ring *ring, uint32_t hand
593593
struct amdgpu_ib *ib)
594594
{
595595
struct amdgpu_device *adev = ring->adev;
596-
uint32_t *msg;
596+
volatile uint32_t *msg;
597597
int r, i;
598598

599599
memset(ib, 0, sizeof(*ib));
@@ -628,7 +628,7 @@ static int amdgpu_vcn_dec_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han
628628
struct amdgpu_ib *ib)
629629
{
630630
struct amdgpu_device *adev = ring->adev;
631-
uint32_t *msg;
631+
volatile uint32_t *msg;
632632
int r, i;
633633

634634
memset(ib, 0, sizeof(*ib));
@@ -751,7 +751,7 @@ static int amdgpu_vcn_dec_sw_send_msg(struct amdgpu_ring *ring,
751751
ib->ptr[ib->length_dw++] = cpu_to_le32(AMDGPU_VCN_IB_FLAG_DECODE_BUFFER);
752752
decode_buffer = (struct amdgpu_vcn_decode_buffer *)&(ib->ptr[ib->length_dw]);
753753
ib->length_dw += sizeof(struct amdgpu_vcn_decode_buffer) / 4;
754-
memset(decode_buffer, 0, sizeof(struct amdgpu_vcn_decode_buffer));
754+
memset_io(decode_buffer, 0, sizeof(struct amdgpu_vcn_decode_buffer));
755755

756756
decode_buffer->valid_buf_flag |= cpu_to_le32(AMDGPU_VCN_CMD_FLAG_MSG_BUFFER);
757757
decode_buffer->msg_buffer_address_hi = cpu_to_le32(addr >> 32);

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4375,7 +4375,7 @@ static int gfx_v10_0_mec_init(struct amdgpu_device *adev)
43754375
return r;
43764376
}
43774377

4378-
memset(hpd, 0, mec_hpd_size);
4378+
memset_io(hpd, 0, mec_hpd_size);
43794379

43804380
amdgpu_bo_kunmap(adev->gfx.mec.hpd_eop_obj);
43814381
amdgpu_bo_unreserve(adev->gfx.mec.hpd_eop_obj);
@@ -5580,7 +5580,7 @@ static void gfx_v10_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade
55805580
memcpy(ptr + toc_offset, fw_data, fw_size);
55815581

55825582
if (fw_size < toc_fw_size)
5583-
memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
5583+
memset_io(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
55845584
}
55855585

55865586
static void gfx_v10_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev)
@@ -6592,7 +6592,7 @@ static void gfx_v10_0_kiq_setting(struct amdgpu_ring *ring)
65926592
}
65936593

65946594
static void gfx_v10_0_gfx_mqd_set_priority(struct amdgpu_device *adev,
6595-
struct v10_gfx_mqd *mqd,
6595+
volatile struct v10_gfx_mqd *mqd,
65966596
struct amdgpu_mqd_prop *prop)
65976597
{
65986598
bool priority = 0;
@@ -6612,7 +6612,7 @@ static void gfx_v10_0_gfx_mqd_set_priority(struct amdgpu_device *adev,
66126612
static int gfx_v10_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
66136613
struct amdgpu_mqd_prop *prop)
66146614
{
6615-
struct v10_gfx_mqd *mqd = m;
6615+
volatile struct v10_gfx_mqd *mqd = m;
66166616
uint64_t hqd_gpu_addr, wb_gpu_addr;
66176617
uint32_t tmp;
66186618
uint32_t rb_bufsz;
@@ -6699,7 +6699,7 @@ static int gfx_v10_0_kgq_init_queue(struct amdgpu_ring *ring, bool reset)
66996699
int mqd_idx = ring - &adev->gfx.gfx_ring[0];
67006700

67016701
if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
6702-
memset((void *)mqd, 0, sizeof(*mqd));
6702+
memset_io((void *)mqd, 0, sizeof(*mqd));
67036703
mutex_lock(&adev->srbm_mutex);
67046704
nv_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
67056705
amdgpu_ring_init_mqd(ring);
@@ -6769,7 +6769,7 @@ static int gfx_v10_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
67696769
static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
67706770
struct amdgpu_mqd_prop *prop)
67716771
{
6772-
struct v10_compute_mqd *mqd = m;
6772+
volatile struct v10_compute_mqd *mqd = m;
67736773
uint64_t hqd_gpu_addr, wb_gpu_addr, eop_base_addr;
67746774
uint32_t tmp;
67756775

@@ -7013,7 +7013,7 @@ static int gfx_v10_0_kiq_init_queue(struct amdgpu_ring *ring)
70137013
nv_grbm_select(adev, 0, 0, 0, 0);
70147014
mutex_unlock(&adev->srbm_mutex);
70157015
} else {
7016-
memset((void *)mqd, 0, sizeof(*mqd));
7016+
memset_io((void *)mqd, 0, sizeof(*mqd));
70177017
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
70187018
amdgpu_ring_clear_ring(ring);
70197019
mutex_lock(&adev->srbm_mutex);
@@ -7037,7 +7037,7 @@ static int gfx_v10_0_kcq_init_queue(struct amdgpu_ring *ring, bool restore)
70377037
int mqd_idx = ring - &adev->gfx.compute_ring[0];
70387038

70397039
if (!restore && !amdgpu_in_reset(adev) && !adev->in_suspend) {
7040-
memset((void *)mqd, 0, sizeof(*mqd));
7040+
memset_io((void *)mqd, 0, sizeof(*mqd));
70417041
mutex_lock(&adev->srbm_mutex);
70427042
nv_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
70437043
amdgpu_ring_init_mqd(ring);

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static void dcn3_notify_wm_ranges(struct clk_mgr *clk_mgr_base)
333333
// should log failure
334334
return;
335335

336-
memset(table, 0, sizeof(*table));
336+
memset_io(table, 0, sizeof(*table));
337337

338338
/* collect valid ranges, place in pmfw table */
339339
for (i = 0; i < WM_SET_COUNT; i++)

0 commit comments

Comments
 (0)