Lines Matching +full:cryptocell +full:- +full:712 +full:- +full:ree

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2012-2019 ARM Limited or its affiliates. */
79 .name = "712", .rev = CC_HW_REV_712, .sig = 0xDCC71200U,
94 { .compatible = "arm,cryptocell-703-ree", .data = &cc703_hw },
95 { .compatible = "arm,cryptocell-713-ree", .data = &cc713_hw },
96 { .compatible = "arm,cryptocell-712-ree", .data = &cc712_hw },
97 { .compatible = "arm,cryptocell-710-ree", .data = &cc710_hw },
98 { .compatible = "arm,cryptocell-630p-ree", .data = &cc630p_hw },
113 /* non cached or write-back, write allocate */ in init_cc_cache_params()
114 val = drvdata->coherent ? 0xb : 0x2; in init_cc_cache_params()
128 drvdata->cache_params = cache_params; in init_cc_cache_params()
132 if (drvdata->hw_rev <= CC_HW_REV_710) in init_cc_cache_params()
137 dev_dbg(dev, "ACE-const previous: 0x%08X\n", ace_const); in init_cc_cache_params()
139 /* system or outer-sharable */ in init_cc_cache_params()
140 val = drvdata->coherent ? 0x2 : 0x3; in init_cc_cache_params()
150 dev_dbg(dev, "ACE-const current: 0x%08X\n", ace_const); in init_cc_cache_params()
152 drvdata->ace_const = ace_const; in init_cc_cache_params()
203 /* clear interrupt - must be before processing events */ in cc_isr()
206 drvdata->irq = irr; in cc_isr()
207 /* Completion interrupt - most probable */ in cc_isr()
208 if (irr & drvdata->comp_mask) { in cc_isr()
209 /* Mask all completion interrupts - will be unmasked in in cc_isr()
212 cc_iowrite(drvdata, CC_REG(HOST_IMR), imr | drvdata->comp_mask); in cc_isr()
213 irr &= ~drvdata->comp_mask; in cc_isr()
219 /* Mask interrupt - will be unmasked in Deferred service in cc_isr()
253 /* 712/710/63 has no reset completion indication, always return true */ in cc_wait_for_reset_completion()
254 if (drvdata->hw_rev <= CC_HW_REV_712) in cc_wait_for_reset_completion()
280 if (drvdata->hw_rev <= CC_HW_REV_712) { in init_cc_regs()
293 val = drvdata->comp_mask | CC_AXI_ERR_IRQ_MASK; in init_cc_regs()
295 if (drvdata->hw_rev >= CC_HW_REV_712) in init_cc_regs()
300 cc_iowrite(drvdata, CC_REG(AXIM_CACHE_PARAMS), drvdata->cache_params); in init_cc_regs()
301 if (drvdata->hw_rev >= CC_HW_REV_712) in init_cc_regs()
302 cc_iowrite(drvdata, CC_REG(AXIM_ACE_CONST), drvdata->ace_const); in init_cc_regs()
311 struct device *dev = &plat_dev->dev; in init_cc_resources()
312 struct device_node *np = dev->of_node; in init_cc_resources()
322 return -ENOMEM; in init_cc_resources()
325 new_drvdata->hw_rev_name = hw_rev->name; in init_cc_resources()
326 new_drvdata->hw_rev = hw_rev->rev; in init_cc_resources()
327 new_drvdata->std_bodies = hw_rev->std_bodies; in init_cc_resources()
329 if (hw_rev->rev >= CC_HW_REV_712) { in init_cc_resources()
330 new_drvdata->axim_mon_offset = CC_REG(AXIM_MON_COMP); in init_cc_resources()
331 new_drvdata->sig_offset = CC_REG(HOST_SIGNATURE_712); in init_cc_resources()
332 new_drvdata->ver_offset = CC_REG(HOST_VERSION_712); in init_cc_resources()
334 new_drvdata->axim_mon_offset = CC_REG(AXIM_MON_COMP8); in init_cc_resources()
335 new_drvdata->sig_offset = CC_REG(HOST_SIGNATURE_630); in init_cc_resources()
336 new_drvdata->ver_offset = CC_REG(HOST_VERSION_630); in init_cc_resources()
339 new_drvdata->comp_mask = CC_COMP_IRQ_MASK; in init_cc_resources()
342 new_drvdata->plat_dev = plat_dev; in init_cc_resources()
347 new_drvdata->clk = clk; in init_cc_resources()
349 new_drvdata->coherent = of_dma_is_coherent(np); in init_cc_resources()
355 new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs); in init_cc_resources()
356 if (IS_ERR(new_drvdata->cc_base)) in init_cc_resources()
357 return PTR_ERR(new_drvdata->cc_base); in init_cc_resources()
359 dev_dbg(dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name, in init_cc_resources()
362 &req_mem_cc_regs->start, new_drvdata->cc_base); in init_cc_resources()
369 init_completion(&new_drvdata->hw_queue_avail); in init_cc_resources()
371 if (!dev->dma_mask) in init_cc_resources()
372 dev->dma_mask = &dev->coherent_dma_mask; in init_cc_resources()
382 rc = clk_prepare_enable(new_drvdata->clk); in init_cc_resources()
388 new_drvdata->sec_disabled = cc_sec_disable; in init_cc_resources()
400 /* Wait for Cryptocell reset completion */ in init_cc_resources()
402 dev_err(dev, "Cryptocell reset not completed"); in init_cc_resources()
405 if (hw_rev->rev <= CC_HW_REV_712) { in init_cc_resources()
407 val = cc_ioread(new_drvdata, new_drvdata->sig_offset); in init_cc_resources()
408 if (val != hw_rev->sig) { in init_cc_resources()
410 val, hw_rev->sig); in init_cc_resources()
411 rc = -EINVAL; in init_cc_resources()
415 hw_rev_pidr = cc_ioread(new_drvdata, new_drvdata->ver_offset); in init_cc_resources()
419 if (val != hw_rev->pidr_0124) { in init_cc_resources()
421 val, hw_rev->pidr_0124); in init_cc_resources()
422 rc = -EINVAL; in init_cc_resources()
428 if (val != hw_rev->cidr_0123) { in init_cc_resources()
430 val, hw_rev->cidr_0123); in init_cc_resources()
431 rc = -EINVAL; in init_cc_resources()
443 if (new_drvdata->std_bodies & CC_STD_NIST) { in init_cc_resources()
445 new_drvdata->std_bodies = CC_STD_OSCCA; in init_cc_resources()
450 rc = -EINVAL; in init_cc_resources()
457 new_drvdata->sec_disabled |= !!val; in init_cc_resources()
459 if (!new_drvdata->sec_disabled) { in init_cc_resources()
460 new_drvdata->comp_mask |= CC_CPP_SM4_ABORT_MASK; in init_cc_resources()
461 if (new_drvdata->std_bodies & CC_STD_NIST) in init_cc_resources()
462 new_drvdata->comp_mask |= CC_CPP_AES_ABORT_MASK; in init_cc_resources()
466 if (new_drvdata->sec_disabled) in init_cc_resources()
470 dev_info(dev, "ARM CryptoCell %s Driver: HW version 0x%08X/0x%8X, Driver version %s\n", in init_cc_resources()
471 hw_rev->name, hw_rev_pidr, sig_cidr, DRV_MODULE_VERSION); in init_cc_resources()
506 new_drvdata->mlli_sram_addr = in init_cc_resources()
508 if (new_drvdata->mlli_sram_addr == NULL_SRAM_ADDR) { in init_cc_resources()
509 rc = -ENOMEM; in init_cc_resources()
574 clk_disable_unprepare(new_drvdata->clk); in init_cc_resources()
586 struct device *dev = &plat_dev->dev; in cleanup_cc_resources()
601 clk_disable_unprepare(drvdata->clk); in cleanup_cc_resources()
606 if (drvdata->hw_rev >= CC_HW_REV_712) in cc_get_default_hash_len()
615 struct device *dev = &plat_dev->dev; in ccree_probe()
629 struct device *dev = &plat_dev->dev; in ccree_remove()
668 MODULE_DESCRIPTION("ARM TrustZone CryptoCell REE Driver");