crypto: qat - relocate PFVF VF related logic
authorMarco Chiappero <marco.chiappero@intel.com>
Wed, 17 Nov 2021 14:30:45 +0000 (14:30 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Nov 2021 05:20:46 +0000 (16:20 +1100)
Move device specific PFVF logic related to the VF to the newly created
adf_gen2_pfvf.c.
This refactory is done to isolate the GEN2 PFVF code into its own file
in preparation for the introduction of support for PFVF for GEN4
devices.

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>
drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c
drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.h
drivers/crypto/qat/qat_c62x/adf_c62x_hw_data.c
drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.h
drivers/crypto/qat/qat_common/adf_gen2_pfvf.c
drivers/crypto/qat/qat_common/adf_gen2_pfvf.h
drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c
drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.h

index 0bc528004f79d9c0c77af0c312d2b1050be1c446..aaf8e65887b884af5e2ea9e182b79e3c685605f5 100644 (file)
@@ -136,7 +136,7 @@ void adf_init_hw_data_c3xxx(struct adf_hw_device_data *hw_data)
        hw_data->enable_ints = adf_enable_ints;
        hw_data->reset_device = adf_reset_flr;
        hw_data->set_ssm_wdtimer = adf_gen2_set_ssm_wdtimer;
-       hw_data->get_pf2vf_offset = adf_gen2_get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_pf_get_pf2vf_offset;
        hw_data->get_vf2pf_sources = adf_gen2_get_vf2pf_sources;
        hw_data->enable_vf2pf_interrupts = adf_gen2_enable_vf2pf_interrupts;
        hw_data->disable_vf2pf_interrupts = adf_gen2_disable_vf2pf_interrupts;
index 3e69b520e82fa20bf972f187c4e6a596e4dd1045..ee61f69a8077e0164c1f327553b8bb3bc959c214 100644 (file)
@@ -4,6 +4,7 @@
 #include <adf_pf2vf_msg.h>
 #include <adf_common_drv.h>
 #include <adf_gen2_hw_data.h>
+#include <adf_gen2_pfvf.h>
 #include "adf_c3xxxvf_hw_data.h"
 
 static struct adf_hw_device_class c3xxxiov_class = {
@@ -47,11 +48,6 @@ static enum dev_sku_info get_sku(struct adf_hw_device_data *self)
        return DEV_SKU_VF;
 }
 
-static u32 get_pf2vf_offset(u32 i)
-{
-       return ADF_C3XXXIOV_PF2VF_OFFSET;
-}
-
 static int adf_vf_int_noop(struct adf_accel_dev *accel_dev)
 {
        return 0;
@@ -86,7 +82,7 @@ void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data)
        hw_data->get_num_aes = get_num_aes;
        hw_data->get_etr_bar_id = get_etr_bar_id;
        hw_data->get_misc_bar_id = get_misc_bar_id;
-       hw_data->get_pf2vf_offset = get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_vf_get_pf2vf_offset;
        hw_data->get_sku = get_sku;
        hw_data->enable_ints = adf_vf_void_noop;
        hw_data->enable_pfvf_comms = adf_enable_vf2pf_comms;
index f5de4ce66014871ab52cffb145dc2ef3d76bdcaf..6b4bf181d15bd4d798cfacc609670267ab86a1e7 100644 (file)
@@ -12,7 +12,6 @@
 #define ADF_C3XXXIOV_TX_RINGS_MASK 0xFF
 #define ADF_C3XXXIOV_ETR_BAR 0
 #define ADF_C3XXXIOV_ETR_MAX_BANKS 1
-#define ADF_C3XXXIOV_PF2VF_OFFSET      0x200
 
 void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data);
 void adf_clean_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data);
index 9303f2dbcaf9eb89ac400ad287cb329621c7264a..0d694c713797563bef707167af12c5be1b73ef48 100644 (file)
@@ -138,7 +138,7 @@ void adf_init_hw_data_c62x(struct adf_hw_device_data *hw_data)
        hw_data->enable_ints = adf_enable_ints;
        hw_data->reset_device = adf_reset_flr;
        hw_data->set_ssm_wdtimer = adf_gen2_set_ssm_wdtimer;
