mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox <barebox@lists.infradead.org>
Subject: [PATCH 07/17] ARM pcm038: Use device functions
Date: Tue,  2 Nov 2010 18:17:20 +0100	[thread overview]
Message-ID: <1288718250-24919-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1288718250-24919-1-git-send-email-s.hauer@pengutronix.de>

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

  parent reply	other threads:[~2010-11-02 17:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Sascha Hauer [this message]
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

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=1288718250-24919-8-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