summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/include/mach/devices-imx51.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-08-17 09:26:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-09-21 09:59:36 +0200
commit0972e837c3631c4fbbf16080c76ebad0c94086d7 (patch)
treec8708a2f8315d49ddca9a93fe56ca13856ec6e09 /arch/arm/mach-imx/include/mach/devices-imx51.h
parent8c1f388d88c78b260e881c93ad21b4fe894300c6 (diff)
downloadbarebox-0972e837c3631c4fbbf16080c76ebad0c94086d7.tar.gz
barebox-0972e837c3631c4fbbf16080c76ebad0c94086d7.tar.xz
i.MX NAND: pass second base address as resource
The nand controller on i.MX51/53 uses two base addresses. Instead of hardcode the second address use the new shiny resources two specify it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/include/mach/devices-imx51.h')
-rw-r--r--arch/arm/mach-imx/include/mach/devices-imx51.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/include/mach/devices-imx51.h b/arch/arm/mach-imx/include/mach/devices-imx51.h
index a5deb5c863..54ea647461 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx51.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx51.h
@@ -1,5 +1,6 @@
#include <mach/devices.h>
+#include <sizes.h>
static inline struct device_d *imx51_add_spi0(struct spi_imx_master *pdata)
{
@@ -53,6 +54,28 @@ static inline struct device_d *imx51_add_mmc1(void *pdata)
static inline struct device_d *imx51_add_nand(struct imx_nand_platform_data *pdata)
{
- return imx_add_nand((void *)MX51_NFC_AXI_BASE_ADDR, pdata);
+ struct resource res[] = {
+ {
+ .start = MX51_NFC_BASE_ADDR,
+ .size = SZ_4K,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = MX51_NFC_AXI_BASE_ADDR,
+ .size = SZ_4K,
+ .flags = IORESOURCE_MEM,
+ },
+ };
+ struct device_d *dev = xzalloc(sizeof(*dev));
+
+ dev->resource = xzalloc(sizeof(struct resource) * ARRAY_SIZE(res));
+ memcpy(dev->resource, res, sizeof(struct resource) * ARRAY_SIZE(res));
+ dev->num_resources = ARRAY_SIZE(res);
+ strcpy(dev->name, "imx_nand");
+ dev->id = -1;
+ dev->platform_data = pdata;
+
+ register_device(dev);
+
+ return dev;
}