Skip to contentSkip to conversation

hw_random: bcm2835: Add support for Broadcom BCM5301x

PATCH New Florian Fainelli 3 participants 9 messages Jun 23, 2016 – Jun 27, 2016

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

cover hw_random: bcm2835: Add support for Broadcom BCM5301x

Hi all,

This patch series adds support for the Broadcom BCM5301x SoCs random number generator which is the same block as the one found in NSP and BCM2835.

Florian Fainelli (3):
Documentation: devicetree: bindings: Add BCM5301x binding
hw_random: bcm2835: Add support for Broadcom BCM5301x
ARM: dts: BCM5301x: Add RNG Device Tree node

 Documentation/devicetree/bindings/rng/brcm,bcm2835.txt | 3 ++-
 arch/arm/boot/dts/bcm5301x.dtsi                        | 5 +++++
 drivers/char/hw_random/Kconfig                         | 2 +-
 drivers/char/hw_random/bcm2835-rng.c                   | 1 +
 4 files changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 Documentation: devicetree: bindings: Add BCM5301x binding

Document the binding used by the Broadcom BCM5301x (Northstar) SoC random number generator.

---
 Documentation/devicetree/bindings/rng/brcm,bcm2835.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/rng/brcm,bcm2835.txt +2 -1
index aa304d412058..26542690b578 100644
@@ -2,7 +2,8 @@ BCM2835 Random number generator
 
 Required properties:
 
-- compatible : should be "brcm,bcm2835-rng"  or "brcm,bcm-nsp-rng"
+- compatible : should be "brcm,bcm2835-rng"  or "brcm,bcm-nsp-rng" or
+  "brcm,bcm5301x-rng"
 - reg : Specifies base physical address and size of the registers.
 
 Example:
Signature · 1 line
2.7.4
maintainer
#2 lore raw

PATCH 1/3 Documentation: devicetree: bindings: Add BCM5301x binding

Quoted 4 lines · Florian Fainelli

Document the binding used by the Broadcom BCM5301x (Northstar) SoC random number generator.

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
#3 lore raw

PATCH 2/3 hw_random: bcm2835: Add support for Broadcom BCM5301x

In reply to Florian Fainelli

The Broadcom BCM5301x SoCs (Northstar) utilize the same random number generator peripheral as Northstar Plus and BCM2835, but just like the NSP SoC, we need to enable the interrupt.

---
 drivers/char/hw_random/Kconfig       | 2 +-
 drivers/char/hw_random/bcm2835-rng.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/char/hw_random/Kconfig +1 -1
index 51401100466b..56ad5a5936a9 100644
@@ -90,7 +90,7 @@ config HW_RANDOM_BCM63XX
 
 config HW_RANDOM_BCM2835
 	tristate "Broadcom BCM2835 Random Number Generator support"
-	depends on ARCH_BCM2835 || ARCH_BCM_NSP
+	depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X
 	default HW_RANDOM
 	---help---
 	  This driver provides kernel-side support for the Random Number
drivers/char/hw_random/bcm2835-rng.c +1 -0
index 75ca820730be..af2149273fe0 100644
@@ -70,6 +70,7 @@ static struct hwrng bcm2835_rng_ops = {
 static const struct of_device_id bcm2835_rng_of_match[] = {
 	{ .compatible = "brcm,bcm2835-rng"},
 	{ .compatible = "brcm,bcm-nsp-rng", .data = nsp_rng_init},
+	{ .compatible = "brcm,bcm5301x-rng", .data = nsp_rng_init},
 	{},
 };
 
Signature · 1 line
2.7.4
maintainer
#4 lore raw

PATCH 2/3 hw_random: bcm2835: Add support for Broadcom BCM5301x

Quoted 5 lines · Florian Fainelli

The Broadcom BCM5301x SoCs (Northstar) utilize the same random number generator peripheral as Northstar Plus and BCM2835, but just like the NSP SoC, we need to enable the interrupt.

Patch applied.

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
#5 lore raw

PATCH 2/3 hw_random: bcm2835: Add support for Broadcom BCM5301x

Quoted 9 lines · Herbert Xu
Quoted 5 lines · Florian Fainelli

The Broadcom BCM5301x SoCs (Northstar) utilize the same random number generator peripheral as Northstar Plus and BCM2835, but just like the NSP SoC, we need to enable the interrupt.

Patch applied.

Thanks! Do you mind taking patch 1 as well? I will take patch 3 via my arm-soc tree.

Signature · 1 line
Florian
#6 lore raw

PATCH 3/3 ARM: dts: BCM5301x: Add RNG Device Tree node

In reply to Florian Fainelli

Add the DT node for the random number generator peripheral.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +5 -0
index 7d4d29bf0ed3..c67e451435f4 100644
@@ -260,6 +260,11 @@
 				     "sata2";
 	};
 
+	rng: rng at 18004000 {
+		compatible = "brcm,bcm5301x-rng";
+		reg = <0x18004000 0x14>;
+	};
+
 	nand: nand at 18028000 {
 		compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
 		reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
Signature · 1 line
2.7.4
#8 lore raw

cover hw_random: bcm2835: Add support for Broadcom BCM5301x

In reply to Florian Fainelli

Patch series looks good.

Quoted 16 lines · Florian Fainelli

Hi all,

This patch series adds support for the Broadcom BCM5301x SoCs random number generator which is the same block as the one found in NSP and BCM2835.

Florian Fainelli (3):
Documentation: devicetree: bindings: Add BCM5301x binding
hw_random: bcm2835: Add support for Broadcom BCM5301x
ARM: dts: BCM5301x: Add RNG Device Tree node

  Documentation/devicetree/bindings/rng/brcm,bcm2835.txt | 3 ++-
  arch/arm/boot/dts/bcm5301x.dtsi                        | 5 +++++
  drivers/char/hw_random/Kconfig                         | 2 +-
  drivers/char/hw_random/bcm2835-rng.c                   | 1 +
  4 files changed, 9 insertions(+), 2 deletions(-)