summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMaya Erez <merez@codeaurora.org>2014-10-27 21:57:45 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 10:57:43 -0700
commit89dc95d277c5a499d3f74b9c4dd4baf1b6310b3f (patch)
treed48cab227f41fceef12df905d2349ce4892f285b /include/linux
parent1eabea8b95a17de147a8713ba00facce52cc89af (diff)
scsi: ufs: add Inline Crypto Engine (ICE) support to UFS
In-order to enhance storage encryption performance, an Inline Cryptographic Engine is introduced to UFS. This patch adds in-line encryption capabilities to the UFS driver. Change-Id: Id3cb913498809b32e1f7eba96395b05a9bf3219f Signed-off-by: Noa Rubens <noag@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/scsi/ufs/ufs-qcom.h28
-rw-r--r--include/linux/scsi/ufs/ufshcd.h16
2 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/scsi/ufs/ufs-qcom.h b/include/linux/scsi/ufs/ufs-qcom.h
index e3c7342a4772..d48ca998cc2c 100644
--- a/include/linux/scsi/ufs/ufs-qcom.h
+++ b/include/linux/scsi/ufs/ufs-qcom.h
@@ -137,6 +137,33 @@ struct ufs_qcom_bus_vote {
struct device_attribute max_bus_bw;
};
+/**
+ * struct ufs_qcom_ice_data - ICE related information
+ * @vops: pointer to variant operations of ICE
+ * @async_done: completion for supporting ICE's driver asynchronous nature
+ * @pdev: pointer to the proper ICE platform device
+ * @state: UFS-ICE interface's internal state (see
+ * ufs-qcom-ice.h for possible internal states)
+ * @quirks: UFS-ICE interface related quirks
+ * @crypto_engine_err: crypto engine errors
+ */
+struct ufs_qcom_ice_data {
+ struct qcom_ice_variant_ops *vops;
+ struct completion async_done;
+ struct platform_device *pdev;
+ int state;
+
+ /*
+ * If UFS host controller should handle cryptographic engine's
+ * errors, enables this quirk.
+ */
+ #define UFS_QCOM_ICE_QUIRK_HANDLE_CRYPTO_ENGINE_ERRORS UFS_BIT(0)
+
+ u16 quirks;
+
+ bool crypto_engine_err;
+};
+
struct ufs_qcom_host {
struct phy *generic_phy;
struct ufs_hba *hba;
@@ -148,6 +175,7 @@ struct ufs_qcom_host {
struct clk *tx_l1_sync_clk;
bool is_lane_clks_enabled;
bool sec_cfg_updated;
+ struct ufs_qcom_ice_data ice;
};
#define ufs_qcom_is_link_off(hba) ufshcd_is_link_off(hba)
diff --git a/include/linux/scsi/ufs/ufshcd.h b/include/linux/scsi/ufs/ufshcd.h
index 90b2417f87fb..d6c130e38e43 100644
--- a/include/linux/scsi/ufs/ufshcd.h
+++ b/include/linux/scsi/ufs/ufshcd.h
@@ -283,6 +283,16 @@ struct ufs_pwr_mode_info {
* @resume: called during host controller PM callback
* @update_sec_cfg: called to restore host controller secure configuration
* @dbg_register_dump: used to dump controller debug information
+ * @crypto_engine_cfg: configure cryptographic engine according to tag parameter
+ * @crypto_engine_eh: cryptographic engine error handling.
+ * Return true is it detects an error, false on
+ * success
+ * @crypto_engine_get_err: returns the saved error status of the
+ * cryptographic engine.If a positive
+ * value is returned, host controller
+ * should be reset.
+ * @crypto_engine_reset_err: resets the saved error status of
+ * the cryptographic engine
*/
struct ufs_hba_variant_ops {
const char *name;
@@ -305,6 +315,10 @@ struct ufs_hba_variant_ops {
int (*resume)(struct ufs_hba *, enum ufs_pm_op);
int (*update_sec_cfg)(struct ufs_hba *hba, bool restore_sec_cfg);
void (*dbg_register_dump)(struct ufs_hba *hba);
+ int (*crypto_engine_cfg)(struct ufs_hba *, unsigned int);
+ int (*crypto_engine_eh)(struct ufs_hba *);
+ int (*crypto_engine_get_err)(struct ufs_hba *);
+ void (*crypto_engine_reset_err)(struct ufs_hba *);
};
/* clock gating state */
@@ -833,6 +847,8 @@ void ufshcd_release(struct ufs_hba *hba);
int ufshcd_wait_for_doorbell_clr(struct ufs_hba *hba, u64 wait_timeout_us);
int ufshcd_change_power_mode(struct ufs_hba *hba,
struct ufs_pa_layer_attr *pwr_mode);
+void ufshcd_abort_outstanding_transfer_requests(struct ufs_hba *hba,
+ int result);
/* Wrapper functions for safely calling variant operations */
static inline const char *ufshcd_get_var_name(struct ufs_hba *hba)