License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 21:07:57 +07:00
// SPDX-License-Identifier: GPL-2.0
2011-03-13 15:54:26 +07:00
/*
* CAAM Error Reporting
*
* Copyright 2009 - 2011 Freescale Semiconductor , Inc .
*/
# include "compat.h"
# include "regs.h"
# include "desc.h"
# include "error.h"
2017-07-10 12:40:28 +07:00
# ifdef DEBUG
# include <linux/highmem.h>
2019-05-23 15:50:30 +07:00
void caam_dump_sg ( const char * prefix_str , int prefix_type ,
2017-07-10 12:40:28 +07:00
int rowsize , int groupsize , struct scatterlist * sg ,
size_t tlen , bool ascii )
{
struct scatterlist * it ;
void * it_page ;
size_t len ;
void * buf ;
2019-05-07 20:37:03 +07:00
for ( it = sg ; it & & tlen > 0 ; it = sg_next ( it ) ) {
2017-07-10 12:40:28 +07:00
/*
* make sure the scatterlist ' s page
* has a valid virtual memory mapping
*/
it_page = kmap_atomic ( sg_page ( it ) ) ;
if ( unlikely ( ! it_page ) ) {
pr_err ( " caam_dump_sg: kmap failed \n " ) ;
return ;
}
buf = it_page + it - > offset ;
len = min_t ( size_t , tlen , it - > length ) ;
2019-05-23 15:50:30 +07:00
print_hex_dump_debug ( prefix_str , prefix_type , rowsize ,
groupsize , buf , len , ascii ) ;
2017-07-10 12:40:28 +07:00
tlen - = len ;
kunmap_atomic ( it_page ) ;
}
}
# else
2019-05-23 15:50:30 +07:00
void caam_dump_sg ( const char * prefix_str , int prefix_type ,
2017-07-10 12:40:28 +07:00
int rowsize , int groupsize , struct scatterlist * sg ,
size_t tlen , bool ascii )
{ }
# endif /* DEBUG */
EXPORT_SYMBOL ( caam_dump_sg ) ;
2019-01-10 20:58:12 +07:00
bool caam_little_end ;
EXPORT_SYMBOL ( caam_little_end ) ;
bool caam_imx ;
EXPORT_SYMBOL ( caam_imx ) ;
2019-08-21 03:23:55 +07:00
size_t caam_ptr_sz ;
EXPORT_SYMBOL ( caam_ptr_sz ) ;
2014-04-25 01:05:13 +07:00
static const struct {
u8 value ;
2014-04-25 01:05:21 +07:00
const char * error_text ;
2014-04-25 01:05:13 +07:00
} desc_error_list [ ] = {
{ 0x00 , " No error. " } ,
2014-04-25 01:05:22 +07:00
{ 0x01 , " SGT Length Error. The descriptor is trying to read more data than is contained in the SGT table. " } ,
2014-04-25 01:05:13 +07:00
{ 0x02 , " SGT Null Entry Error. " } ,
2014-04-25 01:05:22 +07:00
{ 0x03 , " Job Ring Control Error. There is a bad value in the Job Ring Control register. " } ,
{ 0x04 , " Invalid Descriptor Command. The Descriptor Command field is invalid. " } ,
2014-04-25 01:05:13 +07:00
{ 0x05 , " Reserved. " } ,
{ 0x06 , " Invalid KEY Command " } ,
{ 0x07 , " Invalid LOAD Command " } ,
{ 0x08 , " Invalid STORE Command " } ,
{ 0x09 , " Invalid OPERATION Command " } ,
{ 0x0A , " Invalid FIFO LOAD Command " } ,
{ 0x0B , " Invalid FIFO STORE Command " } ,
{ 0x0C , " Invalid MOVE/MOVE_LEN Command " } ,
2014-04-25 01:05:22 +07:00
{ 0x0D , " Invalid JUMP Command. A nonlocal JUMP Command is invalid because the target is not a Job Header Command, or the jump is from a Trusted Descriptor to a Job Descriptor, or because the target Descriptor contains a Shared Descriptor. " } ,
2014-04-25 01:05:13 +07:00
{ 0x0E , " Invalid MATH Command " } ,
{ 0x0F , " Invalid SIGNATURE Command " } ,
2014-04-25 01:05:22 +07:00
{ 0x10 , " Invalid Sequence Command. A SEQ IN PTR OR SEQ OUT PTR Command is invalid or a SEQ KEY, SEQ LOAD, SEQ FIFO LOAD, or SEQ FIFO STORE decremented the input or output sequence length below 0. This error may result if a built-in PROTOCOL Command has encountered a malformed PDU. " } ,
2014-04-25 01:05:13 +07:00
{ 0x11 , " Skip data type invalid. The type must be 0xE or 0xF. " } ,
{ 0x12 , " Shared Descriptor Header Error " } ,
2014-04-25 01:05:22 +07:00
{ 0x13 , " Header Error. Invalid length or parity, or certain other problems. " } ,
{ 0x14 , " Burster Error. Burster has gotten to an illegal state " } ,
{ 0x15 , " Context Register Length Error. The descriptor is trying to read or write past the end of the Context Register. A SEQ LOAD or SEQ STORE with the VLF bit set was executed with too large a length in the variable length register (VSOL for SEQ STORE or VSIL for SEQ LOAD). " } ,
2014-04-25 01:05:13 +07:00
{ 0x16 , " DMA Error " } ,
{ 0x17 , " Reserved. " } ,
{ 0x1A , " Job failed due to JR reset " } ,
{ 0x1B , " Job failed due to Fail Mode " } ,
{ 0x1C , " DECO Watchdog timer timeout error " } ,
2014-04-25 01:05:22 +07:00
{ 0x1D , " DECO tried to copy a key from another DECO but the other DECO's Key Registers were locked " } ,
{ 0x1E , " DECO attempted to copy data from a DECO that had an unmasked Descriptor error " } ,
{ 0x1F , " LIODN error. DECO was trying to share from itself or from another DECO but the two Non-SEQ LIODN values didn't match or the 'shared from' DECO's Descriptor required that the SEQ LIODNs be the same and they aren't. " } ,
{ 0x20 , " DECO has completed a reset initiated via the DRR register " } ,
{ 0x21 , " Nonce error. When using EKT (CCM) key encryption option in the FIFO STORE Command, the Nonce counter reached its maximum value and this encryption mode can no longer be used. " } ,
{ 0x22 , " Meta data is too large (> 511 bytes) for TLS decap (input frame; block ciphers) and IPsec decap (output frame, when doing the next header byte update) and DCRC (output frame). " } ,
2014-04-25 01:05:13 +07:00
{ 0x23 , " Read Input Frame error " } ,
{ 0x24 , " JDKEK, TDKEK or TDSK not loaded error " } ,
{ 0x80 , " DNR (do not run) error " } ,
{ 0x81 , " undefined protocol command " } ,
{ 0x82 , " invalid setting in PDB " } ,
{ 0x83 , " Anti-replay LATE error " } ,
{ 0x84 , " Anti-replay REPLAY error " } ,
{ 0x85 , " Sequence number overflow " } ,
{ 0x86 , " Sigver invalid signature " } ,
{ 0x87 , " DSA Sign Illegal test descriptor " } ,
2014-04-25 01:05:22 +07:00
{ 0x88 , " Protocol Format Error - A protocol has seen an error in the format of data received. When running RSA, this means that formatting with random padding was used, and did not follow the form: 0x00, 0x02, 8-to-N bytes of non-zero pad, 0x00, F data. " } ,
{ 0x89 , " Protocol Size Error - A protocol has seen an error in size. When running RSA, pdb size N < (size of F) when no formatting is used; or pdb size N < (F + 11) when formatting is used. " } ,
2014-04-25 01:05:13 +07:00
{ 0xC1 , " Blob Command error: Undefined mode " } ,
{ 0xC2 , " Blob Command error: Secure Memory Blob mode error " } ,
2014-04-25 01:05:22 +07:00
{ 0xC4 , " Blob Command error: Black Blob key or input size error " } ,
2014-04-25 01:05:13 +07:00
{ 0xC5 , " Blob Command error: Invalid key destination " } ,
{ 0xC8 , " Blob Command error: Trusted/Secure mode error " } ,
2014-04-25 01:05:22 +07:00
{ 0xF0 , " IPsec TTL or hop limit field either came in as 0, or was decremented to 0 " } ,
2014-04-25 01:05:13 +07:00
{ 0xF1 , " 3GPP HFN matches or exceeds the Threshold " } ,
} ;
2018-09-12 15:59:32 +07:00
static const struct {
u8 value ;
const char * error_text ;
} qi_error_list [ ] = {
2019-07-31 20:08:02 +07:00
{ 0x00 , " No error " } ,
2018-09-12 15:59:32 +07:00
{ 0x1F , " Job terminated by FQ or ICID flush " } ,
{ 0x20 , " FD format error " } ,
{ 0x21 , " FD command format error " } ,
{ 0x23 , " FL format error " } ,
{ 0x25 , " CRJD specified in FD, but not enabled in FLC " } ,
{ 0x30 , " Max. buffer size too small " } ,
{ 0x31 , " DHR exceeds max. buffer size (allocate mode, S/G format) " } ,
{ 0x32 , " SGT exceeds max. buffer size (allocate mode, S/G format " } ,
{ 0x33 , " Size over/underflow (allocate mode) " } ,
{ 0x34 , " Size over/underflow (reuse mode) " } ,
{ 0x35 , " Length exceeds max. short length (allocate mode, S/G/ format) " } ,
{ 0x36 , " Memory footprint exceeds max. value (allocate mode, S/G/ format) " } ,
{ 0x41 , " SBC frame format not supported (allocate mode) " } ,
{ 0x42 , " Pool 0 invalid / pool 1 size < pool 0 size (allocate mode) " } ,
{ 0x43 , " Annotation output enabled but ASAR = 0 (allocate mode) " } ,
{ 0x44 , " Unsupported or reserved frame format or SGHR = 1 (reuse mode) " } ,
{ 0x45 , " DHR correction underflow (reuse mode, single buffer format) " } ,
{ 0x46 , " Annotation length exceeds offset (reuse mode) " } ,
{ 0x48 , " Annotation output enabled but ASA limited by ASAR (reuse mode) " } ,
{ 0x49 , " Data offset correction exceeds input frame data length (reuse mode) " } ,
2019-04-15 19:40:21 +07:00
{ 0x4B , " Annotation output enabled but ASA cannot be expanded (frame list) " } ,
2018-09-12 15:59:32 +07:00
{ 0x51 , " Unsupported IF reuse mode " } ,
{ 0x52 , " Unsupported FL use mode " } ,
{ 0x53 , " Unsupported RJD use mode " } ,
{ 0x54 , " Unsupported inline descriptor use mode " } ,
{ 0xC0 , " Table buffer pool 0 depletion " } ,
{ 0xC1 , " Table buffer pool 1 depletion " } ,
{ 0xC2 , " Data buffer pool 0 depletion, no OF allocated " } ,
{ 0xC3 , " Data buffer pool 1 depletion, no OF allocated " } ,
{ 0xC4 , " Data buffer pool 0 depletion, partial OF allocated " } ,
{ 0xC5 , " Data buffer pool 1 depletion, partial OF allocated " } ,
{ 0xD0 , " FLC read error " } ,
{ 0xD1 , " FL read error " } ,
{ 0xD2 , " FL write error " } ,
{ 0xD3 , " OF SGT write error " } ,
{ 0xD4 , " PTA read error " } ,
{ 0xD5 , " PTA write error " } ,
{ 0xD6 , " OF SGT F-bit write error " } ,
{ 0xD7 , " ASA write error " } ,
{ 0xE1 , " FLC[ICR]=0 ICID error " } ,
{ 0xE2 , " FLC[ICR]=1 ICID error " } ,
{ 0xE4 , " source of ICID flush not trusted (BDI = 0) " } ,
} ;
2014-04-25 01:05:13 +07:00
static const char * const cha_id_list [ ] = {
" " ,
" AES " ,
" DES " ,
" ARC4 " ,
" MDHA " ,
" RNG " ,
" SNOW f8 " ,
" Kasumi f8/9 " ,
" PKHA " ,
" CRCA " ,
" SNOW f9 " ,
" ZUCE " ,
" ZUCA " ,
} ;
static const char * const err_id_list [ ] = {
" No error. " ,
" Mode error. " ,
" Data size error. " ,
" Key size error. " ,
" PKHA A memory size error. " ,
" PKHA B memory size error. " ,
" Data arrived out of sequence error. " ,
" PKHA divide-by-zero error. " ,
" PKHA modulus even error. " ,
" DES key parity error. " ,
" ICV check failed. " ,
" Hardware error. " ,
" Unsupported CCM AAD size. " ,
" Class 1 CHA is not reset " ,
" Invalid CHA combination was selected " ,
" Invalid CHA selected. " ,
} ;
static const char * const rng_err_id_list [ ] = {
" " ,
" " ,
" " ,
" Instantiate " ,
" Not instantiated " ,
" Test instantiate " ,
" Prediction resistance " ,
" Prediction resistance and test request " ,
" Uninstantiate " ,
" Secure key generation " ,
} ;
2019-07-31 20:08:03 +07:00
static int report_ccb_status ( struct device * jrdev , const u32 status ,
const char * error )
2011-03-13 15:54:26 +07:00
{
u8 cha_id = ( status & JRSTA_CCBERR_CHAID_MASK ) > >
JRSTA_CCBERR_CHAID_SHIFT ;
u8 err_id = status & JRSTA_CCBERR_ERRID_MASK ;
2014-04-25 01:05:17 +07:00
u8 idx = ( status & JRSTA_DECOERR_INDEX_MASK ) > >
JRSTA_DECOERR_INDEX_SHIFT ;
2014-04-25 01:05:18 +07:00
char * idx_str ;
const char * cha_str = " unidentified cha_id value 0x " ;
char cha_err_code [ 3 ] = { 0 } ;
const char * err_str = " unidentified err_id value 0x " ;
char err_err_code [ 3 ] = { 0 } ;
2014-04-25 01:05:15 +07:00
2014-04-25 01:05:17 +07:00
if ( status & JRSTA_DECOERR_JUMP )
2014-04-25 01:05:18 +07:00
idx_str = " jump tgt desc idx " ;
2014-04-25 01:05:17 +07:00
else
2014-04-25 01:05:18 +07:00
idx_str = " desc idx " ;
2014-04-25 01:05:17 +07:00
2014-04-25 01:05:18 +07:00
if ( cha_id < ARRAY_SIZE ( cha_id_list ) )
cha_str = cha_id_list [ cha_id ] ;
else
snprintf ( cha_err_code , sizeof ( cha_err_code ) , " %02x " , cha_id ) ;
2011-03-13 15:54:26 +07:00
2012-06-23 07:48:52 +07:00
if ( ( cha_id < < JRSTA_CCBERR_CHAID_SHIFT ) = = JRSTA_CCBERR_CHAID_RNG & &
err_id < ARRAY_SIZE ( rng_err_id_list ) & &
strlen ( rng_err_id_list [ err_id ] ) ) {
/* RNG-only error */
2014-04-25 01:05:18 +07:00
err_str = rng_err_id_list [ err_id ] ;
2016-11-09 15:46:19 +07:00
} else {
2014-04-25 01:05:18 +07:00
err_str = err_id_list [ err_id ] ;
2016-11-09 15:46:19 +07:00
}
2014-04-25 01:05:16 +07:00
2015-01-21 01:43:10 +07:00
/*
* CCB ICV check failures are part of normal operation life ;
* we leave the upper layers to do what they want with them .
*/
2019-07-31 20:08:03 +07:00
if ( err_id = = JRSTA_CCBERR_ERRID_ICVCHK )
return - EBADMSG ;
dev_err_ratelimited ( jrdev , " %08x: %s: %s %d: %s%s: %s%s \n " , status ,
error , idx_str , idx , cha_str , cha_err_code ,
err_str , err_err_code ) ;
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2019-07-31 20:08:03 +07:00
static int report_jump_status ( struct device * jrdev , const u32 status ,
const char * error )
2011-03-13 15:54:26 +07:00
{
2014-04-25 01:05:16 +07:00
dev_err ( jrdev , " %08x: %s: %s() not implemented \n " ,
status , error , __func__ ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2019-07-31 20:08:03 +07:00
static int report_deco_status ( struct device * jrdev , const u32 status ,
const char * error )
2011-03-13 15:54:26 +07:00
{
2014-04-25 01:05:19 +07:00
u8 err_id = status & JRSTA_DECOERR_ERROR_MASK ;
2014-04-25 01:05:17 +07:00
u8 idx = ( status & JRSTA_DECOERR_INDEX_MASK ) > >
JRSTA_DECOERR_INDEX_SHIFT ;
2014-04-25 01:05:19 +07:00
char * idx_str ;
2014-04-25 01:05:21 +07:00
const char * err_str = " unidentified error value 0x " ;
2014-04-25 01:05:19 +07:00
char err_err_code [ 3 ] = { 0 } ;
2011-03-13 15:54:26 +07:00
int i ;
2014-04-25 01:05:17 +07:00
if ( status & JRSTA_DECOERR_JUMP )
2014-04-25 01:05:19 +07:00
idx_str = " jump tgt desc idx " ;
2014-04-25 01:05:17 +07:00
else
2014-04-25 01:05:19 +07:00
idx_str = " desc idx " ;
2011-03-13 15:54:26 +07:00
2011-03-23 20:21:53 +07:00
for ( i = 0 ; i < ARRAY_SIZE ( desc_error_list ) ; i + + )
2014-04-25 01:05:19 +07:00
if ( desc_error_list [ i ] . value = = err_id )
2011-03-13 15:54:26 +07:00
break ;
2014-04-25 01:05:19 +07:00
if ( i ! = ARRAY_SIZE ( desc_error_list ) & & desc_error_list [ i ] . error_text )
err_str = desc_error_list [ i ] . error_text ;
else
snprintf ( err_err_code , sizeof ( err_err_code ) , " %02x " , err_id ) ;
2014-04-25 01:05:16 +07:00
2014-04-25 01:05:19 +07:00
dev_err ( jrdev , " %08x: %s: %s %d: %s%s \n " ,
status , error , idx_str , idx , err_str , err_err_code ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2019-07-31 20:08:03 +07:00
static int report_qi_status ( struct device * qidev , const u32 status ,
const char * error )
2018-09-12 15:59:32 +07:00
{
u8 err_id = status & JRSTA_QIERR_ERROR_MASK ;
const char * err_str = " unidentified error value 0x " ;
char err_err_code [ 3 ] = { 0 } ;
int i ;
for ( i = 0 ; i < ARRAY_SIZE ( qi_error_list ) ; i + + )
if ( qi_error_list [ i ] . value = = err_id )
break ;
if ( i ! = ARRAY_SIZE ( qi_error_list ) & & qi_error_list [ i ] . error_text )
err_str = qi_error_list [ i ] . error_text ;
else
snprintf ( err_err_code , sizeof ( err_err_code ) , " %02x " , err_id ) ;
dev_err ( qidev , " %08x: %s: %s%s \n " ,
status , error , err_str , err_err_code ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2018-09-12 15:59:32 +07:00
}
2019-07-31 20:08:03 +07:00
static int report_jr_status ( struct device * jrdev , const u32 status ,
const char * error )
2011-03-13 15:54:26 +07:00
{
2014-04-25 01:05:16 +07:00
dev_err ( jrdev , " %08x: %s: %s() not implemented \n " ,
status , error , __func__ ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2019-07-31 20:08:03 +07:00
static int report_cond_code_status ( struct device * jrdev , const u32 status ,
const char * error )
2011-03-13 15:54:26 +07:00
{
2014-04-25 01:05:16 +07:00
dev_err ( jrdev , " %08x: %s: %s() not implemented \n " ,
status , error , __func__ ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2019-07-31 20:08:03 +07:00
int caam_strstatus ( struct device * jrdev , u32 status , bool qi_v2 )
2011-03-13 15:54:26 +07:00
{
2013-03-27 06:10:15 +07:00
static const struct stat_src {
2019-07-31 20:08:03 +07:00
int ( * report_ssed ) ( struct device * jrdev , const u32 status ,
const char * error ) ;
2014-04-25 01:05:15 +07:00
const char * error ;
2014-11-05 16:21:24 +07:00
} status_src [ 16 ] = {
2011-03-13 15:54:26 +07:00
{ NULL , " No error " } ,
{ NULL , NULL } ,
{ report_ccb_status , " CCB " } ,
{ report_jump_status , " Jump " } ,
{ report_deco_status , " DECO " } ,
2018-09-12 15:59:32 +07:00
{ report_qi_status , " Queue Manager Interface " } ,
2011-03-13 15:54:26 +07:00
{ report_jr_status , " Job Ring " } ,
{ report_cond_code_status , " Condition Code " } ,
2014-11-05 16:21:24 +07:00
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
{ NULL , NULL } ,
2011-03-13 15:54:26 +07:00
} ;
u32 ssrc = status > > JRSTA_SSRC_SHIFT ;
2014-04-25 01:05:21 +07:00
const char * error = status_src [ ssrc ] . error ;
2011-03-13 15:54:26 +07:00
2014-04-25 01:05:14 +07:00
/*
2014-11-05 16:21:24 +07:00
* If there is an error handling function , call it to report the error .
* Otherwise print the error source name .
2014-04-25 01:05:14 +07:00
*/
2014-11-05 16:21:24 +07:00
if ( status_src [ ssrc ] . report_ssed )
2019-07-31 20:08:03 +07:00
return status_src [ ssrc ] . report_ssed ( jrdev , status , error ) ;
if ( error )
2014-11-05 16:21:24 +07:00
dev_err ( jrdev , " %d: %s \n " , ssrc , error ) ;
else
dev_err ( jrdev , " %d: unknown error source \n " , ssrc ) ;
2019-07-31 20:08:03 +07:00
return - EINVAL ;
2011-03-13 15:54:26 +07:00
}
2018-09-12 15:59:32 +07:00
EXPORT_SYMBOL ( caam_strstatus ) ;
crypto: caam/qi2 - add DPAA2-CAAM driver
Add CAAM driver that works using the DPSECI backend, i.e. manages
DPSECI DPAA2 objects sitting on the Management Complex (MC) fsl-mc bus.
Data transfers (crypto requests) are sent/received to/from CAAM crypto
engine via Queue Interface (v2), this being similar to existing caam/qi.
OTOH, configuration/setup (obtaining virtual queue IDs, authorization
etc.) is done by sending commands to the MC f/w.
Note that the CAAM accelerator included in DPAA2 platforms still has
Job Rings. However, the driver being added does not handle access
via this backend. Kconfig & Makefile are updated such that DPAA2-CAAM
(a.k.a. "caam/qi2") driver does not depend on caam/jr or caam/qi
backends - which rely on platform bus support (ctrl.c).
Support for the following aead and authenc algorithms is also added
in this patch:
-aead:
gcm(aes)
rfc4106(gcm(aes))
rfc4543(gcm(aes))
-authenc:
authenc(hmac({md5,sha*}),cbc({aes,des,des3_ede}))
echainiv(authenc(hmac({md5,sha*}),cbc({aes,des,des3_ede})))
authenc(hmac({md5,sha*}),rfc3686(ctr(aes))
seqiv(authenc(hmac({md5,sha*}),rfc3686(ctr(aes)))
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-09-12 15:59:33 +07:00
MODULE_LICENSE ( " GPL " ) ;
MODULE_DESCRIPTION ( " FSL CAAM error reporting " ) ;
MODULE_AUTHOR ( " Freescale Semiconductor " ) ;