Commit 4e518816 authored by Marcus Folkesson's avatar Marcus Folkesson Committed by Herbert Xu

crypto: caam - add support for iMX6UL

i.MX6UL does only require three clocks to enable CAAM module.
Signed-off-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 119a0798
...@@ -123,6 +123,9 @@ PROPERTIES ...@@ -123,6 +123,9 @@ PROPERTIES
EXAMPLE EXAMPLE
iMX6QDL/SX requires four clocks
crypto@300000 { crypto@300000 {
compatible = "fsl,sec-v4.0"; compatible = "fsl,sec-v4.0";
fsl,sec-era = <2>; fsl,sec-era = <2>;
...@@ -139,6 +142,23 @@ EXAMPLE ...@@ -139,6 +142,23 @@ EXAMPLE
clock-names = "mem", "aclk", "ipg", "emi_slow"; clock-names = "mem", "aclk", "ipg", "emi_slow";
}; };
iMX6UL does only require three clocks
crypto: caam@2140000 {
compatible = "fsl,sec-v4.0";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x2140000 0x3c000>;
ranges = <0 0x2140000 0x3c000>;
interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_CAAM_MEM>,
<&clks IMX6UL_CLK_CAAM_ACLK>,
<&clks IMX6UL_CLK_CAAM_IPG>;
clock-names = "mem", "aclk", "ipg";
};
===================================================================== =====================================================================
Job Ring (JR) Node Job Ring (JR) Node
......
...@@ -330,8 +330,8 @@ static int caam_remove(struct platform_device *pdev) ...@@ -330,8 +330,8 @@ static int caam_remove(struct platform_device *pdev)
clk_disable_unprepare(ctrlpriv->caam_ipg); clk_disable_unprepare(ctrlpriv->caam_ipg);
clk_disable_unprepare(ctrlpriv->caam_mem); clk_disable_unprepare(ctrlpriv->caam_mem);
clk_disable_unprepare(ctrlpriv->caam_aclk); clk_disable_unprepare(ctrlpriv->caam_aclk);
if (!of_machine_is_compatible("fsl,imx6ul"))
clk_disable_unprepare(ctrlpriv->caam_emi_slow); clk_disable_unprepare(ctrlpriv->caam_emi_slow);
return 0; return 0;
} }
...@@ -482,6 +482,7 @@ static int caam_probe(struct platform_device *pdev) ...@@ -482,6 +482,7 @@ static int caam_probe(struct platform_device *pdev)
} }
ctrlpriv->caam_aclk = clk; ctrlpriv->caam_aclk = clk;
if (!of_machine_is_compatible("fsl,imx6ul")) {
clk = caam_drv_identify_clk(&pdev->dev, "emi_slow"); clk = caam_drv_identify_clk(&pdev->dev, "emi_slow");
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
ret = PTR_ERR(clk); ret = PTR_ERR(clk);
...@@ -490,6 +491,7 @@ static int caam_probe(struct platform_device *pdev) ...@@ -490,6 +491,7 @@ static int caam_probe(struct platform_device *pdev)
return ret; return ret;
} }
ctrlpriv->caam_emi_slow = clk; ctrlpriv->caam_emi_slow = clk;
}
ret = clk_prepare_enable(ctrlpriv->caam_ipg); ret = clk_prepare_enable(ctrlpriv->caam_ipg);
if (ret < 0) { if (ret < 0) {
...@@ -510,12 +512,14 @@ static int caam_probe(struct platform_device *pdev) ...@@ -510,12 +512,14 @@ static int caam_probe(struct platform_device *pdev)
goto disable_caam_mem; goto disable_caam_mem;
} }
if (!of_machine_is_compatible("fsl,imx6ul")) {
ret = clk_prepare_enable(ctrlpriv->caam_emi_slow); ret = clk_prepare_enable(ctrlpriv->caam_emi_slow);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "can't enable CAAM emi slow clock: %d\n", dev_err(&pdev->dev, "can't enable CAAM emi slow clock: %d\n",
ret); ret);
goto disable_caam_aclk; goto disable_caam_aclk;
} }
}
/* Get configuration properties from device tree */ /* Get configuration properties from device tree */
/* First, get register page */ /* First, get register page */
...@@ -832,6 +836,7 @@ static int caam_probe(struct platform_device *pdev) ...@@ -832,6 +836,7 @@ static int caam_probe(struct platform_device *pdev)
iounmap_ctrl: iounmap_ctrl:
iounmap(ctrl); iounmap(ctrl);
disable_caam_emi_slow: disable_caam_emi_slow:
if (!of_machine_is_compatible("fsl,imx6ul"))
clk_disable_unprepare(ctrlpriv->caam_emi_slow); clk_disable_unprepare(ctrlpriv->caam_emi_slow);
disable_caam_aclk: disable_caam_aclk:
clk_disable_unprepare(ctrlpriv->caam_aclk); clk_disable_unprepare(ctrlpriv->caam_aclk);
......
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