Commit 043ecc63 authored by Antoine Tenart's avatar Antoine Tenart Committed by Herbert Xu

crypto: inside-secure - move the firmware to a better location

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: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e3fe0ae1
...@@ -132,18 +132,24 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv) ...@@ -132,18 +132,24 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv)
{ {
const char *fw_name[] = {"ifpp.bin", "ipue.bin"}; const char *fw_name[] = {"ifpp.bin", "ipue.bin"};
const struct firmware *fw[FW_NB]; const struct firmware *fw[FW_NB];
char fw_path[31];
int i, j, ret = 0; int i, j, ret = 0;
u32 val; u32 val;
for (i = 0; i < FW_NB; i++) { 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) { if (ret) {
dev_err(priv->dev, /* Fallback to the old firmware location. */
"Failed to request firmware %s (%d)\n", ret = request_firmware(&fw[i], fw_name[i], priv->dev);
fw_name[i], ret); if (ret) {
goto release_fw; dev_err(priv->dev,
"Failed to request firmware %s (%d)\n",
fw_name[i], ret);
goto release_fw;
}
} }
} }
/* Clear the scratchpad memory */ /* Clear the scratchpad memory */
val = readl(EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_CTRL); val = readl(EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_CTRL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment