mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Porter <mporter@kernel.crashing.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][PPC32] Redwood[56] support for smc91x Ethernet driver
Date: Fri, 2 Jul 2004 14:12:19 -0700	[thread overview]
Message-ID: <20040702141219.A24135@home.com> (raw)

This patch for linux-2.5 enables the Redwood 5 and Redwood 6 platforms
to use the smc91x ethernet driver.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>

 redwood5.c |   34 +++++++++++++++++++++++++++++++++-
 redwood5.h |    1 +
 redwood6.c |   34 ++++++++++++++++++++++++++++++++++
 redwood6.h |    1 +
 4 files changed, 69 insertions(+), 1 deletion(-)

diff -Nru a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
--- a/arch/ppc/platforms/4xx/redwood5.c	2004-06-23 06:50:11 -07:00
+++ b/arch/ppc/platforms/4xx/redwood5.c	2004-06-23 06:50:11 -07:00
@@ -14,9 +14,41 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
 
+static struct resource smc91x_resources[] = {
+	[0] = {
+		.start	= SMC91111_BASE_ADDR,
+		.end	= SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= SMC91111_IRQ,
+		.end	= SMC91111_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device smc91x_device = {
+	.name		= "smc91x",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(smc91x_resources),
+	.resource	= smc91x_resources,
+};
+
+static struct platform_device *redwood5_devs[] __initdata = {
+	&smc91x_device,
+};
+
+static int __init
+redwood5_platform_add_devices(void)
+{
+	return platform_add_devices(redwood5_devs, ARRAY_SIZE(redwood5_devs));
+}
+
 void __init
 redwood5_setup_arch(void)
 {
@@ -44,7 +76,7 @@
 
 	printk("\n");
 #endif
-
+	device_initcall(redwood5_platform_add_devices);
 }
 
 void __init
diff -Nru a/arch/ppc/platforms/4xx/redwood5.h b/arch/ppc/platforms/4xx/redwood5.h
--- a/arch/ppc/platforms/4xx/redwood5.h	2004-06-23 06:50:11 -07:00
+++ b/arch/ppc/platforms/4xx/redwood5.h	2004-06-23 06:50:11 -07:00
@@ -34,6 +34,7 @@
 
 
 #define SMC91111_BASE_ADDR	0xf2000300
+#define SMC91111_REG_SIZE	16
 #define SMC91111_IRQ		28
 
 #ifdef MAX_HWIFS
diff -Nru a/arch/ppc/platforms/4xx/redwood6.c b/arch/ppc/platforms/4xx/redwood6.c
--- a/arch/ppc/platforms/4xx/redwood6.c	2004-06-23 06:50:11 -07:00
+++ b/arch/ppc/platforms/4xx/redwood6.c	2004-06-23 06:50:11 -07:00
@@ -12,6 +12,8 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/ppc4xx_pic.h>
 #include <linux/delay.h>
@@ -57,6 +59,36 @@
 	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 31: Ext Int 6 */
 };
 
+static struct resource smc91x_resources[] = {
+	[0] = {
+		.start	= SMC91111_BASE_ADDR,
+		.end	= SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= SMC91111_IRQ,
+		.end	= SMC91111_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device smc91x_device = {
+	.name		= "smc91x",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(smc91x_resources),
+	.resource	= smc91x_resources,
+};
+
+static struct platform_device *redwood6_devs[] __initdata = {
+	&smc91x_device,
+};
+
+static int __init
+redwood6_platform_add_devices(void)
+{
+	return platform_add_devices(redwood6_devs, ARRAY_SIZE(redwood6_devs));
+}
+
 
 void __init
 redwood6_setup_arch(void)
@@ -119,6 +151,8 @@
 	printk(KERN_INFO "IBM Redwood6 (STBx25XX) Platform\n");
 	printk(KERN_INFO
 	       "Port by MontaVista Software, Inc. (source@mvista.com)\n");
+
+	device_initcall(redwood6_platform_add_devices);
 }
 
 void __init
diff -Nru a/arch/ppc/platforms/4xx/redwood6.h b/arch/ppc/platforms/4xx/redwood6.h
--- a/arch/ppc/platforms/4xx/redwood6.h	2004-06-23 06:50:11 -07:00
+++ b/arch/ppc/platforms/4xx/redwood6.h	2004-06-23 06:50:11 -07:00
@@ -33,6 +33,7 @@
 #endif				/* !__ASSEMBLY__ */
 
 #define SMC91111_BASE_ADDR	0xf2030300
+#define SMC91111_REG_SIZE	16
 #define SMC91111_IRQ		27
 #define IDE_XLINUX_MUX_BASE        0xf2040000
 #define IDE_DMA_ADDR	0xfce00000


                 reply	other threads:[~2004-07-02 21:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040702141219.A24135@home.com \
    --to=mporter@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®