diff options
Diffstat (limited to 'drivers/crypto/caam/error.c')
-rw-r--r-- | drivers/crypto/caam/error.c | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 7e2d54bffad6..9955ed9643e6 100644 --- a/drivers/crypto/caam/error.c +++ b/drivers/crypto/caam/error.c | |||
@@ -39,18 +39,20 @@ static void report_ccb_status(u32 status, char *outstr) | |||
39 | char *cha_id_list[] = { | 39 | char *cha_id_list[] = { |
40 | "", | 40 | "", |
41 | "AES", | 41 | "AES", |
42 | "DES, 3DES", | 42 | "DES", |
43 | "ARC4", | 43 | "ARC4", |
44 | "MD5, SHA-1, SH-224, SHA-256, SHA-384, SHA-512", | 44 | "MDHA", |
45 | "RNG", | 45 | "RNG", |
46 | "SNOW f8", | 46 | "SNOW f8", |
47 | "Kasumi f8, f9", | 47 | "Kasumi f8/9", |
48 | "All Public Key Algorithms", | 48 | "PKHA", |
49 | "CRC", | 49 | "CRCA", |
50 | "SNOW f9", | 50 | "SNOW f9", |
51 | "ZUCE", | ||
52 | "ZUCA", | ||
51 | }; | 53 | }; |
52 | char *err_id_list[] = { | 54 | char *err_id_list[] = { |
53 | "None. No error.", | 55 | "No error.", |
54 | "Mode error.", | 56 | "Mode error.", |
55 | "Data size error.", | 57 | "Data size error.", |
56 | "Key size error.", | 58 | "Key size error.", |
@@ -67,6 +69,20 @@ static void report_ccb_status(u32 status, char *outstr) | |||
67 | "Invalid CHA combination was selected", | 69 | "Invalid CHA combination was selected", |
68 | "Invalid CHA selected.", | 70 | "Invalid CHA selected.", |
69 | }; | 71 | }; |
72 | char *rng_err_id_list[] = { | ||
73 | "", | ||
74 | "", | ||
75 | "", | ||
76 | "Instantiate", | ||
77 | "Not instantiated", | ||
78 | "Test instantiate", | ||
79 | "Prediction resistance", | ||
80 | "", | ||
81 | "Prediction resistance and test request", | ||
82 | "Uninstantiate", | ||
83 | "", | ||
84 | "Secure key generation", | ||
85 | }; | ||
70 | u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >> | 86 | u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >> |
71 | JRSTA_CCBERR_CHAID_SHIFT; | 87 | JRSTA_CCBERR_CHAID_SHIFT; |
72 | u8 err_id = status & JRSTA_CCBERR_ERRID_MASK; | 88 | u8 err_id = status & JRSTA_CCBERR_ERRID_MASK; |
@@ -81,7 +97,13 @@ static void report_ccb_status(u32 status, char *outstr) | |||
81 | cha_id, sizeof("ff")); | 97 | cha_id, sizeof("ff")); |
82 | } | 98 | } |
83 | 99 | ||
84 | if (err_id < ARRAY_SIZE(err_id_list)) { | 100 | if ((cha_id << JRSTA_CCBERR_CHAID_SHIFT) == JRSTA_CCBERR_CHAID_RNG && |
101 | err_id < ARRAY_SIZE(rng_err_id_list) && | ||
102 | strlen(rng_err_id_list[err_id])) { | ||
103 | /* RNG-only error */ | ||
104 | SPRINTFCAT(outstr, "%s", rng_err_id_list[err_id], | ||
105 | strlen(rng_err_id_list[err_id])); | ||
106 | } else if (err_id < ARRAY_SIZE(err_id_list)) { | ||
85 | SPRINTFCAT(outstr, "%s", err_id_list[err_id], | 107 | SPRINTFCAT(outstr, "%s", err_id_list[err_id], |
86 | strlen(err_id_list[err_id])); | 108 | strlen(err_id_list[err_id])); |
87 | } else { | 109 | } else { |
@@ -101,10 +123,10 @@ static void report_deco_status(u32 status, char *outstr) | |||
101 | u8 value; | 123 | u8 value; |
102 | char *error_text; | 124 | char *error_text; |
103 | } desc_error_list[] = { | 125 | } desc_error_list[] = { |
104 | { 0x00, "None. No error." }, | 126 | { 0x00, "No error." }, |
105 | { 0x01, "SGT Length Error. The descriptor is trying to read " | 127 | { 0x01, "SGT Length Error. The descriptor is trying to read " |
106 | "more data than is contained in the SGT table." }, | 128 | "more data than is contained in the SGT table." }, |
107 | { 0x02, "Reserved." }, | 129 | { 0x02, "SGT Null Entry Error." }, |
108 | { 0x03, "Job Ring Control Error. There is a bad value in the " | 130 | { 0x03, "Job Ring Control Error. There is a bad value in the " |
109 | "Job Ring Control register." }, | 131 | "Job Ring Control register." }, |
110 | { 0x04, "Invalid Descriptor Command. The Descriptor Command " | 132 | { 0x04, "Invalid Descriptor Command. The Descriptor Command " |
@@ -116,7 +138,7 @@ static void report_deco_status(u32 status, char *outstr) | |||
116 | { 0x09, "Invalid OPERATION Command" }, | 138 | { 0x09, "Invalid OPERATION Command" }, |
117 | { 0x0A, "Invalid FIFO LOAD Command" }, | 139 | { 0x0A, "Invalid FIFO LOAD Command" }, |
118 | { 0x0B, "Invalid FIFO STORE Command" }, | 140 | { 0x0B, "Invalid FIFO STORE Command" }, |
119 | { 0x0C, "Invalid MOVE Command" }, | 141 | { 0x0C, "Invalid MOVE/MOVE_LEN Command" }, |
120 | { 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is " | 142 | { 0x0D, "Invalid JUMP Command. A nonlocal JUMP Command is " |
121 | "invalid because the target is not a Job Header " | 143 | "invalid because the target is not a Job Header " |
122 | "Command, or the jump is from a Trusted Descriptor to " | 144 | "Command, or the jump is from a Trusted Descriptor to " |
@@ -166,6 +188,8 @@ static void report_deco_status(u32 status, char *outstr) | |||
166 | "(input frame; block ciphers) and IPsec decap (output " | 188 | "(input frame; block ciphers) and IPsec decap (output " |
167 | "frame, when doing the next header byte update) and " | 189 | "frame, when doing the next header byte update) and " |
168 | "DCRC (output frame)." }, | 190 | "DCRC (output frame)." }, |
191 | { 0x23, "Read Input Frame error" }, | ||
192 | { 0x24, "JDKEK, TDKEK or TDSK not loaded error" }, | ||
169 | { 0x80, "DNR (do not run) error" }, | 193 | { 0x80, "DNR (do not run) error" }, |
170 | { 0x81, "undefined protocol command" }, | 194 | { 0x81, "undefined protocol command" }, |
171 | { 0x82, "invalid setting in PDB" }, | 195 | { 0x82, "invalid setting in PDB" }, |