Marco Chiappero
5106dfeaea
crypto: qat - add AES-XTS support for QAT GEN4 devices
...
Add handling of AES-XTS specific to QAT GEN4 devices.
Co-developed-by: Tomaszx Kowalik <tomaszx.kowalik@intel.com >
Signed-off-by: Tomaszx Kowalik <tomaszx.kowalik@intel.com >
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-12-11 21:54:15 +11:00
Marco Chiappero
67916c9516
crypto: qat - add AES-CTR support for QAT GEN4 devices
...
Add support for AES-CTR for QAT GEN4 devices.
Also, introduce the capability ICP_ACCEL_CAPABILITIES_AES_V2 and the
helper macro HW_CAP_AES_V2, which allow to distinguish between
different HW generations.
Co-developed-by: Tomasz Kowalik <tomaszx.kowalik@intel.com >
Signed-off-by: Tomasz Kowalik <tomaszx.kowalik@intel.com >
Co-developed-by: Mateusz Polrola <mateuszx.potrola@intel.com >
Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com >
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-12-11 21:54:15 +11:00
kernel test robot
da6d57948f
crypto: qat - fix excluded_middle.cocci warnings
...
Condition !A || A && B is equivalent to !A || B.
Generated by: scripts/coccinelle/misc/excluded_middle.cocci
Fixes: b76f0ea013 ("coccinelle: misc: add excluded_middle.cocci script")
CC: Denis Efremov <efremov@linux.com >
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: kernel test robot <lkp@intel.com >
Signed-off-by: Julia Lawall <julia.lawall@inria.fr >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-27 17:13:41 +11:00
Giovanni Cabiddu
8c8268166e
crypto: qat - add qat_4xxx driver
...
Add support for QAT 4xxx devices.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-20 14:45:34 +11:00
Giovanni Cabiddu
6644f49e7b
crypto: qat - add hook to initialize vector routing table
...
Add an hook to initialize the vector routing table with the default
values before MSIx is enabled.
The new function set_msix_rttable() is called only if present in the
struct adf_hw_device_data of the device. This is to allow for QAT
devices that do not support that functionality.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-20 14:45:34 +11:00
Giovanni Cabiddu
e73916f208
crypto: qat - target fw images to specific AEs
...
Introduce support for devices that require multiple firmware images.
If a device requires more than a firmware image to operate, load the
image to the appropriate Acceleration Engine (AE).
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-20 14:45:34 +11:00
Eric Biggers
a24d22b225
crypto: sha - split sha.h into sha1.h and sha2.h
...
Currently <crypto/sha.h> contains declarations for both SHA-1 and SHA-2,
and <crypto/sha3.h> contains declarations for SHA-3.
This organization is inconsistent, but more importantly SHA-1 is no
longer considered to be cryptographically secure. So to the extent
possible, SHA-1 shouldn't be grouped together with any of the other SHA
versions, and usage of it should be phased out.
Therefore, split <crypto/sha.h> into two headers <crypto/sha1.h> and
<crypto/sha2.h>, and make everyone explicitly specify whether they want
the declarations for SHA-1, SHA-2, or both.
This avoids making the SHA-1 declarations visible to files that don't
want anything to do with SHA-1. It also prepares for potentially moving
sha1.h into a new insecure/ or dangerous/ directory.
Signed-off-by: Eric Biggers <ebiggers@google.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Acked-by: Jason A. Donenfeld <Jason@zx2c4.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-20 14:45:33 +11:00
Jack Xu
9c0cef2364
crypto: qat - add gen4 firmware loader
...
Add support for the QAT gen4 devices in the firmware loader.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:55 +11:00
Jack Xu
2778d64cf3
crypto: qat - add support for broadcasting mode
...
Add support for broadcasting mode in firmware loader to enable the next
generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:55 +11:00
Jack Xu
bd684d83c7
crypto: qat - add support for shared ustore
...
Add support for shared ustore mode support. This is required by the next
generation of QAT devices to share the same fw image across engines.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:54 +11:00
Jack Xu
244f572ceb
crypto: qat - allow to target specific AEs
...
Introduce new API, qat_uclo_set_cfg_ae_mask(), to allow the load of the
firmware image to a subset of Acceleration Engines (AEs). This is
required by the next generation of QAT devices to be able to load
different firmware images to the device.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:54 +11:00
Jack Xu
d707d3f23e
crypto: qat - add FCU CSRs to chip info
...
Add firmware control unit (FCU) CSRs to chip info so the firmware
authentication code is common between all devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:54 +11:00
Jack Xu
9e0f74b717
crypto: qat - add CSS3K support
...
Add support for CSS3K, which uses RSA3K as image signature algorithm,
to support the next generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:54 +11:00
Jack Xu
bf8313c71c
crypto: qat - use ae_mask
...
Use ae_mask to decide which Accelerator Engine (AE) to target in AE
related operations, instead of a sequential loop, to skip AEs that are
fused out.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:53 +11:00
Jack Xu
912eebeb72
crypto: qat - add check for null pointer
...
Add null pointer check when freeing the memory for firmware.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:53 +11:00
Jack Xu
4f1e941560
crypto: qat - add misc control CSR to chip info
...
Add misc control CSR to chip info since the CSR offset will be different
in the next generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:53 +11:00
Jack Xu
c4909d327c
crypto: qat - add wake up event to chip info
...
Add the wake up event to chip info since this value will be different
in the next generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:53 +11:00
Jack Xu
767358119f
crypto: qat - add clock enable CSR to chip info
...
Add global clock enable CSR to the chip info since the CSR offset
will be different in the next generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:52 +11:00
Jack Xu
cb439361a3
crypto: qat - add reset CSR and mask to chip info
...
Add reset CSR offset and mask to chip info since they are different
in new QAT devices. This also simplifies the reset/clrReset functions
by using the reset mask.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:52 +11:00
Jack Xu
4f07195d63
crypto: qat - add local memory size to chip info
...
Add the local memory size to the chip info since the size of this memory
will be different in the next generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:52 +11:00
Jack Xu
8b487ae26a
crypto: qat - add support for lm2 and lm3
...
Add support for local memory lm2 and lm3 which is introduced in the next
generation of QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:52 +11:00
Jack Xu
d25cf2c7a0
crypto: qat - add next neighbor to chip_info
...
Introduce the next neighbor (NN) capability in chip_info as NN registers
are not supported in certain SKUs of QAT.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:52 +11:00
Jack Xu
49c1327328
crypto: qat - replace check based on DID
...
Modify condition in qat_uclo_wr_mimage() to use a capability of the
device (sram_visible), rather than the device ID, so the check is not
specific to devices of the same type.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:51 +11:00
Jack Xu
fc5f3f86e5
crypto: qat - introduce chip info structure
...
Introduce the chip info structure which contains device specific
information. The initialization path has been split between common and
hardware specific in order to facilitate the introduction of the next
generation hardware.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:51 +11:00
Jack Xu
58c173b9cb
crypto: qat - refactor long expressions
...
Replace long expressions with local variables in the functions
qat_uclo_wr_uimage_page(), qat_uclo_init_globals() and
qat_uclo_init_umem_seg() to improve readability.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:51 +11:00
Jack Xu
ecb917ad0f
crypto: qat - refactor qat_uclo_set_ae_mode()
...
Refactor qat_uclo_set_ae_mode() by moving the logic that sets the AE
modes to a separate function, qat_hal_set_modes().
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:51 +11:00
Jack Xu
97b9840195
crypto: qat - move defines to header files
...
Move the definition of ICP_QAT_AE_OFFSET, ICP_QAT_CAP_OFFSET,
LOCAL_TO_XFER_REG_OFFSET and ICP_QAT_EP_OFFSET from qat_hal.c to
icp_qat_hal.h to avoid the definition of generation specific constants
in qat_hal.c.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:50 +11:00
Jack Xu
8f87b6271e
crypto: qat - remove global CSRs helpers
...
Include the offset of GLOBAL_CSR directly into the enum hal_global_csr
and remove the macros SET_GLB_CSR/GET_GLB_CSR to simplify the global CSR
access.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:50 +11:00
Jack Xu
10fb050cae
crypto: qat - refactor AE start
...
Change the API and the behaviour of the qat_hal_start() function.
With this change, the function starts under the hood all acceleration
engines (AEs) and there is no longer need to call it for each engine.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:50 +11:00
Jack Xu
82b3230658
crypto: qat - change micro word data mask
...
Change micro word data mask since the Acceleration Engine (AE)
instruction codes have been changed in the new generation QAT devices.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:50 +11:00
Jack Xu
fe278bf35c
crypto: qat - change type for ctx_mask
...
Change type for ctx_mask from unsigned char to unsigned long to avoid
type casting.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:50 +11:00
Jack Xu
72b67d9507
crypto: qat - add support for relative FW ucode loading
...
Improve the way micro instructions (FW code) are uploaded to Accelerator
Engines (AEs). If code starts at PC zero (absolute addressing), read
uwords with no relative address. Otherwise, use relative addressing to
the page region.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:49 +11:00
Jack Xu
ee103cf1f5
crypto: qat - rename qat_uclo_del_uof_obj()
...
Rename the function qat_uclo_del_uof_obj() in qat_uclo_del_obj() since
it frees the memory allocated for all firmware objects.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:49 +11:00
Jack Xu
54fa5d4bf7
crypto: qat - introduce additional parenthesis
...
Introduce additional parenthesis to resolve a warninga reported by
checkpatch.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:49 +11:00
Jack Xu
8ec0bee5d4
crypto: qat - remove unnecessary parenthesis
...
Remove unnecessary parenthesis across the firmware loader.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:48 +11:00
Jack Xu
ed8fc0c1b9
crypto: qat - fix error message
...
Change message in error path of qat_uclo_check_image_compat() to report
an incompatible firmware image that contains a neighbor register table.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Co-developed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:47 +11:00
Jack Xu
49a6cccec4
crypto: qat - fix CSR access
...
Do not mask the AE number with the AE mask when accessing the AE local
CSRs. Bit 12 of the local CSR address is the start of AE number so just
take out the AE mask here.
Signed-off-by: Jack Xu <jack.xu@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:46 +11:00
Jack Xu
3b5c130fb2
crypto: qat - fix status check in qat_hal_put_rel_rd_xfer()
...
The return value of qat_hal_rd_ae_csr() is always a CSR value and never
a status and should not be stored in the status variable of
qat_hal_put_rel_rd_xfer().
This removes the assignment as qat_hal_rd_ae_csr() is not expected to
fail.
A more comprehensive handling of the theoretical corner case which could
result in a fail will be submitted in a separate patch.
Fixes: 8c9478a400 ("crypto: qat - reduce stack size with KASAN")
Signed-off-by: Jack Xu <jack.xu@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:46 +11:00
Giovanni Cabiddu
f21406b051
crypto: qat - support for mof format in fw loader
...
Implement infrastructure for the Multiple Object File (MOF) format
in the firmware loader. This will allow to load a specific firmware
image contained inside an MOF file.
This patch is based on earlier work done by Pingchao Yang.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Jack Xu <jack.xu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:45 +11:00
Adam Guerin
802c6c3ef3
crypto: qat - replace pci with PCI in comments
...
Change all lower case pci in comments to be upper case PCI.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Adam Guerin <adam.guerin@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:44 +11:00
Adam Guerin
ec3c5b32fc
crypto: qat - remove cast for mailbox CSR
...
Remove cast for mailbox CSR in adf_admin.c as it is not needed.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Adam Guerin <adam.guerin@intel.com >
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-13 20:38:43 +11:00
Tom Rix
cc9a99fb89
crypto: qat - remove unneeded semicolon
...
A semicolon is not needed after a switch statement.
Signed-off-by: Tom Rix <trix@redhat.com >
Signed-off-by: Tom Rix <trix@redhat.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-11-06 14:31:15 +11:00
Giovanni Cabiddu
3f9ae99835
crypto: qat - extend ae_mask
...
Change type of ae_mask in adf_hw_device_data to allow for devices with
more than 16 Acceleration Engines (AEs).
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:35:01 +11:00
Giovanni Cabiddu
657ad678e0
crypto: qat - allow for instances in different banks
...
Allow for crypto instances to be configured with symmetric crypto rings
that belong to a bank that is different from the one where asymmetric
crypto rings are located.
This is to allow for devices with banks made of a single ring pair.
In these, crypto instances will be composed of two separate banks.
Changed string literals are not exposed to the user space.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:35:01 +11:00
Giovanni Cabiddu
54e3d7538f
crypto: qat - refactor qat_crypto_dev_config()
...
Refactor function qat_crypto_dev_config() to propagate errors to
the caller.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:35:00 +11:00
Giovanni Cabiddu
533179ce37
crypto: qat - refactor qat_crypto_create_instances()
...
Refactor function qat_crypto_create_instances() to propagate errors to
the caller.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:35:00 +11:00
Giovanni Cabiddu
48710b1f31
crypto: qat - change return value in adf_cfg_key_val_get()
...
If a key is not found in the internal key value storage, return -ENODATA
instead of -1 that is treated as -EPERM and may confuse.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:34:59 +11:00
Giovanni Cabiddu
69d0fc22cf
crypto: qat - change return value in adf_cfg_add_key_value_param()
...
If the parameter type provided to adf_cfg_add_key_value_param()
is invalid, return -EINVAL instead of -1 that is treated as -EPERM and
may confuse.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:34:58 +11:00
Giovanni Cabiddu
83ab8c4b2d
crypto: qat - remove unnecessary void* casts
...
Remove superfluous casts to void* in function qat_crypto_dev_config().
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:34:58 +11:00
Giovanni Cabiddu
185aa9c354
crypto: qat - call functions in adf_sriov if available
...
Call the function configure_iov_threads(), adf_enable_vf2pf_interrupts()
and adf_pf2vf_notify_restarting() only if present in the struct
adf_hw_device_data of the device.
This is to allow for QAT drivers that do not implement those functions.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com >
Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com >
Reviewed-by: Maksim Lukoshkov <maksim.lukoshkov@intel.com >
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-10-30 17:34:57 +11:00