mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 22:14:54 +00:00
crypto: caam: change JR running loop
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
81d5605a86
commit
68a905d1ff
2 changed files with 9 additions and 7 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include <asm/fsl_pamu.h>
|
#include <asm/fsl_pamu.h>
|
||||||
#endif
|
#endif
|
||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
|
||||||
#define CIRC_CNT(head, tail, size) (((head) - (tail)) & (size - 1))
|
#define CIRC_CNT(head, tail, size) (((head) - (tail)) & (size - 1))
|
||||||
#define CIRC_SPACE(head, tail, size) CIRC_CNT((tail), (head) + 1, (size))
|
#define CIRC_SPACE(head, tail, size) CIRC_CNT((tail), (head) + 1, (size))
|
||||||
|
@ -355,8 +356,8 @@ static void desc_done(uint32_t status, void *arg)
|
||||||
|
|
||||||
static inline int run_descriptor_jr_idx(uint32_t *desc, uint8_t sec_idx)
|
static inline int run_descriptor_jr_idx(uint32_t *desc, uint8_t sec_idx)
|
||||||
{
|
{
|
||||||
unsigned long long timeval = get_ticks();
|
unsigned long long timeval = 0;
|
||||||
unsigned long long timeout = usec2ticks(CONFIG_SEC_DEQ_TIMEOUT);
|
unsigned long long timeout = CONFIG_USEC_DEQ_TIMEOUT;
|
||||||
struct result op;
|
struct result op;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@ -369,9 +370,10 @@ static inline int run_descriptor_jr_idx(uint32_t *desc, uint8_t sec_idx)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
timeval = get_ticks();
|
|
||||||
timeout = usec2ticks(CONFIG_SEC_DEQ_TIMEOUT);
|
|
||||||
while (op.done != 1) {
|
while (op.done != 1) {
|
||||||
|
udelay(1);
|
||||||
|
timeval += 1;
|
||||||
|
|
||||||
ret = jr_dequeue(sec_idx);
|
ret = jr_dequeue(sec_idx);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("Error in SEC deq\n");
|
debug("Error in SEC deq\n");
|
||||||
|
@ -379,7 +381,7 @@ static inline int run_descriptor_jr_idx(uint32_t *desc, uint8_t sec_idx)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((get_ticks() - timeval) > timeout) {
|
if (timeval > timeout) {
|
||||||
debug("SEC Dequeue timed out\n");
|
debug("SEC Dequeue timed out\n");
|
||||||
ret = JQ_DEQ_TO_ERR;
|
ret = JQ_DEQ_TO_ERR;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
|
||||||
#define JR_SIZE 4
|
#define JR_SIZE 4
|
||||||
/* Timeout currently defined as 90 sec */
|
/* Timeout currently defined as 10 sec */
|
||||||
#define CONFIG_SEC_DEQ_TIMEOUT 90000000U
|
#define CONFIG_USEC_DEQ_TIMEOUT 10000000U
|
||||||
|
|
||||||
#define DEFAULT_JR_ID 0
|
#define DEFAULT_JR_ID 0
|
||||||
#define DEFAULT_JR_LIODN 0
|
#define DEFAULT_JR_LIODN 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue