mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* device register functions for i.MX
@ 2010-11-02 17:17 Sascha Hauer
  2010-11-02 17:17 ` [PATCH 01/17] ARM i.MX51: Add SPBA0 base addresses Sascha Hauer
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Hi all,

The following series adds device register convenience functions
for i.MX SoCs. Thia simplifies the board support code and is also
done to simplify adding clocks for the devices later.

Sascha

The following changes since commit 3d4f24ef0bc1d00577b87ec216cec61bbf34a4ec:

  Merge branch 'next' (2010-11-02 18:05:32 +0100)

are available in the git repository at:

  git://git.pengutronix.de/git/barebox.git pu

Sascha Hauer (17):
      ARM i.MX51: Add SPBA0 base addresses
      ARM i.MX: Add device convenience functions
      ARM i.MX: Add header protection
      ARM i.MX35: Add IPU base address
      ARM pcm043: Use device functions
      ARM pca100: Use device functions
      ARM pcm038: Use device functions
      ARM pcm037: Use device functions
      ARM imx27ads: Use device functions
      ARM imx21ads: Use device functions
      ARM mx51 babbage: Use device functions
      ARM neso: Use device functions
      ARM mx35 3ds: Use device functions
      ARM mx25 3ds: Use device functions
      ARM eukrea cpuimx35: Use device functions
      ARM eukrea cpuimx27: Use device functions
      ARM eukrea cpuimx25: Use device functions

 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c |   54 +++----------------
 arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c |   27 ++--------
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c |   53 +++----------------
 arch/arm/boards/freescale-mx25-3-stack/3stack.c   |   36 ++-----------
 arch/arm/boards/freescale-mx35-3-stack/3stack.c   |   38 ++------------
 arch/arm/boards/freescale-mx51-pdk/board.c        |   33 ++----------
 arch/arm/boards/guf-neso/board.c                  |   38 ++------------
 arch/arm/boards/imx21ads/imx21ads.c               |   29 ++---------
 arch/arm/boards/imx27ads/imx27ads.c               |   19 +------
 arch/arm/boards/pcm037/pcm037.c                   |   20 +------
 arch/arm/boards/pcm038/pcm038.c                   |   47 ++--------------
 arch/arm/boards/pcm043/pcm043.c                   |   38 ++------------
 arch/arm/boards/phycard-i.MX27/pca100.c           |   28 ++--------
 arch/arm/mach-imx/Makefile                        |    2 +-
 arch/arm/mach-imx/devices.c                       |   59 +++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx21.h    |   33 ++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx25.h    |   38 +++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx27.h    |   54 +++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx31.h    |   35 ++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx35.h    |   57 ++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx51.h    |   53 ++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices.h          |   17 ++++++
 arch/arm/mach-imx/include/mach/imx35-regs.h       |    1 +
 arch/arm/mach-imx/include/mach/imx51-regs.h       |   13 ++++-
 arch/arm/mach-imx/include/mach/imxfb.h            |    5 ++
 25 files changed, 429 insertions(+), 398 deletions(-)
 create mode 100644 arch/arm/mach-imx/devices.c
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx21.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx25.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx27.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx31.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx35.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx51.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices.h

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

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

* [PATCH 01/17] ARM i.MX51: Add SPBA0 base addresses
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 02/17] ARM i.MX: Add device convenience functions Sascha Hauer
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/include/mach/imx51-regs.h |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/imx51-regs.h b/arch/arm/mach-imx/include/mach/imx51-regs.h
index 1719a78..1d241c8 100644
--- a/arch/arm/mach-imx/include/mach/imx51-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx51-regs.h
@@ -91,7 +91,18 @@
 #define MX51_SAHARA_BASE_ADDR	(MX51_AIPS2_BASE_ADDR + 0x000F8000)
 
 #define MX51_SPBA0_BASE_ADDR    0x70000000
-#define MX51_CSPI1_BASE_ADDR    (MX51_SPBA0_BASE_ADDR + 0x00010000)
+#define MX51_MMC_SDHC1_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x00004000)
+#define MX51_MMC_SDHC2_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x00008000)
+#define MX51_UART3_BASE_ADDR 		(MX51_SPBA0_BASE_ADDR + 0x0000C000)
+#define MX51_CSPI1_BASE_ADDR 		(MX51_SPBA0_BASE_ADDR + 0x00010000)
+#define MX51_SSI2_BASE_ADDR		(MX51_SPBA0_BASE_ADDR + 0x00014000)
+#define MX51_MMC_SDHC3_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x00020000)
+#define MX51_MMC_SDHC4_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x00024000)
+#define MX51_SPDIF_BASE_ADDR		(MX51_SPBA0_BASE_ADDR + 0x00028000)
+#define MX51_ATA_DMA_BASE_ADDR		(MX51_SPBA0_BASE_ADDR + 0x00030000)
+#define MX51_SLIM_DMA_BASE_ADDR		(MX51_SPBA0_BASE_ADDR + 0x00034000)
+#define MX51_HSI2C_DMA_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x00038000)
+#define MX51_SPBA_CTRL_BASE_ADDR	(MX51_SPBA0_BASE_ADDR + 0x0003C000)
 
 /*
  * Memory regions and CS
-- 
1.7.2.3


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

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

* [PATCH 02/17] ARM i.MX: Add device convenience functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
  2010-11-02 17:17 ` [PATCH 01/17] ARM i.MX51: Add SPBA0 base addresses Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 03/17] ARM i.MX: Add header protection Sascha Hauer
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/Makefile                     |    2 +-
 arch/arm/mach-imx/devices.c                    |   59 ++++++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx21.h |   33 +++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx25.h |   38 +++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx27.h |   54 ++++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx31.h |   35 ++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx35.h |   57 +++++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices-imx51.h |   53 +++++++++++++++++++++
 arch/arm/mach-imx/include/mach/devices.h       |   17 +++++++
 9 files changed, 347 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-imx/devices.c
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx21.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx25.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx27.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx31.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx35.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices-imx51.h
 create mode 100644 arch/arm/mach-imx/include/mach/devices.h

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index ce38566..d000683 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -10,4 +10,4 @@ obj-$(CONFIG_IMX_CLKO)	+= clko.o
 obj-$(CONFIG_IMX_IIM)	+= iim.o
 obj-$(CONFIG_NAND_IMX) += nand.o
 obj-y += speed.o
