Lines Matching defs:p_hwfn

127 void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn, u32 rt_offset, u32 val)
130 DP_ERR(p_hwfn,
136 p_hwfn->rt_data.init_val[rt_offset] = val;
137 p_hwfn->rt_data.b_valid[rt_offset] = true;
140 void qed_init_store_rt_agg(struct qed_hwfn *p_hwfn,
146 DP_ERR(p_hwfn,
154 p_hwfn->rt_data.init_val[rt_offset + i] = p_val[i];
155 p_hwfn->rt_data.b_valid[rt_offset + i] = true;
159 static int qed_init_rt(struct qed_hwfn *p_hwfn,
163 u32 *p_init_val = &p_hwfn->rt_data.init_val[rt_offset];
164 bool *p_valid = &p_hwfn->rt_data.b_valid[rt_offset];
179 qed_wr(p_hwfn, p_ptt, addr + (i << 2), p_init_val[i]);
189 rc = qed_dmae_host2grc(p_hwfn, p_ptt,
206 int qed_init_alloc(struct qed_hwfn *p_hwfn)
208 struct qed_rt_data *rt_data = &p_hwfn->rt_data;
210 if (IS_VF(p_hwfn->cdev))
229 void qed_init_free(struct qed_hwfn *p_hwfn)
231 kfree(p_hwfn->rt_data.init_val);
232 p_hwfn->rt_data.init_val = NULL;
233 kfree(p_hwfn->rt_data.b_valid);
234 p_hwfn->rt_data.b_valid = NULL;
237 static int qed_init_array_dmae(struct qed_hwfn *p_hwfn,
254 qed_wr(p_hwfn, p_ptt, addr + (i << 2), data[i]);
256 rc = qed_dmae_host2grc(p_hwfn, p_ptt,
264 static int qed_init_fill_dmae(struct qed_hwfn *p_hwfn,
280 return qed_dmae_host2grc(p_hwfn, p_ptt,
285 static void qed_init_fill(struct qed_hwfn *p_hwfn,
292 qed_wr(p_hwfn, p_ptt, addr, fill);
295 static int qed_init_cmd_array(struct qed_hwfn *p_hwfn,
305 struct qed_dev *cdev = p_hwfn->cdev;
321 memset(p_hwfn->unzip_buf, 0, max_size);
323 output_len = qed_unzip_data(p_hwfn, input_len,
325 max_size, (u8 *)p_hwfn->unzip_buf);
327 rc = qed_init_array_dmae(p_hwfn, p_ptt, addr, 0,
329 p_hwfn->unzip_buf,
332 DP_NOTICE(p_hwfn, "Failed to unzip dmae data\n");
345 rc = qed_init_array_dmae(p_hwfn, p_ptt, addr,
356 rc = qed_init_array_dmae(p_hwfn, p_ptt, addr,
367 static int qed_init_cmd_wr(struct qed_hwfn *p_hwfn,
379 DP_NOTICE(p_hwfn,
388 qed_wr(p_hwfn, p_ptt, addr, data);
393 rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, data);
395 qed_init_fill(p_hwfn, p_ptt, addr, 0, data);
398 rc = qed_init_cmd_array(p_hwfn, p_ptt, p_cmd,
402 qed_init_rt(p_hwfn, p_ptt, addr,
428 static void qed_init_cmd_rd(struct qed_hwfn *p_hwfn,
440 val = qed_rd(p_hwfn, p_ptt, addr);
456 DP_ERR(p_hwfn, "Invalid poll comparison type %08x\n",
466 val = qed_rd(p_hwfn, p_ptt, addr);
470 DP_ERR(p_hwfn,
478 static int qed_init_cmd_cb(struct qed_hwfn *p_hwfn,
486 rc = qed_dmae_sanity(p_hwfn, p_ptt, "engine_phase");
489 DP_NOTICE(p_hwfn, "Unexpected init op callback ID %d\n",
497 static u8 qed_init_cmd_mode_match(struct qed_hwfn *p_hwfn,
500 struct qed_dev *cdev = p_hwfn->cdev;
508 return qed_init_cmd_mode_match(p_hwfn, p_offset, modes) ^ 1;
510 arg1 = qed_init_cmd_mode_match(p_hwfn, p_offset, modes);
511 arg2 = qed_init_cmd_mode_match(p_hwfn, p_offset, modes);
514 arg1 = qed_init_cmd_mode_match(p_hwfn, p_offset, modes);
515 arg2 = qed_init_cmd_mode_match(p_hwfn, p_offset, modes);
523 static u32 qed_init_cmd_mode(struct qed_hwfn *p_hwfn,
528 if (qed_init_cmd_mode_match(p_hwfn, &offset, modes))
549 int qed_init_run(struct qed_hwfn *p_hwfn,
553 struct qed_dev *cdev = p_hwfn->cdev;
561 p_hwfn->unzip_buf = kzalloc(MAX_ZIPPED_SIZE * 4, GFP_ATOMIC);
562 if (!p_hwfn->unzip_buf)
571 rc = qed_init_cmd_wr(p_hwfn, p_ptt, &cmd->write,
575 qed_init_cmd_rd(p_hwfn, p_ptt, &cmd->read);
578 cmd_num += qed_init_cmd_mode(p_hwfn, &cmd->if_mode,
593 rc = qed_init_cmd_cb(p_hwfn, p_ptt, &cmd->callback);
604 kfree(p_hwfn->unzip_buf);
605 p_hwfn->unzip_buf = NULL;
609 void qed_gtt_init(struct qed_hwfn *p_hwfn)
619 REG_WR(p_hwfn, gtt_base + i * PXP_GLOBAL_ENTRY_SIZE,