summaryrefslogtreecommitdiff
path: root/drivers/crypto/qat/qat_c3xxx/adf_drv.c
diff options
context:
space:
mode:
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>2020-10-12 23:38:18 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-10-30 09:34:46 +0300
commit7b07ed5042c5d21467af5aa055f2b49b2e661a83 (patch)
tree1c29f5298fa8fc30e3023b87b04a82324b50a6dc /drivers/crypto/qat/qat_c3xxx/adf_drv.c
parente4e37acc3bb0ce6152077e24cf9faad71f3c10b6 (diff)
downloadlinux-7b07ed5042c5d21467af5aa055f2b49b2e661a83.tar.xz
crypto: qat - mask device capabilities with soft straps
Enable acceleration engines (AEs) and accelerators based on soft straps and fuses. When looping with a number of AEs or accelerators, ignore the ones that are disabled. This patch is based on earlier work done by Conor McLoughlin. Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Fiona Trahe <fiona.trahe@intel.com> Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_c3xxx/adf_drv.c')
-rw-r--r--drivers/crypto/qat/qat_c3xxx/adf_drv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
index ed0e8e33fe4b..da6e88026988 100644
--- a/drivers/crypto/qat/qat_c3xxx/adf_drv.c
+++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
@@ -126,10 +126,12 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid);
pci_read_config_dword(pdev, ADF_DEVICE_FUSECTL_OFFSET,
&hw_data->fuses);
+ pci_read_config_dword(pdev, ADF_C3XXX_SOFTSTRAP_CSR_OFFSET,
+ &hw_data->straps);
/* Get Accelerators and Accelerators Engines masks */
- hw_data->accel_mask = hw_data->get_accel_mask(hw_data->fuses);
- hw_data->ae_mask = hw_data->get_ae_mask(hw_data->fuses);
+ hw_data->accel_mask = hw_data->get_accel_mask(hw_data);
+ hw_data->ae_mask = hw_data->get_ae_mask(hw_data);
accel_pci_dev->sku = hw_data->get_sku(hw_data);
/* If the device has no acceleration engines then ignore it. */
if (!hw_data->accel_mask || !hw_data->ae_mask ||