linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini
@ 2019-12-18 13:06 Adam Ford
  2019-12-18 13:06 ` [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support Adam Ford
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adam Ford @ 2019-12-18 13:06 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Iuliana Prodan, Horia Geantă,
	Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, Aymen Sghaier, Herbert Xu,
	David S. Miller, devicetree, linux-kernel, linux-crypto

The i.MX8M Mini uses the same crypto engine as the i.MX8MQ, but
the driver is restricting the check to just the i.MX8MQ.

This patch expands the check for either i.MX8MQ or i.MX8MM.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
---
V3:  No Change
V2:  Expand the check that forces the setting on imx8mq to also be true for imx8mm
     Explictly state imx8mm compatiblity instead of making it generic to all imx8m*
      this is mostly due to lack of other hardware to test

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index d7c3c3805693..c01dda692ecc 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -102,7 +102,8 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc,
 	     * Apparently on i.MX8MQ it doesn't matter if virt_en == 1
 	     * and the following steps should be performed regardless
 	     */
-	    of_machine_is_compatible("fsl,imx8mq")) {
+	    of_machine_is_compatible("fsl,imx8mq") ||
+	    of_machine_is_compatible("fsl,imx8mm")) {
 		clrsetbits_32(&ctrl->deco_rsr, 0, DECORSR_JR0);
 
 		while (!(rd_reg32(&ctrl->deco_rsr) & DECORSR_VALID) &&
@@ -509,6 +510,7 @@ static const struct soc_device_attribute caam_imx_soc_table[] = {
 	{ .soc_id = "i.MX6*",  .data = &caam_imx6_data },
 	{ .soc_id = "i.MX7*",  .data = &caam_imx7_data },
 	{ .soc_id = "i.MX8MQ", .data = &caam_imx7_data },
+	{ .soc_id = "i.MX8MM", .data = &caam_imx7_data },
 	{ .family = "Freescale i.MX" },
 	{ /* sentinel */ }
 };
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support
  2019-12-18 13:06 [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Adam Ford
@ 2019-12-18 13:06 ` Adam Ford
  2019-12-23  8:48   ` Shawn Guo
  2019-12-18 13:06 ` [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM Adam Ford
  2019-12-27 10:38 ` [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Herbert Xu
  2 siblings, 1 reply; 7+ messages in thread
From: Adam Ford @ 2019-12-18 13:06 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Horia Geantă,
	Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, Aymen Sghaier, Herbert Xu,
	David S. Miller, devicetree, linux-kernel, linux-crypto

The i.MX8M Mini supports the same crypto engine as what is in
the i.MX8MQ, but it is not currently present in the device tree.

This patch places it into the device tree.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
---
V3:  Fix typo in commit message.  no code changes
V2:  Don't disable it by default

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index 6edbdfe2d0d7..cbe80a3f048c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -641,6 +641,36 @@
 				status = "disabled";
 			};
 
+			crypto: crypto@30900000 {
+				compatible = "fsl,sec-v4.0";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				reg = <0x30900000 0x40000>;
+				ranges = <0 0x30900000 0x40000>;
+				interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_AHB>,
+					 <&clk IMX8MM_CLK_IPG_ROOT>;
+				clock-names = "aclk", "ipg";
+
+				sec_jr0: jr@1000 {
+					compatible = "fsl,sec-v4.0-job-ring";
+					reg = <0x1000 0x1000>;
+					interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+				};
+
+				sec_jr1: jr@2000 {
+					compatible = "fsl,sec-v4.0-job-ring";
+					reg = <0x2000 0x1000>;
+					interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+				};
+
+				sec_jr2: jr@3000 {
+					compatible = "fsl,sec-v4.0-job-ring";
+					reg = <0x3000 0x1000>;
+					interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+				};
+			};
+
 			i2c1: i2c@30a20000 {
 				compatible = "fsl,imx8mm-i2c", "fsl,imx21-i2c";
 				#address-cells = <1>;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM
  2019-12-18 13:06 [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Adam Ford
  2019-12-18 13:06 ` [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support Adam Ford
@ 2019-12-18 13:06 ` Adam Ford
  2019-12-20  7:08   ` Horia Geanta
  2019-12-23  8:48   ` Shawn Guo
  2019-12-27 10:38 ` [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Herbert Xu
  2 siblings, 2 replies; 7+ messages in thread
From: Adam Ford @ 2019-12-18 13:06 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, Horia Geantă,
	Aymen Sghaier, Herbert Xu, David S. Miller, devicetree,
	linux-kernel, linux-crypto

Both the i.MX8MQ and i.MX8M Mini support the CAAM driver, but it
is currently not enabled by default.

This patch enables this as a module.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
V3:  Make it a module instead of building it into the kernel.
V2:  New to series

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 6a83ba2aea3e..d08a34371f74 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -845,6 +845,7 @@ CONFIG_SECURITY=y
 CONFIG_CRYPTO_ECHAINIV=y
 CONFIG_CRYPTO_ANSI_CPRNG=y
 CONFIG_CRYPTO_DEV_SUN8I_CE=m
+CONFIG_CRYPTO_DEV_FSL_CAAM=m
 CONFIG_CRYPTO_DEV_HISI_ZIP=m
 CONFIG_CMA_SIZE_MBYTES=32
 CONFIG_PRINTK_TIME=y
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM
  2019-12-18 13:06 ` [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM Adam Ford
@ 2019-12-20  7:08   ` Horia Geanta
  2019-12-23  8:48   ` Shawn Guo
  1 sibling, 0 replies; 7+ messages in thread
From: Horia Geanta @ 2019-12-20  7:08 UTC (permalink / raw)
  To: Adam Ford, linux-arm-kernel
  Cc: Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, dl-linux-imx,
	Catalin Marinas, Will Deacon, Aymen Sghaier, Herbert Xu,
	David S. Miller, devicetree, linux-kernel, linux-crypto

On 12/18/2019 3:06 PM, Adam Ford wrote:
> Both the i.MX8MQ and i.MX8M Mini support the CAAM driver, but it
> is currently not enabled by default.
> 
> This patch enables this as a module.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support
  2019-12-18 13:06 ` [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support Adam Ford
@ 2019-12-23  8:48   ` Shawn Guo
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2019-12-23  8:48 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, Horia Geantă,
	Rob Herring, Mark Rutland, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Catalin Marinas, Will Deacon,
	Aymen Sghaier, Herbert Xu, David S. Miller, devicetree,
	linux-kernel, linux-crypto

On Wed, Dec 18, 2019 at 07:06:15AM -0600, Adam Ford wrote:
> The i.MX8M Mini supports the same crypto engine as what is in
> the i.MX8MQ, but it is not currently present in the device tree.
> 
> This patch places it into the device tree.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM
  2019-12-18 13:06 ` [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM Adam Ford
  2019-12-20  7:08   ` Horia Geanta
@ 2019-12-23  8:48   ` Shawn Guo
  1 sibling, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2019-12-23  8:48 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, Rob Herring, Mark Rutland, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, Horia Geantă,
	Aymen Sghaier, Herbert Xu, David S. Miller, devicetree,
	linux-kernel, linux-crypto

On Wed, Dec 18, 2019 at 07:06:16AM -0600, Adam Ford wrote:
> Both the i.MX8MQ and i.MX8M Mini support the CAAM driver, but it
> is currently not enabled by default.
> 
> This patch enables this as a module.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini
  2019-12-18 13:06 [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Adam Ford
  2019-12-18 13:06 ` [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support Adam Ford
  2019-12-18 13:06 ` [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM Adam Ford
@ 2019-12-27 10:38 ` Herbert Xu
  2 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2019-12-27 10:38 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, Iuliana Prodan, Horia Geantă,
	Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, Aymen Sghaier, David S. Miller,
	devicetree, linux-kernel, linux-crypto

On Wed, Dec 18, 2019 at 07:06:14AM -0600, Adam Ford wrote:
> The i.MX8M Mini uses the same crypto engine as the i.MX8MQ, but
> the driver is restricting the check to just the i.MX8MQ.
> 
> This patch expands the check for either i.MX8MQ or i.MX8MM.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> Tested-by: Iuliana Prodan <iuliana.prodan@nxp.com>
> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
> Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
> ---
> V3:  No Change
> V2:  Expand the check that forces the setting on imx8mq to also be true for imx8mm
>      Explictly state imx8mm compatiblity instead of making it generic to all imx8m*
>       this is mostly due to lack of other hardware to test

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-27 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 13:06 [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Adam Ford
2019-12-18 13:06 ` [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support Adam Ford
2019-12-23  8:48   ` Shawn Guo
2019-12-18 13:06 ` [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM Adam Ford
2019-12-20  7:08   ` Horia Geanta
2019-12-23  8:48   ` Shawn Guo
2019-12-27 10:38 ` [PATCH V3 1/3] crypto: caam: Add support for i.MX8M Mini Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).