[PATCH 05/18] crypto: caam - add support for iMX6UL

Marcin Niestroj m.niestroj at grinn-global.com
Mon Sep 3 04:44:39 PDT 2018


Pick commit 4e518816a938187b3bfe1b62fa291d4e38dca06e from Linux
upstream.

    crypto: caam - add support for iMX6UL

    i.MX6UL does only require three clocks to enable CAAM module.

    Signed-off-by: Marcus Folkesson <marcus.folkesson at gmail.com>
    Acked-by: Rob Herring <robh at kernel.org>
    Reviewed-by: Horia Geantă <horia.geanta at nxp.com>
    Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>

Signed-off-by: Marcin Niestroj <m.niestroj at grinn-global.com>
---
 drivers/crypto/caam/ctrl.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 0baddf733..55193f6ef 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -224,7 +224,8 @@ static void caam_remove(struct device_d *dev)
 	clk_disable(ctrlpriv->caam_ipg);
 	clk_disable(ctrlpriv->caam_mem);
 	clk_disable(ctrlpriv->caam_aclk);
-	clk_disable(ctrlpriv->caam_emi_slow);
+	if (ctrlpriv->caam_emi_slow)
+		clk_disable(ctrlpriv->caam_emi_slow);
 }
 
 /*
@@ -341,12 +342,14 @@ static int caam_probe(struct device_d *dev)
 		return -ENODEV;
 	}
 
-	ctrlpriv->caam_emi_slow = clk_get(dev, "emi_slow");
-	if (IS_ERR(ctrlpriv->caam_emi_slow)) {
-		ret = PTR_ERR(ctrlpriv->caam_emi_slow);
-		dev_err(dev,
-			"can't identify CAAM emi slow clk: %d\n", ret);
-		return -ENODEV;
+	if (!of_machine_is_compatible("fsl,imx6ul")) {
+		ctrlpriv->caam_emi_slow = clk_get(dev, "emi_slow");
+		if (IS_ERR(ctrlpriv->caam_emi_slow)) {
+			ret = PTR_ERR(ctrlpriv->caam_emi_slow);
+			dev_err(dev,
+				"can't identify CAAM emi slow clk: %d\n", ret);
+			return -ENODEV;
+		}
 	}
 
 	ret = clk_enable(ctrlpriv->caam_ipg);
@@ -368,11 +371,13 @@ static int caam_probe(struct device_d *dev)
 		return -ENODEV;
 	}
 
-	ret = clk_enable(ctrlpriv->caam_emi_slow);
-	if (ret < 0) {
-		dev_err(dev, "can't enable CAAM emi slow clock: %d\n",
-			ret);
-		return -ENODEV;
+	if (ctrlpriv->caam_emi_slow) {
+		ret = clk_enable(ctrlpriv->caam_emi_slow);
+		if (ret < 0) {
+			dev_err(dev, "can't enable CAAM emi slow clock: %d\n",
+				ret);
+			return -ENODEV;
+		}
 	}
 
 	/* Get configuration properties from device tree */
-- 
2.18.0




More information about the barebox mailing list