2010-11-12 10:49:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Pengutronix
|
|
|
|
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License version 2 as published by the
|
|
|
|
* Free Software Foundation.
|
|
|
|
*/
|
2012-09-14 06:14:45 +00:00
|
|
|
#include "../hardware.h"
|
2012-09-13 07:51:15 +00:00
|
|
|
#include "devices-common.h"
|
2010-11-12 10:49:34 +00:00
|
|
|
|
|
|
|
struct imx_mxc_rnga_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define imx_mxc_rnga_data_entry_single(soc) \
|
|
|
|
{ \
|
|
|
|
.iobase = soc ## _RNGA_BASE_ADDR, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_SOC_IMX31
|
|
|
|
static const struct imx_mxc_rnga_data imx31_mxc_rnga_data __initconst =
|
|
|
|
imx_mxc_rnga_data_entry_single(MX31);
|
|
|
|
#endif /* ifdef CONFIG_SOC_IMX31 */
|
|
|
|
|
|
|
|
static struct platform_device *__init imx_add_mxc_rnga(
|
|
|
|
const struct imx_mxc_rnga_data *data)
|
|
|
|
{
|
|
|
|
struct resource res[] = {
|
|
|
|
{
|
|
|
|
.start = data->iobase,
|
|
|
|
.end = data->iobase + SZ_16K - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
return imx_add_platform_device("mxc_rnga", -1,
|
|
|
|
res, ARRAY_SIZE(res), NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __init imxXX_add_mxc_rnga(void)
|
|
|
|
{
|
|
|
|
struct platform_device *ret;
|
|
|
|
|
|
|
|
#if defined(CONFIG_SOC_IMX31)
|
|
|
|
if (cpu_is_mx31())
|
|
|
|
ret = imx_add_mxc_rnga(&imx31_mxc_rnga_data);
|
|
|
|
else
|
|
|
|
#endif /* if defined(CONFIG_SOC_IMX31) */
|
|
|
|
ret = ERR_PTR(-ENODEV);
|
|
|
|
|
2014-07-04 19:03:10 +00:00
|
|
|
return PTR_ERR_OR_ZERO(ret);
|
2010-11-12 10:49:34 +00:00
|
|
|
}
|
|
|
|
arch_initcall(imxXX_add_mxc_rnga);
|