Franck LENORMAND [Fri, 14 Sep 2018 08:31:57 +0000 (10:31 +0200)]
MLK-19365: crypto: gcm: Cache aligned auth_data
Generic GCM is likely to end up using a hardware accelerator to do
part of the job. Allocating hash, iv and result in a contiguous memory
area increases the risk of dma mapping multiple ranges on the same
cacheline. Also having dma and cpu written data on the same cacheline
will cause coherence issues.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit
03d7978eea76a53e5e964d67898e10d143ddb83d)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 13 Sep 2018 17:04:03 +0000 (19:04 +0200)]
MLK-19365: drivers: crypto: caamalg: ecb(aes) does not use IV
The crypto template lrw(crypto/lrw.c) and xts(crypto/xts.c) require
an ecb(aes) algo as base which ivsize must be zero as ecb(aes)
doesn't need an IV.
The patch
84f5e22194 "MA-9807: Fix ecb(aes) use without an IV"
add support in caamalg for ecb(aes) without iv.
The ecb(aes) implementation of the CAAM declare an ivsize which is
against specification. So remove it to be usable with cryto templates.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit
825831cf1292b6081ef6eee2f01af4704132f4a9)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Thu, 13 Sep 2018 14:41:03 +0000 (16:41 +0200)]
MLK-19053: crypto: caam: RNG4 TRNG errata
The TRNG as used in RNG4, used in CAAM has a documentation issue. The
effect is that it is possible that the entropy used to instantiate the
DRBG may be old entropy, rather than newly generated entropy. There is
proper programming guidance, but it is not in the documentation.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 10 Sep 2018 09:54:24 +0000 (11:54 +0200)]
MLK-19434: crypto: testmgr: Add log printing once if disabled
If the test manager is not disable, it is not possible to
determine if tcrypt result is suitable or not.
This patch fix this issue printing a message to the user.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 9 Jul 2018 16:52:38 +0000 (18:52 +0200)]
MLK-18082: crypto: caam: Change handling of error in probe
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 9 Jul 2018 15:17:22 +0000 (17:17 +0200)]
MLK-18082: crypto: caam: Doc replace tab with spaces
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 9 Jul 2018 12:31:39 +0000 (14:31 +0200)]
MLK-18082: crypto: caam: Fix error handling flow
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Wed, 26 Dec 2018 10:17:10 +0000 (15:47 +0530)]
MLK-18082: crypto: caam: Minimal fix for QX panic
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Tue, 26 Jun 2018 11:10:55 +0000 (13:10 +0200)]
MLK-18082: crypto: caam: Check ret value of dma_set_mask_and_coherent
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 21 Jun 2018 13:20:14 +0000 (15:20 +0200)]
MLK-18082: crypto: caam: sm: Fix descriptor running functions
In case of error when runnign descriptor, there was no indication
of the root cause with the appropriate existing function.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 21 Jun 2018 13:19:07 +0000 (15:19 +0200)]
MLK-18082: crypto: caam: sm: Fix encap/decap function to handle errors
Explicit the use of the ring device to manage the operations related
to DMA.
Some values from DMA functions were not tested hence the issues
were making the descriptor to fail later and make it harder to debug.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Wed, 11 Apr 2018 09:36:33 +0000 (11:36 +0200)]
MLK-17302: crypto: caam: Move RNG instantiation to SECO
On i.MX8 platforms with SECO/SCU the RNG is not anymore instantiated
by the Kernel driver but by SECO. This is true for B0 revision and
later. A0 revision is not supported.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Tue, 19 Jun 2018 09:29:00 +0000 (11:29 +0200)]
MLK-17227: crypto: caam: Update CAAM driver verbosity while RNG init
Move to debug level rather than error level the RNG init traces while
increasing entropy delays.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Wed, 13 Jun 2018 14:40:07 +0000 (16:40 +0200)]
MLK-18082: crypto: caam: fix index when setting ctrlpriv->jr[]
In case index ==
00001000, the resulting index used to access
ctrlpriv->jr[] was 15 instead of the expected value of 0.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Fri, 8 Jun 2018 07:19:22 +0000 (09:19 +0200)]
MLK-17233: Fix CAAM pointer size error for i.MX8
While crypto manager tests some descriptors are malformed due to
pointer size not coherent with CAAM specific dma address size
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 14 Jun 2018 16:28:38 +0000 (18:28 +0200)]
MLK-17841: crypto: caam: Correct bugs in Secure Memory
This patch perform following modifications:
- Send and receive SM command regrouped in 1 function
- Verify that the JR device to use is valid
- Modification of the error handling in the probe
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Cedric Neveux [Tue, 17 Apr 2018 16:04:39 +0000 (18:04 +0200)]
MLK-17909 RNG Instantation done in Secure Firmware
- For i.MX 6 and 7 check if the Secure Firmware (OPTEE) is present.
If present don't do the RNG instantation in the CAAM driver
Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Wed, 11 Apr 2018 11:57:33 +0000 (13:57 +0200)]
MLK-17992: caam: sm: Fix compilation warnings
Fix the following warnings in CAAM SM:
drivers/crypto/caam/sm_store.c: In function 'blacken_key_jobdesc':
drivers/crypto/caam/sm_store.c:141:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c:153:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c: In function 'blob_encap_jobdesc':
drivers/crypto/caam/sm_store.c:274:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)secretbuf;
^
drivers/crypto/caam/sm_store.c: In function 'blob_decap_jobdesc':
drivers/crypto/caam/sm_store.c:390:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)outbuf;
^
drivers/crypto/caam/sm_store.c: In function 'slot_get_base':
drivers/crypto/caam/sm_store.c:569:9: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
return (u32)(ksdata->base_address);
^
drivers/crypto/caam/sm_store.c: In function 'sm_keystore_slot_load':
drivers/crypto/caam/sm_store.c:789:6:
warning: unused variable 'i' [-Wunused-variable]
u32 i;
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Silvano di Ninno [Fri, 16 Mar 2018 13:48:10 +0000 (14:48 +0100)]
MLK-17674-2: CAAM SM : get base address from device tree
Remove hard coded value for base physical address.
Use device tree to get this value.
i.MX8 with seco is still not address since CAAM uses a private bus
to access secure memory
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Silvano di Ninno [Fri, 16 Mar 2018 13:46:28 +0000 (14:46 +0100)]
MLK-17674-1: sm_store remove CONFIG_OF
I.MX linux only works with device tree support
No need to keep code without CONFIG_OF
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Fri, 9 Mar 2018 17:05:49 +0000 (18:05 +0100)]
MLK-17732-2: SM store: Support iMX8QX and iMX8QM
The iMX8 QX and QM have SECO/SCU enabled and the access
to SM registers is different as long as the addresses of
the pages.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 5 Feb 2018 09:54:56 +0000 (10:54 +0100)]
MLK-17253-2: crypto: caam: Use correct memory function for Secure Memory
The Secure Memory is a hardware memory whose address was retrieved using
of_iomap, hence the memory manipulation shall use the set of functions:
memset_io/memcpy_fromio/memcpy_toio in order to works correctly.
Not using these functions can result in kernel panic.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Mon, 5 Feb 2018 09:54:19 +0000 (10:54 +0100)]
MLK-17253-1: crypto: caam: Fix computation of SM pages addresses
The computation of the base address of the physical and virtual
need to be the same depending on the architecture.
The addresses are computed using a pointer on u8 so the additions
always works as expected.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Mon, 18 Dec 2017 11:06:00 +0000 (12:06 +0100)]
MLK-17111-4: crypto: caam: Fix RNG Kernel oops on i.MX8QXP
Seen on i.MX8QXP board by reboot test, that Kernel oops occurs
due to failing RNG instantiation with default entropy delay.
The fix is to disable all job rings if RNG failed to prevent
Kernel crash. And print an error message saying that this is
a known limitation on REV A0 SoC.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Fri, 8 Dec 2017 13:36:46 +0000 (14:36 +0100)]
MLK-17111-1: crypto: caam: Fix RNG instantiation retry
Seen on i.MX8MQ EVK board revision B0 that the RNG instantiation
fail with default entropy delay. Retry process is fixed here to
be able to instantiate RNG successfully.
Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Mon, 27 Nov 2017 16:01:53 +0000 (17:01 +0100)]
MLK-16950 crypto: caam: Fix failed to flush job ring 0
This error occurred on MX8M-EVK while initializing the first job ring.
If the job ring was used before Kernel level, then connecting it to the
irq handler could generate error due to its (unknown) previous state.
This patch calls the hardware reset function before connecting the irq
handler.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 12 Jul 2018 09:52:29 +0000 (11:52 +0200)]
MLK-18082: drivers: crypto: caam: Update copyrights to 2018
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Wed, 29 Nov 2017 03:48:04 +0000 (11:48 +0800)]
MLK-17019 Correct Copyright
Correct Copyright
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Aymen Sghaier [Tue, 21 Nov 2017 17:31:35 +0000 (18:31 +0100)]
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>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Tue, 5 Jun 2018 12:37:46 +0000 (14:37 +0200)]
MLK-18082: crypto: caam: Fix DMA coherency configuration
The DMA configuration of the CAAM for imx8 boards is not strictly
related to the architecture of the kernel.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Tue, 5 Jun 2018 12:10:52 +0000 (14:10 +0200)]
MLK-18082: Reduce code diff with last commit
The organization of functions of the CAAM driver changed
between 4.9 and 4.14 so this arrangement allow to see
more clearly the changes later in the tree.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Tue, 3 Jul 2018 11:27:23 +0000 (13:27 +0200)]
MLK-15473-1: crypto: caam: Add CAAM driver support for iMX8 soc family
Enable CAAM driver for i.MX8 family:
- Use a Job ring for RNG instantiation rather than DECO, even
for i.MX6/7 families.
- Use of aliased CAAM registers instead of original registers in page 0
since page 0 is no more accessible in i.MX8 family except mScale.
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Anson Huang [Wed, 18 Jan 2017 19:59:00 +0000 (03:59 +0800)]
MLK-13911-5 soc: scfw: imx8: add SCFW
Add i.MX8 SCFW API support.
Based on below commit:
(
fcd0efb5f2550712bd7d27f1279e51f7f687f71d)
Fix MX8 MU driver to follow Linux coding conventions.
Remove unused functions.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Added to drivers/soc/imx instead of drivers/soc/imx8
Skipped imx8 imx_rpmsg code
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(Vipul: Fixed merge conflicts and ignore imx8 changes)
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Tue, 5 Jun 2018 09:46:14 +0000 (11:46 +0200)]
MLK-18082: crypto: caam: Move RNG instantation
Move the code related to RNG instanciation to another file
to ease comprehension.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Adrian Alonso [Tue, 2 Jun 2015 20:08:52 +0000 (15:08 -0500)]
MLK-11020: arm: imx: caam: imx7d caam_aclk clock dependency
* Add caam_aclk clock root dependency, imx7d caam
ip module needs caam_aclk and caam_ipg clock signals
to operate add additional clock signal.
Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
[Octavian: since the clk API skips NULL args use a single disable label]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Conflicts:
drivers/crypto/caam/ctrl.c
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Tue, 26 May 2015 20:53:10 +0000 (15:53 -0500)]
MLK-10978-1 ARM: imx6ul: Add CAAM support for i.mx6ul
There are only 3 CAAM clocks that are required for i.mx6ul. Adding
logic to enable only the required clocks based on the device tree
compatibility node.
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Conflicts:
drivers/crypto/caam/ctrl.c
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Wed, 11 Apr 2018 11:57:33 +0000 (13:57 +0200)]
MLK-17992: caam: sm: Fix compilation warnings
Fix the following warnings in CAAM SM:
drivers/crypto/caam/sm_store.c: In function 'blacken_key_jobdesc':
drivers/crypto/caam/sm_store.c:141:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c:153:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c: In function 'blob_encap_jobdesc':
drivers/crypto/caam/sm_store.c:274:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)secretbuf;
^
drivers/crypto/caam/sm_store.c: In function 'blob_decap_jobdesc':
drivers/crypto/caam/sm_store.c:390:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)outbuf;
^
drivers/crypto/caam/sm_store.c: In function 'slot_get_base':
drivers/crypto/caam/sm_store.c:569:9: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
return (u32)(ksdata->base_address);
^
drivers/crypto/caam/sm_store.c: In function 'sm_keystore_slot_load':
drivers/crypto/caam/sm_store.c:789:6:
warning: unused variable 'i' [-Wunused-variable]
u32 i;
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Franck LENORMAND [Thu, 18 Jan 2018 15:35:45 +0000 (16:35 +0100)]
MLK-17412-01: Fix secvio driver to have same driver name as DTS
The name of the driver was "snvs-secvio" which doesn't corresponds
to its use in the differents dts files.
This patch change the driver name to "caam-snvs" to corresponds
to the dts files.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Vipul Kumar [Wed, 26 Dec 2018 07:40:10 +0000 (13:10 +0530)]
crypto: gcm: Fixed compilation error
As per commit
76c6739477fa ("crypto: gcm - move to generic async
completion"), make changes to fix the below compilation error.
crypto/gcm.c: In function ‘crypto_gcm_setkey’:
crypto/gcm.c:107:35: error: field ‘result’ has incomplete type
struct crypto_gcm_setkey_result result ____cacheline_aligned;
^~~~~~
scripts/Makefile.build:303: recipe for target 'crypto/gcm.o' failed
make[1]: *** [crypto/gcm.o] Error 1
Makefile:1052: recipe for target 'crypto' failed
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Thu, 13 Jul 2017 12:00:09 +0000 (15:00 +0300)]
MLK-14765: Enable DCP SHA workaround on all platforms
Remove variant restriction for DCP SHA workaround. All integrations of
DCP seem affected.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Wed, 5 Jul 2017 12:30:44 +0000 (15:30 +0300)]
MA-9807: Fix ecb(aes) use without an IV
CAAM aes modes share descriptors, because of this CAAM requires an IV
for ECB. ECB does not need an IV and users do not have to pass valid
IV vectors. To allow correct usage with minimum impact to the driver a
zero IV is provided by the driver for ECB operations that need it.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Fri, 16 Jun 2017 11:02:50 +0000 (14:02 +0300)]
MLK-14765: Fix DCP Aes timeout issues when used with CTS
The DCP driver does not obey cryptlen, when doing CTS this results in
passing to hardware input stream lengths which are not multiple of
block size. This causes the hw to misbehave. Also not honoring
cryptlen makes CTS fail. A check was introduced to prevent future
erroneous stream lengths from reaching the hardware. Code which is
splitting the input stream in internal DCP pages was changed to obey
cryptlen.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Wed, 7 Jun 2017 14:18:03 +0000 (17:18 +0300)]
MLK-14765: Fix DCP SHA null hashes and output length
On imx6sl and imx6ull DCP writes at least 32 bytes in the output
buffer instead of hash length as documented. Add intermediate buffer
to prevent write out of bounds.
When requested to produce null hashes DCP fails to produce valid
output. Add software workaround to bypass hardware and return valid output.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Tue, 23 May 2017 12:13:50 +0000 (15:13 +0300)]
MLK-14785 CAAM: Fix gcm.c to work correctly with CAAM
CAAM uses DMA to transfer data to and from memory, if
DMA and CPU accessed data share the same cacheline cache
pollution will occur. Marking the result as cacheline aligned
moves it to a separate cache line.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Wed, 19 Apr 2017 15:19:14 +0000 (18:19 +0300)]
MLK-14611 Fix xcbc unkeyed registration
AES is a keyed algorithm, XCBC-AES needs a key for operation,
this patch prevents the registration of AES-based transforms
as unkeyed operations.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Thu, 13 Apr 2017 13:14:06 +0000 (16:14 +0300)]
MLK-14284 Fix CAAM Errata err005766 handling
* Update ERA detection code to check 3 sources CCBVID, CAAMVID and
the device tree.
* Fix bit handling of CAAMVID data to obtain correct results.
* Remove default device tree values.
* Update errata handling to target known affected platforms.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Thu, 13 Apr 2017 12:22:41 +0000 (15:22 +0300)]
MLK-14611 Fix CBC mode support by returning a correct IV
Current CBC mode does not return the last cyphertext block
as IV for operation chaining. CTS fails because of incorrect IV.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Thu, 13 Apr 2017 12:12:27 +0000 (15:12 +0300)]
MLK-14611 Add DES key complexity validation
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Radu Solea [Wed, 8 Mar 2017 14:34:15 +0000 (16:34 +0200)]
Add missing NULL checks in CAAM sm
Missing NULL checks in CAAM sm_store and sm_test cause kernel
crashes if caam init fails.
Signed-off-by: Radu Solea <radu.solea@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Octavian Purdila [Wed, 11 Jan 2017 10:43:48 +0000 (12:43 +0200)]
MLK-13779 crypto: caam - initialize kslock spinlock
Fixes the following lockdep message:
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.1.30-02225-g55e4b9e #8
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<
800162b0>] (unwind_backtrace) from [<
80012ba0>] (show_stack+0x10/0x14)
[<
80012ba0>] (show_stack) from [<
808d09d0>] (dump_stack+0xa8/0xd4)
[<
808d09d0>] (dump_stack) from [<
8007aed0>] (__lock_acquire+0x1eb0/0x2224)
[<
8007aed0>] (__lock_acquire) from [<
8007b840>] (lock_acquire+0xa4/0xd0)
[<
8007b840>] (lock_acquire) from [<
808dc28c>] (_raw_spin_lock+0x3c/0x4c)
[<
808dc28c>] (_raw_spin_lock) from [<
80666724>] (sm_keystore_slot_alloc+0x24/0x74)
[<
80666724>] (sm_keystore_slot_alloc) from [<
806677c8>] (caam_sm_example_init+0x1ec/0xb68)
[<
806677c8>] (caam_sm_example_init) from [<
80c6ff48>] (caam_sm_test_init+0x50/0x58)
[<
80c6ff48>] (caam_sm_test_init) from [<
80009770>] (do_one_initcall+0x8c/0x1d8)
[<
80009770>] (do_one_initcall) from [<
80c26dc8>] (kernel_init_freeable+0x144/0x1e4)
[<
80c26dc8>] (kernel_init_freeable) from [<
808cbff0>] (kernel_init+0x8/0xe8)
[<
808cbff0>] (kernel_init) from [<
8000f618>] (ret_from_fork+0x14/0x3c)
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Reviewed-by: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Wed, 24 Aug 2016 03:52:01 +0000 (22:52 -0500)]
MLK-13095 DCP driver doesn't initialize the DCP clock
Added clock enable and disable to the probe and remove functions
where appropriate.
Signed-off-by: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Mon, 15 Aug 2016 03:12:07 +0000 (22:12 -0500)]
MLK-13073 crypto: dcp: Add DCP support for i.mx6
Enable DCP support for imx6 series.
Signed-off-by: Dan Douglass <dan.douglass@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
ulises [Wed, 18 Nov 2015 14:10:26 +0000 (08:10 -0600)]
MLK-11922 i.mx6: Linux 3.14.28 CAAM & SNVS enabled by default.
JTAG, DS-5 attachment causes exceptions
Added properties to device tree, in order to enable and disable
alarms. The following are the available alarms:
-JTAG active
-WatchDOG 2 reset
-Internal Boot
-External Tamper Detection pad
(Vipul: Fixed merge conflicts)
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Herbert Xu [Tue, 16 Jun 2015 05:54:16 +0000 (13:54 +0800)]
crypto: testmgr - Disable rfc4543 test
Because the old rfc4543 implementation always injected an IV into
the AD, while the new one does not, we have to disable the test
while it is converted over to the new AEAD interface.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Russell King [Sun, 18 Oct 2015 16:51:25 +0000 (17:51 +0100)]
MLK-12312: CAAM hash algorithms fail registration during initialization
Fix cherry-picked from
5ec908319ab53072d3a2188e62ed2e5d7b846951
crypto: caam - only export the state we really need to export
Avoid exporting lots of state by only exporting what we really require,
which is the buffer containing the set of pending bytes to be hashed,
number of pending bytes, the context buffer, and the function pointer
state. This reduces down the exported state size to 216 bytes from
576 bytes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Wed, 20 Jan 2016 19:31:56 +0000 (13:31 -0600)]
MLK-12302 caam: Secure Memory platform device creation crashes
There is new flag that is checked in of_platform_device_create().
The flag is cleared prior to the call now so the device creates
successfully.
Signed-off-by: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Fugang Duan [Fri, 14 Aug 2015 06:46:23 +0000 (14:46 +0800)]
MLK-11360-01 crypto: caam_snvs: add snvs clock management
caam_snvs driver involves snvs HP registers access that needs to
enable snvs clock source. The patch add the clock management.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Ulises Cardenas [Fri, 12 Jun 2015 10:54:36 +0000 (05:54 -0500)]
MLK-11103 Missing register in Secure memory configuration v1
Added missing reserved register for caam_secure_mem_v1 struct
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Thu, 14 May 2015 21:28:52 +0000 (16:28 -0500)]
MLK-10897-1 ARM: imx7d: Add CAAM support for i.mx7d
CAAM only has a single clock in i.mx7d. Logic was added to initialize only
the single clock.
The Secure Memory registers moved in CAAM era included in i.mx7d. This
required changes to support access to two different versions of the
register map. The registers are access through a data structure that
overlay the register region. Two new Secure Memory register structures were
created to support the different versions. Logic was also added to
determine which version is implemented based on the CAAM era, and access
functions were added to support register access to the Secure Memory
Command and Status registers.
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Wed, 14 Jan 2015 18:43:12 +0000 (11:43 -0700)]
MLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()
Replace of_irq_to_resource() in the SECVIO module with the simpler
equivalent irq_of_parse_and_map(). Also, add error checking to
to the SECVIO and Job Ring modules. Based on upstream commit
f7578496a671a96e501f16a5104893275e32c33a.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Thu, 18 Dec 2014 21:06:50 +0000 (14:06 -0700)]
MLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on
This patch allows CAAM to be enabled as a wakeup source for the
Mega/Fast mix domain. If CAAM is enabled as a wakeup source, it
will continue to be powered on across Deep Sleep Mode (DSM). This
allows CAAM to be functional after the system resumes from DSM.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit
290744e3b40a563319324e234fa5a65b49fd4d82)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Winston Hudson (b45308) [Thu, 27 Jun 2013 20:22:39 +0000 (13:22 -0700)]
MLK-9971 Add XCBC-AES support for CAAM in i.MX6 family
Add XCBC-AES support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.
Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families
(such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Thu, 20 Nov 2014 18:28:28 +0000 (11:28 -0700)]
MLK-9951 Update CAAM driver era interface
Add more CAAM era values to the CAAM driver's caam_get_era()
function. Read only 32 bits of data since the data required
to identify the IP_ID and MAJ_REV is located in the first 32
bits of the register. And, update the function for use with
ARM/Little Endian devices.
[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit
6050d7faf2d0c063195aa9454c130548a9f8058f)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Mon, 3 Nov 2014 22:28:10 +0000 (15:28 -0700)]
MLK-9710-5 Unregister Secure Memory platform device upon shutdown
Unregister Secure Memory platform device when the Secure Memory
module is shut down. This allows the Secure Memory module to
be inserted again successfully.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit
785456f38234e64618ee9c74ab4258f39f00e73c)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan (b42089) [Tue, 26 Mar 2013 21:11:32 +0000 (14:11 -0700)]
MLK-9769-20 Limit AXI pipeline to a depth of one in CAAM for i.MX6 devices
i.MX6 devices have an issue wherein AXI bus transactions may not occur
in the correct order. This isn't a problem running single descriptors,
but can be if running multiple concurrent descriptors. Reworking the CAAM
driver to throttle to single requests is impractical, so this patch limits
the AXI pipeline to a depth of one (from a default of four) to preclude
this situation from occurring.
Signed-off-by: Victoria Milhoan (b42089) <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Winston Hudson [Mon, 17 Nov 2014 17:17:35 +0000 (10:17 -0700)]
MLK-9769-19 Add ARC4-ECB support for CAAM in i.MX6 family
Adds ARC4-ECB Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.
Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families
(such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Winston Hudson (b45308) [Thu, 27 Jun 2013 04:08:30 +0000 (21:08 -0700)]
MLK-9769-18 Add 3DES-ECB-EDE support for CAAM in i.MX6 family
Adds 3DES-ECB-EDE Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.
Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families
(such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Winston Hudson (b45308) [Thu, 27 Jun 2013 03:49:36 +0000 (20:49 -0700)]
MLK-9769-17 Add AES-ECB support for CAAM in i.MX6 family
Adds AES-ECB (Electronic Codebook) support to the CAAM crypto accelerator
core in the i.MX6 family of SoC devices.
Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families
(such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Winston Hudson [Mon, 17 Nov 2014 16:27:30 +0000 (09:27 -0700)]
MLK-9769-16 Add DES-ECB support for CAAM in i.MX6 family
Adds DES-ECB Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.
Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families
(such as QorIQ). Thus the property names are often tied to the sec-4.0+
nomenclature.
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan (b42089) [Fri, 29 Mar 2013 07:13:14 +0000 (00:13 -0700)]
MLK-9769-14 Add CRYPTO_ALG_KERN_DRIVER_ONLY flag to Freescale CAAM driver
The CRYPTO_ALG_KERN_DRIVER_ONLY flag is used to indicate that
the crypto algorithm is only available via a kernel driver.
This patch adds the flag only when the flag is available in the
kernel. Utilizing the flag based on it's availability in the
kernel allows the driver to compile on older kernel versions.
The original community patch is located at
http://permalink.gmane.org/gmane.linux.kernel.cryptoapi/6547
for reference.
Signed-off-by: Victoria Milhoan (b42089) <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Fri, 2 Aug 2013 21:19:27 +0000 (14:19 -0700)]
MLK-9710-15 Correct size of padded key buffers
Correct size of padded key buffers for the Secure Memory test module.
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit
da77cf5583c064deefd09a5e91851ab4398701a0)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Fri, 2 Aug 2013 03:08:19 +0000 (20:08 -0700)]
MLK-9710-14 Un-pad cache sizes for blob export/import
Blob exportation and importation functions were adding padding to
the buffer mapping and cache control functions, which resulted in
incorrect CPU-level views into a DMA-ed blob.
Also, corrected descriptor constructors to use symbolic form of
blob overhead calculation.
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit
c5f2cbb1fa51b0142742de77fe0a37c290bd04a0)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Fri, 2 Aug 2013 03:06:05 +0000 (20:06 -0700)]
MLK-9710-13 Correct size in BLOB_OVERHEAD definition
Increase the size of BLOB_OVERHEAD.
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit
32aced88dedf1c1c11170d125d3cc546ffefb366)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Wed, 24 Jul 2013 03:56:08 +0000 (20:56 -0700)]
MLK-9710-12 Adapt sm_test as a black-key handling example
Converted sm_test to an example that can show:
- key covering
- secret encapsulation as external memory blob
- secret decapsulation from external memory blob
- checks and displays of the handling of key content
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit
45818b72fc4b3fe3fff755b1f9a27cd5519ca2cf)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Wed, 24 Jul 2013 03:49:29 +0000 (20:49 -0700)]
MLK-9710-11 Add internal key cover and external blob export/import to prototype SM-API
Extended/amended the prototype SM-API with the following functions:
- Added key covering (blackening) function in-place to a keyslot
- Added export operation to encapsulate data to external memory as a
secure memory blob (including descriptor capable of secure memory or
general memory blob generation)
- Removed in-place blob encapsulation
- Added import operation to decapsulate a blob from external memory into
secure memory (including descriptor capable of general memory or secure
memory content decapsulation)
- Removed in-place blob decapsulation
[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit
c577769ed0347bb4e3428b5696fb7f209af0a7ad)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Thu, 25 Sep 2014 23:34:11 +0000 (16:34 -0700)]
MLK-9710-18 snvs - make SECVIO module device tree correct
Converted the prototype 3.0.x SNVS Security Violation Handler
subsystem to be device tree correct/compliant under 3.10 for ARM
platforms. Also, separated out SNVS property detection so as to make
it independent of CAAM, and corrected function namespace accordingly.
Later releases of this subsystem are likely to be separate from the
kernel's CAAM driver space.
[<vicki.milhoan@freescale.com>: Edited to apply to latest 3.10 kernel]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit
c8c128086eae012ced0c96d66f21f36bcbd14f66)
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Leonard Crestez [Tue, 6 Mar 2018 18:32:19 +0000 (20:32 +0200)]
MLK-12305 Enable CAAM in imx_v7_defconfig
Enabled CAAM in imx_v7_defconfig.
Signed-off-by: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Wed, 27 Nov 2013 09:40:44 +0000 (03:40 -0600)]
ENGR00289885 [iMX6Q] Add Secure Memory and SECVIO support.
1. Pull in secure memory support from 3.0.35 kernel.
2. Pull in SECVIO support from 3.0.35 kernel.
3. Make changes to support device tree.
4. Add device tree setting for SECVIO sources.
[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Dan Douglass <b41520@freescale.com>
(cherry picked from commit
f3bfd42e2db3af8326734bebf750e94e74734f6e)
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Fri, 19 Oct 2012 21:37:12 +0000 (14:37 -0700)]
MLK-9769-10 Add Blob command bitdefs.
Add bit definitions for Blob protocol protinfo field.
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Fri, 19 Oct 2012 21:43:41 +0000 (14:43 -0700)]
MLK-9769-11 Add SM register defs, and expanded driver-private storage.
These add changes to the driver private areas for the CAAM
controller and CAAM Secure Memory subsystems, and expand register
definitions to include the Secure Memory subsystems as reflected
in multiple areas (controller, rings, secure memory itself).
[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Steve Cornelius [Wed, 24 Jul 2013 03:47:32 +0000 (20:47 -0700)]
MLK-9710-10 Add CCM defs for FIFO_STORE instruction
Added definitions to enable FIFO_STORE to encode options for storing
keys in AES-CCM mode
[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit
a3cd8e5fad274f33fc6f0030413f89a6339b1d5a)
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Wed, 12 Nov 2014 16:58:24 +0000 (09:58 -0700)]
MLK-9769-9 Adjust RNG timing to support more devices
Adjust RNG timing parameters to support more i.MX6 devices.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan (b42089) [Fri, 17 Oct 2014 23:30:56 +0000 (16:30 -0700)]
MLK-9769-8 Add a test for the Freescale CAAM Random Number Generator
Freescale's CAAM includes a Random Number Generator. This change adds
a kernel configuration option to test the RNG's capabilities via the
hw_random framework.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Victoria Milhoan [Wed, 29 Oct 2014 18:23:05 +0000 (11:23 -0700)]
MLK-9769-1 caam: remove incorrect comment from job ring module
The caam_jr_register() function is no longer part of the CAAM
driver. This patch removes a comment referencing the function.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Horia Geanta [Fri, 18 Apr 2014 10:01:42 +0000 (13:01 +0300)]
crypto: caam - add allocation failure handling in SPRINTFCAT macro
commit
27c5fb7a84242b66bf1e0b2fe6bf40d19bcc5c04 upstream.
GFP_ATOMIC memory allocation could fail.
In this case, avoid NULL pointer dereference and notify user.
Cc: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts:
drivers/crypto/caam/error.c
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 29 Mar 2018 03:36:43 +0000 (11:36 +0800)]
MLK-17938: pxp: pxp will hang when output height is 8
When output height is eight, yscale of ps engine will be
over two, it not support by pxp.
According to pxp doc, a factor greater than 2 is not
supported with the bilinear filter. so correct it when
this case happen in order to ensure that pxp will be
not hang up.
Reviewed-by: Robby.cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Fri, 23 Mar 2018 03:41:49 +0000 (11:41 +0800)]
MLK-17487: pxp: fix pxp yuv to yuv generate color dots issue
When PxP convert yuyv to nv12 format, some color dots will
introdue to output image. IC recommend that YCBCR_MODE and
BYPASS bit of CSC1_COEF0 should be 1.
Reviewed-by: robby.cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 7 Sep 2017 02:04:14 +0000 (10:04 +0800)]
MLK-16374-4: PxP: add AS and PS engine colorkey support
Enable PS and AS colorkey function if user enable and
set colorkey parameters of s0 and overlay buffer.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit
f2ed3bfca174b3e370fc37cd5f75a67334822093)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Wed, 6 Sep 2017 06:23:13 +0000 (14:23 +0800)]
MLK-16374-3: PxP: improve stride parameter setting compatible
In pxp lib, the unit of stride parameter is pixel and stride
is not equal with width parameter of out buffer in some cases.
In order to use latest pxp lib in old version rootfs, PXP_DEVICE_LEGACY
macro is used to distinguish pxp drvier version. Because the
new pxp driver define a new variable and pxp lib can know this
through PXP_DEVICE_LEGACY, and determine if use it.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
91da74e81cfdd2774b39a7574edf93de3f2a3f25)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Tue, 5 Sep 2017 09:58:02 +0000 (17:58 +0800)]
MLK-16374-2: PxP: add new format support for as and out buffer
1) add PXP_PIX_FMT_BGRA32 format support for AS buffer
2) add PXP_PIX_FMT_BGRA32 format support for OUT buffer
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
4eeefd54cdbb8d1d3ffd64bd444ea7b759101a35)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Mon, 4 Sep 2017 08:42:41 +0000 (16:42 +0800)]
MLK-16374-1: PxP: add alpha blending back compatible
In support of both g2d and pxp lib alpha blending, there
must be two alpha blending versions. So there is one rule
that user should obey for different usage cases.
1) g2d alpha blending: user should set combine_enable
member of struct pxp_proc_data.
2) pxp lib alpha blending: user should set combine_enable
member of struct pxp_layer_param if the pxp_layer_param
describe overlay buffer parameters.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
7c62393a556d043f88dd188edac3c0d250039358)
TODO: check patch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 31 Aug 2017 11:00:47 +0000 (19:00 +0800)]
MLK-16348: PxP: fix background issue
There was no pxp background register setting, so the
background we see always black.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit
d3ee45e2671478854a165f34f91fabac247e8a39)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 31 Aug 2017 01:39:12 +0000 (09:39 +0800)]
MMFMWK-7674: PxP: add YVU420P support
PxP PS engine support YUV420 format, but not YVU420. The difference
between two format is U and V, if we exchange U and V base address,
the PxP driver can also support YVU420 format.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
cbc71da10afe67ae815a97a68e4a1b0dff4693eb)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Fri, 25 Aug 2017 10:57:08 +0000 (18:57 +0800)]
MLK-16276: PxP: Improve code compatibility
g2d code has different parameter setting about stride parameter.
For compatibility with all cases of using PxP, we need add this
improved feature.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
53c8ffffec181a765f4487a9d1bf2eb05b1b78f7)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Fri, 25 Aug 2017 10:48:32 +0000 (18:48 +0800)]
MLK-16252: PxP: fix video shift issue
If pxp use crop x/y valuse as the upper left coordinate in
out buffer, pxp driver only need to write out buffer base
address to pxp out_buf register. If pxp driver use zero as
ps_ulc register value, pxp out_buf register need an offset
added with out buffer base address.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
14c988f1eb7e9471b0875016df29708865727fbb)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Fri, 18 Aug 2017 02:09:08 +0000 (10:09 +0800)]
MLK-16217: PXP: fix pxp rotate yuv formate video issue
Because of IC limitation, pxp only can use rotation0 engine to
do rotation operation.
Correct coordinate settings of ps and out buffer.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 20 Jul 2017 04:18:42 +0000 (12:18 +0800)]
MLK-16045: pxp: add lut function in pxp data flow path
When do epdc colormap test, the epdc need pxp lut function. But
if the data flow through mux0->mux1...or mux0->mux2..., the pxp
can not trigger interrupt but mux0->mux3... can. This issue only
occures on imx7d, so I set a constant data path when using lut function.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Thu, 13 Jul 2017 14:53:51 +0000 (22:53 +0800)]
MLK-15962: pxp-v3: fix pxp operation timeout issue
PxP block on imx6sll, imx6ull is different with imx7d, the node
path_ctrl should be different. So add path_ctrl for 6sll, 6ull.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Wed, 5 Jul 2017 06:03:06 +0000 (14:03 +0800)]
MLK-15337: pxp-v3: add pxp v3 crop feature
Add pxp v3 crop feature support.
Update the pxp_dma.h file.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Guoniu.Zhou [Wed, 5 Jul 2017 04:20:33 +0000 (12:20 +0800)]
MLK-15325: pxp-v3: Modify pxp pitch parameter and csc
coefficient setting.
Because the caller of pxp-v3 does not set the stride parameter,
this will cause pitch parameter to be zero and pxp can't work.
Correct the csc1 coefficient when use pxp convert YUV to RGB format.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>