linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support
@ 2014-11-19 16:07 Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 1/4] hwrng: atmel: use clk_prepapre_enable/_disable_unprepare Boris Brezillon
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

This series adds DT support for the TRNG (True Random Generator) block and
adds missing trng nodes to dtsi files.

Best Regards,

Boris


Boris Brezillon (4):
  hwrng: atmel: use clk_prepapre_enable/_disable_unprepare
  hwrng: atmel: add DT support
  hwrng: atmel: Add TRNG DT binding doc
  ARM: at91/dt: add trng node

 Documentation/devicetree/bindings/hwrng/atmel-trng.txt | 16 ++++++++++++++++
 arch/arm/boot/dts/at91sam9g45.dtsi                     |  7 +++++++
 drivers/char/hw_random/Kconfig                         |  2 +-
 drivers/char/hw_random/atmel-rng.c                     | 15 +++++++++++----
 4 files changed, 35 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwrng/atmel-trng.txt

-- 
1.9.1

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

* [PATCH RESEND 1/4] hwrng: atmel: use clk_prepapre_enable/_disable_unprepare
  2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
@ 2014-11-19 16:07 ` Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 2/4] hwrng: atmel: add DT support Boris Brezillon
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare_enable/_disable_unprepare instead of clk_enable/disable
to work properly with the CCF.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/char/hw_random/atmel-rng.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 851bc7e..644ec48 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -67,7 +67,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
 	if (IS_ERR(trng->clk))
 		return PTR_ERR(trng->clk);
 
-	ret = clk_enable(trng->clk);
+	ret = clk_prepare_enable(trng->clk);
 	if (ret)
 		return ret;
 
@@ -95,7 +95,7 @@ static int atmel_trng_remove(struct platform_device *pdev)
 	hwrng_unregister(&trng->rng);
 
 	writel(TRNG_KEY, trng->base + TRNG_CR);
-	clk_disable(trng->clk);
+	clk_disable_unprepare(trng->clk);
 
 	return 0;
 }
@@ -105,7 +105,7 @@ static int atmel_trng_suspend(struct device *dev)
 {
 	struct atmel_trng *trng = dev_get_drvdata(dev);
 
-	clk_disable(trng->clk);
+	clk_disable_unprepare(trng->clk);
 
 	return 0;
 }
@@ -114,7 +114,7 @@ static int atmel_trng_resume(struct device *dev)
 {
 	struct atmel_trng *trng = dev_get_drvdata(dev);
 
-	return clk_enable(trng->clk);
+	return clk_prepare_enable(trng->clk);
 }
 
 static const struct dev_pm_ops atmel_trng_pm_ops = {
-- 
1.9.1

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

* [PATCH RESEND 2/4] hwrng: atmel: add DT support
  2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 1/4] hwrng: atmel: use clk_prepapre_enable/_disable_unprepare Boris Brezillon
@ 2014-11-19 16:07 ` Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 3/4] hwrng: atmel: Add TRNG DT binding doc Boris Brezillon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Add DT support.

Make the driver depend on CONFIG_OF as at91sam9g45 was the only SoC making
use of the TRNG block and this SoC is now fully migrated to DT.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/char/hw_random/Kconfig     | 2 +-
 drivers/char/hw_random/atmel-rng.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 836b061..a0f5500 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -64,7 +64,7 @@ config HW_RANDOM_AMD
 
 config HW_RANDOM_ATMEL
 	tristate "Atmel Random Number Generator support"
-	depends on ARCH_AT91 && HAVE_CLK
+	depends on ARCH_AT91 && HAVE_CLK && OF
 	default HW_RANDOM
 	---help---
 	  This driver provides kernel-side support for the Random Number
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 644ec48..0bb0b21 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -123,6 +123,12 @@ static const struct dev_pm_ops atmel_trng_pm_ops = {
 };
 #endif /* CONFIG_PM */
 
