Skip to contentSkip to conversation

dt-bindings: fsl-imx-sahara: Add i.MX51 as a supported SoC

PATCH In review Fabio Estevam 2 participants 6 messages Jun 22, 2018 – Jun 26, 2018

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/2 dt-bindings: fsl-imx-sahara: Add i.MX51 as a supported SoC

From: Fabio Estevam <[email protected]>

i.MX51 and i.MX53 share the same sahara IP block version, so add i.MX51 in the list of supported SoCs.

---
Changes since v1:
- Fix typo in commit log "i.MX51 and i.MX53"

 Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt +3 -2
index e8a35c7..5343a48 100644
@@ -1,8 +1,9 @@
 Freescale SAHARA Cryptographic Accelerator included in some i.MX chips.
-Currently only i.MX27 and i.MX53 are supported.
+Currently i.MX27, i.MX51 and i.MX53 are supported.
 
 Required properties:
-- compatible : Should be "fsl,<soc>-sahara"
+- compatible : Should be "fsl,imx27-sahara", "fsl,imx51-sahara"
+or "fsl,imx53-sahara"
 - reg : Should contain SAHARA registers location and length
 - interrupts : Should contain SAHARA interrupt number
 
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH v2 2/2 crypto: sahara - Add i.MX51 entry

From: Fabio Estevam <[email protected]>

i.MX51 and i.MX53 share the same sahara IP block version, so add i.MX51 in the compatible list.

---
Changes since v1:
- Fix typo in commit log "i.MX51 and i.MX53"

 drivers/crypto/sahara.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/crypto/sahara.c +4 -1
index 0f2245e..ce1a42c 100644
@@ -1382,6 +1382,7 @@ static const struct platform_device_id sahara_platform_ids[] = {
 MODULE_DEVICE_TABLE(platform, sahara_platform_ids);
 
 static const struct of_device_id sahara_dt_ids[] = {
+	{ .compatible = "fsl,imx51-sahara" },
 	{ .compatible = "fsl,imx53-sahara" },
 	{ .compatible = "fsl,imx27-sahara" },
 	{ /* sentinel */ }
@@ -1507,7 +1508,9 @@ static int sahara_probe(struct platform_device *pdev)
 		if (version != SAHARA_VERSION_3)
 			err = -ENODEV;
 	} else if (of_device_is_compatible(pdev->dev.of_node,
-			"fsl,imx53-sahara")) {
+		   "fsl,imx53-sahara") ||
+		   of_device_is_compatible(pdev->dev.of_node,
+		   "fsl,imx51-sahara")) {
 		if (((version >> 8) & 0xff) != SAHARA_VERSION_4)
 			err = -ENODEV;
 		version = (version >> 8) & 0xff;
Signature · 1 line
2.7.4
maintainer
#2 lore raw
In reply to Fabio Estevam
Quoted 18 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

i.MX51 and i.MX53 share the same sahara IP block version, so add i.MX51 in the list of supported SoCs.

---
Changes since v1:
- Fix typo in commit log "i.MX51 and i.MX53"

 Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt +0 -0
index e8a35c7..5343a48 100644

Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt line 6

Quoted 8 lines
Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt +3 -2
@@ -1,8 +1,9 @@
 Freescale SAHARA Cryptographic Accelerator included in some i.MX chips.
-Currently only i.MX27 and i.MX53 are supported.
+Currently i.MX27, i.MX51 and i.MX53 are supported.
 
 Required properties:
-- compatible : Should be "fsl,<soc>-sahara"
+- compatible : Should be "fsl,imx27-sahara", "fsl,imx51-sahara"
+or "fsl,imx53-sahara"

Looks like imx51 should be a fallback and you can drop the driver change.

Quoted 6 lines
Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt +0 -0
 - reg : Should contain SAHARA registers location and length
 - interrupts : Should contain SAHARA interrupt number
 
Signature · 1 line
2.7.4
author reviewer
#3 lore raw

Hi Rob,

Quoted 2 lines · Rob Herring

Looks like imx51 should be a fallback and you can drop the driver change.

I thought about that too.

If I do like this in imx51.dtsi:

compatible = "fsl,imx51-sahara", "fsl,imx53-sahara";

Then the driver works just fine.

I was not sure if this was OK or not because imx51 was introduced prior than imx53 was launched.

Would it be OK to use: compatible = "fsl,imx51-sahara", "fsl,imx53-sahara"; ?

Thanks

maintainer
#4 lore raw
Quoted 12 lines · Fabio Estevam

Hi Rob,

Quoted 2 lines · Rob Herring

Looks like imx51 should be a fallback and you can drop the driver change.

I thought about that too.

If I do like this in imx51.dtsi:

Quoted 8 lines

compatible = "fsl,imx51-sahara", "fsl,imx53-sahara";

Then the driver works just fine.

I was not sure if this was OK or not because imx51 was introduced prior than imx53 was launched.

Would it be OK to use: compatible = "fsl,imx51-sahara", "fsl,imx53-sahara"; ?

Yes, but the order should be reversed as it should be most specific and newest first.

Rob

author reviewer
#5 lore raw

Hi Rob,

Quoted 4 lines · Rob Herring
Quoted 1 line

Would it be OK to use: compatible = "fsl,imx51-sahara", "fsl,imx53-sahara"; ?

Yes, but the order should be reversed as it should be most specific and newest first.

Thanks for the feedback. Just sent a dts patch as you suggested.