-       hw_data->get_pf2vf_offset = adf_gen2_get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_pf_get_pf2vf_offset;
        hw_data->get_vf2pf_sources = adf_gen2_get_vf2pf_sources;
        hw_data->enable_vf2pf_interrupts = adf_gen2_enable_vf2pf_interrupts;
        hw_data->disable_vf2pf_interrupts = adf_gen2_disable_vf2pf_interrupts;
index 3bee3e4673636f1911e88307f817ebb1d73e141a..407f3beee43c01762752c65ed5f31b4dd58f493e 100644 (file)
@@ -4,6 +4,7 @@
 #include <adf_pf2vf_msg.h>
 #include <adf_common_drv.h>
 #include <adf_gen2_hw_data.h>
+#include <adf_gen2_pfvf.h>
 #include "adf_c62xvf_hw_data.h"
 
 static struct adf_hw_device_class c62xiov_class = {
@@ -47,11 +48,6 @@ static enum dev_sku_info get_sku(struct adf_hw_device_data *self)
        return DEV_SKU_VF;
 }
 
-static u32 get_pf2vf_offset(u32 i)
-{
-       return ADF_C62XIOV_PF2VF_OFFSET;
-}
-
 static int adf_vf_int_noop(struct adf_accel_dev *accel_dev)
 {
        return 0;
@@ -86,7 +82,7 @@ void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data)
        hw_data->get_num_aes = get_num_aes;
        hw_data->get_etr_bar_id = get_etr_bar_id;
        hw_data->get_misc_bar_id = get_misc_bar_id;
-       hw_data->get_pf2vf_offset = get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_vf_get_pf2vf_offset;
        hw_data->get_sku = get_sku;
        hw_data->enable_ints = adf_vf_void_noop;
        hw_data->enable_pfvf_comms = adf_enable_vf2pf_comms;
index 794778c486782f2084e985ee0880262360c0c2ee..a1a62c003ebf1a3bbe1a131acf83580cd6e5ac75 100644 (file)
@@ -12,7 +12,6 @@
 #define ADF_C62XIOV_TX_RINGS_MASK 0xFF
 #define ADF_C62XIOV_ETR_BAR 0
 #define ADF_C62XIOV_ETR_MAX_BANKS 1
-#define ADF_C62XIOV_PF2VF_OFFSET       0x200
 
 void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data);
 void adf_clean_hw_data_c62xiov(struct adf_hw_device_data *hw_data);
index d4d79419daaa4d918b3a507bd9f90d114d5cf0ed..ea8d34922374bdb3cc58219529ea2d878edfb56b 100644 (file)
@@ -8,13 +8,20 @@
 #define ADF_GEN2_ERR_REG_VF2PF(vf_src) (((vf_src) & 0x01FFFE00) >> 9)
 #define ADF_GEN2_ERR_MSK_VF2PF(vf_mask)        (((vf_mask) & 0xFFFF) << 9)
 
-#define ADF_GEN2_PF2VF_OFFSET(i)       (0x3A000 + 0x280 + ((i) * 0x04))
+#define ADF_GEN2_PF_PF2VF_OFFSET(i)    (0x3A000 + 0x280 + ((i) * 0x04))
+#define ADF_GEN2_VF_PF2VF_OFFSET       0x200
 
-u32 adf_gen2_get_pf2vf_offset(u32 i)
+u32 adf_gen2_pf_get_pf2vf_offset(u32 i)
 {
-       return ADF_GEN2_PF2VF_OFFSET(i);
+       return ADF_GEN2_PF_PF2VF_OFFSET(i);
 }
