linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] hwrng: add support for i.MX6 rngb
@ 2020-07-14 12:39 Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs Horia Geantă
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

Add support for RNGB found in some i.MX6 SoCs (6SL, 6SLL, 6ULL, 6ULZ),
based on RNGC driver (drivers/char/hw_random/imx-rngc.c).

This driver claims support also for RNGB (besides RNGC),
and is currently used only by i.MX25.

Note:

Several NXP SoC from QorIQ family (P1010, P1023, P4080, P3041, P5020)
also have a RNGB, however it's part of the CAAM
(Cryptograhic Accelerator and Assurance Module) crypto accelerator.
In this case, RNGB is managed in the caam driver
(drivers/crypto/caam/), since it's tightly related to
the caam "job ring" interface, not to mention CAAM internally relying on
RNGB as source of randomness.

On the other hand, the i.MX6 SoCs with RNGB have a DCP
(Data Co-Processor) crypto accelerator and this block and RNGB
are independent.

Changelog:
v3
-mention in the DT binding the compatibility with "fsl,imx25-rngb"
-collected Reviewed-by
v2
-update rngb DT binding with compatible strings for i.MX6 SoCs

Horia Geantă (5):
  dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs
  ARM: dts: imx6sl: fix rng node
  ARM: dts: imx6sll: add rng
  ARM: dts: imx6ull: add rng
  hwrng: imx-rngc: enable driver for i.MX6

 Documentation/devicetree/bindings/rng/imx-rng.txt | 3 +++
 arch/arm/boot/dts/imx6sl.dtsi                     | 2 ++
 arch/arm/boot/dts/imx6sll.dtsi                    | 7 +++++++
 arch/arm/boot/dts/imx6ull.dtsi                    | 7 +++++++
 drivers/char/hw_random/Kconfig                    | 2 +-
 drivers/char/hw_random/imx-rngc.c                 | 3 +++
 6 files changed, 23 insertions(+), 1 deletion(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs
  2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
@ 2020-07-14 12:39 ` Horia Geantă
  2020-07-14 21:09   ` Rob Herring
  2020-07-14 12:39 ` [PATCH v3 2/5] ARM: dts: imx6sl: fix rng node Horia Geantă
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

RNGB block is found in some i.MX6 SoCs - 6SL, 6SLL, 6ULL, 6ULZ.
Add corresponding compatible strings.

Note:

Several NXP SoC from QorIQ family (P1010, P1023, P4080, P3041, P5020)
also have a RNGB, however it's part of the CAAM
(Cryptograhic Accelerator and Assurance Module) crypto accelerator.
In this case, RNGB is managed in the caam driver
(drivers/crypto/caam/), since it's tightly related to
the caam "job ring" interface, not to mention CAAM internally relying on
RNGB as source of randomness.

On the other hand, the i.MX6 SoCs with RNGB have a DCP
(Data Co-Processor) crypto accelerator and this block and RNGB
are independent.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 Documentation/devicetree/bindings/rng/imx-rng.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/rng/imx-rng.txt b/Documentation/devicetree/bindings/rng/imx-rng.txt
index 405c2b00ccb0..659d4efdd664 100644
--- a/Documentation/devicetree/bindings/rng/imx-rng.txt
+++ b/Documentation/devicetree/bindings/rng/imx-rng.txt
@@ -5,6 +5,9 @@ Required properties:
                "fsl,imx21-rnga"
                "fsl,imx31-rnga" (backward compatible with "fsl,imx21-rnga")
                "fsl,imx25-rngb"
+               "fsl,imx6sl-rngb" (backward compatible with "fsl,imx25-rngb")
+               "fsl,imx6sll-rngb" (backward compatible with "fsl,imx25-rngb")
+               "fsl,imx6ull-rngb" (backward compatible with "fsl,imx25-rngb")
                "fsl,imx35-rngc"
 - reg : offset and length of the register set of this block
 - interrupts : the interrupt number for the RNG block
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 2/5] ARM: dts: imx6sl: fix rng node
  2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs Horia Geantă
@ 2020-07-14 12:39 ` Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 3/5] ARM: dts: imx6sll: add rng Horia Geantă
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

rng DT node was added without a compatible string.

i.MX driver for RNGC (drivers/char/hw_random/imx-rngc.c) also claims
support for RNGB, and is currently used for i.MX25.

Let's use this driver also for RNGB block in i.MX6SL.

Fixes: e29fe21cff96 ("ARM: dts: add device tree source for imx6sl SoC")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 arch/arm/boot/dts/imx6sl.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 1c7180f28539..91a8c54d5e11 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -939,8 +939,10 @@
 			};
 
 			rngb: rngb@21b4000 {
+				compatible = "fsl,imx6sl-rngb", "fsl,imx25-rngb";
 				reg = <0x021b4000 0x4000>;
 				interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX6SL_CLK_DUMMY>;
 			};
 
 			weim: weim@21b8000 {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 3/5] ARM: dts: imx6sll: add rng
  2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 2/5] ARM: dts: imx6sl: fix rng node Horia Geantă
@ 2020-07-14 12:39 ` Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 4/5] ARM: dts: imx6ull: " Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6 Horia Geantă
  4 siblings, 0 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

Add node for the RNGB block.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 arch/arm/boot/dts/imx6sll.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
index fb5d3bc50c6b..0b622201a1f3 100644
--- a/arch/arm/boot/dts/imx6sll.dtsi
+++ b/arch/arm/boot/dts/imx6sll.dtsi
@@ -786,6 +786,13 @@
 				clocks = <&clks IMX6SLL_CLK_MMDC_P0_IPG>;
 			};
 
+			rngb: rng@21b4000 {
+				compatible = "fsl,imx6sll-rngb", "fsl,imx25-rngb";
+				reg = <0x021b4000 0x4000>;
+				interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX6SLL_CLK_DUMMY>;
+			};
+
 			ocotp: efuse@21bc000 {
 				#address-cells = <1>;
 				#size-cells = <1>;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 4/5] ARM: dts: imx6ull: add rng
  2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
                   ` (2 preceding siblings ...)
  2020-07-14 12:39 ` [PATCH v3 3/5] ARM: dts: imx6sll: add rng Horia Geantă
@ 2020-07-14 12:39 ` Horia Geantă
  2020-07-14 12:39 ` [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6 Horia Geantă
  4 siblings, 0 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

Add node for the RNGB block.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/arm/boot/dts/imx6ull.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/imx6ull.dtsi b/arch/arm/boot/dts/imx6ull.dtsi
index fcde7f77ae42..9bf67490ac49 100644
--- a/arch/arm/boot/dts/imx6ull.dtsi
+++ b/arch/arm/boot/dts/imx6ull.dtsi
@@ -68,6 +68,13 @@
 				clock-names = "dcp";
 			};
 
+			rngb: rng@2284000 {
+				compatible = "fsl,imx6ull-rngb", "fsl,imx25-rngb";
+				reg = <0x02284000 0x4000>;
+				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX6UL_CLK_DUMMY>;
+			};
+
 			iomuxc_snvs: iomuxc-snvs@2290000 {
 				compatible = "fsl,imx6ull-iomuxc-snvs";
 				reg = <0x02290000 0x4000>;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6
  2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
                   ` (3 preceding siblings ...)
  2020-07-14 12:39 ` [PATCH v3 4/5] ARM: dts: imx6ull: " Horia Geantă
@ 2020-07-14 12:39 ` Horia Geantă
  2020-07-14 12:47   ` Arnd Bergmann
  2020-07-14 12:48   ` Fabio Estevam
  4 siblings, 2 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 12:39 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Matt Mackall, Herbert Xu
  Cc: devicetree, Arnd Bergmann, Iuliana Prodan, Greg Kroah-Hartman,
	Marco Felsch, linux-kernel, Franck Lenormand, NXP Linux Team,
	Pengutronix Kernel Team, Martin Kaiser, Silvano Di Ninno,
	Fabio Estevam, linux-arm-kernel, linux-crypto

i.MX6 SL, SLL, ULL, ULZ SoCs have an RNGB block.

Since imx-rngc driver supports also rngb,
let's enable it for these SoCs too.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/char/hw_random/Kconfig    | 2 +-
 drivers/char/hw_random/imx-rngc.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 8478eb757f3c..98f95a09ce55 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -255,7 +255,7 @@ config HW_RANDOM_MXC_RNGA
 config HW_RANDOM_IMX_RNGC
 	tristate "Freescale i.MX RNGC Random Number Generator"
 	depends on HAS_IOMEM && HAVE_CLK
-	depends on SOC_IMX25 || COMPILE_TEST
+	depends on SOC_IMX25 || SOC_IMX6SL || SOC_IMX6SLL || SOC_IMX6UL || COMPILE_TEST
 	default HW_RANDOM
 	help
 	  This driver provides kernel-side support for the Random Number
diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 9c47e431ce90..84576d2fbf8c 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -350,6 +350,9 @@ static SIMPLE_DEV_PM_OPS(imx_rngc_pm_ops, imx_rngc_suspend, imx_rngc_resume);
 
 static const struct of_device_id imx_rngc_dt_ids[] = {
 	{ .compatible = "fsl,imx25-rngb", .data = NULL, },
+	{ .compatible = "fsl,imx6sl-rngb", .data = NULL, },
+	{ .compatible = "fsl,imx6sll-rngb", .data = NULL, },
+	{ .compatible = "fsl,imx6ull-rngb", .data = NULL, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_rngc_dt_ids);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6
  2020-07-14 12:39 ` [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6 Horia Geantă
@ 2020-07-14 12:47   ` Arnd Bergmann
  2020-07-14 14:27     ` Horia Geantă
  2020-07-14 12:48   ` Fabio Estevam
  1 sibling, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2020-07-14 12:47 UTC (permalink / raw)
  To: Horia Geantă
  Cc: DTML, Martin Kaiser, Herbert Xu, Greg Kroah-Hartman,
	Iuliana Prodan, Fabio Estevam, Sascha Hauer, Marco Felsch,
	linux-kernel, Franck Lenormand, Rob Herring, NXP Linux Team,
	Pengutronix Kernel Team, Matt Mackall, Silvano Di Ninno,
	Shawn Guo, Linux ARM,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE

On Tue, Jul 14, 2020 at 2:39 PM Horia Geantă <horia.geanta@nxp.com> wrote:
> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> index 8478eb757f3c..98f95a09ce55 100644
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -255,7 +255,7 @@ config HW_RANDOM_MXC_RNGA
>  config HW_RANDOM_IMX_RNGC
>         tristate "Freescale i.MX RNGC Random Number Generator"
>         depends on HAS_IOMEM && HAVE_CLK
> -       depends on SOC_IMX25 || COMPILE_TEST
> +       depends on SOC_IMX25 || SOC_IMX6SL || SOC_IMX6SLL || SOC_IMX6UL || COMPILE_TEST
>         default HW_RANDOM

Are these the only chips that have it? If other i.MX variations have
the same block,
or might have it in the future, maybe just generialize the dependency
to SOC_IMX6
or ARCH_IMX?

> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
> index 9c47e431ce90..84576d2fbf8c 100644
> --- a/drivers/char/hw_random/imx-rngc.c
> +++ b/drivers/char/hw_random/imx-rngc.c
> @@ -350,6 +350,9 @@ static SIMPLE_DEV_PM_OPS(imx_rngc_pm_ops, imx_rngc_suspend, imx_rngc_resume);
>
>  static const struct of_device_id imx_rngc_dt_ids[] = {
>         { .compatible = "fsl,imx25-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6sl-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6sll-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6ull-rngb", .data = NULL, },
>         { /* sentinel */ }

In the .dts file you describe the devices as compatible with fsl,imx25-rngb,
so this change is not really needed, unless you want to add non-NULL
.data fields in a follow-up. It is usually a good idea to have the more
specialized compatible strings in the DT, but the driver change won't
do anything here.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6
  2020-07-14 12:39 ` [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6 Horia Geantă
  2020-07-14 12:47   ` Arnd Bergmann
@ 2020-07-14 12:48   ` Fabio Estevam
  1 sibling, 0 replies; 10+ messages in thread
From: Fabio Estevam @ 2020-07-14 12:48 UTC (permalink / raw)
  To: Horia Geantă
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Martin Kaiser, Herbert Xu, Arnd Bergmann, Iuliana Prodan,
	Greg Kroah-Hartman, Sascha Hauer, Marco Felsch, linux-kernel,
	Franck Lenormand, Rob Herring, NXP Linux Team,
	Pengutronix Kernel Team, Matt Mackall, Silvano Di Ninno,
	Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE

On Tue, Jul 14, 2020 at 9:39 AM Horia Geantă <horia.geanta@nxp.com> wrote:

>  static const struct of_device_id imx_rngc_dt_ids[] = {
>         { .compatible = "fsl,imx25-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6sl-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6sll-rngb", .data = NULL, },
> +       { .compatible = "fsl,imx6ull-rngb", .data = NULL, },

It seems that these new entries are not needed, since they fallback to
"fsl,imx25-rngb".

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6
  2020-07-14 12:47   ` Arnd Bergmann
@ 2020-07-14 14:27     ` Horia Geantă
  0 siblings, 0 replies; 10+ messages in thread
From: Horia Geantă @ 2020-07-14 14:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: DTML, Martin Kaiser, Herbert Xu, Greg Kroah-Hartman,
	Iuliana Prodan, Fabio Estevam, Sascha Hauer, Marco Felsch,
	linux-kernel, Franck Lenormand, Rob Herring, dl-linux-imx,
	Pengutronix Kernel Team, Matt Mackall, Silvano Di Ninno,
	Shawn Guo, Linux ARM,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE

On 7/14/2020 3:48 PM, Arnd Bergmann wrote:
> On Tue, Jul 14, 2020 at 2:39 PM Horia Geantă <horia.geanta@nxp.com> wrote:
>> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
>> index 8478eb757f3c..98f95a09ce55 100644
>> --- a/drivers/char/hw_random/Kconfig
>> +++ b/drivers/char/hw_random/Kconfig
>> @@ -255,7 +255,7 @@ config HW_RANDOM_MXC_RNGA
>>  config HW_RANDOM_IMX_RNGC
>>         tristate "Freescale i.MX RNGC Random Number Generator"
>>         depends on HAS_IOMEM && HAVE_CLK
>> -       depends on SOC_IMX25 || COMPILE_TEST
>> +       depends on SOC_IMX25 || SOC_IMX6SL || SOC_IMX6SLL || SOC_IMX6UL || COMPILE_TEST
>>         default HW_RANDOM
> 
> Are these the only chips that have it? If other i.MX variations have
> the same block,
> or might have it in the future, maybe just generialize the dependency
> to SOC_IMX6
> or ARCH_IMX?
> 
Fabio also suggested this during v1, see discussion here:
https://lore.kernel.org/linux-crypto/292aafd1-7249-5b76-ccc3-77b153594ef9@nxp.com

The SoC list is relatively stable, to the best of my knowledge.

>> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
>> index 9c47e431ce90..84576d2fbf8c 100644
>> --- a/drivers/char/hw_random/imx-rngc.c
>> +++ b/drivers/char/hw_random/imx-rngc.c
>> @@ -350,6 +350,9 @@ static SIMPLE_DEV_PM_OPS(imx_rngc_pm_ops, imx_rngc_suspend, imx_rngc_resume);
>>
>>  static const struct of_device_id imx_rngc_dt_ids[] = {
>>         { .compatible = "fsl,imx25-rngb", .data = NULL, },
>> +       { .compatible = "fsl,imx6sl-rngb", .data = NULL, },
>> +       { .compatible = "fsl,imx6sll-rngb", .data = NULL, },
>> +       { .compatible = "fsl,imx6ull-rngb", .data = NULL, },
>>         { /* sentinel */ }
> 
> In the .dts file you describe the devices as compatible with fsl,imx25-rngb,
> so this change is not really needed, unless you want to add non-NULL
> .data fields in a follow-up. It is usually a good idea to have the more
> specialized compatible strings in the DT, but the driver change won't
> do anything here.
> 
Indeed, this isn't needed.
Will remove it in v4.

Thanks,
Horia

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs
  2020-07-14 12:39 ` [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs Horia Geantă
@ 2020-07-14 21:09   ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2020-07-14 21:09 UTC (permalink / raw)
  To: Horia Geantă
  Cc: devicetree, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Iuliana Prodan, Martin Kaiser, Silvano Di Ninno, Marco Felsch,
	linux-kernel, Franck Lenormand, Rob Herring, linux-crypto,
	Pengutronix Kernel Team, Matt Mackall, Shawn Guo, Fabio Estevam,
	Sascha Hauer, linux-arm-kernel, NXP Linux Team

On Tue, 14 Jul 2020 15:39:16 +0300, Horia Geantă wrote:
> RNGB block is found in some i.MX6 SoCs - 6SL, 6SLL, 6ULL, 6ULZ.
> Add corresponding compatible strings.
> 
> Note:
> 
> Several NXP SoC from QorIQ family (P1010, P1023, P4080, P3041, P5020)
> also have a RNGB, however it's part of the CAAM
> (Cryptograhic Accelerator and Assurance Module) crypto accelerator.
> In this case, RNGB is managed in the caam driver
> (drivers/crypto/caam/), since it's tightly related to
> the caam "job ring" interface, not to mention CAAM internally relying on
> RNGB as source of randomness.
> 
> On the other hand, the i.MX6 SoCs with RNGB have a DCP
> (Data Co-Processor) crypto accelerator and this block and RNGB
> are independent.
> 
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
> ---
>  Documentation/devicetree/bindings/rng/imx-rng.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-07-14 21:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 12:39 [PATCH v3 0/5] hwrng: add support for i.MX6 rngb Horia Geantă
2020-07-14 12:39 ` [PATCH v3 1/5] dt-bindings: rng: add RNGB compatibles for i.MX6 SoCs Horia Geantă
2020-07-14 21:09   ` Rob Herring
2020-07-14 12:39 ` [PATCH v3 2/5] ARM: dts: imx6sl: fix rng node Horia Geantă
2020-07-14 12:39 ` [PATCH v3 3/5] ARM: dts: imx6sll: add rng Horia Geantă
2020-07-14 12:39 ` [PATCH v3 4/5] ARM: dts: imx6ull: " Horia Geantă
2020-07-14 12:39 ` [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6 Horia Geantă
2020-07-14 12:47   ` Arnd Bergmann
2020-07-14 14:27     ` Horia Geantă
2020-07-14 12:48   ` Fabio Estevam

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).