Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: caam - Add Platform driver for Job Ring

The SEC Job Rings are now available as individual devices.
This would enable sharing of job rings between kernel and
user space. Job Rings can now be dynamically bound/unbound
from kernel.

Changes are made in the following layers of CAAM Driver
1. Controller driver
- Does basic initialization of CAAM Block.
- Creates platform devices for Job Rings.
(Earlier the initialization of Job ring was done
by the controller driver)

2. JobRing Platform driver
- Manages the platform Job Ring devices created
by the controller driver

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Reviewed-by: Garg Vakul-B16394 <vakul@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ruchika Gupta and committed by
Herbert Xu
313ea293 0d289788

+234 -138
+19 -6
drivers/crypto/caam/Kconfig
··· 4 4 help 5 5 Enables the driver module for Freescale's Cryptographic Accelerator 6 6 and Assurance Module (CAAM), also known as the SEC version 4 (SEC4). 7 - This module adds a job ring operation interface, and configures h/w 7 + This module creates job ring devices, and configures h/w 8 8 to operate as a DPAA component automatically, depending 9 9 on h/w feature availability. 10 10 11 11 To compile this driver as a module, choose M here: the module 12 12 will be called caam. 13 13 14 + config CRYPTO_DEV_FSL_CAAM_JR 15 + tristate "Freescale CAAM Job Ring driver backend" 16 + depends on CRYPTO_DEV_FSL_CAAM 17 + default y 18 + help 19 + Enables the driver module for Job Rings which are part of 20 + Freescale's Cryptographic Accelerator 21 + and Assurance Module (CAAM). This module adds a job ring operation 22 + interface. 23 + 24 + To compile this driver as a module, choose M here: the module 25 + will be called caam_jr. 26 + 14 27 config CRYPTO_DEV_FSL_CAAM_RINGSIZE 15 28 int "Job Ring size" 16 - depends on CRYPTO_DEV_FSL_CAAM 29 + depends on CRYPTO_DEV_FSL_CAAM_JR 17 30 range 2 9 18 31 default "9" 19 32 help ··· 44 31 45 32 config CRYPTO_DEV_FSL_CAAM_INTC 46 33 bool "Job Ring interrupt coalescing" 47 - depends on CRYPTO_DEV_FSL_CAAM 34 + depends on CRYPTO_DEV_FSL_CAAM_JR 48 35 default n 49 36 help 50 37 Enable the Job Ring's interrupt coalescing feature. ··· 75 62 76 63 config CRYPTO_DEV_FSL_CAAM_CRYPTO_API 77 64 tristate "Register algorithm implementations with the Crypto API" 78 - depends on CRYPTO_DEV_FSL_CAAM 65 + depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR 79 66 default y 80 67 select CRYPTO_ALGAPI 81 68 select CRYPTO_AUTHENC ··· 89 76 90 77 config CRYPTO_DEV_FSL_CAAM_AHASH_API 91 78 tristate "Register hash algorithm implementations with Crypto API" 92 - depends on CRYPTO_DEV_FSL_CAAM 79 + depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR 93 80 default y 94 81 select CRYPTO_HASH 95 82 help ··· 101 88 102 89 config CRYPTO_DEV_FSL_CAAM_RNG_API 103 90 tristate "Register caam device for hwrng API" 104 - depends on CRYPTO_DEV_FSL_CAAM 91 + depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR 105 92 default y 106 93 select CRYPTO_RNG 107 94 select HW_RANDOM
+3 -1
drivers/crypto/caam/Makefile
··· 6 6 endif 7 7 8 8 obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam.o 9 + obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_JR) += caam_jr.o 9 10 obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API) += caamalg.o 10 11 obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API) += caamhash.o 11 12 obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API) += caamrng.o 12 13 13 - caam-objs := ctrl.o jr.o error.o key_gen.o 14 + caam-objs := ctrl.o 15 + caam_jr-objs := jr.o key_gen.o error.o
+3 -1
drivers/crypto/caam/caamalg.c
··· 2071 2071 container_of(alg, struct caam_crypto_alg, crypto_alg); 2072 2072 struct caam_ctx *ctx = crypto_tfm_ctx(tfm); 2073 2073 struct caam_drv_private *priv = dev_get_drvdata(caam_alg->ctrldev); 2074 + struct platform_device *pdev; 2074 2075 int tgt_jr = atomic_inc_return(&priv->tfm_count); 2075 2076 2076 2077 /* 2077 2078 * distribute tfms across job rings to ensure in-order 2078 2079 * crypto request processing per tfm 2079 2080 */ 2080 - ctx->jrdev = priv->jrdev[(tgt_jr / 2) % priv->total_jobrs]; 2081 + pdev = priv->jrpdev[(tgt_jr / 2) % priv->total_jobrs]; 2082 + ctx->jrdev = &pdev->dev; 2081 2083 2082 2084 /* copy descriptor header template value */ 2083 2085 ctx->class1_alg_type = OP_TYPE_CLASS1_ALG | caam_alg->class1_alg_type;
+3 -1
drivers/crypto/caam/caamhash.c
··· 1680 1680 HASH_MSG_LEN + SHA512_DIGEST_SIZE }; 1681 1681 int tgt_jr = atomic_inc_return(&priv->tfm_count); 1682 1682 int ret = 0; 1683 + struct platform_device *pdev; 1683 1684 1684 1685 /* 1685 1686 * distribute tfms across job rings to ensure in-order 1686 1687 * crypto request processing per tfm 1687 1688 */ 1688 - ctx->jrdev = priv->jrdev[tgt_jr % priv->total_jobrs]; 1689 + pdev = priv->jrpdev[tgt_jr % priv->total_jobrs]; 1690 + ctx->jrdev = &pdev->dev; 1689 1691 1690 1692 /* copy descriptor header template value */ 1691 1693 ctx->alg_type = OP_TYPE_CLASS2_ALG | caam_hash->alg_type;
+4 -3
drivers/crypto/caam/caamrng.c
··· 279 279 static int __init caam_rng_init(void) 280 280 { 281 281 struct device_node *dev_node; 282 - struct platform_device *pdev; 282 + struct platform_device *pdev, *jrpdev; 283 283 struct device *ctrldev; 284 284 struct caam_drv_private *priv; 285 285 ··· 305 305 if (!priv) 306 306 return -ENODEV; 307 307 308 - caam_init_rng(&rng_ctx, priv->jrdev[0]); 308 + jrpdev = priv->jrpdev[0]; 309 + caam_init_rng(&rng_ctx, &jrpdev->dev); 309 310 310 - dev_info(priv->jrdev[0], "registering rng-caam\n"); 311 + dev_info(&jrpdev->dev, "registering rng-caam\n"); 311 312 return hwrng_register(&caam_rng); 312 313 } 313 314
+20 -10
drivers/crypto/caam/ctrl.c
··· 268 268 { 269 269 struct device *ctrldev; 270 270 struct caam_drv_private *ctrlpriv; 271 - struct caam_drv_private_jr *jrpriv; 272 271 struct caam_full __iomem *topregs; 273 272 int ring, ret = 0; 274 273 ··· 275 276 ctrlpriv = dev_get_drvdata(ctrldev); 276 277 topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; 277 278 278 - /* shut down JobRs */ 279 + /* Remove platform devices for JobRs */ 279 280 for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { 280 - ret |= caam_jr_shutdown(ctrlpriv->jrdev[ring]); 281 - jrpriv = dev_get_drvdata(ctrlpriv->jrdev[ring]); 282 - irq_dispose_mapping(jrpriv->irq); 281 + if (ctrlpriv->jrpdev[ring]) 282 + of_device_unregister(ctrlpriv->jrpdev[ring]); 283 283 } 284 284 285 285 /* De-initialize RNG state handles initialized by this driver. */ ··· 293 295 /* Unmap controller region */ 294 296 iounmap(&topregs->ctrl); 295 297 296 - kfree(ctrlpriv->jrdev); 298 + kfree(ctrlpriv->jrpdev); 297 299 kfree(ctrlpriv); 298 300 299 301 return ret; ··· 448 450 rspec++; 449 451 } 450 452 451 - ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL); 452 - if (ctrlpriv->jrdev == NULL) { 453 + ctrlpriv->jrpdev = kzalloc(sizeof(struct platform_device *) * rspec, 454 + GFP_KERNEL); 455 + if (ctrlpriv->jrpdev == NULL) { 453 456 iounmap(&topregs->ctrl); 454 457 return -ENOMEM; 455 458 } ··· 458 459 ring = 0; 459 460 ctrlpriv->total_jobrs = 0; 460 461 for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring") { 461 - caam_jr_probe(pdev, np, ring); 462 + ctrlpriv->jrpdev[ring] = 463 + of_platform_device_create(np, NULL, dev); 464 + if (!ctrlpriv->jrpdev[ring]) { 465 + pr_warn("JR%d Platform device creation error\n", ring); 466 + continue; 467 + } 462 468 ctrlpriv->total_jobrs++; 463 469 ring++; 464 470 } 465 471 if (!ring) { 466 472 for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") { 467 - caam_jr_probe(pdev, np, ring); 473 + ctrlpriv->jrpdev[ring] = 474 + of_platform_device_create(np, NULL, dev); 475 + if (!ctrlpriv->jrpdev[ring]) { 476 + pr_warn("JR%d Platform device creation error\n", 477 + ring); 478 + continue; 479 + } 468 480 ctrlpriv->total_jobrs++; 469 481 ring++; 470 482 }
+3 -3
drivers/crypto/caam/intern.h
··· 37 37 38 38 /* Private sub-storage for a single JobR */ 39 39 struct caam_drv_private_jr { 40 - struct device *parentdev; /* points back to controller dev */ 41 - struct platform_device *jr_pdev;/* points to platform device for JR */ 40 + struct list_head list_node; /* Job Ring device list */ 41 + struct device *dev; 42 42 int ridx; 43 43 struct caam_job_ring __iomem *rregs; /* JobR's register space */ 44 44 struct tasklet_struct irqtask; ··· 63 63 struct caam_drv_private { 64 64 65 65 struct device *dev; 66 - struct device **jrdev; /* Alloc'ed array per sub-device */ 66 + struct platform_device **jrpdev; /* Alloc'ed array per sub-device */ 67 67 struct platform_device *pdev; 68 68 69 69 /* Physical-presence section */
+179 -110
drivers/crypto/caam/jr.c
··· 11 11 #include "desc.h" 12 12 #include "intern.h" 13 13 14 + struct jr_driver_data { 15 + /* List of Physical JobR's with the Driver */ 16 + struct list_head jr_list; 17 + spinlock_t jr_alloc_lock; /* jr_list lock */ 18 + } ____cacheline_aligned; 19 + 20 + static struct jr_driver_data driver_data; 21 + 22 + static int caam_reset_hw_jr(struct device *dev) 23 + { 24 + struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); 25 + unsigned int timeout = 100000; 26 + 27 + /* 28 + * mask interrupts since we are going to poll 29 + * for reset completion status 30 + */ 31 + setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); 32 + 33 + /* initiate flush (required prior to reset) */ 34 + wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); 35 + while (((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) == 36 + JRINT_ERR_HALT_INPROGRESS) && --timeout) 37 + cpu_relax(); 38 + 39 + if ((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) != 40 + JRINT_ERR_HALT_COMPLETE || timeout == 0) { 41 + dev_err(dev, "failed to flush job ring %d\n", jrp->ridx); 42 + return -EIO; 43 + } 44 + 45 + /* initiate reset */ 46 + timeout = 100000; 47 + wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); 48 + while ((rd_reg32(&jrp->rregs->jrcommand) & JRCR_RESET) && --timeout) 49 + cpu_relax(); 50 + 51 + if (timeout == 0) { 52 + dev_err(dev, "failed to reset job ring %d\n", jrp->ridx); 53 + return -EIO; 54 + } 55 + 56 + /* unmask interrupts */ 57 + clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); 58 + 59 + return 0; 60 + } 61 + 62 + /* 63 + * Shutdown JobR independent of platform property code 64 + */ 65 + int caam_jr_shutdown(struct device *dev) 66 + { 67 + struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); 68 + dma_addr_t inpbusaddr, outbusaddr; 69 + int ret; 70 + 71 + ret = caam_reset_hw_jr(dev); 72 + 73 + tasklet_kill(&jrp->irqtask); 74 + 75 + /* Release interrupt */ 76 + free_irq(jrp->irq, dev); 77 + 78 + /* Free rings */ 79 + inpbusaddr = rd_reg64(&jrp->rregs->inpring_base); 80 + outbusaddr = rd_reg64(&jrp->rregs->outring_base); 81 + dma_free_coherent(dev, sizeof(dma_addr_t) * JOBR_DEPTH, 82 + jrp->inpring, inpbusaddr); 83 + dma_free_coherent(dev, sizeof(struct jr_outentry) * JOBR_DEPTH, 84 + jrp->outring, outbusaddr); 85 + kfree(jrp->entinfo); 86 + 87 + return ret; 88 + } 89 + 90 + static int caam_jr_remove(struct platform_device *pdev) 91 + { 92 + int ret; 93 + struct device *jrdev; 94 + struct caam_drv_private_jr *jrpriv; 95 + 96 + jrdev = &pdev->dev; 97 + jrpriv = dev_get_drvdata(jrdev); 98 + 99 + /* 100 + * Make sure ring is empty before release 101 + */ 102 + if (rd_reg32(&jrpriv->rregs->outring_used) || 103 + (rd_reg32(&jrpriv->rregs->inpring_avail) != JOBR_DEPTH)) { 104 + dev_err(jrdev, "Device is busy\n"); 105 + return -EBUSY; 106 + } 107 + 108 + /* Remove the node from Physical JobR list maintained by driver */ 109 + spin_lock(&driver_data.jr_alloc_lock); 110 + list_del(&jrpriv->list_node); 111 + spin_unlock(&driver_data.jr_alloc_lock); 112 + 113 + /* Release ring */ 114 + ret = caam_jr_shutdown(jrdev); 115 + if (ret) 116 + dev_err(jrdev, "Failed to shut down job ring\n"); 117 + irq_dispose_mapping(jrpriv->irq); 118 + 119 + return ret; 120 + } 121 + 14 122 /* Main per-ring interrupt handler */ 15 123 static irqreturn_t caam_jr_interrupt(int irq, void *st_dev) 16 124 { ··· 313 205 } 314 206 EXPORT_SYMBOL(caam_jr_enqueue); 315 207 316 - static int caam_reset_hw_jr(struct device *dev) 317 - { 318 - struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); 319 - unsigned int timeout = 100000; 320 - 321 - /* 322 - * mask interrupts since we are going to poll 323 - * for reset completion status 324 - */ 325 - setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); 326 - 327 - /* initiate flush (required prior to reset) */ 328 - wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); 329 - while (((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) == 330 - JRINT_ERR_HALT_INPROGRESS) && --timeout) 331 - cpu_relax(); 332 - 333 - if ((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) != 334 - JRINT_ERR_HALT_COMPLETE || timeout == 0) { 335 - dev_err(dev, "failed to flush job ring %d\n", jrp->ridx); 336 - return -EIO; 337 - } 338 - 339 - /* initiate reset */ 340 - timeout = 100000; 341 - wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); 342 - while ((rd_reg32(&jrp->rregs->jrcommand) & JRCR_RESET) && --timeout) 343 - cpu_relax(); 344 - 345 - if (timeout == 0) { 346 - dev_err(dev, "failed to reset job ring %d\n", jrp->ridx); 347 - return -EIO; 348 - } 349 - 350 - /* unmask interrupts */ 351 - clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); 352 - 353 - return 0; 354 - } 355 - 356 208 /* 357 209 * Init JobR independent of platform property detection 358 210 */ ··· 328 260 329 261 /* Connect job ring interrupt handler. */ 330 262 error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, 331 - "caam-jobr", dev); 263 + dev_name(dev), dev); 332 264 if (error) { 333 265 dev_err(dev, "can't connect JobR %d interrupt (%d)\n", 334 266 jrp->ridx, jrp->irq); ··· 384 316 return 0; 385 317 } 386 318 387 - /* 388 - * Shutdown JobR independent of platform property code 389 - */ 390 - int caam_jr_shutdown(struct device *dev) 391 - { 392 - struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); 393 - dma_addr_t inpbusaddr, outbusaddr; 394 - int ret; 395 - 396 - ret = caam_reset_hw_jr(dev); 397 - 398 - tasklet_kill(&jrp->irqtask); 399 - 400 - /* Release interrupt */ 401 - free_irq(jrp->irq, dev); 402 - 403 - /* Free rings */ 404 - inpbusaddr = rd_reg64(&jrp->rregs->inpring_base); 405 - outbusaddr = rd_reg64(&jrp->rregs->outring_base); 406 - dma_free_coherent(dev, sizeof(dma_addr_t) * JOBR_DEPTH, 407 - jrp->inpring, inpbusaddr); 408 - dma_free_coherent(dev, sizeof(struct jr_outentry) * JOBR_DEPTH, 409 - jrp->outring, outbusaddr); 410 - kfree(jrp->entinfo); 411 - of_device_unregister(jrp->jr_pdev); 412 - 413 - return ret; 414 - } 415 319 416 320 /* 417 - * Probe routine for each detected JobR subsystem. It assumes that 418 - * property detection was picked up externally. 321 + * Probe routine for each detected JobR subsystem. 419 322 */ 420 - int caam_jr_probe(struct platform_device *pdev, struct device_node *np, 421 - int ring) 323 + static int caam_jr_probe(struct platform_device *pdev) 422 324 { 423 - struct device *ctrldev, *jrdev; 424 - struct platform_device *jr_pdev; 425 - struct caam_drv_private *ctrlpriv; 325 + struct device *jrdev; 326 + struct device_node *nprop; 327 + struct caam_job_ring __iomem *ctrl; 426 328 struct caam_drv_private_jr *jrpriv; 427 - u32 *jroffset; 329 + static int total_jobrs; 428 330 int error; 429 331 430 - ctrldev = &pdev->dev; 431 - ctrlpriv = dev_get_drvdata(ctrldev); 432 - 332 + jrdev = &pdev->dev; 433 333 jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), 434 334 GFP_KERNEL); 435 - if (jrpriv == NULL) { 436 - dev_err(ctrldev, "can't alloc private mem for job ring %d\n", 437 - ring); 335 + if (!jrpriv) 336 + return -ENOMEM; 337 + 338 + dev_set_drvdata(jrdev, jrpriv); 339 + 340 + /* save ring identity relative to detection */ 341 + jrpriv->ridx = total_jobrs++; 342 + 343 + nprop = pdev->dev.of_node; 344 + /* Get configuration properties from device tree */ 345 + /* First, get register page */ 346 + ctrl = of_iomap(nprop, 0); 347 + if (!ctrl) { 348 + dev_err(jrdev, "of_iomap() failed\n"); 438 349 return -ENOMEM; 439 350 } 440 - jrpriv->parentdev = ctrldev; /* point back to parent */ 441 - jrpriv->ridx = ring; /* save ring identity relative to detection */ 442 351 443 - /* 444 - * Derive a pointer to the detected JobRs regs 445 - * Driver has already iomapped the entire space, we just 446 - * need to add in the offset to this JobR. Don't know if I 447 - * like this long-term, but it'll run 448 - */ 449 - jroffset = (u32 *)of_get_property(np, "reg", NULL); 450 - jrpriv->rregs = (struct caam_job_ring __iomem *)((void *)ctrlpriv->ctrl 451 - + *jroffset); 452 - 453 - /* Build a local dev for each detected queue */ 454 - jr_pdev = of_platform_device_create(np, NULL, ctrldev); 455 - if (jr_pdev == NULL) { 456 - kfree(jrpriv); 457 - return -EINVAL; 458 - } 459 - 460 - jrpriv->jr_pdev = jr_pdev; 461 - jrdev = &jr_pdev->dev; 462 - dev_set_drvdata(jrdev, jrpriv); 463 - ctrlpriv->jrdev[ring] = jrdev; 352 + jrpriv->rregs = (struct caam_job_ring __force *)ctrl; 464 353 465 354 if (sizeof(dma_addr_t) == sizeof(u64)) 466 - if (of_device_is_compatible(np, "fsl,sec-v5.0-job-ring")) 355 + if (of_device_is_compatible(nprop, "fsl,sec-v5.0-job-ring")) 467 356 dma_set_mask(jrdev, DMA_BIT_MASK(40)); 468 357 else 469 358 dma_set_mask(jrdev, DMA_BIT_MASK(36)); ··· 428 403 dma_set_mask(jrdev, DMA_BIT_MASK(32)); 429 404 430 405 /* Identify the interrupt */ 431 - jrpriv->irq = of_irq_to_resource(np, 0, NULL); 406 + jrpriv->irq = of_irq_to_resource(nprop, 0, NULL); 432 407 433 408 /* Now do the platform independent part */ 434 409 error = caam_jr_init(jrdev); /* now turn on hardware */ 435 410 if (error) { 436 - of_device_unregister(jr_pdev); 437 411 kfree(jrpriv); 438 412 return error; 439 413 } 440 414 441 - return error; 415 + jrpriv->dev = jrdev; 416 + spin_lock(&driver_data.jr_alloc_lock); 417 + list_add_tail(&jrpriv->list_node, &driver_data.jr_list); 418 + spin_unlock(&driver_data.jr_alloc_lock); 419 + 420 + return 0; 442 421 } 422 + 423 + static struct of_device_id caam_jr_match[] = { 424 + { 425 + .compatible = "fsl,sec-v4.0-job-ring", 426 + }, 427 + { 428 + .compatible = "fsl,sec4.0-job-ring", 429 + }, 430 + {}, 431 + }; 432 + MODULE_DEVICE_TABLE(of, caam_jr_match); 433 + 434 + static struct platform_driver caam_jr_driver = { 435 + .driver = { 436 + .name = "caam_jr", 437 + .owner = THIS_MODULE, 438 + .of_match_table = caam_jr_match, 439 + }, 440 + .probe = caam_jr_probe, 441 + .remove = caam_jr_remove, 442 + }; 443 + 444 + static int __init jr_driver_init(void) 445 + { 446 + spin_lock_init(&driver_data.jr_alloc_lock); 447 + INIT_LIST_HEAD(&driver_data.jr_list); 448 + return platform_driver_register(&caam_jr_driver); 449 + } 450 + 451 + static void __exit jr_driver_exit(void) 452 + { 453 + platform_driver_unregister(&caam_jr_driver); 454 + } 455 + 456 + module_init(jr_driver_init); 457 + module_exit(jr_driver_exit); 458 + 459 + MODULE_LICENSE("GPL"); 460 + MODULE_DESCRIPTION("FSL CAAM JR request backend"); 461 + MODULE_AUTHOR("Freescale Semiconductor - NMG/STC");
-3
drivers/crypto/caam/jr.h
··· 13 13 void *areq), 14 14 void *areq); 15 15 16 - extern int caam_jr_probe(struct platform_device *pdev, struct device_node *np, 17 - int ring); 18 - extern int caam_jr_shutdown(struct device *dev); 19 16 #endif /* JR_H */