From 45001e92d0249a8c4b9f6c3695215652e8e8493d Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Thu, 2 Apr 2009 12:38:41 -0300 Subject: i.MX31: Add hw-random for RNGA This hw-random driver add support to RNGA hardware found on some i.MX processors. Signed-off-by: Alan Carvalho de Assis Acked-by: Matt Mackall Signed-off-by: Sascha Hauer --- arch/arm/mach-mx3/Kconfig | 1 + arch/arm/mach-mx3/devices.c | 17 +++++++++++++++++ arch/arm/plat-mxc/Kconfig | 4 ++++ 3 files changed, 22 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 0e7de945ee6..32e45155089 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig @@ -1,6 +1,7 @@ if ARCH_MX3 config ARCH_MX31 + select ARCH_HAS_RNGA bool config ARCH_MX35 diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index 380be0c9b21..227a538bb94 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "devices.h" @@ -283,6 +284,21 @@ struct platform_device mxcsdhc_device1 = { .num_resources = ARRAY_SIZE(mxcsdhc1_resources), .resource = mxcsdhc1_resources, }; + +static struct resource rnga_resources[] = { + { + .start = RNGA_BASE_ADDR, + .end = RNGA_BASE_ADDR + 0x28, + .flags = IORESOURCE_MEM, + }, +}; + +struct platform_device mxc_rnga_device = { + .name = "mxc_rnga", + .id = -1, + .num_resources = 1, + .resource = rnga_resources, +}; #endif /* CONFIG_ARCH_MX31 */ /* i.MX31 Image Processing Unit */ @@ -359,6 +375,7 @@ static int mx3_devices_init(void) if (cpu_is_mx31()) { mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR; mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff; + mxc_register_device(&mxc_rnga_device, NULL); } if (cpu_is_mx35()) { mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig index beeb01aa029..8986b741223 100644 --- a/arch/arm/plat-mxc/Kconfig +++ b/arch/arm/plat-mxc/Kconfig @@ -52,6 +52,10 @@ config MXC_PWM help Enable support for the i.MX PWM controller(s). +config ARCH_HAS_RNGA + bool + depends on ARCH_MXC + config ARCH_MXC_IOMUX_V3 bool endif -- cgit v1.2.3