mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* i.MX IIM module rework
@ 2011-07-28  7:59 Sascha Hauer
  2011-07-28  7:59 ` [PATCH 1/9] ARM i.MX: IIM rework Sascha Hauer
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

This series reworks the i.MX IIM module and adds support for more
SoCs.

Sascha Hauer (9):
      ARM i.MX: IIM rework
      ARM i.MX IIM: add support for more SoCs
      ARM i.MX IIM: Make explicit sensing the default
      ARM i.MX25 IIM: switch IIM support to use resources
      ARM i.MX35: Add IIM support
      ARM i.MX31: Add IIM support
      ARM i.MX51: Add IIM support
      ARM i.MX IIM: switch to resources
      ARM i.MX27: Add IIM support

 arch/arm/mach-imx/Kconfig                   |    2 +-
 arch/arm/mach-imx/iim.c                     |  102 ++++++++++++++-------------
 arch/arm/mach-imx/imx25.c                   |   39 ++---------
 arch/arm/mach-imx/imx27.c                   |   10 +++
 arch/arm/mach-imx/imx31.c                   |   11 +++
 arch/arm/mach-imx/imx35.c                   |   11 +++
 arch/arm/mach-imx/imx51.c                   |   10 +++
 arch/arm/mach-imx/include/mach/imx27-regs.h |    1 +
 8 files changed, 101 insertions(+), 85 deletions(-)

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/9] ARM i.MX: IIM rework
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 2/9] ARM i.MX IIM: add support for more SoCs Sascha Hauer
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

The IIM module uses two drivers, one for the general IIM
module and one for the individual banks.
This patch turns this into a single driver to ease registration
of the resources. This changes the user visible behaviour in
the way that the explicit_sense_enable and permanent_write_enable
device parameters are no longer bank specific but for the
whole device. Also, the IIM module supports a maximum of
8 fuse banks, with these patch all of them are registered, even
if they are not present in a SoC.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/iim.c |   99 +++++++++++++++++++++++------------------------
 1 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index 0774ebb..1d23fd3 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -31,7 +31,15 @@
 
 static unsigned long mac_addr_base;
 
-static int do_fuse_sense(unsigned long reg_base, unsigned int bank,
+struct iim_priv {
+	struct cdev cdev;
+	void __iomem *base;
+	void __iomem *bankbase;
+	int bank;
+	int banksize;
+};
+
+static int do_fuse_sense(void __iomem *reg_base, unsigned int bank,
 		unsigned int row)
 {
 	u8 err, stat;
@@ -77,37 +85,34 @@ static ssize_t imx_iim_read(struct cdev *cdev, void *buf, size_t count,
 		ulong offset, ulong flags)
 {
 	ulong size, i;
-	struct device_d *dev = cdev->dev;
+	struct iim_priv *priv = cdev->priv;
 	const char *sense_param;
 	unsigned long explicit_sense = 0;
 
-	if (dev == NULL)
-		return -EINVAL;
-
-	if ((sense_param = dev_get_param(dev, "explicit_sense_enable")))
+	if ((sense_param = dev_get_param(cdev->dev, "explicit_sense_enable")))
 		explicit_sense = simple_strtoul(sense_param, NULL, 0);
 
-	size = min((ulong)count, dev->size - offset);
+	size = min((ulong)count, priv->banksize - offset);
 	if (explicit_sense) {
 		for (i = 0; i < size; i++) {
 			int row_val;
 
-			row_val = do_fuse_sense(dev->parent->map_base,
-				dev->id, (offset+i)*4);
+			row_val = do_fuse_sense(priv->base,
+				priv->bank, (offset + i) * 4);
 			if (row_val < 0)
 				return row_val;
 			((u8 *)buf)[i] = (u8)row_val;
 		}
 	} else {
 		for (i = 0; i < size; i++)
-			((u8 *)buf)[i] = ((u8 *)dev->map_base)[(offset+i)*4];
+			((u8 *)buf)[i] = ((u8 *)priv->bankbase)[(offset+i)*4];
 	}
 
 	return size;
 }
 
 #ifdef CONFIG_IMX_IIM_FUSE_BLOW
-static int do_fuse_blow(unsigned long reg_base, unsigned int bank,
+static int do_fuse_blow(void __iomem *reg_base, unsigned int bank,
 		unsigned int row, u8 value)
 {
 	int bit, ret = 0;
@@ -172,24 +177,21 @@ static ssize_t imx_iim_write(struct cdev *cdev, const void *buf, size_t count,
 		ulong offset, ulong flags)
 {
 	ulong size, i;
-	struct device_d *dev = cdev->dev;
+	struct iim_priv *priv = cdev->priv;
 	const char *write_param;
 	unsigned int blow_enable = 0;
 
-	if (dev == NULL)
-		return -EINVAL;
-
-	if ((write_param = dev_get_param(dev, "permanent_write_enable")))
+	if ((write_param = dev_get_param(cdev->dev, "permanent_write_enable")))
 		blow_enable = simple_strtoul(write_param, NULL, 0);
 
-	size = min((ulong)count, dev->size - offset);
+	size = min((ulong)count, priv->banksize - offset);
 #ifdef CONFIG_IMX_IIM_FUSE_BLOW
 	if (blow_enable) {
 		for (i = 0; i < size; i++) {
 			int ret;
 
-			ret = do_fuse_blow(dev->parent->map_base, dev->id,
-					(offset+i)*4, ((u8 *)buf)[i]);
+			ret = do_fuse_blow(priv->base, priv->bank,
+					(offset + i) * 4, ((u8 *)buf)[i]);
 			if (ret < 0)
 				return ret;
 		}
@@ -197,7 +199,7 @@ static ssize_t imx_iim_write(struct cdev *cdev, const void *buf, size_t count,
 #endif /* CONFIG_IMX_IIM_FUSE_BLOW */
 	{
 		for (i = 0; i < size; i++)
-			((u8 *)dev->map_base)[(offset+i)*4] = ((u8 *)buf)[i];
+			((u8 *)priv->bankbase)[(offset+i)*4] = ((u8 *)buf)[i];
 	}
 
 	return size;
@@ -224,38 +226,41 @@ static int imx_iim_blow_enable_set(struct device_d *dev, struct param_d *param,
 	return dev_param_set_generic(dev, param, blow_enable ? "1" : "0");
 }
 
-static int imx_iim_probe(struct device_d *dev)
-{
-	struct imx_iim_platform_data *pdata = dev->platform_data;
-
-	if (pdata)
-		mac_addr_base = pdata->mac_addr_base;
-
-	return 0;
-}
-
-static int imx_iim_bank_probe(struct device_d *dev)
+static int imx_iim_add_bank(struct device_d *dev, int num)
 {
+	struct iim_priv *priv;
 	struct cdev *cdev;
-	struct device_d *parent;
-	int err;
 
-	cdev = xzalloc(sizeof (struct cdev));
-	dev->priv = cdev;
+	priv = xzalloc(sizeof (*priv));
 
+	priv->base	= (void __iomem *)dev->map_base;
+	priv->bankbase	= priv->base + 0x800 + 0x400 * num;
+	priv->bank	= num;
+	priv->banksize	= 32;
+	cdev = &priv->cdev;
 	cdev->dev	= dev;
 	cdev->ops	= &imx_iim_ops;
-	cdev->size	= dev->size;
-	cdev->name	= asprintf(DRIVERNAME "_bank%d", dev->id);
+	cdev->priv	= priv;
+	cdev->size	= 32;
+	cdev->name	= asprintf(DRIVERNAME "_bank%d", num);
 	if (cdev->name == NULL)
 		return -ENOMEM;
 
-	parent = get_device_by_name(DRIVERNAME "0");
-	if (parent == NULL)
-		return -ENODEV;
-	err = dev_add_child(parent, dev);
-	if (err < 0)
-		return err;
+	return devfs_create(cdev);
+}
+
+static int imx_iim_probe(struct device_d *dev)
+{
+	struct imx_iim_platform_data *pdata = dev->platform_data;
+	int err;
+	int i;
+
+	if (pdata)
+		mac_addr_base = pdata->mac_addr_base;
+
+	for (i = 0; i < 8; i++) {
+		imx_iim_add_bank(dev, i);
+	}
 
 #ifdef CONFIG_IMX_IIM_FUSE_BLOW
 	err = dev_add_param(dev, "permanent_write_enable",
@@ -275,7 +280,7 @@ static int imx_iim_bank_probe(struct device_d *dev)
 	if (err < 0)
 		return err;
 
-	return devfs_create(cdev);
+	return 0;
 }
 
 static struct driver_d imx_iim_driver = {
@@ -283,15 +288,9 @@ static struct driver_d imx_iim_driver = {
 	.probe	= imx_iim_probe,
 };
 
-static struct driver_d imx_iim_bank_driver = {
-	.name	= DRIVERNAME "_bank",
-	.probe	= imx_iim_bank_probe,
-};
-
 static int imx_iim_init(void)
 {
 	register_driver(&imx_iim_driver);
-	register_driver(&imx_iim_bank_driver);
 
 	return 0;
 }
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/9] ARM i.MX IIM: add support for more SoCs
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
  2011-07-28  7:59 ` [PATCH 1/9] ARM i.MX: IIM rework Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 3/9] ARM i.MX IIM: Make explicit sensing the default Sascha Hauer
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Do not depend on the specific SoCs for the IIM module, but
instead exclude the one that don't have this unit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index f497d35..f99fcb3 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -480,7 +480,7 @@ config IMX_CLKO
 
 config IMX_IIM
 	tristate "IIM fusebox device"
-	depends on ARCH_IMX25 || ARCH_IMX35
+	depends on !ARCH_IMX21 && !ARCH_IMX21
 	help
 	  Device driver for the IC Identification Module (IIM) fusebox. Use the 
 	  regular md/mw commands to program and read the fusebox.
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/9] ARM i.MX IIM: Make explicit sensing the default
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
  2011-07-28  7:59 ` [PATCH 1/9] ARM i.MX: IIM rework Sascha Hauer
  2011-07-28  7:59 ` [PATCH 2/9] ARM i.MX IIM: add support for more SoCs Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 4/9] ARM i.MX25 IIM: switch IIM support to use resources Sascha Hauer
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

The register based fuse readout is not available on i.MX27/31
SoCs, so make explicit sensing the default.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/iim.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index 1d23fd3..69e78ff 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -276,7 +276,7 @@ static int imx_iim_probe(struct device_d *dev)
 			imx_iim_blow_enable_set, NULL, 0);
 	if (err < 0)
 		return err;
-	err = dev_set_param(dev, "explicit_sense_enable", "0");
+	err = dev_set_param(dev, "explicit_sense_enable", "1");
 	if (err < 0)
 		return err;
 
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/9] ARM i.MX25 IIM: switch IIM support to use resources
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (2 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 3/9] ARM i.MX IIM: Make explicit sensing the default Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 5/9] ARM i.MX35: Add IIM support Sascha Hauer
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/imx25.c |   39 +++++----------------------------------
 1 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c
