crypto: caam: add support for iMX6UL
Subsystems (3)
PATCH RESEND 1/1 crypto: caam: add support for iMX6UL
i.MX6UL does only require three clocks to enable CAAM module.
Signed-off-by Marcus Folkesson <[email protected]>
Acked-by Rob Herring <[email protected]>
Reviewed-by Horia Geantă <[email protected]>
--- .../devicetree/bindings/crypto/fsl-sec4.txt | 20 +++++++++++++ drivers/crypto/caam/ctrl.c | 35 ++++++++++++---------- 2 files changed, 40 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/crypto/fsl-sec4.txt +20 -0
@@ -123,6 +123,9 @@ PROPERTIES EXAMPLE + +iMX6QDL/SX requires four clocks + crypto@300000 { compatible = "fsl,sec-v4.0"; fsl,sec-era = <2>;
@@ -139,6 +142,23 @@ EXAMPLE 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
drivers/crypto/caam/ctrl.c +20 -15
@@ -329,8 +329,8 @@ static int caam_remove(struct platform_device *pdev)clk_disable_unprepare (ctrlpriv->caam_ipg);clk_disable_unprepare (ctrlpriv->caam_mem);clk_disable_unprepare (ctrlpriv->caam_aclk); -clk_disable_unprepare (ctrlpriv->caam_emi_slow); - +if (!of_machine_is_compatible ("fsl,imx6ul" )) +clk_disable_unprepare (ctrlpriv->caam_emi_slow);return 0 ; }
@@ -481,14 +481,16 @@ static int caam_probe(struct platform_device *pdev) } ctrlpriv->caam_aclk = clk; - clk =caam_drv_identify_clk (&pdev->dev,"emi_slow" ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); -dev_err (&pdev->dev, -"can't identify CAAM emi_slow clk: %d\n" , ret); -return ret; +if (!of_machine_is_compatible ("fsl,imx6ul" )) { + clk =caam_drv_identify_clk (&pdev->dev,"emi_slow" ); +if (IS_ERR (clk)) { + ret =PTR_ERR (clk); +dev_err (&pdev->dev, +"can't identify CAAM emi_slow clk: %d\n" , ret); +return ret; + } + ctrlpriv->caam_emi_slow = clk; } - ctrlpriv->caam_emi_slow = clk; ret =clk_prepare_enable (ctrlpriv->caam_ipg);if (ret <0 ) {
@@ -509,11 +511,13 @@ static int caam_probe(struct platform_device *pdev) goto disable_caam_mem; } - ret =clk_prepare_enable (ctrlpriv->caam_emi_slow); -if (ret <0 ) { -dev_err (&pdev->dev,"can't enable CAAM emi slow clock: %d\n" , - ret); - goto disable_caam_aclk; +if (!of_machine_is_compatible ("fsl,imx6ul" )) { + ret =clk_prepare_enable (ctrlpriv->caam_emi_slow); +if (ret <0 ) { +dev_err (&pdev->dev,"can't enable CAAM emi slow clock: %d\n" , + ret); + goto disable_caam_aclk; + } }/* Get configuration properties from device tree */
@@ -829,7 +833,8 @@ caam_remove: iounmap_ctrl:iounmap (ctrl); disable_caam_emi_slow: -clk_disable_unprepare (ctrlpriv->caam_emi_slow); +if (!of_machine_is_compatible ("fsl,imx6ul" )) +clk_disable_unprepare (ctrlpriv->caam_emi_slow); disable_caam_aclk:clk_disable_unprepare (ctrlpriv->caam_aclk); disable_caam_mem:
Signature · 6 lines
2.8.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Herbert Xu
maintainerQuoted 5 lines · Marcus Folkesson
i.MX6UL does only require three clocks to enable CAAM module.
Signed-off-by Marcus Folkesson <[email protected]>Acked-by Rob Herring <[email protected]>Reviewed-by Horia Geantă <[email protected]>
Patch applied. Thanks.
Signature · 7 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 53 lines · Marcus Folkesson
i.MX6UL does only require three clocks to enable CAAM module.
Signed-off-by Marcus Folkesson <[email protected]>Acked-by Rob Herring <[email protected]>Reviewed-by Horia Geantă <[email protected]>--- .../devicetree/bindings/crypto/fsl-sec4.txt | 20 +++++++++++++ drivers/crypto/caam/ctrl.c | 35 ++++++++++++---------- 2 files changed, 40 insertions(+), 15 deletions(-)Documentation/devicetree/bindings/crypto/fsl-sec4.txt +20
-0@@ -123,6 +123,9 @@ PROPERTIES EXAMPLE + +iMX6QDL/SX requires four clocks + crypto@300000 { compatible = "fsl,sec-v4.0"; fsl,sec-era = <2>;@@ -139,6 +142,23 @@ EXAMPLE 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) Nodedrivers/crypto/caam/ctrl.c +0
-0
drivers/crypto/caam/ctrl.c static int caam_remove(struct platform_device *pdev) · line 333
Quoted 7 lines
drivers/crypto/caam/ctrl.c +2
-2@@ -329,8 +329,8 @@ static int caam_remove(struct platform_device *pdev)clk_disable_unprepare (ctrlpriv->caam_ipg);clk_disable_unprepare (ctrlpriv->caam_mem);clk_disable_unprepare (ctrlpriv->caam_aclk); -clk_disable_unprepare (ctrlpriv->caam_emi_slow); - +if (!of_machine_is_compatible ("fsl,imx6ul" )) +clk_disable_unprepare (ctrlpriv->caam_emi_slow);
There is no need to re-lookup the platform here. Can't you check the validity of ctrlpriv->caam_emi_slow ?
Quoted 28 lines
drivers/crypto/caam/ctrl.c +9
-7return 0 ; }@@ -481,14 +481,16 @@ static int caam_probe(struct platform_device *pdev) } ctrlpriv->caam_aclk = clk; - clk =caam_drv_identify_clk (&pdev->dev,"emi_slow" ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); -dev_err (&pdev->dev, -"can't identify CAAM emi_slow clk: %d\n" , ret); -return ret; +if (!of_machine_is_compatible ("fsl,imx6ul" )) { + clk =caam_drv_identify_clk (&pdev->dev,"emi_slow" ); +if (IS_ERR (clk)) { + ret =PTR_ERR (clk); +dev_err (&pdev->dev, +"can't identify CAAM emi_slow clk: %d\n" , ret); +return ret; + } + ctrlpriv->caam_emi_slow = clk; } - ctrlpriv->caam_emi_slow = clk; ret =clk_prepare_enable (ctrlpriv->caam_ipg);if (ret <0 ) {
drivers/crypto/caam/ctrl.c static int caam_probe(struct platform_device *pdev) · line 514
Quoted 9 lines
drivers/crypto/caam/ctrl.c +1
-5@@ -509,11 +511,13 @@ static int caam_probe(struct platform_device *pdev) goto disable_caam_mem; } - ret =clk_prepare_enable (ctrlpriv->caam_emi_slow); -if (ret <0 ) { -dev_err (&pdev->dev,"can't enable CAAM emi slow clock: %d\n" , - ret); - goto disable_caam_aclk; +if (!of_machine_is_compatible ("fsl,imx6ul" )) {
Same here.
Quoted 10 lines
drivers/crypto/caam/ctrl.c +6
-0+ ret =clk_prepare_enable (ctrlpriv->caam_emi_slow); +if (ret <0 ) { +dev_err (&pdev->dev,"can't enable CAAM emi slow clock: %d\n" , + ret); + goto disable_caam_aclk; + } }/* Get configuration properties from device tree */
drivers/crypto/caam/ctrl.c caam_remove: · line 837
Quoted 6 lines
drivers/crypto/caam/ctrl.c +2
-1@@ -829,7 +833,8 @@ caam_remove: iounmap_ctrl:iounmap (ctrl); disable_caam_emi_slow: -clk_disable_unprepare (ctrlpriv->caam_emi_slow); +if (!of_machine_is_compatible ("fsl,imx6ul" )) +clk_disable_unprepare (ctrlpriv->caam_emi_slow);
and here.
Quoted 6 lines
drivers/crypto/caam/ctrl.c +0
-0disable_caam_aclk:clk_disable_unprepare (ctrlpriv->caam_aclk); disable_caam_mem:Signature · 1 line
2.8.0
Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html