-EXPORT_SYMBOL_GPL(adf_gen2_get_pf2vf_offset);
+EXPORT_SYMBOL_GPL(adf_gen2_pf_get_pf2vf_offset);
+
+u32 adf_gen2_vf_get_pf2vf_offset(u32 i)
+{
+       return ADF_GEN2_VF_PF2VF_OFFSET;
+}
+EXPORT_SYMBOL_GPL(adf_gen2_vf_get_pf2vf_offset);
 
 u32 adf_gen2_get_vf2pf_sources(void __iomem *pmisc_addr)
 {
index 0987e254e86b3941978641b2a24ec628ce0a7187..a21787e3e5508374a5dc7e9dd87fe0aeffe8f6b3 100644 (file)
@@ -11,7 +11,8 @@
 #define ADF_GEN2_ERRMSK3 (0x3A000 + 0x1C)
 #define ADF_GEN2_ERRMSK5 (0x3A000 + 0xDC)
 
-u32 adf_gen2_get_pf2vf_offset(u32 i);
+u32 adf_gen2_pf_get_pf2vf_offset(u32 i);
+u32 adf_gen2_vf_get_pf2vf_offset(u32 i);
 u32 adf_gen2_get_vf2pf_sources(void __iomem *pmisc_bar);
 void adf_gen2_enable_vf2pf_interrupts(void __iomem *pmisc_addr, u32 vf_mask);
 void adf_gen2_disable_vf2pf_interrupts(void __iomem *pmisc_addr, u32 vf_mask);
index e134385b76a8c39e6190d79e59e1c1778b32b9a2..5fc2e5a7f10b62dc6bfdd50776badd674163999b 100644 (file)
@@ -215,7 +215,7 @@ void adf_init_hw_data_dh895xcc(struct adf_hw_device_data *hw_data)
        hw_data->get_arb_mapping = adf_get_arbiter_mapping;
        hw_data->enable_ints = adf_enable_ints;
        hw_data->reset_device = adf_reset_sbr;
-       hw_data->get_pf2vf_offset = adf_gen2_get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_pf_get_pf2vf_offset;
        hw_data->get_vf2pf_sources = get_vf2pf_sources;
        hw_data->enable_vf2pf_interrupts = enable_vf2pf_interrupts;
        hw_data->disable_vf2pf_interrupts = disable_vf2pf_interrupts;
index 7c6ed6bc8abf2fbbdffa83fe387f1db033b04621..30d862226026e060a29c3422f710e4a0ef60aa4d 100644 (file)
@@ -4,6 +4,7 @@
 #include <adf_pf2vf_msg.h>
 #include <adf_common_drv.h>
 #include <adf_gen2_hw_data.h>
+#include <adf_gen2_pfvf.h>
 #include "adf_dh895xccvf_hw_data.h"
 
 static struct adf_hw_device_class dh895xcciov_class = {
@@ -47,11 +48,6 @@ static enum dev_sku_info get_sku(struct adf_hw_device_data *self)
        return DEV_SKU_VF;
 }
 
-static u32 get_pf2vf_offset(u32 i)
-{
-       return ADF_DH895XCCIOV_PF2VF_OFFSET;
-}
-
 static int adf_vf_int_noop(struct adf_accel_dev *accel_dev)
 {
        return 0;
@@ -86,7 +82,7 @@ void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data)
        hw_data->get_num_aes = get_num_aes;
        hw_data->get_etr_bar_id = get_etr_bar_id;
        hw_data->get_misc_bar_id = get_misc_bar_id;
-       hw_data->get_pf2vf_offset = get_pf2vf_offset;
+       hw_data->get_pf2vf_offset = adf_gen2_vf_get_pf2vf_offset;
        hw_data->get_sku = get_sku;
        hw_data->enable_ints = adf_vf_void_noop;
        hw_data->enable_pfvf_comms = adf_enable_vf2pf_comms;
index 306ebb71a408bd9330185acdba9d6facf54136fa..6973fa967bc8ee7a8bfa0867c6b749ca3c833861 100644 (file)
@@ -12,7 +12,6 @@
 #define ADF_DH895XCCIOV_TX_RINGS_MASK 0xFF
 #define ADF_DH895XCCIOV_ETR_BAR 0
 #define ADF_DH895XCCIOV_ETR_MAX_BANKS 1
-#define ADF_DH895XCCIOV_PF2VF_OFFSET   0x200
 
 void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data);
 void adf_clean_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data);