Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02b5942e authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Veerabhadrarao Badiganti
Browse files

mmc: cmdq_hci: Add Inline Crypto Engine (ICE) support



Add changes to configure ICE for data encryption/decryption
using CMDQ.

Change-Id: I9a10d18d617102916526e994e9f9d22d2aa5446b
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 4eca099a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -729,6 +729,15 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
		goto ring_doorbell;
	}

	if (cq_host->ops->crypto_cfg) {
		err = cq_host->ops->crypto_cfg(mmc, mrq, tag);
		if (err) {
			pr_err("%s: failed to configure crypto: err %d tag %d\n",
					mmc_hostname(mmc), err, tag);
			goto out;
		}
	}

	task_desc = (__le64 __force *)get_desc(cq_host, tag);

	cmdq_prep_task_desc(mrq, &data, 1,
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -208,6 +208,8 @@ struct cmdq_host_ops {
	void (*enhanced_strobe_mask)(struct mmc_host *mmc, bool set);
	int (*reset)(struct mmc_host *mmc);
	void (*post_cqe_halt)(struct mmc_host *mmc);
	int (*crypto_cfg)(struct mmc_host *mmc, struct mmc_request *mrq,
				u32 slot);
};

static inline void cmdq_writel(struct cmdq_host *host, u32 val, int reg)
+17 −0
Original line number Diff line number Diff line
@@ -3746,6 +3746,16 @@ static void sdhci_cmdq_post_cqe_halt(struct mmc_host *mmc)
			SDHCI_INT_RESPONSE, SDHCI_INT_ENABLE);
	sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
}
static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
		struct mmc_request *mrq, u32 slot)
{
	struct sdhci_host *host = mmc_priv(mmc);

	if (!host->is_crypto_en)
		return 0;

	return sdhci_crypto_cfg(host, mrq, slot);
}
#else
static void sdhci_cmdq_set_transfer_params(struct mmc_host *mmc)
{
@@ -3789,6 +3799,12 @@ static void sdhci_cmdq_clear_set_dumpregs(struct mmc_host *mmc, bool set)

static void sdhci_cmdq_post_cqe_halt(struct mmc_host *mmc)
{

}
static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
		struct mmc_request *mrq, u32 slot)
{
	return 0;
}
#endif

@@ -3801,6 +3817,7 @@ static const struct cmdq_host_ops sdhci_cmdq_ops = {
	.enhanced_strobe_mask = sdhci_enhanced_strobe_mask,
	.post_cqe_halt = sdhci_cmdq_post_cqe_halt,
	.set_transfer_params = sdhci_cmdq_set_transfer_params,
	.crypto_cfg	= sdhci_cmdq_crypto_cfg,
};

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT