1 From cfcc8526e97bdcbfcbf945246b878262389b8842 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Wed, 25 Jan 2012 17:39:59 +0100
4 Subject: [PATCH 17/63] MIPS: BCM63XX: add RNG driver platform_device stub
6 Signed-off-by: Florian Fainelli <florian@openwrt.org>
8 arch/mips/bcm63xx/Makefile | 4 ++--
9 arch/mips/bcm63xx/dev-trng.c | 40 ++++++++++++++++++++++++++++++++++++++++
10 2 files changed, 42 insertions(+), 2 deletions(-)
11 create mode 100644 arch/mips/bcm63xx/dev-trng.c
13 --- a/arch/mips/bcm63xx/Makefile
14 +++ b/arch/mips/bcm63xx/Makefile
16 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
17 - dev-dsp.o dev-enet.o dev-pcmcia.o dev-spi.o dev-uart.o \
19 + dev-dsp.o dev-enet.o dev-pcmcia.o dev-spi.o dev-trng.o \
20 + dev-uart.o dev-wdt.o
21 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
25 +++ b/arch/mips/bcm63xx/dev-trng.c
28 + * This file is subject to the terms and conditions of the GNU General Public
29 + * License. See the file "COPYING" in the main directory of this archive
32 + * Copyright (C) 2011 Florian Fainelli <florian@openwrt.org>
35 +#include <linux/init.h>
36 +#include <linux/kernel.h>
37 +#include <linux/platform_device.h>
38 +#include <bcm63xx_cpu.h>
40 +static struct resource trng_resources[] = {
42 + .start = -1, /* filled at runtime */
43 + .end = -1, /* filled at runtime */
44 + .flags = IORESOURCE_MEM,
48 +static struct platform_device bcm63xx_trng_device = {
49 + .name = "bcm63xx-trng",
51 + .num_resources = ARRAY_SIZE(trng_resources),
52 + .resource = trng_resources,
55 +int __init bcm63xx_trng_register(void)
57 + if (!BCMCPU_IS_6368())
60 + trng_resources[0].start = bcm63xx_regset_address(RSET_TRNG);
61 + trng_resources[0].end = trng_resources[0].start;
62 + trng_resources[0].end += RSET_TRNG_SIZE - 1;
64 + return platform_device_register(&bcm63xx_trng_device);
66 +arch_initcall(bcm63xx_trng_register);