+static const struct of_device_id atmel_trng_dt_ids[] = {
+	{ .compatible = "atmel,at91sam9g45-trng" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, atmel_trng_dt_ids);
+
 static struct platform_driver atmel_trng_driver = {
 	.probe		= atmel_trng_probe,
 	.remove		= atmel_trng_remove,
@@ -132,6 +138,7 @@ static struct platform_driver atmel_trng_driver = {
 #ifdef CONFIG_PM
 		.pm	= &atmel_trng_pm_ops,
 #endif /* CONFIG_PM */
+		.of_match_table = atmel_trng_dt_ids,
 	},
 };
 
-- 
1.9.1

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

* [PATCH RESEND 3/4] hwrng: atmel: Add TRNG DT binding doc
  2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 1/4] hwrng: atmel: use clk_prepapre_enable/_disable_unprepare Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 2/4] hwrng: atmel: add DT support Boris Brezillon
@ 2014-11-19 16:07 ` Boris Brezillon
  2014-11-19 16:07 ` [PATCH RESEND 4/4] ARM: at91/dt: add trng node Boris Brezillon
  2014-11-19 16:15 ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Nicolas Ferre
  4 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Document DT bindings of Atmel's TRNG (True Random Number Generator) IP.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 Documentation/devicetree/bindings/hwrng/atmel-trng.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwrng/atmel-trng.txt

diff --git a/Documentation/devicetree/bindings/hwrng/atmel-trng.txt b/Documentation/devicetree/bindings/hwrng/atmel-trng.txt
new file mode 100644
index 0000000..4ac5aaa
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwrng/atmel-trng.txt
@@ -0,0 +1,16 @@
+Atmel TRNG (True Random Number Generator) block
+
+Required properties:
+- compatible : Should be "atmel,at91sam9g45-trng"
+- reg : Offset and length of the register set of this block
+- interrupts : the interrupt number for the TRNG block
+- clocks: should contain the TRNG clk source
+
+Example:
+
+trng at fffcc000 {
+	compatible = "atmel,at91sam9g45-trng";
+	reg = <0xfffcc000 0x4000>;
+	interrupts = <6 IRQ_TYPE_LEVEL_HIGH 0>;
+	clocks = <&trng_clk>;
+};
-- 
1.9.1

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

* [PATCH RESEND 4/4] ARM: at91/dt: add trng node
  2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
                   ` (2 preceding siblings ...)
  2014-11-19 16:07 ` [PATCH RESEND 3/4] hwrng: atmel: Add TRNG DT binding doc Boris Brezillon
