linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: herbert@gondor.apana.org.au, davem@davemloft.net,
	gregory.clement@bootlin.com, andrew@lunn.ch,
	jason@lakedaemon.net, sebastian.hesselbarth@gmail.com
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com,
	miquel.raynal@bootlin.com, nadavh@marvell.com, oferh@marvell.com,
	igall@marvell.com
Subject: [PATCH 01/14] crypto: inside-secure - move the firmware to a better location
Date: Thu, 28 Jun 2018 17:15:31 +0200	[thread overview]
Message-ID: <20180628151544.22134-2-antoine.tenart@bootlin.com> (raw)
In-Reply-To: <20180628151544.22134-1-antoine.tenart@bootlin.com>

This patch moves the firmware loaded by the Inside Secure SafeXcel
driver from /lib/firmware/ to /lib/firmware/inside-secure/eip197b/. This
prepares the driver for future patches which will support other
revisions of the EIP197 crypto engine as they'll have their own
firmwares.

To keep the compatibility of what was done, the old path is still
supported as a fallback for the EIP197b (currently the only one
supported by the driver that loads a firmware).

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/crypto/inside-secure/safexcel.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index c39d2d7c9917..a04d39231aaf 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -132,18 +132,24 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv)
 {
 	const char *fw_name[] = {"ifpp.bin", "ipue.bin"};
 	const struct firmware *fw[FW_NB];
+	char fw_path[31];
 	int i, j, ret = 0;
 	u32 val;
 
 	for (i = 0; i < FW_NB; i++) {
-		ret = request_firmware(&fw[i], fw_name[i], priv->dev);
+		snprintf(fw_path, 31, "inside-secure/eip197b/%s", fw_name[i]);
+		ret = request_firmware(&fw[i], fw_path, priv->dev);
 		if (ret) {
-			dev_err(priv->dev,
-				"Failed to request firmware %s (%d)\n",
-				fw_name[i], ret);
-			goto release_fw;
+			/* Fallback to the old firmware location. */
+			ret = request_firmware(&fw[i], fw_name[i], priv->dev);
+			if (ret) {
+				dev_err(priv->dev,
+					"Failed to request firmware %s (%d)\n",
+					fw_name[i], ret);
+				goto release_fw;
+			}
 		}
-	 }
+	}
 
 	/* Clear the scratchpad memory */
 	val = readl(EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_CTRL);
-- 
2.17.1


  reply	other threads:[~2018-06-28 15:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 15:15 [PATCH 00/14] crypto: inside-secure - EIP197d support Antoine Tenart
2018-06-28 15:15 ` Antoine Tenart [this message]
2018-06-28 15:15 ` [PATCH 02/14] crypto: inside-secure - use precise compatibles Antoine Tenart
2018-06-28 15:15 ` [PATCH 03/14] Documentation/bindings: crypto: inside-secure: update the compatibles Antoine Tenart
2018-06-28 15:15 ` [PATCH 04/14] crypto: inside-secure - filter out the algorithms by engine Antoine Tenart
2018-06-28 15:15 ` [PATCH 05/14] crypto: inside-secure - add an invalidation flag Antoine Tenart
2018-06-28 15:15 ` [PATCH 06/14] crypto: inside-secure - dynamic ring configuration allocation Antoine Tenart
2018-06-28 15:15 ` [PATCH 07/14] crypto: inside-secure - add multiple processing engine support Antoine Tenart
2018-06-28 15:15 ` [PATCH 08/14] crypto: inside-secure - eip197d support Antoine Tenart
2018-06-28 15:15 ` [PATCH 09/14] Documentation/bindings: crypto: inside-secure: " Antoine Tenart
2018-06-28 15:15 ` [PATCH 10/14] crypto: inside-secure - adjust the TRC configuration for EIP197D Antoine Tenart
2018-06-28 15:15 ` [PATCH 11/14] crypto: inside-secure - reset CDR and RDR rings on module removal Antoine Tenart
2018-06-28 15:15 ` [PATCH 12/14] crypto: inside-secure - set tx_max_cmd_queue to 32 Antoine Tenart
2018-06-28 15:15 ` [PATCH 13/14] arm64: dts: marvell: armada-cp110: update the crypto engine compatible Antoine Tenart
2018-07-13 11:44   ` Gregory CLEMENT
2018-07-21 21:35   ` Olof Johansson
2018-07-23  7:21     ` Antoine Tenart
2018-06-28 15:15 ` [PATCH 14/14] arm64: dts: marvell: armada-37xx: " Antoine Tenart
2018-07-13 11:44   ` Gregory CLEMENT
2018-07-08 16:44 ` [PATCH 00/14] crypto: inside-secure - EIP197d support Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180628151544.22134-2-antoine.tenart@bootlin.com \
    --to=antoine.tenart@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@bootlin.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=igall@marvell.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=nadavh@marvell.com \
    --cc=oferh@marvell.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).