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