Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45001e92 authored by Alan Carvalho de Assis's avatar Alan Carvalho de Assis Committed by Sascha Hauer
Browse files

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: default avatarAlan Carvalho de Assis <acassis@gmail.com>
Acked-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 220bbcea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
if ARCH_MX3

config ARCH_MX31
	select ARCH_HAS_RNGA
	bool

config ARCH_MX35
+17 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/gpio.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <mach/common.h>
#include <mach/imx-uart.h>

#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;
+4 −0
Original line number Diff line number Diff line
@@ -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
+12 −0
Original line number Diff line number Diff line
@@ -148,3 +148,15 @@ config HW_RANDOM_VIRTIO

	  To compile this driver as a module, choose M here: the
	  module will be called virtio-rng.  If unsure, say N.

config HW_RANDOM_MXC_RNGA
	tristate "Freescale i.MX RNGA Random Number Generator"
	depends on HW_RANDOM && ARCH_HAS_RNGA
	---help---
	  This driver provides kernel-side support for the Random Number
	  Generator hardware found on Freescale i.MX processors.

	  To compile this driver as a module, choose M here: the
	  module will be called mxc-rnga.

	  If unsure, say Y.
+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o
obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o
obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o
obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o
obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o
Loading