@ 2014-11-19 16:07 ` Boris Brezillon
  2014-11-19 16:15 ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Nicolas Ferre
  4 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Add a DT node for the TRNG (True Random Number Generator) block.

Keep this block enabled as it does not depend on any external connection,
and thus should be available on all boards.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/boot/dts/at91sam9g45.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 932a669..790c890 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -934,6 +934,13 @@
 				status = "disabled";
 			};
 
+			trng at fffcc000 {
+				compatible = "atmel,at91sam9g45-trng";
+				reg = <0xfffcc000 0x4000>;
+				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 0>;
+				clocks = <&trng_clk>;
+			};
+
 			i2c0: i2c at fff84000 {
 				compatible = "atmel,at91sam9g10-i2c";
 				reg = <0xfff84000 0x100>;
-- 
1.9.1

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

* [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support
  2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
                   ` (3 preceding siblings ...)
  2014-11-19 16:07 ` [PATCH RESEND 4/4] ARM: at91/dt: add trng node Boris Brezillon
@ 2014-11-19 16:15 ` Nicolas Ferre
  2014-11-19 16:18   ` [PATCH RESEND 0/4] hrng: atmel: add DT support Boris Brezillon
  2014-11-20  4:05   ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Herbert Xu
  4 siblings, 2 replies; 10+ messages in thread
From: Nicolas Ferre @ 2014-11-19 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 19/11/2014 17:07, Boris Brezillon :
> Hello,
> 
> This series adds DT support for the TRNG (True Random Generator) block and
> adds missing trng nodes to dtsi files.

Nitpicking: subject of this cover letter seems not good ;-)

Herbert, do you think you can take this series yourself or do I have to
take it?

Bye,

> Boris Brezillon (4):
>   hwrng: atmel: use clk_prepapre_enable/_disable_unprepare
>   hwrng: atmel: add DT support
>   hwrng: atmel: Add TRNG DT binding doc
>   ARM: at91/dt: add trng node
> 
>  Documentation/devicetree/bindings/hwrng/atmel-trng.txt | 16 ++++++++++++++++
>  arch/arm/boot/dts/at91sam9g45.dtsi                     |  7 +++++++
>  drivers/char/hw_random/Kconfig                         |  2 +-
>  drivers/char/hw_random/atmel-rng.c                     | 15 +++++++++++----
>  4 files changed, 35 insertions(+), 5 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/hwrng/atmel-trng.txt
> 


-- 
Nicolas Ferre

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

* [PATCH RESEND 0/4] hrng: atmel: add DT support
  2014-11-19 16:15 ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Nicolas Ferre
@ 2014-11-19 16:18   ` Boris Brezillon
  2014-11-19 17:35     ` Nicolas Ferre
  2014-11-20  4:05   ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Herbert Xu
  1 sibling, 1 reply; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 16:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 19 Nov 2014 17:15:47 +0100
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:

> On 19/11/2014 17:07, Boris Brezillon :
> > Hello,
> > 
> > This series adds DT support for the TRNG (True Random Generator) block and
> > adds missing trng nodes to dtsi files.
> 
> Nitpicking: subject of this cover letter seems not good ;-)

Sorry, you should read:

"hrng: atmel: add DT support"

> 
> Herbert, do you think you can take this series yourself or do I have to
> take it?
> 
> Bye,
> 
> > Boris Brezillon (4):
> >   hwrng: atmel: use clk_prepapre_enable/_disable_unprepare
> >   hwrng: atmel: add DT support
> >   hwrng: atmel: Add TRNG DT binding doc
> >   ARM: at91/dt: add trng node
> > 
> >  Documentation/devicetree/bindings/hwrng/atmel-trng.txt | 16 ++++++++++++++++
> >  arch/arm/boot/dts/at91sam9g45.dtsi                     |  7 +++++++
> >  drivers/char/hw_random/Kconfig                         |  2 +-
> >  drivers/char/hw_random/atmel-rng.c                     | 15 +++++++++++----
> >  4 files changed, 35 insertions(+), 5 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/hwrng/atmel-trng.txt
> > 
> 
> 



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [PATCH RESEND 0/4] hrng: atmel: add DT support
  2014-11-19 16:18   ` [PATCH RESEND 0/4] hrng: atmel: add DT support Boris Brezillon
@ 2014-11-19 17:35     ` Nicolas Ferre
  2014-11-19 17:39       ` Boris Brezillon
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Ferre @ 2014-11-19 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 19/11/2014 17:18, Boris Brezillon :
> On Wed, 19 Nov 2014 17:15:47 +0100
> Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> 
>> On 19/11/2014 17:07, Boris Brezillon :
>>> Hello,
>>>
>>> This series adds DT support for the TRNG (True Random Generator) block and
>>> adds missing trng nodes to dtsi files.
>>
>> Nitpicking: subject of this cover letter seems not good ;-)
> 
> Sorry, you should read:
> 
> "hrng: atmel: add DT support"

Yep

>> Herbert, do you think you can take this series yourself or do I have to
>> take it?

Oh, and BTW some "Acked-by" tags from Peter are missing, did forget them
or changed something?

