diff options
author | Aymen Sghaier <aymen.sghaier@nxp.com> | 2017-11-21 18:31:35 +0100 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 2bd4e4c48e66518dd5bf77cf45329dab6a9f0a57 (patch) | |
tree | 5ed698a389941ee7e499502b0f68f85af5545e75 /drivers/crypto | |
parent | 761352372f4afa00a8528f4ae62c1ec9ee6a28ab (diff) |
MLK-15473-8: crypto: caam: Disable CAAM JR1 according to SCFW update
After CAAM JR1 has been moved to SECO,
imx-sc-firmware commit 36ff24f36b56 ("Move CAAM JR1 to SECO FW."),
Linux no longer boots and rises a kernel panic at "caam_probe".
So the CAAM JR1 should be disabled in the device-tree.
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/ctrl.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 6c424abe16ce..28511c8d1e37 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -410,7 +410,7 @@ static void check_virt(struct caam_drv_private *ctrlpriv, u32 comp_params) static int enable_jobrings(struct caam_drv_private *ctrlpriv, int block_offset) { - int ring; + int ring, index; int rspec = 0; struct device_node *nprop, *np; @@ -444,9 +444,21 @@ static int enable_jobrings(struct caam_drv_private *ctrlpriv, int block_offset) ring); continue; } - ctrlpriv->jr[ring] = (struct caam_job_ring __force *) + + if (of_property_read_u32_index(np, "reg", 0, &index)) { + pr_warn("%s read reg property error %d.", + np->full_name, index); + continue; + } + /* Get actual job ring index from its offset + * ex: CAAM JR2 offset 0x30000 index = 2 + */ + while (index > 16) + index = index >> 4; + index -= 1; + ctrlpriv->jr[index] = (struct caam_job_ring __force *) ((uint8_t *)ctrlpriv->ctrl + - (ring + JR_BLOCK_NUMBER) * + (index + JR_BLOCK_NUMBER) * block_offset); ctrlpriv->total_jobrs++; ring++; |