mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: franck.jullien@gmail.com
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] nios2/generic.c: Add resources for altera TSE
Date: Tue, 26 Jul 2011 22:07:54 +0200	[thread overview]
Message-ID: <1311710877-13004-2-git-send-email-franck.jullien@gmail.com> (raw)
In-Reply-To: <1311710877-13004-1-git-send-email-franck.jullien@gmail.com>

From: Franck Jullien <franck.jullien@gmail.com>

This patch adds resources for the Altera TSE driver as
this driver has been moved to resources usage.

The serial device also uses resources declared with the helps
of add_generic_device.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
 arch/nios2/boards/generic/generic.c |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 089715b..49c1d7c 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -6,20 +6,32 @@
 
 static int phy_address = 1;
 
+static struct resource mac_resources[] = {
+	[0] = {
+		.start	= NIOS_SOPC_TSE_BASE,
+		.size	= 0x400,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= NIOS_SOPC_SGDMA_RX_BASE,
+		.size	= 0x40,
+		.flags	= IORESOURCE_MEM,
+	},
+	[2] = {
+		.start	= NIOS_SOPC_SGDMA_TX_BASE,
+		.size	= 0x40,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
 static struct device_d mac_dev = {
 	.id            = -1,
 	.name          = "altera_tse",
-	.map_base      = NIOS_SOPC_TSE_BASE,
-	.size          = 0x00000400,
+	.num_resources = ARRAY_SIZE(mac_resources),
+	.resource      = mac_resources,
 	.platform_data = &phy_address,
 };
 
-static struct device_d altera_serial_device = {
-	.id       = -1,
-	.name     = "altera_serial",
-	.map_base = NIOS_SOPC_UART_BASE,
-};
-
 /*
 static struct device_d epcs_flash_device = {
 	.id       = -1,
@@ -49,7 +61,8 @@ device_initcall(generic_devices_init);
 
 static int altera_console_init(void)
 {
-	register_device(&altera_serial_device);
+	add_generic_device("altera_serial", -1, NULL, NIOS_SOPC_UART_BASE, 0x20,
+			   IORESOURCE_MEM, NULL);
 
 	return 0;
 }
-- 
1.7.6


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

  reply	other threads:[~2011-07-26 20:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 20:07 [PATCH v2] Switch nios2 devices to resources franck.jullien
2011-07-26 20:07 ` franck.jullien [this message]
2011-07-26 20:07 ` [PATCH 2/4] nios2/altera_tse: Switch " franck.jullien
2011-07-26 20:07 ` [PATCH 3/4] nios2/serial_altera: " franck.jullien
2011-07-26 20:07 ` [PATCH 4/4] nios2/altera_serial_jtag: " franck.jullien
2011-07-27  8:56 ` [PATCH v2] Switch nios2 devices " 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=1311710877-13004-2-git-send-email-franck.jullien@gmail.com \
    --to=franck.jullien@gmail.com \
    --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