>> Bye,
>>
>>> Boris Brezillon (4):
>>>   hwrng: atmel: use clk_prepapre_enable/_disable_unprepare
>>>   hwrng: atmel: add DT support
>>>   hwrng: atmel: Add TRNG DT binding doc
>>>   ARM: at91/dt: add trng node
>>>
>>>  Documentation/devicetree/bindings/hwrng/atmel-trng.txt | 16 ++++++++++++++++
>>>  arch/arm/boot/dts/at91sam9g45.dtsi                     |  7 +++++++
>>>  drivers/char/hw_random/Kconfig                         |  2 +-
>>>  drivers/char/hw_random/atmel-rng.c                     | 15 +++++++++++----
>>>  4 files changed, 35 insertions(+), 5 deletions(-)
>>>  create mode 100644 Documentation/devicetree/bindings/hwrng/atmel-trng.txt
>>>
>>
>>
> 
> 
> 


-- 
Nicolas Ferre

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

* [PATCH RESEND 0/4] hrng: atmel: add DT support
  2014-11-19 17:35     ` Nicolas Ferre
@ 2014-11-19 17:39       ` Boris Brezillon
  0 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2014-11-19 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 19 Nov 2014 18:35:56 +0100
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:

> On 19/11/2014 17:18, Boris Brezillon :
> > On Wed, 19 Nov 2014 17:15:47 +0100
> > Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> > 
> >> On 19/11/2014 17:07, Boris Brezillon :
> >>> Hello,
> >>>
> >>> This series adds DT support for the TRNG (True Random Generator) block and
> >>> adds missing trng nodes to dtsi files.
> >>
> >> Nitpicking: subject of this cover letter seems not good ;-)
> > 
> > Sorry, you should read:
> > 
> > "hrng: atmel: add DT support"
> 
> Yep
> 
> >> Herbert, do you think you can take this series yourself or do I have to
> >> take it?
> 
> Oh, and BTW some "Acked-by" tags from Peter are missing, did forget them
> or changed something?

Indeed, I forgot some of them (and nothing changed BTW).

Do you want me to resend this series with the proper title and the
missing Acked-by tags ?

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support
  2014-11-19 16:15 ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Nicolas Ferre
  2014-11-19 16:18   ` [PATCH RESEND 0/4] hrng: atmel: add DT support Boris Brezillon
@ 2014-11-20  4:05   ` Herbert Xu
  1 sibling, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2014-11-20  4:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 19, 2014 at 05:15:47PM +0100, Nicolas Ferre wrote:
> On 19/11/2014 17:07, Boris Brezillon :
> > Hello,
> > 
> > This series adds DT support for the TRNG (True Random Generator) block and
> > adds missing trng nodes to dtsi files.
> 
> Nitpicking: subject of this cover letter seems not good ;-)
> 
> Herbert, do you think you can take this series yourself or do I have to
> take it?

Sure I can take this.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2014-11-20  4:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 16:07 [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Boris Brezillon
2014-11-19 16:07 ` [PATCH RESEND 1/4] hwrng: atmel: use clk_prepapre_enable/_disable_unprepare Boris Brezillon
2014-11-19 16:07 ` [PATCH RESEND 2/4] hwrng: atmel: add DT support Boris Brezillon
2014-11-19 16:07 ` [PATCH RESEND 3/4] hwrng: atmel: Add TRNG DT binding doc Boris Brezillon
2014-11-19 16:07 ` [PATCH RESEND 4/4] ARM: at91/dt: add trng node Boris Brezillon
2014-11-19 16:15 ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Nicolas Ferre
2014-11-19 16:18   ` [PATCH RESEND 0/4] hrng: atmel: add DT support Boris Brezillon
2014-11-19 17:35     ` Nicolas Ferre
2014-11-19 17:39       ` Boris Brezillon
2014-11-20  4:05   ` [PATCH RESEND 0/4] ARM: at91: remove at91sam9g45/9m10 legacy board support Herbert Xu

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