Skip to contentSkip to conversation

ARM: AM33xx: Add RNG Moudle data

PATCH RESEND New Lokesh Vutla 5 participants 11 messages Aug 29, 2013 – Oct 29, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: AM33xx: Add RNG Moudle data

This Patch series adds HWMOD data and DT data for RNG module.

Reposting these patches as suggested by Paul Walmsley.
http://www.spinics.net/lists/arm-kernel/msg270678.html
Both these patches should go together because after adding Patch 1/2, hwmod wouldn't find the register iospace and crash, and thats added only in dt.

Lokesh Vutla (2):
ARM: dts: AM33xx: Add RNG node
ARM: AM33xx: hwmod: Add RNG module data

 .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++
 arch/arm/boot/dts/am33xx.dtsi                      |    7 ++++
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c         |   36 ++++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

 .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
 arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
 2 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+		Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+	compatible = "ti,omap4-rng";
+	ti,hwmods = "rng";
+	reg = <0x48310000 0x2000>;
+	interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +7 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
 			#size-cells = <1>;
 			status = "disabled";
 		};
+
+		rng: rng at 48310000 {
+			compatible = "ti,omap4-rng";
+			ti,hwmods = "rng";
+			reg = <0x48310000 0x2000>;
+			interrupts = <111>;
+		};
 	};
 };
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

Hi Benoit,

Quoted 3 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

Seems you missed this patch. Please consider this for this merge window. Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh

Quoted 58 lines

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

 .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
 arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
 2 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+		Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+	compatible = "ti,omap4-rng";
+	ti,hwmods = "rng";
+	reg = <0x48310000 0x2000>;
+	interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +7 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
 			#size-cells = <1>;
 			status = "disabled";
 		};
+
+		rng: rng at 48310000 {
+			compatible = "ti,omap4-rng";
+			ti,hwmods = "rng";
+			reg = <0x48310000 0x2000>;
+			interrupts = <111>;
+		};
 	};
 };
maintainer
#3 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

Quoted 3 lines · Lokesh Vutla

Seems you missed this patch. Please consider this for this merge window. Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

That won't happen since this patch from Suman got merged:

http://www.mail-archive.com/linux-omap at vger.kernel.org/msg96447.html

- Paul

#4 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

In reply to Lokesh Vutla

Hi Lokesh,

Quoted 6 lines · Lokesh Vutla

Hi Benoit,

Quoted 3 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

Seems you missed this patch. Please consider this for this merge window.

Indeed I missed it. Sorry :-(

Quoted 16 lines

Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh

Quoted 11 lines

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

  .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
  arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
  2 files changed, 29 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt

I do not see the acked-by for the binding part. You do need that for any new bindings nowadays.

Quoted 39 lines
Quoted 39 lines
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+		Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+	compatible = "ti,omap4-rng";
+	ti,hwmods = "rng";
+	reg = <0x48310000 0x2000>;
+	interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +2 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
  			#size-cells = <1>;
  			status = "disabled";
  		};
+
+		rng: rng at 48310000 {
Quoted 9 lines

arch/arm/boot/dts/am33xx.dtsi line 541

Quoted 8 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+			compatible = "ti,omap4-rng";
+			ti,hwmods = "rng";
+			reg = <0x48310000 0x2000>;
+			interrupts = <111>;
+		};
  	};
  };

It looks good to me, but it does not apply on my branch. Please rebase it and repost with the proper acked-by.

Thanks,
Benoit

Signature · 4 lines
Beno?t Cousson
BayLibre
Embedded Linux Technology Lab
www.baylibre.com
#5 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

Hi Benoit,

Quoted 80 lines · Benoit Cousson

Hi Lokesh,

Quoted 6 lines · Lokesh Vutla

Hi Benoit,

Quoted 3 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

Seems you missed this patch. Please consider this for this merge window.

