Lines Matching refs:cpt

74 static void otx_cpt_send_msg_to_vf(struct otx_cpt_device *cpt, int vf,
78 writeq(mbx->data, cpt->reg_base + OTX_CPT_PF_VFX_MBOXX(vf, 1));
79 writeq(mbx->msg, cpt->reg_base + OTX_CPT_PF_VFX_MBOXX(vf, 0));
86 static void otx_cpt_mbox_send_ack(struct otx_cpt_device *cpt, int vf,
91 otx_cpt_send_msg_to_vf(cpt, vf, mbx);
95 static void otx_cptpf_mbox_send_nack(struct otx_cpt_device *cpt, int vf,
100 otx_cpt_send_msg_to_vf(cpt, vf, mbx);
103 static void otx_cpt_clear_mbox_intr(struct otx_cpt_device *cpt, u32 vf)
106 writeq(1ull << vf, cpt->reg_base + OTX_CPT_PF_MBOX_INTX(0));
112 static void otx_cpt_cfg_qlen_for_vf(struct otx_cpt_device *cpt, int vf,
117 pf_qx_ctl.u = readq(cpt->reg_base + OTX_CPT_PF_QX_CTL(vf));
120 writeq(pf_qx_ctl.u, cpt->reg_base + OTX_CPT_PF_QX_CTL(vf));
126 static void otx_cpt_cfg_vq_priority(struct otx_cpt_device *cpt, int vf, u32 pri)
130 pf_qx_ctl.u = readq(cpt->reg_base + OTX_CPT_PF_QX_CTL(vf));
132 writeq(pf_qx_ctl.u, cpt->reg_base + OTX_CPT_PF_QX_CTL(vf));
135 static int otx_cpt_bind_vq_to_grp(struct otx_cpt_device *cpt, u8 q, u8 grp)
137 struct device *dev = &cpt->pdev->dev;
142 if (q >= cpt->max_vfs) {
144 q, cpt->max_vfs);
154 eng_grp = &cpt->eng_grps.grp[grp];
160 pf_qx_ctl.u = readq(cpt->reg_base + OTX_CPT_PF_QX_CTL(q));
162 writeq(pf_qx_ctl.u, cpt->reg_base + OTX_CPT_PF_QX_CTL(q));
178 static void otx_cpt_handle_mbox_intr(struct otx_cpt_device *cpt, int vf)
182 struct device *dev = &cpt->pdev->dev;
187 mbx.msg = readq(cpt->reg_base + OTX_CPT_PF_VFX_MBOXX(vf, 0));
188 mbx.data = readq(cpt->reg_base + OTX_CPT_PF_VFX_MBOXX(vf, 1));
195 mbx.data = cpt->vfs_enabled;
196 otx_cpt_send_msg_to_vf(cpt, vf, &mbx);
201 otx_cpt_send_msg_to_vf(cpt, vf, &mbx);
205 otx_cpt_mbox_send_ack(cpt, vf, &mbx);
208 otx_cpt_cfg_qlen_for_vf(cpt, vf, mbx.data);
209 otx_cpt_mbox_send_ack(cpt, vf, &mbx);
212 vftype = otx_cpt_bind_vq_to_grp(cpt, vf, (u8)mbx.data);
217 otx_cptpf_mbox_send_nack(cpt, vf, &mbx);
221 otx_cpt_send_msg_to_vf(cpt, vf, &mbx);
226 mbx.data = cpt->pf_type;
227 otx_cpt_send_msg_to_vf(cpt, vf, &mbx);
230 otx_cpt_cfg_vq_priority(cpt, vf, mbx.data);
231 otx_cpt_mbox_send_ack(cpt, vf, &mbx);
234 dev_err(&cpt->pdev->dev, "Invalid msg from VF%d, msg 0x%llx\n",
240 void otx_cpt_mbox_intr_handler (struct otx_cpt_device *cpt, int mbx)
245 intr = readq(cpt->reg_base + OTX_CPT_PF_MBOX_INTX(0));
247 for (vf = 0; vf < cpt->max_vfs; vf++) {
249 otx_cpt_handle_mbox_intr(cpt, vf);
250 otx_cpt_clear_mbox_intr(cpt, vf);