-
+obj-y += devices.o
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
new file mode 100644
index 0000000..dfeae1e
--- /dev/null
+++ b/arch/arm/mach-imx/devices.c
@@ -0,0 +1,59 @@
+#include <common.h>
+#include <driver.h>
+#include <mach/devices.h>
+
+static struct device_d *imx_add_device(char *name, int id, void *base, int size, void *pdata)
+{
+	struct device_d *dev;
+
+	dev = xzalloc(sizeof(*dev));
+	strcpy(dev->name,name);
+	dev->id = id;
+	dev->map_base = (unsigned long)base;
+	dev->size = size;
+	dev->platform_data = pdata;
+
+	register_device(dev);
+
+	return 0;
+}
+
+struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata)
+{
+	return imx_add_device("fec_imx", -1, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_spi(void *base, int id, struct spi_imx_master *pdata)
+{
+	return imx_add_device("imx_spi", id, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_i2c(void *base, int id, struct i2c_platform_data *pdata)
+{
+	return imx_add_device("i2c-imx", id, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_uart(void *base, int id)
+{
+	return imx_add_device("imx_serial", id, base, 0x1000, NULL);
+}
+
+struct device_d *imx_add_nand(void *base, struct imx_nand_platform_data *pdata)
+{
+	return imx_add_device("imx_nandl", -1, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata)
+{
+	return imx_add_device("imxfb", -1, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata)
+{
+	return imx_add_device("imx-ipu-fb", -1, base, 0x1000, pdata);
+}
+
+struct device_d *imx_add_mmc(void *base, int id, void *pdata)
+{
+	return imx_add_device("imx-mmc", id, base, 0x1000, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx21.h b/arch/arm/mach-imx/include/mach/devices-imx21.h
new file mode 100644
index 0000000..1e1fbbd
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx21.h
@@ -0,0 +1,33 @@
+
+#include <mach/devices.h>
+
+static inline struct device_d *imx21_add_uart0(void)
+{
+	return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx21_add_uart1(void)
+{
+	return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
+
+static inline struct device_d *imx21_add_uart2(void)
+{
+	return imx_add_uart((void *)IMX_UART3_BASE, 2);
+}
+
+static inline struct device_d *imx21_add_uart3(void)
+{
+	return imx_add_uart((void *)IMX_UART4_BASE, 3);
+}
+
+static inline struct device_d *imx21_add_nand(struct imx_nand_platform_data *pdata)
+{
+	return imx_add_nand((void *)0xDF003000, pdata);
+}
+
+static inline struct device_d *imx21_add_fb(struct imx_fb_platform_data *pdata)
+{
+	return imx_add_fb((void *)0x10021000, pdata);
+}
+
diff --git a/arch/arm/mach-imx/include/mach/devices-imx25.h b/arch/arm/mach-imx/include/mach/devices-imx25.h
new file mode 100644
index 0000000..dc7f98f
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx25.h
@@ -0,0 +1,38 @@
+
+#include <mach/devices.h>
+
+static inline struct device_d *imx25_add_i2c0(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx25_add_uart0(void)
+{
+	return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx25_add_uart1(void)
+{
+	return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
+
+static inline struct device_d *imx25_add_nand(struct imx_nand_platform_data *pdata)
+{
+	return imx_add_nand((void *)IMX_NFC_BASE, pdata);
+}
+
+static inline struct device_d *imx25_add_fb(struct imx_fb_platform_data *pdata)
+{
+	return imx_add_fb((void *)0x53fbc000, pdata);
+}
+
+static inline struct device_d *imx25_add_fec(struct fec_platform_data *pdata)
+{
+	return imx_add_fec((void *)IMX_FEC_BASE, pdata);
+}
+
+static inline struct device_d *imx25_add_mmc0(void *pdata)
+{
+	return imx_add_mmc((void *)0x53fb4000, 0, pdata);
+}
+
diff --git a/arch/arm/mach-imx/include/mach/devices-imx27.h b/arch/arm/mach-imx/include/mach/devices-imx27.h
new file mode 100644
index 0000000..0511eb5
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx27.h
@@ -0,0 +1,54 @@
+
+#include <mach/devices.h>
+
+static inline struct device_d *imx27_add_spi0(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)IMX_SPI1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx27_add_i2c0(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx27_add_uart0(void)
+{
+	return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx27_add_uart1(void)
+{
+	return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
+
+static inline struct device_d *imx27_add_uart2(void)
+{
+	return imx_add_uart((void *)IMX_UART3_BASE, 2);
+}
+
+static inline struct device_d *imx27_add_uart3(void)
+{
+	return imx_add_uart((void *)IMX_UART4_BASE, 3);
+}
+
+static inline struct device_d *imx27_add_nand(struct imx_nand_platform_data *pdata)
+{
+	return imx_add_nand((void *)IMX_NFC_BASE, pdata);
+}
+
+static inline struct device_d *imx27_add_fb(struct imx_fb_platform_data *pdata)
+{
+	return imx_add_fb((void *)0x10021000, pdata);
+}
+
+static inline struct device_d *imx27_add_fec(struct fec_platform_data *pdata)
+{
+	return imx_add_fec((void *)IMX_FEC_BASE, pdata);
+}
+
+static inline struct device_d *imx27_add_mmc0(void *pdata)
+{
+	return imx_add_mmc((void *)0x10014000, 0, pdata);
+}
+
+
diff --git a/arch/arm/mach-imx/include/mach/devices-imx31.h b/arch/arm/mach-imx/include/mach/devices-imx31.h
new file mode 100644
index 0000000..1f5a48a
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx31.h
@@ -0,0 +1,35 @@
+
+#include <mach/imx-regs.h>
+#include <mach/devices.h>
+
+#if 0
+static inline struct device_d *imx31_add_spi0(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)IMX_SPI1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx31_add_spi1(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)IMX_SPI2_BASE, 1, pdata);
+}
+#endif
+
+static inline struct device_d *imx31_add_uart0(void)
+{
+	return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx31_add_uart1(void)
+{
+	return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
+
+static inline struct device_d *imx31_add_nand(struct imx_nand_platform_data *pdata)
+{
+	return imx_add_nand((void *)0xb8000000, pdata);
+}
+
+static inline struct device_d *imx31_add_fb(struct imx_fb_platform_data *pdata)
+{
+	return imx_add_ipufb((void *)IPU_BASE, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx35.h b/arch/arm/mach-imx/include/mach/devices-imx35.h
new file mode 100644
index 0000000..3b2b1ff
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx35.h
@@ -0,0 +1,57 @@
+
+#include <mach/devices.h>
+
+static inline struct device_d *imx35_add_i2c0(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx35_add_i2c1(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata);
+}
+
+static inline struct device_d *imx35_add_i2c2(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C3_BASE, 2, pdata);
+}
+
+static inline struct device_d *imx35_add_uart0(void)
+{
+	return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx35_add_uart1(void)
+{
+	return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
+
+static inline struct device_d *imx35_add_nand(struct imx_nand_platform_data *pdata)
+{
+	return imx_add_nand((void *)IMX_NFC_BASE, pdata);
+}
+
+static inline struct device_d *imx35_add_fb(struct imx_ipu_fb_platform_data *pdata)
+{
+	return imx_add_ipufb((void *)IMX_IPU_BASE, pdata);
+}
+
+static inline struct device_d *imx35_add_fec(struct fec_platform_data *pdata)
+{
+	return imx_add_fec((void *)IMX_FEC_BASE, pdata);
+}
+
+static inline struct device_d *imx35_add_mmc0(void *pdata)
+{
+	return imx_add_mmc((void *)IMX_SDHC1_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx35_add_mmc1(void *pdata)
+{
+	return imx_add_mmc((void *)IMX_SDHC2_BASE, 1, pdata);
+}
+
+static inline struct device_d *imx35_add_mmc2(void *pdata)
+{
+	return imx_add_mmc((void *)IMX_SDHC3_BASE, 2, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx51.h b/arch/arm/mach-imx/include/mach/devices-imx51.h
new file mode 100644
index 0000000..ff63fca
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx51.h
@@ -0,0 +1,53 @@
+
+#include <mach/devices.h>
+
+static inline struct device_d *imx51_add_spi0(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)MX51_CSPI1_BASE_ADDR, 0, pdata);
+}
+
+static inline struct device_d *imx51_add_spi1(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)MX51_CSPI2_BASE_ADDR, 1, pdata);
+}
+
+static inline struct device_d *imx51_add_spi2(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)MX51_CSPI3_BASE_ADDR, 2, pdata);
+}
+
+static inline struct device_d *imx51_add_i2c0(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)MX51_I2C1_BASE_ADDR, 0, pdata);
+}
+
+static inline struct device_d *imx51_add_i2c1(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)MX51_I2C2_BASE_ADDR, 1, pdata);
+}
+
+static inline struct device_d *imx51_add_uart0(void)
+{
+	return imx_add_uart((void *)MX51_UART1_BASE_ADDR, 0);
+}
+
+static inline struct device_d *imx51_add_uart1(void)
+{
+	return imx_add_uart((void *)MX51_UART2_BASE_ADDR, 1);
+}
+
+static inline struct device_d *imx51_add_fec(struct fec_platform_data *pdata)
+{
+	return imx_add_fec((void *)MX51_MXC_FEC_BASE_ADDR, pdata);
+}
+
+static inline struct device_d *imx51_add_mmc0(void *pdata)
+{
+	return imx_add_mmc((void *)MX51_MMC_SDHC1_BASE_ADDR, 0, pdata);
+}
+
+static inline struct device_d *imx51_add_mmc1(void *pdata)
+{
+	return imx_add_mmc((void *)MX51_MMC_SDHC2_BASE_ADDR, 0, pdata);
+}
+
diff --git a/arch/arm/mach-imx/include/mach/devices.h b/arch/arm/mach-imx/include/mach/devices.h
new file mode 100644
index 0000000..677d5b5
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices.h
@@ -0,0 +1,17 @@
+
+#include <fec.h>
+#include <i2c/i2c.h>
+#include <mach/spi.h>
+#include <mach/imx-nand.h>
+#include <mach/imxfb.h>
+#include <mach/imx-ipu-fb.h>
+
+struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata);
+struct device_d *imx_add_spi(void *base, int id, struct spi_imx_master *pdata);
+struct device_d *imx_add_i2c(void *base, int id, struct i2c_platform_data *pdata);
+struct device_d *imx_add_uart(void *base, int id);
+struct device_d *imx_add_nand(void *base, struct imx_nand_platform_data *pdata);
+struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata);
+struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata);
+struct device_d *imx_add_mmc(void *base, int id, void *pdata);
+
-- 
1.7.2.3


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

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

* [PATCH 03/17] ARM i.MX: Add header protection
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
  2010-11-02 17:17 ` [PATCH 01/17] ARM i.MX51: Add SPBA0 base addresses Sascha Hauer
  2010-11-02 17:17 ` [PATCH 02/17] ARM i.MX: Add device convenience functions Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 04/17] ARM i.MX35: Add IPU base address Sascha Hauer
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

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

diff --git a/arch/arm/mach-imx/include/mach/imxfb.h b/arch/arm/mach-imx/include/mach/imxfb.h
index 16b43ea..b71b7f4 100644
--- a/arch/arm/mach-imx/include/mach/imxfb.h
+++ b/arch/arm/mach-imx/include/mach/imxfb.h
@@ -1,3 +1,6 @@
+#ifndef __MACH_IMXFB_H
+#define __MACH_IMXFB_H
+
 /*
  * This structure describes the machine which we are running on.
  */
@@ -80,6 +83,8 @@ struct imx_fb_platform_data {
 
 void set_imx_fb_info(struct imx_fb_platform_data *);
 
+#endif /* __MACH_IMXFB_H */
+
 /**
  * @file
  * @brief i.MX related framebuffer declarations
-- 
1.7.2.3


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

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

* [PATCH 04/17] ARM i.MX35: Add IPU base address
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (2 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 03/17] ARM i.MX: Add header protection Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 05/17] ARM pcm043: Use device functions Sascha Hauer
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

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

diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h
index 89ca7ea..75825e5 100644
--- a/arch/arm/mach-imx/include/mach/imx35-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx35-regs.h
@@ -51,6 +51,7 @@
 #define IMX_SDHC1_BASE		0x53FB4000
 #define IMX_SDHC2_BASE		0x53FB8000
 #define IMX_SDHC3_BASE		0x53FBC000
+#define IMX_IPU_BASE		0x53FC0000
 #define IMX_OTG_BASE		0x53FF4000
 #define IMX_WDOG_BASE		0x53fdc000
 
-- 
1.7.2.3


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

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

* [PATCH 05/17] ARM pcm043: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (3 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 04/17] ARM i.MX35: Add IPU base address Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 06/17] ARM pca100: " Sascha Hauer
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/pcm043/pcm043.c |   38 +++++---------------------------------
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
index 5932f95..2191bc8 100644
--- a/arch/arm/boards/pcm043/pcm043.c
+++ b/arch/arm/boards/pcm043/pcm043.c
@@ -43,6 +43,7 @@
 #include <mach/imx-ipu-fb.h>
 #include <mach/imx-pll.h>
 #include <mach/iomux-mx35.h>
+#include <mach/devices-imx35.h>
 
 /*
  * Up to 32MiB NOR type flash, connected to
@@ -59,13 +60,6 @@ static struct fec_platform_data fec_info = {
 	.xcv_type = MII100,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = IMX_FEC_BASE,
-	.platform_data	= &fec_info,
-};
-
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
 	.flags = DEVFS_RDWR,
@@ -85,13 +79,6 @@ struct imx_nand_platform_data nand_info = {
 	.flash_bbt = 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = IMX_NFC_BASE,
-	.platform_data	= &nand_info,
-};
-
 #ifdef CONFIG_PCM043_DISPLAY_SHARP
 static struct fb_videomode pcm043_fb_mode = {
 	/* 240x320 @ 60 Hz */
@@ -135,14 +122,6 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.bpp		= 16,
 };
 
-static struct device_d imx_ipu_fb_dev = {
-	.id		= -1,
-	.name		= "imx-ipu-fb",
-	.map_base	= 0x53fc0000,
-	.size		= 0x1000,
-	.platform_data	= &ipu_fb_data,
-};
-
 #ifdef CONFIG_MMU
 static int pcm043_mmu_init(void)
 {
@@ -185,11 +164,11 @@ static int imx35_devices_init(void)
 	else
 		nand_info.width = 1;    /* 8 bit */
 
-	register_device(&fec_dev);
+	imx35_add_fec(&fec_info);
 	/*
 	 * This platform supports NOR and NAND
 	 */
-	register_device(&nand_dev);
+	imx35_add_nand(&nand_info);
 	register_device(&cfi_dev);
 
 	if ((reg & 0xc00) == 0x800) {   /* reset mode: external boot */
@@ -210,7 +189,7 @@ static int imx35_devices_init(void)
 	}
 
 	register_device(&sdram0_dev);
-	register_device(&imx_ipu_fb_dev);
+	imx35_add_fb(&ipu_fb_data);
 
 	armlinux_add_dram(&sdram0_dev);
 	armlinux_set_bootparams((void *)0x80000100);
@@ -221,13 +200,6 @@ static int imx35_devices_init(void)
 
 device_initcall(imx35_devices_init);
 
-static struct device_d imx35_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 16 * 1024,
-};
-
 static struct pad_desc pcm043_pads[] = {
 	MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
 	MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
@@ -261,7 +233,7 @@ static int imx35_console_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
 
-	register_device(&imx35_serial_device);
+	imx35_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 06/17] ARM pca100: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (4 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 05/17] ARM pcm043: Use device functions Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 07/17] ARM pcm038: " Sascha Hauer
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/phycard-i.MX27/pca100.c |   28 +++++-----------------------
 1 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 3a96180..32f7e74 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -1,4 +1,4 @@
-	/*
+/*
  * Copyright (C) 2007 Sascha Hauer, Pengutronix 
  *
  * This program is free software; you can redistribute it and/or
@@ -39,6 +39,7 @@
 #include <asm/mmu.h>
 #include <usb/isp1504.h>
 #include <mach/iomux-mx27.h>
+#include <mach/devices-imx27.h>
 
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
@@ -58,26 +59,12 @@ static struct fec_platform_data fec_info = {
 	.phy_addr = 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = 0x1002b000,
-	.platform_data	= &fec_info,
-};
-
 struct imx_nand_platform_data nand_info = {
 	.width = 1,
 	.hw_ecc = 1,
 	.flash_bbt = 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xd8000000,
-	.platform_data	= &nand_info,
-};
-
 #ifdef CONFIG_USB
 static struct device_d usbh2_dev = {
 	.id	  = -1,
@@ -110,11 +97,6 @@ static void pca100_usbh_init(void)
 }
 #endif
 
-static struct device_d mmc_dev = {
-	.name		= "imx-mmc",
-	.map_base	= 0x10014000,
-};
-
 #ifdef CONFIG_MMU
 static void pca100_mmu_init(void)
 {
@@ -207,10 +189,10 @@ static int pca100_devices_init(void)
 	for (i = 0; i < ARRAY_SIZE(mode); i++)
 		imx_gpio_mode(mode[i]);
 
-	register_device(&nand_dev);
+	imx27_add_nand(&nand_info);
 	register_device(&sdram_dev);
-	register_device(&fec_dev);
-	register_device(&mmc_dev);
+	imx27_add_fec(&fec_info);
+	imx27_add_mmc0(NULL);
 
 	PCCR1 |= PCCR1_PERCLK2_EN;
 
-- 
1.7.2.3


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

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

* [PATCH 07/17] ARM pcm038: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (5 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 06/17] ARM pca100: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 08/17] ARM pcm037: " Sascha Hauer
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/pcm038/pcm038.c |   47 +++++----------------------------------
 1 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 3a9b413..1dbc6b6 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -43,6 +43,7 @@
 #include <usb/isp1504.h>
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
+#include <mach/devices-imx27.h>
 
 #include "pll.h"
 
@@ -84,13 +85,6 @@ static struct fec_platform_data fec_info = {
 	.phy_addr = 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = 0x1002b000,
-	.platform_data	= &fec_info,
-};
-
 static int pcm038_spi_cs[] = {GPIO_PORTD + 28};
 
 static struct spi_imx_master pcm038_spi_0_data = {
@@ -98,13 +92,6 @@ static struct spi_imx_master pcm038_spi_0_data = {
 	.num_chipselect = ARRAY_SIZE(pcm038_spi_cs),
 };
 
-static struct device_d spi_dev = {
-	.id	  = -1,
-	.name     = "imx_spi",
-	.map_base = 0x1000e000,
-	.platform_data = &pcm038_spi_0_data,
-};
-
 static struct spi_board_info pcm038_spi_board_info[] = {
 	{
 		.name = "mc13783",
@@ -120,13 +107,6 @@ static struct imx_nand_platform_data nand_info = {
 	.flash_bbt	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xd8000000,
-	.platform_data	= &nand_info,
-};
-
 static struct imx_fb_videomode imxfb_mode = {
 	.mode = {
 		.name		= "Sharp-LQ035Q7",
@@ -161,14 +141,6 @@ static struct imx_fb_platform_data pcm038_fb_data = {
 	.dmacr	= 0x00020010,
 };
 
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name		= "imxfb",
-	.map_base	= 0x10021000,
-	.size		= 0x1000,
-	.platform_data	= &pcm038_fb_data,
-};
-
 #ifdef CONFIG_USB
 static struct device_d usbh2_dev = {
 	.id	  = -1,
@@ -323,13 +295,13 @@ static int pcm038_devices_init(void)
 	gpio_direction_output(GPIO_PORTD | 28, 0);
 	gpio_set_value(GPIO_PORTD | 28, 0);
 	spi_register_board_info(pcm038_spi_board_info, ARRAY_SIZE(pcm038_spi_board_info));
-	register_device(&spi_dev);
+	imx27_add_spi0(&pcm038_spi_0_data);
 
 	register_device(&cfi_dev);
-	register_device(&nand_dev);
+	imx27_add_nand(&nand_info);
 	register_device(&sdram_dev);
 	register_device(&sram_dev);
-	register_device(&imxfb_dev);
+	imx27_add_fb(&pcm038_fb_data);
 
 #ifdef CONFIG_USB
 	pcm038_usbh_init();
@@ -339,7 +311,7 @@ static int pcm038_devices_init(void)
 	/* Register the fec device after the PLL re-initialisation
 	 * as the fec depends on the (now higher) ipg clock
 	 */
-	register_device(&fec_dev);
+	imx27_add_fec(&fec_info);
 
 	switch ((GPCR & GPCR_BOOT_MASK) >> GPCR_BOOT_SHIFT) {
 	case GPCR_BOOT_8BIT_NAND_2k:
@@ -372,16 +344,9 @@ static int pcm038_devices_init(void)
 
 device_initcall(pcm038_devices_init);
 
-static struct device_d pcm038_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 4096,
-};
-
 static int pcm038_console_init(void)
 {
-	register_device(&pcm038_serial_device);
+	imx27_add_uart0();
 
 	return 0;
 }
-- 
1.7.2.3


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

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

* [PATCH 08/17] ARM pcm037: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (6 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 07/17] ARM pcm038: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 09/17] ARM imx27ads: " Sascha Hauer
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/pcm037/pcm037.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index 89e2481..ffecec2 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -37,7 +37,7 @@
 #include <partition.h>
 #include <generated/mach-types.h>
 #include <mach/imx-nand.h>
-
+#include <mach/devices-imx31.h>
 
 /*
  * Up to 32MiB NOR type flash, connected to
@@ -126,13 +126,6 @@ struct imx_nand_platform_data nand_info = {
 	.flash_bbt = 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xB8000000,
-	.platform_data	= &nand_info,
-};
-
 #ifdef CONFIG_USB
 static struct device_d usbotg_dev = {
 	.id	  = -1,
@@ -295,7 +288,7 @@ static int imx31_devices_init(void)
 	protect_file("/dev/env0", 1);
 
 	register_device(&sram_dev);
-	register_device(&nand_dev);
+	imx31_add_nand(&nand_info);
 	register_device(&network_dev);
 
 	register_device(&sdram0_dev);
@@ -320,13 +313,6 @@ static int imx31_devices_init(void)
 
 device_initcall(imx31_devices_init);
 
-static struct device_d imx31_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 16 * 1024,
-};
-
 static int imx31_console_init(void)
 {
 	/* init gpios for serial port */
@@ -335,7 +321,7 @@ static int imx31_console_init(void)
 	imx_iomux_mode(MX31_PIN_CTS1__CTS1);
 	imx_iomux_mode(MX31_PIN_RTS1__RTS1);
 
-	register_device(&imx31_serial_device);
+	imx31_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 09/17] ARM imx27ads: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (7 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 08/17] ARM pcm037: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 10/17] ARM imx21ads: " Sascha Hauer
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/imx27ads/imx27ads.c |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boards/imx27ads/imx27ads.c b/arch/arm/boards/imx27ads/imx27ads.c
index ae5da7f..0d433c1 100644
--- a/arch/arm/boards/imx27ads/imx27ads.c
+++ b/arch/arm/boards/imx27ads/imx27ads.c
@@ -32,6 +32,7 @@
 #include <fcntl.h>
 #include <generated/mach-types.h>
 #include <mach/iomux-mx27.h>
+#include <mach/devices-imx27.h>
 
 static struct device_d cfi_dev = {
 	.id	  = -1,
@@ -58,13 +59,6 @@ static struct fec_platform_data fec_info = {
 	.phy_addr = 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = 0x1002b000,
-	.platform_data	= &fec_info,
-};
-
 static int imx27ads_timing_init(void)
 {
 	/* configure cpld on cs4 */
@@ -134,7 +128,7 @@ static int mx27ads_devices_init(void)
 
 	register_device(&cfi_dev);
 	register_device(&sdram_dev);
-	register_device(&fec_dev);
+	imx27_add_fec(&fec_info);
 
 	devfs_add_partition("nor0", 0x00000, 0x20000, PARTITION_FIXED, "self0");
 	devfs_add_partition("nor0", 0x20000, 0x20000, PARTITION_FIXED, "env0");
@@ -149,16 +143,9 @@ static int mx27ads_devices_init(void)
 
 device_initcall(mx27ads_devices_init);
 
-static struct device_d mx27ads_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 4096,
-};
-
 static int mx27ads_console_init(void)
 {
-	register_device(&mx27ads_serial_device);
+	imx27_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 10/17] ARM imx21ads: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (8 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 09/17] ARM imx27ads: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 11/17] ARM mx51 babbage: " Sascha Hauer
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/imx21ads/imx21ads.c |   29 ++++-------------------------
 1 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c
index 44d37aa..3942581 100644
--- a/arch/arm/boards/imx21ads/imx21ads.c
+++ b/arch/arm/boards/imx21ads/imx21ads.c
@@ -36,6 +36,7 @@
 #include <mach/imx-nand.h>
 #include <mach/imxfb.h>
 #include <mach/iomux-mx21.h>
+#include <mach/devices-imx21.h>
 
 #define MX21ADS_IO_REG    0xCC800000
 #define MX21ADS_IO_LCDON  (1 << 9)
@@ -65,13 +66,6 @@ struct imx_nand_platform_data nand_info = {
 	.hw_ecc = 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xDF003000,
-	.platform_data  = &nand_info,
-};
-
 static struct device_d cs8900_dev = {
 	.id	  = -1,
 	.name     = "cs8900",
@@ -111,14 +105,6 @@ static struct imx_fb_platform_data imx_fb_data = {
 	.dmacr          = 0x00020008,
 };
 
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name           = "imxfb",
-	.map_base       = 0x10021000,
-	.size           = 0x1000,
-	.platform_data  = &imx_fb_data,
-};
-
 static int imx21ads_timing_init(void)
 {
 	u32 temp;
@@ -199,9 +185,9 @@ static int mx21ads_devices_init(void)
 
 	register_device(&cfi_dev);
 	register_device(&sdram_dev);
-	register_device(&nand_dev);
+	imx21_add_nand(&nand_info);
 	register_device(&cs8900_dev);
-	register_device(&imxfb_dev);
+	imx21_add_fb(&imx_fb_data);
 
 	armlinux_add_dram(&sdram_dev);
 	armlinux_set_bootparams((void *)0xc0000100);
@@ -224,16 +210,9 @@ static int mx21ads_enable_display(void)
 
 late_initcall(mx21ads_enable_display);
 
-static struct device_d mx21ads_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 4096,
-};
-
 static int mx21ads_console_init(void)
 {
-	register_device(&mx21ads_serial_device);
+	imx21_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 11/17] ARM mx51 babbage: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (9 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 10/17] ARM imx21ads: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 12/17] ARM neso: " Sascha Hauer
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx51-pdk/board.c |   33 ++++-----------------------
 1 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
index 5197c55..ff779ca 100644
--- a/arch/arm/boards/freescale-mx51-pdk/board.c
+++ b/arch/arm/boards/freescale-mx51-pdk/board.c
@@ -39,6 +39,7 @@
 #include <mach/spi.h>
 #include <mach/generic.h>
 #include <mach/iomux-mx51.h>
+#include <mach/devices-imx51.h>
 
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
@@ -57,17 +58,6 @@ static struct fec_platform_data fec_info = {
 	.xcv_type = MII100,
 };
 
-static struct device_d fec_dev = {
-	.name     = "fec_imx",
-	.map_base = 0x83fec000,
-	.platform_data	= &fec_info,
-};
-
-static struct device_d esdhc_dev = {
-	.name     = "imx-esdhc",
-	.map_base = 0x70004000,
-};
-
 static struct pad_desc f3s_pads[] = {
 	MX51_PAD_EIM_EB2__FEC_MDIO,
 	MX51_PAD_EIM_EB3__FEC_RDATA1,
@@ -130,13 +120,6 @@ static struct spi_imx_master spi_0_data = {
 	.num_chipselect = ARRAY_SIZE(spi_0_cs),
 };
 
-static struct device_d spi_dev = {
-	.id       = -1,
-	.name     = "imx_spi",
-	.map_base = MX51_CSPI1_BASE_ADDR,
-	.platform_data = &spi_0_data,
-};
-
 static const struct spi_board_info mx51_babbage_spi_board_info[] = {
 	{
 		.name = "mc13892-spi",
@@ -268,12 +251,12 @@ static int f3s_devices_init(void)
 	babbage_mmu_init();
 
 	register_device(&sdram_dev);
-	register_device(&fec_dev);
-	register_device(&esdhc_dev);
+	imx51_add_fec(&fec_info);
+	imx51_add_mmc0(NULL);
 
 	spi_register_board_info(mx51_babbage_spi_board_info,
 			ARRAY_SIZE(mx51_babbage_spi_board_info));
-	register_device(&spi_dev);
+	imx51_add_spi0(&spi_0_data);
 
 	babbage_power_init();
 
@@ -295,12 +278,6 @@ static int f3s_part_init(void)
 }
 late_initcall(f3s_part_init);
 
-static struct device_d f3s_serial_device = {
-	.name     = "imx_serial",
-	.map_base = 0x73fbc000,
-	.size     = 4096,
-};
-
 static int f3s_console_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(f3s_pads, ARRAY_SIZE(f3s_pads));
@@ -310,7 +287,7 @@ static int f3s_console_init(void)
 	writel(0, 0x73fa8230);
 	writel(0, 0x73fa8234);
 
-	register_device(&f3s_serial_device);
+	imx51_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 12/17] ARM neso: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (10 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 11/17] ARM mx51 babbage: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 13/17] ARM mx35 3ds: " Sascha Hauer
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/guf-neso/board.c |   38 +++++---------------------------------
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 9c85c08..d371dd6 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -44,6 +44,7 @@
 #include <mach/imx-nand.h>
 #include <mach/imx-pll.h>
 #include <mach/imxfb.h>
+#include <mach/devices-imx27.h>
 
 /* two pins are controlling the CS signals to the USB phys */
 #define USBH2_PHY_CS_GPIO (GPIO_PORTF + 20)
@@ -71,26 +72,12 @@ static struct fec_platform_data fec_info = {
 	.phy_addr = 31,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = 0x1002b000,
-	.platform_data	= &fec_info,
-};
-
 static struct imx_nand_platform_data nand_info = {
 	.width		= 1,
 	.hw_ecc		= 1,
 	.flash_bbt	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xd8000000,
-	.platform_data	= &nand_info,
-};
-
 static struct imx_fb_videomode imxfb_mode = {
 	.mode = {
 		.name		= "CPT CLAA070LC0JCT",
@@ -139,14 +126,6 @@ static struct imx_fb_platform_data neso_fb_data = {
 	.framebuffer_ovl = (void *)0xa7f00000,
 };
 
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name		= "imxfb",
-	.map_base	= 0x10021000,
-	.size		= 0x1000,
-	.platform_data	= &neso_fb_data,
-};
-
 #ifdef CONFIG_USB
 
 static struct device_d usbh2_dev = {
@@ -334,16 +313,16 @@ static int neso_devices_init(void)
 	for (i = 0; i < ARRAY_SIZE(mode); i++)
 		imx_gpio_mode(mode[i]);
 
-	register_device(&nand_dev);
+	imx27_add_nand(&nand_info);
 	register_device(&sdram_dev);
-	register_device(&imxfb_dev);
+	imx27_add_fb(&neso_fb_data);
 
 #ifdef CONFIG_USB
 	neso_usbh_init();
 	register_device(&usbh2_dev);
 #endif
 
-	register_device(&fec_dev);
+	imx27_add_fec(&fec_info);
 
 	devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw");
 	dev_add_bb_dev("self_raw", "self0");
@@ -360,16 +339,9 @@ static int neso_devices_init(void)
 
 device_initcall(neso_devices_init);
 
-static struct device_d neso_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 4096,
-};
-
 static int neso_console_init(void)
 {
-	register_device(&neso_serial_device);
+	imx27_add_uart0();
 
 	return 0;
 }
-- 
1.7.2.3


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

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

* [PATCH 13/17] ARM mx35 3ds: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (11 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 12/17] ARM neso: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 14/17] ARM mx25 " Sascha Hauer
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx35-3-stack/3stack.c |   38 +++--------------------
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
index d6699cd..127bfb4 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
@@ -48,6 +48,7 @@
 #include <mach/pmic.h>
 #include <mach/imx-ipu-fb.h>
 #include <mach/generic.h>
+#include <mach/devices-imx35.h>
 
 #include <i2c/i2c.h>
 #include <mfd/mc13892.h>
@@ -70,13 +71,6 @@ static struct fec_platform_data fec_info = {
 	.phy_addr	= 0x1F,
 };
 
-static struct device_d fec_dev = {
-	.id		= -1,
-	.name		= "fec_imx",
-	.map_base	= IMX_FEC_BASE,
-	.platform_data	= &fec_info,
-};
-
 static struct memory_platform_data sdram_pdata = {
 	.name	= "ram0",
 	.flags	= DEVFS_RDWR,
@@ -95,13 +89,6 @@ struct imx_nand_platform_data nand_info = {
 	.flash_bbt	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id		= -1,
-	.name		= "imx_nand",
-	.map_base	= IMX_NFC_BASE,
-	.platform_data	= &nand_info,
-};
-
 static struct device_d smc911x_dev = {
 	.id		= -1,
 	.name		= "smc911x",
@@ -149,14 +136,6 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.bpp		= 16,
 };
 
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name		= "imx-ipu-fb",
-	.map_base	= 0x53fc0000,
-	.size		= 0x1000,
-	.platform_data	= &ipu_fb_data,
-};
-
 /*
  * Revision to be passed to kernel. The kernel provided
  * by freescale relies on this.
@@ -202,7 +181,7 @@ static int f3s_devices_init(void)
 	/*
 	 * This platform supports NOR and NAND
 	 */
-	register_device(&nand_dev);
+	imx35_add_nand(&nand_info);
 	register_device(&cfi_dev);
 
 	switch ((reg >> 25) & 0x3) {
@@ -225,11 +204,11 @@ static int f3s_devices_init(void)
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
 	register_device(&i2c_dev);
 
-	register_device(&fec_dev);
+	imx35_add_fec(&fec_info);
 	register_device(&smc911x_dev);
 
 	register_device(&sdram_dev);
-	register_device(&imxfb_dev);
+	imx35_add_fb(&ipu_fb_data);
 
 	armlinux_add_dram(&sdram_dev);
 	armlinux_set_bootparams((void *)0x80000100);
@@ -250,13 +229,6 @@ static int f3s_enable_display(void)
 
 late_initcall(f3s_enable_display);
 
-static struct device_d f3s_serial_device = {
-	.id		= -1,
-	.name		= "imx_serial",
-	.map_base	= IMX_UART1_BASE,
-	.size		= 4096,
-};
-
 static struct pad_desc f3s_pads[] = {
 	MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
 	MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
@@ -322,7 +294,7 @@ static int f3s_console_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(f3s_pads, ARRAY_SIZE(f3s_pads));
 
-	register_device(&f3s_serial_device);
+	imx35_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 14/17] ARM mx25 3ds: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (12 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 13/17] ARM mx35 3ds: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 15/17] ARM eukrea cpuimx35: " Sascha Hauer
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx25-3-stack/3stack.c |   36 +++-------------------
 1 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index 25945f1..49b7f5c 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -40,6 +40,7 @@
 #include <linux/err.h>
 #include <i2c/i2c.h>
 #include <mfd/mc34704.h>
+#include <mach/devices-imx25.h>
 
 extern unsigned long _stext;
 extern void exception_vectors(void);
@@ -112,13 +113,6 @@ static struct fec_platform_data fec_info = {
 	.phy_addr	= 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = IMX_FEC_BASE,
-	.platform_data	= &fec_info,
-};
-
 static struct memory_platform_data sdram_pdata = {
 	.name	= "ram0",
 	.flags	= DEVFS_RDWR,
@@ -156,13 +150,6 @@ struct imx_nand_platform_data nand_info = {
 	.hw_ecc	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = IMX_NFC_BASE,
-	.platform_data	= &nand_info,
-};
-
 #ifdef CONFIG_USB
 static void imx25_usb_init(void)
 {
@@ -197,12 +184,6 @@ static struct i2c_board_info i2c_devices[] = {
 	},
 };
 
-static struct device_d i2c_dev = {
-	.id	  = -1,
-	.name     = "i2c-imx",
-	.map_base = IMX_I2C1_BASE,
-};
-
 static int imx25_3ds_pmic_init(void)
 {
 	struct mc34704 *pmic;
@@ -259,12 +240,12 @@ static int imx25_devices_init(void)
 	register_device(&usbh2_dev);
 #endif
 
-	register_device(&fec_dev);
+	imx25_add_fec(&fec_info);
 
 	if (readl(IMX_CCM_BASE + CCM_RCSR) & (1 << 14))
 		nand_info.width = 2;
 
-	register_device(&nand_dev);
+	imx25_add_nand(&nand_info);
 
 	devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw");
 	dev_add_bb_dev("self_raw", "self0");
@@ -276,7 +257,7 @@ static int imx25_devices_init(void)
 	register_device(&sram0_dev);
 
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	register_device(&i2c_dev);
+	imx25_add_i2c0(NULL);
 
 	armlinux_add_dram(&sdram0_dev);
 	armlinux_set_bootparams((void *)0x80000100);
@@ -288,13 +269,6 @@ static int imx25_devices_init(void)
 
 device_initcall(imx25_devices_init);
 
-static struct device_d imx25_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 16 * 1024,
-};
-
 static struct pad_desc imx25_pads[] = {
 	MX25_PAD_FEC_MDC__MDC,
 	MX25_PAD_FEC_MDIO__MDIO,
@@ -339,7 +313,7 @@ static int imx25_console_init(void)
 
 	writel(0x03010101, 0x53f80024);
 
-	register_device(&imx25_serial_device);
+	imx25_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 15/17] ARM eukrea cpuimx35: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (13 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 14/17] ARM mx25 " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 16/17] ARM eukrea cpuimx27: " Sascha Hauer
  2010-11-02 17:17 ` [PATCH 17/17] ARM eukrea cpuimx25: " Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c |   53 +++------------------
 1 files changed, 7 insertions(+), 46 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index dfe64d0..07f320b 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -54,19 +54,13 @@
 #include <i2c/i2c.h>
 #include <usb/fsl_usb2.h>
 #include <mach/usb.h>
+#include <mach/devices-imx35.h>
 
 static struct fec_platform_data fec_info = {
 	.xcv_type	= MII100,
 	.phy_addr	= 0x1F,
 };
 
-static struct device_d fec_dev = {
-	.id		= -1,
-	.name		= "fec_imx",
-	.map_base	= IMX_FEC_BASE,
-	.platform_data	= &fec_info,
-};
-
 static struct memory_platform_data sdram_pdata = {
 	.name	= "ram0",
 	.flags	= DEVFS_RDWR,
@@ -86,13 +80,6 @@ struct imx_nand_platform_data nand_info = {
 	.flash_bbt	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id		= -1,
-	.name		= "imx_nand",
-	.map_base	= IMX_NFC_BASE,
-	.platform_data	= &nand_info,
-};
-
 static struct fb_videomode imxfb_mode = {
 	.name		= "CMO_QVGA",
 	.refresh	= 60,
@@ -121,25 +108,6 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.enable		= eukrea_cpuimx35_enable_display,
 };
 
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name		= "imx-ipu-fb",
-	.map_base	= 0x53fc0000,
-	.size		= 0x1000,
-	.platform_data	= &ipu_fb_data,
-};
-
-static struct device_d i2c_dev = {
-	.id	  = -1,
-	.name     = "i2c-imx",
-	.map_base = IMX_I2C1_BASE,
-};
-
-static struct device_d esdhc_dev = {
-	.name		= "imx-esdhc",
-	.map_base	= IMX_SDHC1_BASE,
-};
-
 #ifdef CONFIG_USB
 static void imx35_usb_init(void)
 {
@@ -212,20 +180,20 @@ static int eukrea_cpuimx35_devices_init(void)
 {
 	unsigned int tmp;
 
-	register_device(&nand_dev);
+	imx35_add_nand(&nand_info);
 
 	devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw");
 	dev_add_bb_dev("self_raw", "self0");
 	devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw");
 	dev_add_bb_dev("env_raw", "env0");
 
-	register_device(&fec_dev);
+	imx35_add_fec(&fec_info);
 
 	register_device(&sdram_dev);
-	register_device(&imxfb_dev);
+	imx35_add_fb(&ipu_fb_data);
 
-	register_device(&i2c_dev);
-	register_device(&esdhc_dev);
+	imx35_add_i2c0(NULL);
+	imx35_add_mmc0(NULL);
 
 #ifdef CONFIG_USB
 	imx35_usb_init();
@@ -245,13 +213,6 @@ static int eukrea_cpuimx35_devices_init(void)
 
 device_initcall(eukrea_cpuimx35_devices_init);
 
-static struct device_d eukrea_cpuimx35_serial_device = {
-	.id		= -1,
-	.name		= "imx_serial",
-	.map_base	= IMX_UART1_BASE,
-	.size		= 4096,
-};
-
 static struct pad_desc eukrea_cpuimx35_pads[] = {
 	MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
 	MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
@@ -306,7 +267,7 @@ static int eukrea_cpuimx35_console_init(void)
 	/* led default off */
 	gpio_direction_output(32 * 2 + 29, 1);
 
-	register_device(&eukrea_cpuimx35_serial_device);
+	imx35_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

* [PATCH 16/17] ARM eukrea cpuimx27: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (14 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 15/17] ARM eukrea cpuimx35: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  2010-11-02 17:17 ` [PATCH 17/17] ARM eukrea cpuimx25: " Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c |   27 +++-----------------
 1 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index 62fc14e..4567cba 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -46,6 +46,7 @@
 #include <i2c/i2c.h>
 #include <mfd/lp3972.h>
 #include <mach/iomux-mx27.h>
+#include <mach/devices-imx27.h>
 
 static struct device_d cfi_dev = {
 	.id	  = -1,
@@ -86,26 +87,12 @@ static struct fec_platform_data fec_info = {
 	.phy_addr = 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = 0x1002b000,
-	.platform_data	= &fec_info,
-};
-
 struct imx_nand_platform_data nand_info = {
 	.width = 1,
 	.hw_ecc = 1,
 	.flash_bbt = 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = 0xd8000000,
-	.platform_data	= &nand_info,
-};
-
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 unsigned int quad_uart_read(unsigned long base, unsigned char reg_idx)
 {
@@ -156,12 +143,6 @@ static struct i2c_board_info i2c_devices[] = {
 	},
 };
 
-static struct device_d i2c_dev = {
-	.id		= -1,
-	.name		= "i2c-imx",
-	.map_base	= IMX_I2C1_BASE,
-};
-
 #ifdef CONFIG_MMU
 static void eukrea_cpuimx27_mmu_init(void)
 {
@@ -294,12 +275,12 @@ static int eukrea_cpuimx27_devices_init(void)
 #ifdef CONFIG_EUKREA_CPUIMX27_NOR_64MB
 	register_device(&cfi_dev1);
 #endif
-	register_device(&nand_dev);
+	imx27_add_nand(&nand_info);
 	register_device(&sdram_dev);
 
 	PCCR0 |= PCCR0_I2C1_EN;
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	register_device(&i2c_dev);
+	imx27_add_i2c0(NULL);
 
 	devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
 	devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
@@ -359,7 +340,7 @@ static int eukrea_cpuimx27_late_init(void)
 	u8 reg[1];
 #endif
 	console_flush();
-	register_device(&fec_dev);
+	imx27_add_fec(&fec_info);
 
 #ifdef CONFIG_I2C_LP3972
 	client = lp3972_get_client();
-- 
1.7.2.3


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

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

* [PATCH 17/17] ARM eukrea cpuimx25: Use device functions
  2010-11-02 17:17 device register functions for i.MX Sascha Hauer
                   ` (15 preceding siblings ...)
  2010-11-02 17:17 ` [PATCH 16/17] ARM eukrea cpuimx27: " Sascha Hauer
@ 2010-11-02 17:17 ` Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:17 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c |   54 +++------------------
 1 files changed, 7 insertions(+), 47 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 805ffe2..3048c3f 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -43,6 +43,7 @@
 #include <i2c/i2c.h>
 #include <usb/fsl_usb2.h>
 #include <mach/usb.h>
+#include <mach/devices-imx25.h>
 
 extern unsigned long _stext;
 extern void exception_vectors(void);
@@ -88,13 +89,6 @@ static struct fec_platform_data fec_info = {
 	.phy_addr	= 1,
 };
 
-static struct device_d fec_dev = {
-	.id	  = -1,
-	.name     = "fec_imx",
-	.map_base = IMX_FEC_BASE,
-	.platform_data	= &fec_info,
-};
-
 static struct memory_platform_data sdram_pdata = {
 	.name	= "ram0",
 	.flags	= DEVFS_RDWR,
@@ -113,13 +107,6 @@ struct imx_nand_platform_data nand_info = {
 	.hw_ecc	= 1,
 };
 
-static struct device_d nand_dev = {
-	.id	  = -1,
-	.name     = "imx_nand",
-	.map_base = IMX_NFC_BASE,
-	.platform_data	= &nand_info,
-};
-
 static struct imx_fb_videomode imxfb_mode = {
 	.mode = {
 		.name		= "CMO-QVGA",
@@ -145,26 +132,6 @@ static struct imx_fb_platform_data eukrea_cpuimx25_fb_data = {
 	.dmacr		= 0x80040060,
 };
 
-
-static struct device_d imxfb_dev = {
-	.id		= -1,
-	.name		= "imxfb",
-	.map_base	= 0x53fbc000,
-	.size		= 0x1000,
-	.platform_data	= &eukrea_cpuimx25_fb_data,
-};
-
-static struct device_d i2c_dev = {
-	.id	  = -1,
-	.name     = "i2c-imx",
-	.map_base = IMX_I2C1_BASE,
-};
-
-static struct device_d esdhc_dev = {
-	.name		= "imx-esdhc",
-	.map_base	= 0x53fb4000,
-};
-
 #ifdef CONFIG_USB
 static void imx25_usb_init(void)
 {
@@ -285,10 +252,10 @@ static int eukrea_cpuimx25_devices_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads,
 		ARRAY_SIZE(eukrea_cpuimx25_pads));
 
-	register_device(&fec_dev);
+	imx25_add_fec(&fec_info);
 
 	nand_info.width = 1;
-	register_device(&nand_dev);
+	imx25_add_nand(&nand_info);
 
 	devfs_add_partition("nand0", 0x00000, 0x40000,
 		PARTITION_FIXED, "self_raw");
@@ -304,10 +271,10 @@ static int eukrea_cpuimx25_devices_init(void)
 	gpio_direction_output(26, 1);
 	gpio_set_value(26, 1);
 
-	register_device(&imxfb_dev);
+	imx25_add_fb(&eukrea_cpuimx25_fb_data);
 
-	register_device(&i2c_dev);
-	register_device(&esdhc_dev);
+	imx25_add_i2c0(NULL);
+	imx25_add_mmc0(NULL);
 
 #ifdef CONFIG_USB
 	imx25_usb_init();
@@ -324,16 +291,9 @@ static int eukrea_cpuimx25_devices_init(void)
 
 device_initcall(eukrea_cpuimx25_devices_init);
 
-static struct device_d eukrea_cpuimx25_serial_device = {
-	.id	  = -1,
-	.name     = "imx_serial",
-	.map_base = IMX_UART1_BASE,
-	.size     = 16 * 1024,
-};
-
 static int eukrea_cpuimx25_console_init(void)
 {
-	register_device(&eukrea_cpuimx25_serial_device);
+	imx25_add_uart0();
 	return 0;
 }
 
-- 
1.7.2.3


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

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

end of thread, other threads:[~2010-11-02 17:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 17:17 device register functions for i.MX Sascha Hauer
2010-11-02 17:17 ` [PATCH 01/17] ARM i.MX51: Add SPBA0 base addresses Sascha Hauer
2010-11-02 17:17 ` [PATCH 02/17] ARM i.MX: Add device convenience functions Sascha Hauer
2010-11-02 17:17 ` [PATCH 03/17] ARM i.MX: Add header protection Sascha Hauer
2010-11-02 17:17 ` [PATCH 04/17] ARM i.MX35: Add IPU base address Sascha Hauer
2010-11-02 17:17 ` [PATCH 05/17] ARM pcm043: Use device functions Sascha Hauer
2010-11-02 17:17 ` [PATCH 06/17] ARM pca100: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 07/17] ARM pcm038: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 08/17] ARM pcm037: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 09/17] ARM imx27ads: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 10/17] ARM imx21ads: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 11/17] ARM mx51 babbage: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 12/17] ARM neso: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 13/17] ARM mx35 3ds: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 14/17] ARM mx25 " Sascha Hauer
2010-11-02 17:17 ` [PATCH 15/17] ARM eukrea cpuimx35: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 16/17] ARM eukrea cpuimx27: " Sascha Hauer
2010-11-02 17:17 ` [PATCH 17/17] ARM eukrea cpuimx25: " Sascha Hauer

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