2016-06-23 00:27:13

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
2.7.4


2016-06-23 00:27:13

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 1/3] Documentation: devicetree: bindings: Add BCM5301x binding

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

Signed-off-by: Florian Fainelli <[email protected]>
---
Documentation/devicetree/bindings/rng/brcm,bcm2835.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm2835.txt b/Documentation/devicetree/bindings/rng/brcm,bcm2835.txt
index aa304d412058..26542690b578 100644
--- a/Documentation/devicetree/bindings/rng/brcm,bcm2835.txt
+++ b/Documentation/devicetree/bindings/rng/brcm,bcm2835.txt
@@ -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:
--
2.7.4

2016-06-23 00:27:15

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 2/3] hw_random: bcm2835: Add support for Broadcom BCM5301x

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.

Signed-off-by: Florian Fainelli <[email protected]>
---
drivers/char/hw_random/Kconfig | 2 +-
drivers/char/hw_random/bcm2835-rng.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 51401100466b..56ad5a5936a9 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -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
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index 75ca820730be..af2149273fe0 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -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},
{},
};

--
2.7.4

2016-06-23 00:27:16

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: BCM5301x: Add RNG Device Tree node

Add the DT node for the random number generator peripheral.

Signed-off-by: Florian Fainelli <[email protected]>
---
arch/arm/boot/dts/bcm5301x.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
index 7d4d29bf0ed3..c67e451435f4 100644
--- a/arch/arm/boot/dts/bcm5301x.dtsi
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -260,6 +260,11 @@
"sata2";
};

+ rng: rng@18004000 {
+ compatible = "brcm,bcm5301x-rng";
+ reg = <0x18004000 0x14>;
+ };
+
nand: nand@18028000 {
compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
--
2.7.4

2016-06-23 00:55:17

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH 0/3] hw_random: bcm2835: Add support for Broadcom BCM5301x

Patch series looks good.

Acked-by: Scott Branden <[email protected]>

On 16-06-22 05:27 PM, Florian Fainelli wrote:
> 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(-)
>

2016-06-24 13:31:41

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 2/3] hw_random: bcm2835: Add support for Broadcom BCM5301x

On Wed, Jun 22, 2016 at 05:27:02PM -0700, Florian Fainelli wrote:
> 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.
>
> Signed-off-by: Florian Fainelli <[email protected]>

Patch applied.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2016-06-24 17:30:49

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 2/3] hw_random: bcm2835: Add support for Broadcom BCM5301x

On 06/24/2016 06:31 AM, Herbert Xu wrote:
> On Wed, Jun 22, 2016 at 05:27:02PM -0700, Florian Fainelli wrote:
>> 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.
>>
>> Signed-off-by: Florian Fainelli <[email protected]>
>
> Patch applied.
>

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

2016-06-27 09:04:48

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 1/3] Documentation: devicetree: bindings: Add BCM5301x binding

On Wed, Jun 22, 2016 at 05:27:01PM -0700, Florian Fainelli wrote:
> Document the binding used by the Broadcom BCM5301x (Northstar) SoC
> random number generator.
>
> Signed-off-by: Florian Fainelli <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2016-06-27 18:21:50

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 3/3] ARM: dts: BCM5301x: Add RNG Device Tree node

On 06/22/2016 05:27 PM, Florian Fainelli wrote:
> Add the DT node for the random number generator peripheral.
>
> Signed-off-by: Florian Fainelli <[email protected]>

Applied
--
Florian