Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2011 Florian Fainelli <florian@openwrt.org>
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, /* filled at runtime */
0017         .end        = -1, /* filled at runtime */
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);