Lines Matching refs:new_drvdata
266 struct cc_drvdata *new_drvdata; in init_cc_resources() local
276 new_drvdata = devm_kzalloc(dev, sizeof(*new_drvdata), GFP_KERNEL); in init_cc_resources()
277 if (!new_drvdata) in init_cc_resources()
285 new_drvdata->hw_rev_name = hw_rev->name; in init_cc_resources()
286 new_drvdata->hw_rev = hw_rev->rev; in init_cc_resources()
287 new_drvdata->std_bodies = hw_rev->std_bodies; in init_cc_resources()
290 new_drvdata->axim_mon_offset = CC_REG(AXIM_MON_COMP); in init_cc_resources()
291 new_drvdata->sig_offset = CC_REG(HOST_SIGNATURE_712); in init_cc_resources()
292 new_drvdata->ver_offset = CC_REG(HOST_VERSION_712); in init_cc_resources()
294 new_drvdata->axim_mon_offset = CC_REG(AXIM_MON_COMP8); in init_cc_resources()
295 new_drvdata->sig_offset = CC_REG(HOST_SIGNATURE_630); in init_cc_resources()
296 new_drvdata->ver_offset = CC_REG(HOST_VERSION_630); in init_cc_resources()
299 new_drvdata->comp_mask = CC_COMP_IRQ_MASK; in init_cc_resources()
301 platform_set_drvdata(plat_dev, new_drvdata); in init_cc_resources()
302 new_drvdata->plat_dev = plat_dev; in init_cc_resources()
320 new_drvdata->clk = clk; in init_cc_resources()
322 new_drvdata->coherent = of_dma_is_coherent(np); in init_cc_resources()
328 new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs); in init_cc_resources()
329 if (IS_ERR(new_drvdata->cc_base)) { in init_cc_resources()
331 return PTR_ERR(new_drvdata->cc_base); in init_cc_resources()
337 &req_mem_cc_regs->start, new_drvdata->cc_base); in init_cc_resources()
340 new_drvdata->irq = platform_get_irq(plat_dev, 0); in init_cc_resources()
341 if (new_drvdata->irq < 0) in init_cc_resources()
342 return new_drvdata->irq; in init_cc_resources()
344 init_completion(&new_drvdata->hw_queue_avail); in init_cc_resources()
364 rc = cc_clk_on(new_drvdata); in init_cc_resources()
370 new_drvdata->sec_disabled = cc_sec_disable; in init_cc_resources()
373 if (!cc_wait_for_reset_completion(new_drvdata)) { in init_cc_resources()
379 val = cc_ioread(new_drvdata, new_drvdata->sig_offset); in init_cc_resources()
387 hw_rev_pidr = cc_ioread(new_drvdata, new_drvdata->ver_offset); in init_cc_resources()
390 val = cc_read_idr(new_drvdata, pidr_0124_offsets); in init_cc_resources()
399 val = cc_read_idr(new_drvdata, cidr_0123_offsets); in init_cc_resources()
409 val = cc_ioread(new_drvdata, CC_REG(HOST_REMOVE_INPUT_PINS)); in init_cc_resources()
415 if (new_drvdata->std_bodies & CC_STD_NIST) { in init_cc_resources()
417 new_drvdata->std_bodies = CC_STD_OSCCA; in init_cc_resources()
427 val = cc_ioread(new_drvdata, CC_REG(SECURITY_DISABLED)); in init_cc_resources()
429 new_drvdata->sec_disabled |= !!val; in init_cc_resources()
431 if (!new_drvdata->sec_disabled) { in init_cc_resources()
432 new_drvdata->comp_mask |= CC_CPP_SM4_ABORT_MASK; in init_cc_resources()
433 if (new_drvdata->std_bodies & CC_STD_NIST) in init_cc_resources()
434 new_drvdata->comp_mask |= CC_CPP_AES_ABORT_MASK; in init_cc_resources()
438 if (new_drvdata->sec_disabled) in init_cc_resources()
445 rc = devm_request_irq(dev, new_drvdata->irq, cc_isr, in init_cc_resources()
446 IRQF_SHARED, "ccree", new_drvdata); in init_cc_resources()
449 new_drvdata->irq); in init_cc_resources()
452 dev_dbg(dev, "Registered to IRQ: %d\n", new_drvdata->irq); in init_cc_resources()
454 rc = init_cc_regs(new_drvdata, true); in init_cc_resources()
460 rc = cc_debugfs_init(new_drvdata); in init_cc_resources()
466 rc = cc_fips_init(new_drvdata); in init_cc_resources()
471 rc = cc_sram_mgr_init(new_drvdata); in init_cc_resources()
477 new_drvdata->mlli_sram_addr = in init_cc_resources()
478 cc_sram_alloc(new_drvdata, MAX_MLLI_BUFF_SIZE); in init_cc_resources()
479 if (new_drvdata->mlli_sram_addr == NULL_SRAM_ADDR) { in init_cc_resources()
485 rc = cc_req_mgr_init(new_drvdata); in init_cc_resources()
491 rc = cc_buffer_mgr_init(new_drvdata); in init_cc_resources()
497 rc = cc_pm_init(new_drvdata); in init_cc_resources()
504 rc = cc_cipher_alloc(new_drvdata); in init_cc_resources()
511 rc = cc_hash_alloc(new_drvdata); in init_cc_resources()
517 rc = cc_aead_alloc(new_drvdata); in init_cc_resources()
524 cc_pm_go(new_drvdata); in init_cc_resources()
530 cc_set_ree_fips_status(new_drvdata, true); in init_cc_resources()
535 cc_hash_free(new_drvdata); in init_cc_resources()
537 cc_cipher_free(new_drvdata); in init_cc_resources()
539 cc_buffer_mgr_fini(new_drvdata); in init_cc_resources()
541 cc_req_mgr_fini(new_drvdata); in init_cc_resources()
543 cc_sram_mgr_fini(new_drvdata); in init_cc_resources()
545 cc_fips_fini(new_drvdata); in init_cc_resources()
547 cc_debugfs_fini(new_drvdata); in init_cc_resources()
549 fini_cc_regs(new_drvdata); in init_cc_resources()
551 cc_clk_off(new_drvdata); in init_cc_resources()