Indeed I missed it. Sorry :-(

Quoted 16 lines

Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh

Quoted 11 lines

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

  .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
  arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
  2 files changed, 29 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt

I do not see the acked-by for the binding part. You do need that for any new bindings nowadays.

Quoted 39 lines
Quoted 39 lines
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+        Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+    compatible = "ti,omap4-rng";
+    ti,hwmods = "rng";
+    reg = <0x48310000 0x2000>;
+    interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +2 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
              #size-cells = <1>;
              status = "disabled";
          };
+
+        rng: rng at 48310000 {
Quoted 9 lines

arch/arm/boot/dts/am33xx.dtsi line 541

Quoted 8 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+            compatible = "ti,omap4-rng";
+            ti,hwmods = "rng";
+            reg = <0x48310000 0x2000>;
+            interrupts = <111>;
+        };
      };
  };
Quoted 1 line

It looks good to me, but it does not apply on my branch.

Can I take this as your Acked-by: ?
Ok, Ill rebase on top of your tree and post it.

Thanks and Regards,
Lokesh

Quoted 6 lines

Please rebase it and repost with the proper acked-by.

Thanks,
Benoit

#6 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

In reply to Benoit Cousson

+ Rob and Mark

Quoted 8 lines · Benoit Cousson

Hi Lokesh,

Quoted 5 lines · Lokesh Vutla

Hi Benoit,

Quoted 3 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

Can you please review this patch..

Thanks and regards,
Lokesh

Quoted 79 lines
Quoted 1 line

Seems you missed this patch. Please consider this for this merge window.

Indeed I missed it. Sorry :-(

Quoted 16 lines

Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh

Quoted 11 lines

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

  .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
  arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
  2 files changed, 29 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt

I do not see the acked-by for the binding part. You do need that for any new bindings nowadays.

Quoted 39 lines
Quoted 39 lines
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+        Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+    compatible = "ti,omap4-rng";
+    ti,hwmods = "rng";
+    reg = <0x48310000 0x2000>;
+    interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +2 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
              #size-cells = <1>;
              status = "disabled";
          };
+
+        rng: rng at 48310000 {
Quoted 9 lines

arch/arm/boot/dts/am33xx.dtsi line 541

Quoted 8 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+            compatible = "ti,omap4-rng";
+            ti,hwmods = "rng";
+            reg = <0x48310000 0x2000>;
+            interrupts = <111>;
+        };
      };
  };

It looks good to me, but it does not apply on my branch. Please rebase it and repost with the proper acked-by.

Thanks,
Benoit

maintainer
#7 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

Quoted 11 lines · Lokesh Vutla

+ Rob and Mark

Quoted 8 lines · Benoit Cousson

Hi Lokesh,

Quoted 5 lines · Lokesh Vutla

Hi Benoit,

Quoted 3 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

Can you please review this patch..

OK enough of waiting here, I'm picking this patch into omap-for-v3.13/dt branch as it removes some boot time warnings we're seeing.

Regards,

Tony

Quoted 82 lines

Thanks and regards,
Lokesh

Quoted 79 lines
Quoted 1 line

Seems you missed this patch. Please consider this for this merge window.

Indeed I missed it. Sorry :-(

Quoted 16 lines

Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh

Quoted 11 lines

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

  .../devicetree/bindings/hwrng/omap_rng.txt         |   22 ++++++++++++++++++++
  arch/arm/boot/dts/am33xx.dtsi                      |    7 +++++++
  2 files changed, 29 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt

I do not see the acked-by for the binding part. You do need that for any new bindings nowadays.

Quoted 39 lines
Quoted 39 lines
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +22 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.
+        Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+    compatible = "ti,omap4-rng";
+    ti,hwmods = "rng";
+    reg = <0x48310000 0x2000>;
+    interrupts = <111>;
+};
arch/arm/boot/dts/am33xx.dtsi +2 -0
index 38b446b..26ebe30 100644
@@ -530,5 +530,12 @@
              #size-cells = <1>;
              status = "disabled";
          };
+
+        rng: rng at 48310000 {
Quoted 9 lines

arch/arm/boot/dts/am33xx.dtsi line 541

Quoted 8 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+            compatible = "ti,omap4-rng";
+            ti,hwmods = "rng";
+            reg = <0x48310000 0x2000>;
+            interrupts = <111>;
+        };
      };
  };

It looks good to me, but it does not apply on my branch. Please rebase it and repost with the proper acked-by.

Thanks,
Benoit

#8 lore raw

PATCH RESEND v2 1/2 ARM: dts: AM33xx: Add RNG node

In reply to Lokesh Vutla
Quoted 33 lines · Lokesh Vutla

Add the AM33xx RNG module's device tree data.
Also add Documentation file describing the data
for the RNG module.

---
Changes since V1:
- Drop "status=disabled" entry in dt node, Since
RNG is present on all AM33xx platforms.

.../devicetree/bindings/hwrng/omap_rng.txt | 22 ++++++++++++++++++++
arch/arm/boot/dts/am33xx.dtsi | 7 +++++++

2 files changed, 29 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt

Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +12 -0
new file mode 100644
index 0000000..6a62acd
@@ -0,0 +1,22 @@
+OMAP SoC HWRNG Module
+
+Required properties:
+
+- compatible : Should contain entries for this and backward compatible
+  RNG versions:
+  - "ti,omap2-rng" for OMAP2.
+  - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
+  Note that these two versions are incompatible.
+- ti,hwmods: Name of the hwmod associated with the RNG module
+- reg : Offset and length of the register set for the module
+- interrupts : the interrupt number for the RNG module.

Documentation/devicetree/bindings/hwrng/omap_rng.txt line 22

Quoted 10 lines
Documentation/devicetree/bindings/hwrng/omap_rng.txt new file +10 -0
+		Only used for "ti,omap4-rng".
+
+Example:
+/* AM335x */
+rng: rng at 48310000 {
+	compatible = "ti,omap4-rng";
+	ti,hwmods = "rng";
+	reg = <0x48310000 0x2000>;
+	interrupts = <111>;
+};

For the DT-Binding portion:

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
#9 lore raw

PATCH RESEND v2 2/2 ARM: AM33xx: hwmod: Add RNG module data

In reply to Lokesh Vutla

Add RNG hwmod data for AM33xx SoC.

---
* Made am33xx_l4_per__rng structure as static to fix sparse warning

 arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   36 ++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +36 -0
index 215894f..3e32f45 100644
@@ -2480,6 +2480,41 @@ static struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* rng */
+static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
+	.rev_offs	= 0x1fe0,
+	.sysc_offs	= 0x1fe4,
+	.sysc_flags	= SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
+	.idlemodes	= SIDLE_FORCE | SIDLE_NO,
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class am33xx_rng_hwmod_class = {
+	.name		= "rng",
+	.sysc		= &am33xx_rng_sysc,
+};
+
+static struct omap_hwmod am33xx_rng_hwmod = {
+	.name		= "rng",
+	.class		= &am33xx_rng_hwmod_class,
+	.clkdm_name	= "l4ls_clkdm",
+	.flags		= HWMOD_SWSUP_SIDLE,
+	.main_clk	= "rng_fck",
+	.prcm		= {
+		.omap4	= {
+			.clkctrl_offs	= AM33XX_CM_PER_RNG_CLKCTRL_OFFSET,
+			.modulemode	= MODULEMODE_SWCTRL,
+		},
+	},
+};
+
+static struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
+	.master		= &am33xx_l4_ls_hwmod,
+	.slave		= &am33xx_rng_hwmod,
+	.clk		= "rng_fck",
+	.user		= OCP_USER_MPU,
+};
+
 static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
 	&am33xx_l3_main__emif,
 	&am33xx_mpu__l3_main,
@@ -2559,6 +2594,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
 	&am33xx_cpgmac0__mdio,
 	&am33xx_l3_main__sha0,
 	&am33xx_l3_main__aes0,
+	&am33xx_l4_per__rng,
 	NULL,
 };
 
Signature · 1 line
1.7.9.5