Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7959637imm; Thu, 28 Jun 2018 12:05:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf3i9JFdt4LJLzJlPUqCU0+RrKrZq/ozygexjMP38Q+vVdkFNZ2M3QSVsivxMTZz2/aTyF8 X-Received: by 2002:a62:c00c:: with SMTP id x12-v6mr1306724pff.216.1530212709432; Thu, 28 Jun 2018 12:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530212709; cv=none; d=google.com; s=arc-20160816; b=vdQhUN+PvAOEiMZ7wVTyjhgJuq1MqnK23yXKChhObg09n8oG0xRuc3l/GDkjEKAB2g vz3QN+HUO9Ja+1Z2tQ/j8sXOI4ZgrvmAFRbS4XJSOx76g30YNXX9JIUw1u9IqCg600OA yOP8zQQ5w94Sf3Hd+c6/OK7Kego1jiNLLA7rEko4XXIWk8khhoqQT4TwUtNQgqG6Flme FqttmCdNq9DURrn94gSnWZstpLLQOQUZWHWIGa0qc8BNZ0ZiIbn1OSPf/ipKYnlBQC4r 58yCsLUBgJalQe2nvXujPyIbCU+jMdKcQdi1WbfpMKkg9mPZxfesRJelMSToZllsqliL Fi2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tfa4+GBWCDJ8j632Wd1VSbZriqZU0DMTNLk/Acn/mrc=; b=EK7Z8zWvH6cd/RqVCepnrxuaw0/4aX0FFxhOA2HiqTIvHCv8cnBAl/Aa6yzd6A5jA5 Fplonz4J13fbH+15hiqEpbB/u43z/v5Mz4xdLxU1b5q0zYAA+E91Xl8wRwTzuB3c8Q2c Fh51Qjl+y8rz8KIsXvSRF0gyLw0hgOcv0N//QU1k0DY7kZ7nPv9abSyeYUnYxyKt1HKX w47Oox0COr/T2PsTIz4AkFQcMqdxJZ5hBHnvVG1FFe8JtUYFTt2lLMQgm8STfF86YQFD h+cHYhzV11/FEGdNBFyn8u/t205AxamKBGypcskxfQYfCI47I37SRwNlSKWs092+nYaE qXXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b76-v6si4568176pfl.223.2018.06.28.12.04.55; Thu, 28 Jun 2018 12:05:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753941AbeF1PYL (ORCPT + 99 others); Thu, 28 Jun 2018 11:24:11 -0400 Received: from mail.bootlin.com ([62.4.15.54]:53331 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966713AbeF1PUE (ORCPT ); Thu, 28 Jun 2018 11:20:04 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7FFD920A36; Thu, 28 Jun 2018 17:20:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (nat.foo.tf [163.172.35.26]) by mail.bootlin.com (Postfix) with ESMTPSA id 548F5203EC; Thu, 28 Jun 2018 17:20:02 +0200 (CEST) From: Antoine Tenart 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 , 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 Message-Id: <20180628151544.22134-2-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628151544.22134-1-antoine.tenart@bootlin.com> References: <20180628151544.22134-1-antoine.tenart@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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