Skip to contentSkip to conversation

crypto: caam: Add support for i.MX8M Mini

PATCH Applied Adam Ford 4 participants 7 messages Dec 18, 2019 – Dec 27, 2019

Subsystems (4)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v3 1/3 crypto: caam: Add support for i.MX8M Mini

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.

---

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

drivers/crypto/caam/ctrl.c +3 -1
index d7c3c3805693..c01dda692ecc 100644
@@ -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 */ }
 };
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH v3 2/3 arm64: dts: imx8mm: Add Crypto CAAM support

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.

---

V3:  Fix typo in commit message.  no code changes
V2:  Don't disable it by default
arch/arm64/boot/dts/freescale/imx8mm.dtsi +30 -0
index 6edbdfe2d0d7..cbe80a3f048c 100644
@@ -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>;
Signature · 1 line
2.20.1
Applied
#2 lore raw

Re: [PATCH V3 2/3] arm64: dts: imx8mm: Add Crypto CAAM support

Quoted 7 lines · Adam Ford

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.

Applied, thanks.

author
#3 lore raw

PATCH v3 3/3 arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM

In reply to Adam Ford

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.

---

V3:  Make it a module instead of building it into the kernel.
V2:  New to series
arch/arm64/configs/defconfig +1 -0
index 6a83ba2aea3e..d08a34371f74 100644
@@ -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
Signature · 1 line
2.20.1
Applied
#5 lore raw

Re: [PATCH V3 3/3] arm64: defconfig: Enable CRYPTO_DEV_FSL_CAAM

In reply to Adam Ford
Quoted 6 lines · Adam Ford

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.

Applied, thanks.

maintainer
#6 lore raw
In reply to Adam Ford
Quoted 9 lines · Adam Ford

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.

Quoted 5 lines

---

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.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt