mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 6/6] ARM i.MX53: Fix nand registration helper
Date: Thu, 13 Oct 2011 17:30:08 +0200	[thread overview]
Message-ID: <1318519808-14316-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1318519808-14316-1-git-send-email-s.hauer@pengutronix.de>

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2011-10-13 15:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 15:30 i.MX53 patches Sascha Hauer
2011-10-13 15:30 ` [PATCH 1/6] ARM i.MX53: Add lowlevel init code Sascha Hauer
2011-10-13 15:30 ` [PATCH 2/6] ARM i.MX53 Loco: Use generic " Sascha Hauer
2011-10-13 15:30 ` [PATCH 3/6] ARM i.MX53: sync iomux data with latest kernel Sascha Hauer
2011-10-13 15:30 ` [PATCH 4/6] mtd nand i.MX: Add i.MX53 support Sascha Hauer
2011-10-13 15:30 ` [PATCH 5/6] mtd nand i.MX: depend on ARCH_IMX instead of individual SoCs Sascha Hauer
2011-10-13 15:30 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318519808-14316-7-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox