[PATCH 6/6] ARM i.MX53: Fix nand registration helper

Sascha Hauer s.hauer at pengutronix.de
Thu Oct 13 11:30:08 EDT 2011


We switched to resources recently and the nand controller
of the i.MX53 needs two of them, so fix the helper in the
same way as the i.MX51

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-imx/include/mach/devices-imx53.h |   25 ++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/devices-imx53.h b/arch/arm/mach-imx/include/mach/devices-imx53.h
index 41572a7..70e7671 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx53.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx53.h
@@ -53,6 +53,27 @@ static inline struct device_d *imx53_add_mmc2(void *pdata)
 
 static inline struct device_d *imx53_add_nand(struct imx_nand_platform_data *pdata)
 {
-	return imx_add_nand((void *)MX53_NFC_AXI_BASE_ADDR, pdata);
-}
+	struct resource res[] = {
+		{
+			.start = MX53_NFC_BASE_ADDR,
+			.size = SZ_4K,
+			.flags = IORESOURCE_MEM,
+		}, {
+			.start = MX53_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;
+}
-- 
1.7.7




More information about the barebox mailing list