diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-06-02 10:54:22 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-06-17 06:06:27 -0400 |
commit | 923e3819005e60449ed6c9c8a86fd8e5cd9e6d77 (patch) | |
tree | 6771d45baadf1b627bd0c02b693052e516a26fa4 /arch/mips | |
parent | 049a947c611a19523eaaf193f698b897a62d0593 (diff) |
MIPS: TXx9: Add TX4939 RNG support
Add platform support for RNG of TX4939 SoC.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/txx9/tx4939.h | 3 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4939.c | 17 | ||||
-rw-r--r-- | 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 050364d50b79..d4f342cd5939 100644 --- a/arch/mips/include/asm/txx9/tx4939.h +++ b/arch/mips/include/asm/txx9/tx4939.h | |||
@@ -45,6 +45,8 @@ | |||
45 | #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) | 45 | #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) |
46 | #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) | 46 | #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) |
47 | 47 | ||
48 | #define TX4939_RNG_REG (TX4939_CRYPTO_REG + 0xb0) | ||
49 | |||
48 | struct tx4939_le_reg { | 50 | struct tx4939_le_reg { |
49 | __u32 r; | 51 | __u32 r; |
50 | __u32 unused; | 52 | __u32 unused; |
@@ -547,5 +549,6 @@ void tx4939_ndfmc_init(unsigned int hold, unsigned int spw, | |||
547 | void tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1); | 549 | void tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1); |
548 | void tx4939_aclc_init(void); | 550 | void tx4939_aclc_init(void); |
549 | void tx4939_sramc_init(void); | 551 | void tx4939_sramc_init(void); |
552 | void tx4939_rng_init(void); | ||
550 | 553 | ||
551 | #endif /* __ASM_TXX9_TX4939_H */ | 554 | #endif /* __ASM_TXX9_TX4939_H */ |
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c index df13a891fb4b..3dc19f482959 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) | |||
500 | txx9_sramc_init(&tx4939_sram_resource); | 500 | txx9_sramc_init(&tx4939_sram_resource); |
501 | } | 501 | } |
502 | 502 | ||
503 | void __init tx4939_rng_init(void) | ||
504 | { | ||
505 | static struct resource res = { | ||
506 | .start = TX4939_RNG_REG & 0xfffffffffULL, | ||
507 | .end = (TX4939_RNG_REG & 0xfffffffffULL) + 0x30 - 1, | ||
508 | .flags = IORESOURCE_MEM, | ||
509 | }; | ||
510 | static struct platform_device pdev = { | ||
511 | .name = "tx4939-rng", | ||
512 | .id = -1, | ||
513 | .num_resources = 1, | ||
514 | .resource = &res, | ||
515 | }; | ||
516 | |||
517 | platform_device_register(&pdev); | ||
518 | } | ||
519 | |||
503 | static void __init tx4939_stop_unused_modules(void) | 520 | static void __init tx4939_stop_unused_modules(void) |
504 | { | 521 | { |
505 | __u64 pcfg, rst = 0, ckd = 0; | 522 | __u64 pcfg, rst = 0, ckd = 0; |
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c index b9196966447b..c033ffe71cdf 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) | |||
502 | tx4939_aclc_init(); | 502 | tx4939_aclc_init(); |
503 | platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); | 503 | platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); |
504 | tx4939_sramc_init(); | 504 | tx4939_sramc_init(); |
505 | tx4939_rng_init(); | ||
505 | } | 506 | } |
506 | 507 | ||
507 | static void __init rbtx4939_setup(void) | 508 | static void __init rbtx4939_setup(void) |