0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/init.h>
0010 #include <linux/kernel.h>
0011 #include <linux/platform_device.h>
0012 #include <bcm63xx_cpu.h>
0013
0014 static struct resource rng_resources[] = {
0015 {
0016 .start = -1,
0017 .end = -1,
0018 .flags = IORESOURCE_MEM,
0019 },
0020 };
0021
0022 static struct platform_device bcm63xx_rng_device = {
0023 .name = "bcm63xx-rng",
0024 .id = -1,
0025 .num_resources = ARRAY_SIZE(rng_resources),
0026 .resource = rng_resources,
0027 };
0028
0029 int __init bcm63xx_rng_register(void)
0030 {
0031 if (!BCMCPU_IS_6368())
0032 return -ENODEV;
0033
0034 rng_resources[0].start = bcm63xx_regset_address(RSET_RNG);
0035 rng_resources[0].end = rng_resources[0].start;
0036 rng_resources[0].end += RSET_RNG_SIZE - 1;
0037
0038 return platform_device_register(&bcm63xx_rng_device);
0039 }
0040 arch_initcall(bcm63xx_rng_register);