36 #ifdef CONFIG_DEBUG_FS
53 static void build_instantiation_desc(
u32 *
desc)
57 init_job_desc(desc, 0);
65 set_jump_tgt_here(desc, jump_cmd);
98 static int instantiate_rng(
struct device *jrdev)
108 dev_err(jrdev,
"cannot allocate RNG init descriptor memory\n");
112 build_instantiation_desc(desc);
114 init_completion(&instantiation.completion);
118 ret = instantiation.err;
120 dev_err(jrdev,
"unable to instantiate RNG\n");
143 r4tst = &topregs->
ctrl.r4tst[0];
148 val = rd_reg32(&r4tst->
rtsdctl);
150 wr_reg32(&r4tst->
rtsdctl, val);
168 static const struct {
184 if (caam_eras[i].ip_id == sec_vid->
ip_id &&
185 caam_eras[i].maj_rev == sec_vid->
maj_rev)
186 return caam_eras[
i].era;
195 int ret, ring, rspec;
202 #ifdef CONFIG_DEBUG_FS
212 ctrlpriv->
pdev = pdev;
213 nprop = pdev->
dev.of_node;
219 dev_err(dev,
"caam: of_iomap() failed\n");
251 for_each_compatible_node(np,
NULL,
"fsl,sec-v4.0-job-ring")
255 for_each_compatible_node(np,
NULL,
"fsl,sec4.0-job-ring")
260 if (ctrlpriv->jrdev ==
NULL) {
267 for_each_compatible_node(np,
NULL,
"fsl,sec-v4.0-job-ring") {
273 for_each_compatible_node(np,
NULL,
"fsl,sec4.0-job-ring") {
281 ctrlpriv->
qi_present = !!(rd_reg64(&topregs->
ctrl.perfmon.comp_parms) &
291 dev_err(dev,
"no queues configured, terminating\n");
302 ret = instantiate_rng(ctrlpriv->
jrdev[0]);
314 caam_id = rd_reg64(&topregs->
ctrl.perfmon.caam_id);
317 dev_info(dev,
"device ID = 0x%016llx (Era %d)\n", caam_id,
319 dev_info(dev,
"job rings = %d, qi = %d\n",
322 #ifdef CONFIG_DEBUG_FS
334 ctrlpriv->ctl_rq_dequeued =
338 ctrlpriv->ctl_ob_enc_req =
342 ctrlpriv->ctl_ib_dec_req =
346 ctrlpriv->ctl_ob_enc_bytes =
350 ctrlpriv->ctl_ob_prot_bytes =
354 ctrlpriv->ctl_ib_dec_bytes =
358 ctrlpriv->ctl_ib_valid_bytes =
364 ctrlpriv->ctl_faultaddr =
368 ctrlpriv->ctl_faultdetail =
372 ctrlpriv->ctl_faultstatus =
375 ctrlpriv->ctl, &perfmon->
status);
378 ctrlpriv->ctl_kek_wrap.data = &ctrlpriv->
ctrl->kek[0];
384 &ctrlpriv->ctl_kek_wrap);
386 ctrlpriv->ctl_tkek_wrap.data = &ctrlpriv->
ctrl->tkek[0];
392 &ctrlpriv->ctl_tkek_wrap);
394 ctrlpriv->ctl_tdsk_wrap.data = &ctrlpriv->
ctrl->tdsk[0];
400 &ctrlpriv->ctl_tdsk_wrap);
407 .compatible =
"fsl,sec-v4.0",
410 .compatible =
"fsl,sec4.0",
420 .of_match_table = caam_match,