summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2017-05-27 18:12:01 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:42 (GMT)
commit929c3fac19eff7d30873437b249265cce0d7fc77 (patch)
tree68ac164385187ec464120e081721589c3d8750d6
parentc42174f5a55f85e8be7ce128bb1f1798d050660d (diff)
downloadlinux-929c3fac19eff7d30873437b249265cce0d7fc77.tar.xz
crypto: caam/qi2 - add dpseci capabilities support
Starting with MC firmware 10.2.0 (*), support has been added to obtain the properties of dpseci objects, such as Congestion Group or Order Preservation. (*) DPSECI object (API) version has not bumped, it's still v5.1; this makes it harder to offer backwards compatibility. Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
-rw-r--r--drivers/crypto/caam/dpseci.c1
-rw-r--r--drivers/crypto/caam/dpseci.h11
-rw-r--r--drivers/crypto/caam/dpseci_cmd.h4
3 files changed, 15 insertions, 1 deletions
diff --git a/drivers/crypto/caam/dpseci.c b/drivers/crypto/caam/dpseci.c
index e4ad127..e76b267 100644
--- a/drivers/crypto/caam/dpseci.c
+++ b/drivers/crypto/caam/dpseci.c
@@ -477,6 +477,7 @@ int dpseci_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
attr->id = le32_to_cpu(rsp_params->id);
attr->num_tx_queues = rsp_params->num_tx_queues;
attr->num_rx_queues = rsp_params->num_rx_queues;
+ attr->options = le32_to_cpu(rsp_params->options);
return 0;
}
diff --git a/drivers/crypto/caam/dpseci.h b/drivers/crypto/caam/dpseci.h
index b2ba526..d37489c 100644
--- a/drivers/crypto/caam/dpseci.h
+++ b/drivers/crypto/caam/dpseci.h
@@ -63,6 +63,11 @@ int dpseci_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpseci_id,
int dpseci_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
/**
+ * Enable the Congestion Group support
+ */
+#define DPSECI_OPT_HAS_CG 0x000020
+
+/**
* Enable the Order Restoration support
*/
#define DPSECI_OPT_HAS_OPR 0x000040
@@ -75,6 +80,7 @@ int dpseci_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
/**
* struct dpseci_cfg - Structure representing DPSECI configuration
* @options: Any combination of the following options:
+ * DPSECI_OPT_HAS_CG
* DPSECI_OPT_HAS_OPR
* DPSECI_OPT_OPR_SHARED
* @num_tx_queues: num of queues towards the SEC
@@ -129,11 +135,16 @@ int dpseci_clear_irq_status(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
* @id: DPSECI object ID
* @num_tx_queues: number of queues towards the SEC
* @num_rx_queues: number of queues back from the SEC
+ * @options: any combination of the following options:
+ * DPSECI_OPT_HAS_CG
+ * DPSECI_OPT_HAS_OPR
+ * DPSECI_OPT_OPR_SHARED
*/
struct dpseci_attr {
int id;
u8 num_tx_queues;
u8 num_rx_queues;
+ u32 options;
};
int dpseci_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
diff --git a/drivers/crypto/caam/dpseci_cmd.h b/drivers/crypto/caam/dpseci_cmd.h
index 502c47e..7624315 100644
--- a/drivers/crypto/caam/dpseci_cmd.h
+++ b/drivers/crypto/caam/dpseci_cmd.h
@@ -127,9 +127,11 @@ struct dpseci_cmd_irq_status {
struct dpseci_rsp_get_attributes {
__le32 id;
- __le32 pad;
+ __le32 pad0;
u8 num_tx_queues;
u8 num_rx_queues;
+ u8 pad1[6];
+ __le32 options;
};
struct dpseci_cmd_queue {