index 37eafaf..75ec8c7 100644
--- a/arch/arm/mach-imx/imx25.c
+++ b/arch/arm/mach-imx/imx25.c
@@ -20,6 +20,7 @@
 #include <mach/imx-regs.h>
 #include <mach/iim.h>
 #include <asm/io.h>
+#include <sizes.h>
 
 #include "gpio.h"
 
@@ -53,41 +54,11 @@ static struct imx_iim_platform_data imx25_iim_pdata = {
 	.mac_addr_base	= IIM_MAC_ADDR,
 };
 
-static struct device_d imx25_iim_dev = {
-	.id		= -1,
-	.name		= "imx_iim",
-	.map_base	= IMX_IIM_BASE,
-	.platform_data	= &imx25_iim_pdata,
-};
-
-static struct device_d imx25_iim_bank0_dev = {
-	.name		= "imx_iim_bank",
-	.id		= 0,
-	.map_base	= IIM_BANK0_BASE,
-	.size		= IIM_BANK_SIZE,
-};
-
-static struct device_d imx25_iim_bank1_dev = {
-	.name		= "imx_iim_bank",
-	.id		= 1,
-	.map_base	= IIM_BANK1_BASE,
-	.size		= IIM_BANK_SIZE,
-};
-
-static struct device_d imx25_iim_bank2_dev = {
-	.name		= "imx_iim_bank",
-	.id		= 2,
-	.map_base	= IIM_BANK2_BASE,
-	.size		= IIM_BANK_SIZE,
-};
-
-static int imx25_iim_init(void)
+static int imx25_init(void)
 {
-	register_device(&imx25_iim_dev);
-	register_device(&imx25_iim_bank0_dev);
-	register_device(&imx25_iim_bank1_dev);
-	register_device(&imx25_iim_bank2_dev);
+	add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K,
+			IORESOURCE_MEM, &imx25_iim_pdata);
 
 	return 0;
 }
-coredevice_initcall(imx25_iim_init);
+coredevice_initcall(imx25_init);
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 5/9] ARM i.MX35: Add IIM support
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (3 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 4/9] ARM i.MX25 IIM: switch IIM support to use resources Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 6/9] ARM i.MX31: " Sascha Hauer
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/imx35.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c
index 74d63eb..40718e5 100644
--- a/arch/arm/mach-imx/imx35.c
+++ b/arch/arm/mach-imx/imx35.c
@@ -16,6 +16,8 @@
  */
 
 #include <common.h>
+#include <sizes.h>
+#include <init.h>
 #include <asm/io.h>
 #include <mach/imx-regs.h>
 #include <mach/iim.h>
@@ -39,3 +41,12 @@ int imx_silicon_revision()
 
 	return (reg & 0xFF);
 }
+
+static int imx35_init(void)
+{
+	add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K,
+			IORESOURCE_MEM, NULL);
+
+	return 0;
+}
+coredevice_initcall(imx35_init);
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/9] ARM i.MX31: Add IIM support
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (4 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 5/9] ARM i.MX35: Add IIM support Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 7/9] ARM i.MX51: " Sascha Hauer
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/imx31.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/imx31.c b/arch/arm/mach-imx/imx31.c
index f2fea4c..bb713ca 100644
--- a/arch/arm/mach-imx/imx31.c
+++ b/arch/arm/mach-imx/imx31.c
@@ -16,6 +16,9 @@
  */
 
 #include <common.h>
+#include <init.h>
+#include <sizes.h>
+#include <mach/imx-regs.h>
 
 #include "gpio.h"
 
@@ -27,3 +30,11 @@ void *imx_gpio_base[] = {
 
 int imx_gpio_count = ARRAY_SIZE(imx_gpio_base) * 32;
 
+static int imx31_init(void)
+{
+	add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K,
+			IORESOURCE_MEM, NULL);
+
+	return 0;
+}
+coredevice_initcall(imx31_init);
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 7/9] ARM i.MX51: Add IIM support
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (5 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 6/9] ARM i.MX31: " Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 8/9] ARM i.MX IIM: switch to resources Sascha Hauer
  2011-07-28  7:59 ` [PATCH 9/9] ARM i.MX27: Add IIM support Sascha Hauer
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/imx51.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/imx51.c b/arch/arm/mach-imx/imx51.c
index 075ed22..8b7c807 100644
--- a/arch/arm/mach-imx/imx51.c
+++ b/arch/arm/mach-imx/imx51.c
@@ -17,6 +17,7 @@
 
 #include <init.h>
 #include <common.h>
+#include <sizes.h>
 #include <asm/io.h>
 #include <mach/imx51-regs.h>
 
@@ -79,3 +80,12 @@ static int imx51_print_silicon_rev(void)
 	return 0;
 }
 device_initcall(imx51_print_silicon_rev);
+
+static int imx51_init(void)
+{
+	add_generic_device("imx_iim", 0, NULL, MX51_IIM_BASE_ADDR, SZ_4K,
+			IORESOURCE_MEM, NULL);
+
+	return 0;
+}
+coredevice_initcall(imx51_init);
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 8/9] ARM i.MX IIM: switch to resources
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (6 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 7/9] ARM i.MX51: " Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  2011-07-28  7:59 ` [PATCH 9/9] ARM i.MX27: Add IIM support Sascha Hauer
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/iim.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index 69e78ff..852f75b 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -226,14 +226,14 @@ static int imx_iim_blow_enable_set(struct device_d *dev, struct param_d *param,
 	return dev_param_set_generic(dev, param, blow_enable ? "1" : "0");
 }
 
