• Home
  • Raw
  • Download

Lines Matching +full:inline +full:- +full:crypto +full:- +full:engine

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Qualcomm ICE (Inline Crypto Engine) support.
5 * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
12 #include "ufshcd-crypto.h"
13 #include "ufs-qcom.h"
54 /* BIST ("built-in self-test"?) status flags */
62 writel((val), (host)->ice_mmio + (reg))
64 readl((host)->ice_mmio + (reg))
68 struct device *dev = host->hba->dev; in qcom_ice_supported()
81 dev_info(dev, "Found QC Inline Crypto Engine (ICE) v%d.%d.%d\n", in qcom_ice_supported()
97 struct ufs_hba *hba = host->hba; in ufs_qcom_ice_init()
98 struct device *dev = hba->dev; in ufs_qcom_ice_init()
118 host->ice_mmio = devm_ioremap_resource(dev, res); in ufs_qcom_ice_init()
119 if (IS_ERR(host->ice_mmio)) { in ufs_qcom_ice_init()
120 err = PTR_ERR(host->ice_mmio); in ufs_qcom_ice_init()
131 dev_warn(dev, "Disabling inline encryption support\n"); in ufs_qcom_ice_init()
132 hba->caps &= ~UFSHCD_CAP_CRYPTO; in ufs_qcom_ice_init()
143 * [0]-0, [1]-0, [2]-0, [3]-E, [4]-0, [5]-0, [6]-0, [7]-0 in qcom_ice_low_power_mode_enable()
164 if (!(host->hba->caps & UFSHCD_CAP_CRYPTO)) in ufs_qcom_ice_enable()
184 return -ETIMEDOUT; in qcom_ice_wait_bist_status()
192 if (!(host->hba->caps & UFSHCD_CAP_CRYPTO)) in ufs_qcom_ice_resume()
197 dev_err(host->hba->dev, "BIST status error (%d)\n", err); in ufs_qcom_ice_resume()
205 * vendor-specific SCM calls for this; it doesn't support the standard way.
218 if (!(cfg->config_enable & UFS_CRYPTO_CONFIGURATION_ENABLE)) in ufs_qcom_ice_program_key()
221 /* Only AES-256-XTS has been tested so far. */ in ufs_qcom_ice_program_key()
222 cap = hba->crypto_cap_array[cfg->crypto_cap_idx]; in ufs_qcom_ice_program_key()
225 dev_err_ratelimited(hba->dev, in ufs_qcom_ice_program_key()
226 "Unhandled crypto capability; algorithm_id=%d, key_size=%d\n", in ufs_qcom_ice_program_key()
228 return -EINVAL; in ufs_qcom_ice_program_key()
231 memcpy(key.bytes, cfg->crypto_key, AES_256_XTS_KEY_SIZE); in ufs_qcom_ice_program_key()
234 * The SCM call byte-swaps the 32-bit words of the key. So we have to in ufs_qcom_ice_program_key()
242 cfg->data_unit_size); in ufs_qcom_ice_program_key()