layerscape: add 64b/32b target for ls1012ardb device
[openwrt/openwrt.git] / package / boot / uboot-layerscape / patches / 0081-crypto-fsl-Update-blob-cmd-to-accept-64bit-addresses.patch
1 From 5d4a46fe8847d26112764c5768ff00f839fb3810 Mon Sep 17 00:00:00 2001
2 From: Sumit Garg <sumit.garg@nxp.com>
3 Date: Tue, 12 Jul 2016 14:05:34 -0400
4 Subject: [PATCH 81/93] crypto/fsl: Update blob cmd to accept 64bit addresses
5
6 Update blob cmd to accept 64bit source, key modifier and destination
7 addresses. Also correct output result print format for fsl specific
8 implementation of blob cmd.
9
10 Signed-off-by: Sumit Garg <sumit.garg@nxp.com>
11 ---
12 common/cmd_blob.c | 2 +-
13 drivers/crypto/fsl/fsl_blob.c | 13 ++++++++++---
14 2 files changed, 11 insertions(+), 4 deletions(-)
15
16 diff --git a/common/cmd_blob.c b/common/cmd_blob.c
17 index ac8b268..bdd4cfd 100644
18 --- a/common/cmd_blob.c
19 +++ b/common/cmd_blob.c
20 @@ -54,7 +54,7 @@ __weak int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
21 */
22 static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
23 {
24 - uint32_t key_addr, src_addr, dst_addr, len;
25 + ulong key_addr, src_addr, dst_addr, len;
26 uint8_t *km_ptr, *src_ptr, *dst_ptr;
27 int enc, ret = 0;
28
29 diff --git a/drivers/crypto/fsl/fsl_blob.c b/drivers/crypto/fsl/fsl_blob.c
30 index 8b25921..d24b8fc 100644
31 --- a/drivers/crypto/fsl/fsl_blob.c
32 +++ b/drivers/crypto/fsl/fsl_blob.c
33 @@ -18,7 +18,7 @@ int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
34 int ret, i = 0;
35 u32 *desc;
36
37 - printf("\nDecapsulating data to form blob\n");
38 + printf("\nDecapsulating blob to get data\n");
39 desc = malloc(sizeof(int) * MAX_CAAM_DESCSIZE);
40 if (!desc) {
41 debug("Not enough memory for descriptor allocation\n");
42 @@ -27,12 +27,15 @@ int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
43
44 inline_cnstr_jobdesc_blob_decap(desc, key_mod, src, dst, len);
45
46 + debug("Descriptor dump:\n");
47 for (i = 0; i < 14; i++)
48 - printf("%x\n", *(desc + i));
49 + debug("Word[%d]: %08x\n", i, *(desc + i));
50 ret = run_descriptor_jr(desc);
51
52 if (ret)
53 printf("Error in Decapsulation %d\n", ret);
54 + else
55 + printf("Decapsulation Success\n");
56
57 free(desc);
58 return ret;
59 @@ -51,12 +54,16 @@ int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
60 }
61
62 inline_cnstr_jobdesc_blob_encap(desc, key_mod, src, dst, len);
63 +
64 + debug("Descriptor dump:\n");
65 for (i = 0; i < 14; i++)
66 - printf("%x\n", *(desc + i));
67 + debug("Word[%d]: %08x\n", i, *(desc + i));
68 ret = run_descriptor_jr(desc);
69
70 if (ret)
71 printf("Error in Encapsulation %d\n", ret);
72 + else
73 + printf("Encapsulation Success\n");
74
75 free(desc);
76 return ret;
77 --
78 1.7.9.5
79