-static int imx_iim_add_bank(struct device_d *dev, int num)
+static int imx_iim_add_bank(struct device_d *dev, void __iomem *base, int num)
 {
 	struct iim_priv *priv;
 	struct cdev *cdev;
 
 	priv = xzalloc(sizeof (*priv));
 
-	priv->base	= (void __iomem *)dev->map_base;
+	priv->base	= base;
 	priv->bankbase	= priv->base + 0x800 + 0x400 * num;
 	priv->bank	= num;
 	priv->banksize	= 32;
@@ -254,12 +254,15 @@ static int imx_iim_probe(struct device_d *dev)
 	struct imx_iim_platform_data *pdata = dev->platform_data;
 	int err;
 	int i;
+	void __iomem *base;
+
+	base = dev_request_mem_region(dev, 0);
 
 	if (pdata)
 		mac_addr_base = pdata->mac_addr_base;
 
 	for (i = 0; i < 8; i++) {
-		imx_iim_add_bank(dev, i);
+		imx_iim_add_bank(dev, base, i);
 	}
 
 #ifdef CONFIG_IMX_IIM_FUSE_BLOW
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 9/9] ARM i.MX27: Add IIM support
  2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
                   ` (7 preceding siblings ...)
  2011-07-28  7:59 ` [PATCH 8/9] ARM i.MX IIM: switch to resources Sascha Hauer
@ 2011-07-28  7:59 ` Sascha Hauer
  8 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28  7:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/imx27.c                   |   10 ++++++++++
 arch/arm/mach-imx/include/mach/imx27-regs.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/imx27.c b/arch/arm/mach-imx/imx27.c
index 04bdd5f..86039c4 100644
--- a/arch/arm/mach-imx/imx27.c
+++ b/arch/arm/mach-imx/imx27.c
@@ -17,6 +17,8 @@
 
 #include <common.h>
 #include <mach/imx-regs.h>
+#include <sizes.h>
+#include <init.h>
 
 #include "gpio.h"
 
@@ -36,3 +38,11 @@ void *imx_gpio_base[] = {
 
 int imx_gpio_count = ARRAY_SIZE(imx_gpio_base) * 32;
 
+static int imx27_init(void)
+{
+	add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K,
+			IORESOURCE_MEM, NULL);
+
+	return 0;
+}
+coredevice_initcall(imx27_init);
diff --git a/arch/arm/mach-imx/include/mach/imx27-regs.h b/arch/arm/mach-imx/include/mach/imx27-regs.h
index e87d5bf..570b430 100644
--- a/arch/arm/mach-imx/include/mach/imx27-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx27-regs.h
@@ -29,6 +29,7 @@
 #define IMX_FB_BASE                (0x21000 + IMX_IO_BASE)
 #define IMX_PLL_BASE               (0x27000 + IMX_IO_BASE)
 #define IMX_SYSTEM_CTL_BASE        (0x27800 + IMX_IO_BASE)
+#define IMX_IIM_BASE               (0x28000 + IMX_IO_BASE)
 #define IMX_OTG_BASE               (0x24000 + IMX_IO_BASE)
 #define IMX_FEC_BASE               (0x2b000 + IMX_IO_BASE)
 
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-07-28  7:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28  7:59 i.MX IIM module rework Sascha Hauer
2011-07-28  7:59 ` [PATCH 1/9] ARM i.MX: IIM rework Sascha Hauer
2011-07-28  7:59 ` [PATCH 2/9] ARM i.MX IIM: add support for more SoCs Sascha Hauer
2011-07-28  7:59 ` [PATCH 3/9] ARM i.MX IIM: Make explicit sensing the default Sascha Hauer
2011-07-28  7:59 ` [PATCH 4/9] ARM i.MX25 IIM: switch IIM support to use resources Sascha Hauer
2011-07-28  7:59 ` [PATCH 5/9] ARM i.MX35: Add IIM support Sascha Hauer
2011-07-28  7:59 ` [PATCH 6/9] ARM i.MX31: " Sascha Hauer
2011-07-28  7:59 ` [PATCH 7/9] ARM i.MX51: " Sascha Hauer
2011-07-28  7:59 ` [PATCH 8/9] ARM i.MX IIM: switch to resources Sascha Hauer
2011-07-28  7:59 ` [PATCH 9/9] ARM i.MX27: Add IIM support Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox