Commit 923e3819 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle

MIPS: TXx9: Add TX4939 RNG support

Add platform support for RNG of TX4939 SoC.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 049a947c
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
#define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00)
#define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00)
#define TX4939_RNG_REG (TX4939_CRYPTO_REG + 0xb0)
struct tx4939_le_reg { struct tx4939_le_reg {
__u32 r; __u32 r;
__u32 unused; __u32 unused;
...@@ -547,5 +549,6 @@ void tx4939_ndfmc_init(unsigned int hold, unsigned int spw, ...@@ -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_dmac_init(int memcpy_chan0, int memcpy_chan1);
void tx4939_aclc_init(void); void tx4939_aclc_init(void);
void tx4939_sramc_init(void); void tx4939_sramc_init(void);
void tx4939_rng_init(void);
#endif /* __ASM_TXX9_TX4939_H */ #endif /* __ASM_TXX9_TX4939_H */
...@@ -500,6 +500,23 @@ void __init tx4939_sramc_init(void) ...@@ -500,6 +500,23 @@ void __init tx4939_sramc_init(void)
txx9_sramc_init(&tx4939_sram_resource); 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) static void __init tx4939_stop_unused_modules(void)
{ {
__u64 pcfg, rst = 0, ckd = 0; __u64 pcfg, rst = 0, ckd = 0;
......
...@@ -502,6 +502,7 @@ static void __init rbtx4939_device_init(void) ...@@ -502,6 +502,7 @@ static void __init rbtx4939_device_init(void)
tx4939_aclc_init(); tx4939_aclc_init();
platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
tx4939_sramc_init(); tx4939_sramc_init();
tx4939_rng_init();
} }
static void __init rbtx4939_setup(void) static void __init rbtx4939_setup(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment