[PATCH v4] crypto/caam: add backlogging support

2015-09-21 Thread Alex Porosanu
full, the job is enqueued. The API contract which states that a CRYPTO_TFM_REQ_MAY_BACKLOG transformation must be able to enqueue at least 1 entry is assured by allowing only a number of transformations to be affined to one JR, equal to half the number of JR slots minus one. Signed-off-by: Ale

[PATCH v3] crypto/caam: add backlogging support

2015-09-19 Thread Alex Porosanu
the processing thread will sleep once -EBUSY is received. Signed-off-by: Alex Porosanu --- v3: - as per Herbert's observation, allow only # of backlogging slots transformations w/MAY_BACKLOG flag set to be affined to a JR; the total # of transformations that can be thus allocated is equal t

[PATCH v2] crypto/caam: add backlogging support

2015-09-16 Thread Alex Porosanu
full, the job is enqueued. Caveat: if the users of the driver don't obey the API contract which states that once -EBUSY is received, no more requests are to be sent, eventually the driver will reject the enqueues. Signed-off-by: Alex Porosanu --- v2: - added backlogging support for hash as

[PATCH] crypto/caam: add backlogging support

2015-09-08 Thread Alex Porosanu
full, the job is enqueued. Caveat: if the users of the driver don't obey the API contract which states that once -EBUSY is received, no more requests are to be sent, eventually the driver will reject the enqueues. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/

[PATCH 1/3] crypto: caam - disable RNG oscillator maximum frequency check

2014-08-11 Thread Alex Porosanu
d as being out of bounds. This patch effectively disables the maximum frequency check, by setting a high enough maximum allowable frequency for the oscillator. The reasoning behind this is that usually a broken oscillator will run too slow (i.e. not run at all) rather than run too fast. Signed-off-by:

[PATCH 3/3] crypto: caam - enable raw data instead of von Neumann data

2014-08-11 Thread Alex Porosanu
The sampling of the oscillator can be done in multiple modes for generating the entropy value. By default, this is set to von Neumann. This patch changes the sampling to raw data, since it has been discovered that the generated entropy has a better 'quality'. Signed-off-by: Ale

[PATCH 2/3] crypto: caam - change starting entropy delay value

2014-08-11 Thread Alex Porosanu
adverse cases, the CPU isn't hogged by the instantiation loop. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c | 9 + drivers/crypto/caam/regs.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c

[PATCH 0/3] CAAM RNG4 fixes

2014-08-11 Thread Alex Porosanu
This series of patches target the RNG4 block of CAAM and fix an issue identified on new platforms using this IP. Two of the patches, change the way the entropy is being taken from the internal oscillator and adjust the delay accordingly. Alex Porosanu (3): crypto: caam - disable RNG oscillator

[PATCH] crypto: caam - fix ERA retrieval function

2014-02-06 Thread Alex Porosanu
SEC ERA has to be retrieved by reading the "fsl,sec-era" property from the device tree. This property is updated/filled in by u-boot. Change-Id: Ie1620354a0cf2cac5cd2c72bd5f2449f55858378 Signed-off-by: Alex Porosanu --- drivers/crypto/caam/c

[PATCH 2/7] crypto: caam - fix hash, alg and rng registration if CAAM driver not initialized

2013-09-09 Thread Alex Porosanu
If the CAAM driver initialization failed (due to various reasons, e.g. RNG4 initialization failed), then the registration of hash/algorithms/rng shouldn't take place. This patch adds the necessary code to prevent this registration. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/caam

[PATCH 0/7] crypto: caam - RNG4 patches and fixes

2013-09-09 Thread Alex Porosanu
the maximum number of samples taken until the state handle can be properly initialized; o there are two state handles present in the RNG4 block and only one is initialized; patch 5 in the patch-set fixes this issue, also adding the necessary code for deinstantiation only the handles that were

[PATCH 5/7] crypto: caam - uninstantiate RNG state handle 0 if instantiated by caam driver

2013-09-09 Thread Alex Porosanu
If the caam driver module instantiates the RNG state handle 0, then upon the removal of the module, the RNG state handle is left initialized. This patch takes care of reverting the state of the handle back to its previous uninstantatied state. Signed-off-by: Alex Porosanu --- drivers/crypto

[PATCH 1/7] crypto: caam - fix RNG state handle instantiation descriptor

2013-09-09 Thread Alex Porosanu
adds a halt command at the end of the descriptor to ensure the DECO halts when it reaches the end of the descriptor buffer. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers

[PATCH 6/7] crypto: caam - fix RNG4 AAI defines

2013-09-09 Thread Alex Porosanu
RNG4 defines in desc.h were incomplete (bits AI & PS were missing), while SK was set as an ALG related bit. This patchs adds the missing bits and corrects the SK bit. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c |2 +- drivers/crypto/caam/desc.h | 17 +---

[PATCH 7/7] crypto: caam - enable instantiation of all RNG4 state handles

2013-09-09 Thread Alex Porosanu
state handle(s) instantiated by this driver will be deinstantiated when removing the module. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c | 206 -- drivers/crypto/caam/intern.h |8 +- drivers/crypto/caam/regs.h |7 ++- 3 files

[PATCH 4/7] crypto: caam - split RNG4 instantiation function

2013-09-09 Thread Alex Porosanu
mechanism. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c | 140 +--- 1 files changed, 92 insertions(+), 48 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index d5fe5f5..3ad032f 100644 --- a/drivers/crypto/caam

[PATCH 3/7] crypto: caam - fix RNG4 instantiation

2013-09-09 Thread Alex Porosanu
le, by checking the DECO state field of the said register. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c | 63 --- drivers/crypto/caam/regs.h |7 +++- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/caa

[PATCH 2/2] crypto: caam - add option for enabling DEBUG mode

2013-08-14 Thread Alex Porosanu
This patch adds an option to the Kconfig file for SEC which enables the user to see the debug messages that are printed inside the SEC driver. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/Kconfig |8 drivers/crypto/caam/Makefile |3 +++ 2 files changed, 11 insertions

[PATCH 1/2] crypto: caam - replace xstr macro with __stringify

2013-08-14 Thread Alex Porosanu
CAAM driver contains one macro (xstr) used for printing the line location in a file where a memdump is done. This patch replaces the xstr macro with the already existing __stringify macro that performs the same function. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/caamalg.c | 78

[PATCH 1/2] crypto: caam - support for RNG version retrieval

2013-02-05 Thread Alex Porosanu
This patch adds support for retrieving the version of the RNG block inside the SEC. This is done by retrieving the corresponding value from the the CHAVID register. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c | 11 +++ drivers/crypto/caam/regs.h | 37

[PATCH 0/2] RNG4 support for SEC versions < 5

2013-02-05 Thread Alex Porosanu
or not is not always correct. This set of patches should fix this by adding support for retrieving the version of the RNG block and executing the intialization of it depending if it is greater or equal than 4. Alex Porosanu (2): crypto: caam - support for RNG version retrieval crypto: caam -

[PATCH 2/2] crypto: caam - fix RNG init for SEC with RNG version greater than 4

2013-02-05 Thread Alex Porosanu
have SEC v4.4 but RNG 4 Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index d5e6837..132b98a 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto

[PATCH] ERA retrieval and printing for SEC device

2012-06-26 Thread Alex Porosanu
This patch adds support for retrieving and printing of SEC ERA information. It is useful for knowing beforehand what features exist from the SEC point of view on a certain SoC. Only era-s 1 to 4 are currently supported; other eras will appear as unknown. Signed-off-by: Alex Porosanu --- drivers