mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] TXx9: Add TX4939 RNG support (v2)
@ 2009-06-02 14:54 Atsushi Nemoto
  2009-06-03  9:44 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Atsushi Nemoto @ 2009-06-02 14:54 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf, herbert, mpm, linux-kernel

Add platform support for RNG of TX4939 SoC.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Changes since v1:
* Move TX4939_RNG_REG definition to tx4939.h

 arch/mips/include/asm/txx9/tx4939.h   |    3 +++
 arch/mips/txx9/generic/setup_tx4939.c |   17 +++++++++++++++++
 arch/mips/txx9/rbtx4939/setup.c       |    1 +
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/txx9/tx4939.h b/arch/mips/include/asm/txx9/tx4939.h
index 050364d..d4f342c 100644
--- a/arch/mips/include/asm/txx9/tx4939.h
+++ b/arch/mips/include/asm/txx9/tx4939.h
@@ -45,6 +45,8 @@
 #define TX4939_RTC_REG		(TX4939_REG_BASE + 0xfb00)
 #define TX4939_CIR_REG		(TX4939_REG_BASE + 0xfc00)
 
+#define TX4939_RNG_REG		(TX4939_CRYPTO_REG + 0xb0)
+
 struct tx4939_le_reg {
 	__u32 r;
 	__u32 unused;
@@ -547,5 +549,6 @@ void tx4939_ndfmc_init(unsigned int hold, unsigned int spw,
 void tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1);
 void tx4939_aclc_init(void);
 void tx4939_sramc_init(void);
+void tx4939_rng_init(void);
 
 #endif /* __ASM_TXX9_TX4939_H */
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index df13a89..3dc19f4 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -500,6 +500,23 @@ void __init tx4939_sramc_init(void)
 		txx9_sramc_init(&tx4939_sram_resource);
 }
 
+void __init tx4939_rng_init(void)
+{
+	static struct resource res = {
+		.start = TX4939_RNG_REG & 0xfffffffffULL,
+		.end = (TX4939_RNG_REG & 0xfffffffffULL) + 0x30 - 1,
+		.flags = IORESOURCE_MEM,
+	};
+	static struct platform_device pdev = {
+		.name = "tx4939-rng",
+		.id = -1,
+		.num_resources = 1,
+		.resource = &res,
+	};
+
+	platform_device_register(&pdev);
+}
+
 static void __init tx4939_stop_unused_modules(void)
 {
 	__u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index b919696..c033ffe 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -502,6 +502,7 @@ static void __init rbtx4939_device_init(void)
 	tx4939_aclc_init();
 	platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
 	tx4939_sramc_init();
+	tx4939_rng_init();
 }
 
 static void __init rbtx4939_setup(void)
-- 
1.5.6.5


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

* Re: [PATCH] TXx9: Add TX4939 RNG support (v2)
  2009-06-02 14:54 [PATCH] TXx9: Add TX4939 RNG support (v2) Atsushi Nemoto
@ 2009-06-03  9:44 ` Herbert Xu
  2009-06-03 10:03   ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2009-06-03  9:44 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips, ralf, mpm, linux-kernel

On Tue, Jun 02, 2009 at 11:54:22PM +0900, Atsushi Nemoto wrote:
> Add platform support for RNG of TX4939 SoC.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Aha, I knew I should have left Ralf take the patch, and this is
the reason :)

Rather than having the patches split between the two of us, I'll
back out the RNG patch from my tree so both of them can go through
Ralf's MIPS tree.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <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] 4+ messages in thread

* Re: [PATCH] TXx9: Add TX4939 RNG support (v2)
  2009-06-03  9:44 ` Herbert Xu
@ 2009-06-03 10:03   ` Ralf Baechle
  2009-06-03 10:04     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2009-06-03 10:03 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Atsushi Nemoto, linux-mips, mpm, linux-kernel

On Wed, Jun 03, 2009 at 07:44:54PM +1000, Herbert Xu wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Wed, 3 Jun 2009 19:44:54 +1000
> To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, mpm@selenic.com,
> 	linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] TXx9: Add TX4939 RNG support (v2)
> Content-Type: text/plain; charset=us-ascii
> 
> On Tue, Jun 02, 2009 at 11:54:22PM +0900, Atsushi Nemoto wrote:
> > Add platform support for RNG of TX4939 SoC.
> > 
> > Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> 
> Aha, I knew I should have left Ralf take the patch, and this is
> the reason :)
> 
> Rather than having the patches split between the two of us, I'll
> back out the RNG patch from my tree so both of them can go through
> Ralf's MIPS tree.

Ah, got this email just in time before actually dropping the patch as I
said in the other mail so I won't drop it.

Confusion`R`Us ;-)

  Ralf

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

* Re: [PATCH] TXx9: Add TX4939 RNG support (v2)
  2009-06-03 10:03   ` Ralf Baechle
@ 2009-06-03 10:04     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2009-06-03 10:04 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Atsushi Nemoto, linux-mips, mpm, linux-kernel

On Wed, Jun 03, 2009 at 11:03:35AM +0100, Ralf Baechle wrote:
> 
> Ah, got this email just in time before actually dropping the patch as I
> said in the other mail so I won't drop it.
> 
> Confusion`R`Us ;-)

Heh, I should stop replying emails too quickly.  Let's make this
the final agreement.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <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] 4+ messages in thread

end of thread, other threads:[~2009-06-03 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 14:54 [PATCH] TXx9: Add TX4939 RNG support (v2) Atsushi Nemoto
2009-06-03  9:44 ` Herbert Xu
2009-06-03 10:03   ` Ralf Baechle
2009-06-03 10:04     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®