summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/cqhci.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-01-25 16:14:52 -0800
committerUlf Hansson <ulf.hansson@linaro.org>2021-02-01 12:02:33 +0100
commit0a0c866f377ebea6ed5b65942cf1269651c21072 (patch)
tree60dbfb78ab0daffb006653703625d1d3bd1abf5b /drivers/mmc/host/cqhci.h
parent1e80709bdbfc1e1f3cac0ba8ed9a58f5789bcf51 (diff)
downloadlinux-0a0c866f377ebea6ed5b65942cf1269651c21072.tar.gz
mmc: cqhci: add cqhci_host_ops::program_key
On Snapdragon SoCs, the Linux kernel isn't permitted to directly access the standard CQHCI crypto configuration registers. Instead, programming and evicting keys must be done through vendor-specific SMC calls. To support this hardware, add a ->program_key() method to 'struct cqhci_host_ops'. This allows overriding the standard CQHCI crypto key programming / eviction procedure. This is inspired by the corresponding UFS crypto support, which uses these same SMC calls. See commit 1bc726e26ef3 ("scsi: ufs: Add program_key() variant op"). Acked-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Satya Tangirala <satyat@google.com> Reviewed-and-tested-by: Peng Zhou <peng.zhou@mediatek.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Link: https://lore.kernel.org/r/20210126001456.382989-6-ebiggers@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/cqhci.h')
-rw-r--r--drivers/mmc/host/cqhci.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
index 8e9e8f5db5bc..ba9387ed90eb 100644
--- a/drivers/mmc/host/cqhci.h
+++ b/drivers/mmc/host/cqhci.h
@@ -286,6 +286,10 @@ struct cqhci_host_ops {
u64 *data);
void (*pre_enable)(struct mmc_host *mmc);
void (*post_disable)(struct mmc_host *mmc);
+#ifdef CONFIG_MMC_CRYPTO
+ int (*program_key)(struct cqhci_host *cq_host,
+ const union cqhci_crypto_cfg_entry *cfg, int slot);
+#endif
};
static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg)