aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitesh Narayan Lal <b44382@freescale.com>2014-09-01 05:30:44 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-09-15 07:44:11 -0400
commitfb4562b20894444288152e6de67c28adac6c789d (patch)
tree0eb2522be23d7ab78faa6fa913ed523e166a760a
parentea2d9fc1af6ebcdf849723ac4f3f91a1c93b5e7c (diff)
crypto: caam - Dynamic allocation of addresses for various memory blocks in CAAM.
CAAM's memory is broken into following address blocks: Block Included Registers 0 General Registers 1-4 Job ring registers 6 RTIC registers 7 QI registers 8 DECO and CCB Size of the above stated blocks varies in various platforms. The block size can be 4K or 64K. The block size can be dynamically determined by reading CTPR register in CAAM. This patch initializes the block addresses dynamically based on the value read from this register. Signed-off-by: Ruchika Gupta <r66431@freescale.com> Signed-off-by: Nitesh Narayan Lal <b44382@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/caam/ctrl.c114
-rw-r--r--drivers/crypto/caam/intern.h9
-rw-r--r--drivers/crypto/caam/regs.h38
3 files changed, 81 insertions, 80 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index c6210373b1be..31000c8c4a90 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -1,5 +1,4 @@
1/* 1/* * CAAM control-plane driver backend
2 * CAAM control-plane driver backend
3 * Controller-level driver, kernel property detection, initialization 2 * Controller-level driver, kernel property detection, initialization
4 * 3 *
5 * Copyright 2008-2012 Freescale Semiconductor, Inc. 4 * Copyright 2008-2012 Freescale Semiconductor, Inc.
@@ -81,38 +80,37 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc,
81 u32 *status) 80 u32 *status)
82{ 81{
83 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); 82 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev);
84 struct caam_full __iomem *topregs; 83 struct caam_ctrl __iomem *ctrl = ctrlpriv->ctrl;
84 struct caam_deco __iomem *deco = ctrlpriv->deco;
85 unsigned int timeout = 100000; 85 unsigned int timeout = 100000;
86 u32 deco_dbg_reg, flags; 86 u32 deco_dbg_reg, flags;
87 int i; 87 int i;
88 88
89 /* Set the bit to request direct access to DECO0 */
90 topregs = (struct caam_full __iomem *)ctrlpriv->ctrl;
91 89
92 if (ctrlpriv->virt_en == 1) { 90 if (ctrlpriv->virt_en == 1) {
93 setbits32(&topregs->ctrl.deco_rsr, DECORSR_JR0); 91 setbits32(&ctrl->deco_rsr, DECORSR_JR0);
94 92
95 while (!(rd_reg32(&topregs->ctrl.deco_rsr) & DECORSR_VALID) && 93 while (!(rd_reg32(&ctrl->deco_rsr) & DECORSR_VALID) &&
96 --timeout) 94 --timeout)
97 cpu_relax(); 95 cpu_relax();
98 96
99 timeout = 100000; 97 timeout = 100000;
100 } 98 }
101 99
102 setbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); 100 setbits32(&ctrl->deco_rq, DECORR_RQD0ENABLE);
103 101
104 while (!(rd_reg32(&topregs->ctrl.deco_rq) & DECORR_DEN0) && 102 while (!(rd_reg32(&ctrl->deco_rq) & DECORR_DEN0) &&
105 --timeout) 103 --timeout)
106 cpu_relax(); 104 cpu_relax();
107 105
108 if (!timeout) { 106 if (!timeout) {
109 dev_err(ctrldev, "failed to acquire DECO 0\n"); 107 dev_err(ctrldev, "failed to acquire DECO 0\n");
110 clrbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); 108 clrbits32(&ctrl->deco_rq, DECORR_RQD0ENABLE);
111 return -ENODEV; 109 return -ENODEV;
112 } 110 }
113 111
114 for (i = 0; i < desc_len(desc); i++) 112 for (i = 0; i < desc_len(desc); i++)
115 wr_reg32(&topregs->deco.descbuf[i], *(desc + i)); 113 wr_reg32(&deco->descbuf[i], *(desc + i));
116 114
117 flags = DECO_JQCR_WHL; 115 flags = DECO_JQCR_WHL;
118 /* 116 /*
@@ -123,11 +121,11 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc,
123 flags |= DECO_JQCR_FOUR; 121 flags |= DECO_JQCR_FOUR;
124 122
125 /* Instruct the DECO to execute it */ 123 /* Instruct the DECO to execute it */
126 wr_reg32(&topregs->deco.jr_ctl_hi, flags); 124 wr_reg32(&deco->jr_ctl_hi, flags);
127 125
128 timeout = 10000000; 126 timeout = 10000000;
129 do { 127 do {
130 deco_dbg_reg = rd_reg32(&topregs->deco.desc_dbg); 128 deco_dbg_reg = rd_reg32(&deco->desc_dbg);
131 /* 129 /*
132 * If an error occured in the descriptor, then 130 * If an error occured in the descriptor, then
133 * the DECO status field will be set to 0x0D 131 * the DECO status field will be set to 0x0D
@@ -138,14 +136,14 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc,
138 cpu_relax(); 136 cpu_relax();
139 } while ((deco_dbg_reg & DESC_DBG_DECO_STAT_VALID) && --timeout); 137 } while ((deco_dbg_reg & DESC_DBG_DECO_STAT_VALID) && --timeout);
140 138
141 *status = rd_reg32(&topregs->deco.op_status_hi) & 139 *status = rd_reg32(&deco->op_status_hi) &
142 DECO_OP_STATUS_HI_ERR_MASK; 140 DECO_OP_STATUS_HI_ERR_MASK;
143 141
144 if (ctrlpriv->virt_en == 1) 142 if (ctrlpriv->virt_en == 1)
145 clrbits32(&topregs->ctrl.deco_rsr, DECORSR_JR0); 143 clrbits32(&ctrl->deco_rsr, DECORSR_JR0);
146 144
147 /* Mark the DECO as free */ 145 /* Mark the DECO as free */
148 clrbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); 146 clrbits32(&ctrl->deco_rq, DECORR_RQD0ENABLE);
149 147
150 if (!timeout) 148 if (!timeout)
151 return -EAGAIN; 149 return -EAGAIN;
@@ -176,13 +174,13 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
176 int gen_sk) 174 int gen_sk)
177{ 175{
178 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); 176 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev);
179 struct caam_full __iomem *topregs; 177 struct caam_ctrl __iomem *ctrl;
180 struct rng4tst __iomem *r4tst; 178 struct rng4tst __iomem *r4tst;
181 u32 *desc, status, rdsta_val; 179 u32 *desc, status, rdsta_val;
182 int ret = 0, sh_idx; 180 int ret = 0, sh_idx;
183 181
184 topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; 182 ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl;
185 r4tst = &topregs->ctrl.r4tst[0]; 183 r4tst = &ctrl->r4tst[0];
186 184
187 desc = kmalloc(CAAM_CMD_SZ * 7, GFP_KERNEL); 185 desc = kmalloc(CAAM_CMD_SZ * 7, GFP_KERNEL);
188 if (!desc) 186 if (!desc)
@@ -212,12 +210,11 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
212 * CAAM eras), then try again. 210 * CAAM eras), then try again.
213 */ 211 */
214 rdsta_val = 212 rdsta_val =
215 rd_reg32(&topregs->ctrl.r4tst[0].rdsta) & RDSTA_IFMASK; 213 rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK;
216 if (status || !(rdsta_val & (1 << sh_idx))) 214 if (status || !(rdsta_val & (1 << sh_idx)))
217 ret = -EAGAIN; 215 ret = -EAGAIN;
218 if (ret) 216 if (ret)
219 break; 217 break;
220
221 dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx); 218 dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx);
222 /* Clear the contents before recreating the descriptor */ 219 /* Clear the contents before recreating the descriptor */
223 memset(desc, 0x00, CAAM_CMD_SZ * 7); 220 memset(desc, 0x00, CAAM_CMD_SZ * 7);
@@ -285,12 +282,12 @@ static int caam_remove(struct platform_device *pdev)
285{ 282{
286 struct device *ctrldev; 283 struct device *ctrldev;
287 struct caam_drv_private *ctrlpriv; 284 struct caam_drv_private *ctrlpriv;
288 struct caam_full __iomem *topregs; 285 struct caam_ctrl __iomem *ctrl;
289 int ring, ret = 0; 286 int ring, ret = 0;
290 287
291 ctrldev = &pdev->dev; 288 ctrldev = &pdev->dev;
292 ctrlpriv = dev_get_drvdata(ctrldev); 289 ctrlpriv = dev_get_drvdata(ctrldev);
293 topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; 290 ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl;
294 291
295 /* Remove platform devices for JobRs */ 292 /* Remove platform devices for JobRs */
296 for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { 293 for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) {
@@ -308,7 +305,7 @@ static int caam_remove(struct platform_device *pdev)
308#endif 305#endif
309 306
310 /* Unmap controller region */ 307 /* Unmap controller region */
311 iounmap(&topregs->ctrl); 308 iounmap(&ctrl);
312 309
313 return ret; 310 return ret;
314} 311}
@@ -323,12 +320,12 @@ static void kick_trng(struct platform_device *pdev, int ent_delay)
323{ 320{
324 struct device *ctrldev = &pdev->dev; 321 struct device *ctrldev = &pdev->dev;
325 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); 322 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev);
326 struct caam_full __iomem *topregs; 323 struct caam_ctrl __iomem *ctrl;
327 struct rng4tst __iomem *r4tst; 324 struct rng4tst __iomem *r4tst;
328 u32 val; 325 u32 val;
329 326
330 topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; 327 ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl;
331 r4tst = &topregs->ctrl.r4tst[0]; 328 r4tst = &ctrl->r4tst[0];
332 329
333 /* put RNG4 into program mode */ 330 /* put RNG4 into program mode */
334 setbits32(&r4tst->rtmctl, RTMCTL_PRGM); 331 setbits32(&r4tst->rtmctl, RTMCTL_PRGM);
@@ -396,13 +393,14 @@ static int caam_probe(struct platform_device *pdev)
396 struct device *dev; 393 struct device *dev;
397 struct device_node *nprop, *np; 394 struct device_node *nprop, *np;
398 struct caam_ctrl __iomem *ctrl; 395 struct caam_ctrl __iomem *ctrl;
399 struct caam_full __iomem *topregs;
400 struct caam_drv_private *ctrlpriv; 396 struct caam_drv_private *ctrlpriv;
401#ifdef CONFIG_DEBUG_FS 397#ifdef CONFIG_DEBUG_FS
402 struct caam_perfmon *perfmon; 398 struct caam_perfmon *perfmon;
403#endif 399#endif
404 u32 scfgr, comp_params; 400 u32 scfgr, comp_params;
405 u32 cha_vid_ls; 401 u32 cha_vid_ls;
402 int pg_size;
403 int BLOCK_OFFSET = 0;
406 404
407 ctrlpriv = devm_kzalloc(&pdev->dev, sizeof(struct caam_drv_private), 405 ctrlpriv = devm_kzalloc(&pdev->dev, sizeof(struct caam_drv_private),
408 GFP_KERNEL); 406 GFP_KERNEL);
@@ -421,10 +419,27 @@ static int caam_probe(struct platform_device *pdev)
421 dev_err(dev, "caam: of_iomap() failed\n"); 419 dev_err(dev, "caam: of_iomap() failed\n");
422 return -ENOMEM; 420 return -ENOMEM;
423 } 421 }
424 ctrlpriv->ctrl = (struct caam_ctrl __force *)ctrl; 422 /* Finding the page size for using the CTPR_MS register */
423 comp_params = rd_reg32(&ctrl->perfmon.comp_parms_ms);
424 pg_size = (comp_params & CTPR_MS_PG_SZ_MASK) >> CTPR_MS_PG_SZ_SHIFT;
425 425
426 /* topregs used to derive pointers to CAAM sub-blocks only */ 426 /* Allocating the BLOCK_OFFSET based on the supported page size on
427 topregs = (struct caam_full __iomem *)ctrl; 427 * the platform
428 */
429 if (pg_size == 0)
430 BLOCK_OFFSET = PG_SIZE_4K;
431 else
432 BLOCK_OFFSET = PG_SIZE_64K;
433
434 ctrlpriv->ctrl = (struct caam_ctrl __force *)ctrl;
435 ctrlpriv->assure = (struct caam_assurance __force *)
436 ((uint8_t *)ctrl +
437 BLOCK_OFFSET * ASSURE_BLOCK_NUMBER
438 );
439 ctrlpriv->deco = (struct caam_deco __force *)
440 ((uint8_t *)ctrl +
441 BLOCK_OFFSET * DECO_BLOCK_NUMBER
442 );
428 443
429 /* Get the IRQ of the controller (for security violations only) */ 444 /* Get the IRQ of the controller (for security violations only) */
430 ctrlpriv->secvio_irq = irq_of_parse_and_map(nprop, 0); 445 ctrlpriv->secvio_irq = irq_of_parse_and_map(nprop, 0);
@@ -433,15 +448,14 @@ static int caam_probe(struct platform_device *pdev)
433 * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel, 448 * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel,
434 * long pointers in master configuration register 449 * long pointers in master configuration register
435 */ 450 */
436 setbits32(&topregs->ctrl.mcr, MCFGR_WDENABLE | 451 setbits32(&ctrl->mcr, MCFGR_WDENABLE |
437 (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0)); 452 (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0));
438 453
439 /* 454 /*
440 * Read the Compile Time paramters and SCFGR to determine 455 * Read the Compile Time paramters and SCFGR to determine
441 * if Virtualization is enabled for this platform 456 * if Virtualization is enabled for this platform
442 */ 457 */
443 comp_params = rd_reg32(&topregs->ctrl.perfmon.comp_parms_ms); 458 scfgr = rd_reg32(&ctrl->scfgr);
444 scfgr = rd_reg32(&topregs->ctrl.scfgr);
445 459
446 ctrlpriv->virt_en = 0; 460 ctrlpriv->virt_en = 0;
447 if (comp_params & CTPR_MS_VIRT_EN_INCL) { 461 if (comp_params & CTPR_MS_VIRT_EN_INCL) {
@@ -459,7 +473,7 @@ static int caam_probe(struct platform_device *pdev)
459 } 473 }
460 474
461 if (ctrlpriv->virt_en == 1) 475 if (ctrlpriv->virt_en == 1)
462 setbits32(&topregs->ctrl.jrstart, JRSTART_JR0_START | 476 setbits32(&ctrl->jrstart, JRSTART_JR0_START |
463 JRSTART_JR1_START | JRSTART_JR2_START | 477 JRSTART_JR1_START | JRSTART_JR2_START |
464 JRSTART_JR3_START); 478 JRSTART_JR3_START);
465 479
@@ -486,7 +500,7 @@ static int caam_probe(struct platform_device *pdev)
486 sizeof(struct platform_device *) * rspec, 500 sizeof(struct platform_device *) * rspec,
487 GFP_KERNEL); 501 GFP_KERNEL);
488 if (ctrlpriv->jrpdev == NULL) { 502 if (ctrlpriv->jrpdev == NULL) {
489 iounmap(&topregs->ctrl); 503 iounmap(&ctrl);
490 return -ENOMEM; 504 return -ENOMEM;
491 } 505 }
492 506
@@ -502,18 +516,26 @@ static int caam_probe(struct platform_device *pdev)
502 ring); 516 ring);
503 continue; 517 continue;
504 } 518 }
519 ctrlpriv->jr[ring] = (struct caam_job_ring __force *)
520 ((uint8_t *)ctrl +
521 (ring + JR_BLOCK_NUMBER) *
522 BLOCK_OFFSET
523 );
505 ctrlpriv->total_jobrs++; 524 ctrlpriv->total_jobrs++;
506 ring++; 525 ring++;
507 } 526 }
508 527
509 /* Check to see if QI present. If so, enable */ 528 /* Check to see if QI present. If so, enable */
510 ctrlpriv->qi_present = 529 ctrlpriv->qi_present =
511 !!(rd_reg32(&topregs->ctrl.perfmon.comp_parms_ms) & 530 !!(rd_reg32(&ctrl->perfmon.comp_parms_ms) &
512 CTPR_MS_QI_MASK); 531 CTPR_MS_QI_MASK);
513 if (ctrlpriv->qi_present) { 532 if (ctrlpriv->qi_present) {
514 ctrlpriv->qi = (struct caam_queue_if __force *)&topregs->qi; 533 ctrlpriv->qi = (struct caam_queue_if __force *)
534 ((uint8_t *)ctrl +
535 BLOCK_OFFSET * QI_BLOCK_NUMBER
536 );
515 /* This is all that's required to physically enable QI */ 537 /* This is all that's required to physically enable QI */
516 wr_reg32(&topregs->qi.qi_control_lo, QICTL_DQEN); 538 wr_reg32(&ctrlpriv->qi->qi_control_lo, QICTL_DQEN);
517 } 539 }
518 540
519 /* If no QI and no rings specified, quit and go home */ 541 /* If no QI and no rings specified, quit and go home */
@@ -523,7 +545,7 @@ static int caam_probe(struct platform_device *pdev)
523 return -ENOMEM; 545 return -ENOMEM;
524 } 546 }
525 547
526 cha_vid_ls = rd_reg32(&topregs->ctrl.perfmon.cha_id_ls); 548 cha_vid_ls = rd_reg32(&ctrl->perfmon.cha_id_ls);
527 549
528 /* 550 /*
529 * If SEC has RNG version >= 4 and RNG state handle has not been 551 * If SEC has RNG version >= 4 and RNG state handle has not been
@@ -531,7 +553,7 @@ static int caam_probe(struct platform_device *pdev)
531 */ 553 */
532 if ((cha_vid_ls & CHA_ID_LS_RNG_MASK) >> CHA_ID_LS_RNG_SHIFT >= 4) { 554 if ((cha_vid_ls & CHA_ID_LS_RNG_MASK) >> CHA_ID_LS_RNG_SHIFT >= 4) {
533 ctrlpriv->rng4_sh_init = 555 ctrlpriv->rng4_sh_init =
534 rd_reg32(&topregs->ctrl.r4tst[0].rdsta); 556 rd_reg32(&ctrl->r4tst[0].rdsta);
535 /* 557 /*
536 * If the secure keys (TDKEK, JDKEK, TDSK), were already 558 * If the secure keys (TDKEK, JDKEK, TDSK), were already
537 * generated, signal this to the function that is instantiating 559 * generated, signal this to the function that is instantiating
@@ -542,7 +564,7 @@ static int caam_probe(struct platform_device *pdev)
542 ctrlpriv->rng4_sh_init &= RDSTA_IFMASK; 564 ctrlpriv->rng4_sh_init &= RDSTA_IFMASK;
543 do { 565 do {
544 int inst_handles = 566 int inst_handles =
545 rd_reg32(&topregs->ctrl.r4tst[0].rdsta) & 567 rd_reg32(&ctrl->r4tst[0].rdsta) &
546 RDSTA_IFMASK; 568 RDSTA_IFMASK;
547 /* 569 /*
548 * If either SH were instantiated by somebody else 570 * If either SH were instantiated by somebody else
@@ -587,13 +609,13 @@ static int caam_probe(struct platform_device *pdev)
587 ctrlpriv->rng4_sh_init = ~ctrlpriv->rng4_sh_init & RDSTA_IFMASK; 609 ctrlpriv->rng4_sh_init = ~ctrlpriv->rng4_sh_init & RDSTA_IFMASK;
588 610
589 /* Enable RDB bit so that RNG works faster */ 611 /* Enable RDB bit so that RNG works faster */
590 setbits32(&topregs->ctrl.scfgr, SCFGR_RDBENABLE); 612 setbits32(&ctrl->scfgr, SCFGR_RDBENABLE);
591 } 613 }
592 614
593 /* NOTE: RTIC detection ought to go here, around Si time */ 615 /* NOTE: RTIC detection ought to go here, around Si time */
594 616
595 caam_id = (u64)rd_reg32(&topregs->ctrl.perfmon.caam_id_ms) << 32 | 617 caam_id = (u64)rd_reg32(&ctrl->perfmon.caam_id_ms) << 32 |
596 (u64)rd_reg32(&topregs->ctrl.perfmon.caam_id_ls); 618 (u64)rd_reg32(&ctrl->perfmon.caam_id_ls);
597 619
598 /* Report "alive" for developer to see */ 620 /* Report "alive" for developer to see */
599 dev_info(dev, "device ID = 0x%016llx (Era %d)\n", caam_id, 621 dev_info(dev, "device ID = 0x%016llx (Era %d)\n", caam_id,
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h
index 97363db4e56e..89b94cc9e7a2 100644
--- a/drivers/crypto/caam/intern.h
+++ b/drivers/crypto/caam/intern.h
@@ -70,10 +70,11 @@ struct caam_drv_private {
70 struct platform_device *pdev; 70 struct platform_device *pdev;
71 71
72 /* Physical-presence section */ 72 /* Physical-presence section */
73 struct caam_ctrl *ctrl; /* controller region */ 73 struct caam_ctrl __iomem *ctrl; /* controller region */
74 struct caam_deco **deco; /* DECO/CCB views */ 74 struct caam_deco __iomem *deco; /* DECO/CCB views */
75 struct caam_assurance *ac; 75 struct caam_assurance __iomem *assure;
76 struct caam_queue_if *qi; /* QI control region */ 76 struct caam_queue_if __iomem *qi; /* QI control region */
77 struct caam_job_ring __iomem *jr[4]; /* JobR's register space */
77 78
78 /* 79 /*
79 * Detected geometry block. Filled in from device tree if powerpc, 80 * Detected geometry block. Filled in from device tree if powerpc,
diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
index bc9cd62b96e0..378ddc17f60e 100644
--- a/drivers/crypto/caam/regs.h
+++ b/drivers/crypto/caam/regs.h
@@ -194,6 +194,8 @@ struct caam_perfmon {
194#define CTPR_MS_QI_MASK (0x1ull << CTPR_MS_QI_SHIFT) 194#define CTPR_MS_QI_MASK (0x1ull << CTPR_MS_QI_SHIFT)
195#define CTPR_MS_VIRT_EN_INCL 0x00000001 195#define CTPR_MS_VIRT_EN_INCL 0x00000001
196#define CTPR_MS_VIRT_EN_POR 0x00000002 196#define CTPR_MS_VIRT_EN_POR 0x00000002
197#define CTPR_MS_PG_SZ_MASK 0x10
198#define CTPR_MS_PG_SZ_SHIFT 4
197 u32 comp_parms_ms; /* CTPR - Compile Parameters Register */ 199 u32 comp_parms_ms; /* CTPR - Compile Parameters Register */
198 u32 comp_parms_ls; /* CTPR - Compile Parameters Register */ 200 u32 comp_parms_ls; /* CTPR - Compile Parameters Register */
199 u64 rsvd1[2]; 201 u64 rsvd1[2];
@@ -769,34 +771,10 @@ struct caam_deco {
769#define DECO_JQCR_WHL 0x20000000 771#define DECO_JQCR_WHL 0x20000000
770#define DECO_JQCR_FOUR 0x10000000 772#define DECO_JQCR_FOUR 0x10000000
771 773
772/* 774#define JR_BLOCK_NUMBER 1
773 * Current top-level view of memory map is: 775#define ASSURE_BLOCK_NUMBER 6
774 * 776#define QI_BLOCK_NUMBER 7
775 * 0x0000 - 0x0fff - CAAM Top-Level Control 777#define DECO_BLOCK_NUMBER 8
776 * 0x1000 - 0x1fff - Job Ring 0 778#define PG_SIZE_4K 0x1000
777 * 0x2000 - 0x2fff - Job Ring 1 779#define PG_SIZE_64K 0x10000
778 * 0x3000 - 0x3fff - Job Ring 2
779 * 0x4000 - 0x4fff - Job Ring 3
780 * 0x5000 - 0x5fff - (unused)
781 * 0x6000 - 0x6fff - Assurance Controller
782 * 0x7000 - 0x7fff - Queue Interface
783 * 0x8000 - 0x8fff - DECO-CCB 0
784 * 0x9000 - 0x9fff - DECO-CCB 1
785 * 0xa000 - 0xafff - DECO-CCB 2
786 * 0xb000 - 0xbfff - DECO-CCB 3
787 * 0xc000 - 0xcfff - DECO-CCB 4
788 *
789 * caam_full describes the full register view of CAAM if useful,
790 * although many configurations may choose to implement parts of
791 * the register map separately, in differing privilege regions
792 */
793struct caam_full {
794 struct caam_ctrl __iomem ctrl;
795 struct caam_job_ring jr[4];
796 u64 rsvd[512];
797 struct caam_assurance assure;
798 struct caam_queue_if qi;
799 struct caam_deco deco;
800};
801
802#endif /* REGS_H */ 780#endif /* REGS_H */