From: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: Add SH Ethernet platform device for Solution Engine
Date: Fri, 18 Jan 2008 08:40:05 +0000 [thread overview]
Message-ID: <479065E5.70109@renesas.com> (raw)
Add SH Ethernet platform device for Solution Engine.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
---
arch/sh/boards/se/770x/setup.c | 53 +++++++++++++++++++++++++++++++
include/asm-sh/se.h | 15 ++++++++
2 files changed, 68 insertions(+)
diff -uprN a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c
--- a/arch/sh/boards/se/770x/setup.c 2008-01-18 10:53:54.000000000 +0900
+++ b/arch/sh/boards/se/770x/setup.c 2008-01-18 16:49:15.000000000 +0900
@@ -2,6 +2,7 @@
* linux/arch/sh/boards/se/770x/setup.c
*
* Copyright (C) 2000 Kazumoto Kojima
+ * Copyright (C) 2007,2008 Nobuhiro Iwamatsu
*
* Hitachi SolutionEngine Support.
*
@@ -115,9 +116,61 @@ static struct platform_device heartbeat_
.resource = heartbeat_resources,
};
+#if defined(CONFIG_SH_ETH)
+static struct resource sh_eth0_resources[] = {
+ [0] = {
+ .start = SH_ETH0_BASE,
+ .end = SH_ETH0_BASE + 0x1B8,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_SH_ETH0,
+ .end = IRQ_SH_ETH0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sh_eth0_device = {
+ .name = "sh-eth",
+ .id = 0,
+ .dev = {
+ .platform_data = (void *)PHY_ID,
+ },
+ .num_resources = ARRAY_SIZE(sh_eth0_resources),
+ .resource = sh_eth0_resources,
+};
+
+static struct resource sh_eth1_resources[] = {
+ [0] = {
+ .start = SH_ETH1_BASE,
+ .end = SH_ETH1_BASE + 0x1B8,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_SH_ETH1,
+ .end = IRQ_SH_ETH1,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sh_eth1_device = {
+ .name = "sh-eth",
+ .id = 1,
+ .dev = {
+ .platform_data = (void *)PHY_ID,
+ },
+ .num_resources = ARRAY_SIZE(sh_eth1_resources),
+ .resource = sh_eth1_resources,
+};
+#endif /* CONFIG_SH_ETH */
+
static struct platform_device *se_devices[] __initdata = {
&heartbeat_device,
&cf_ide_device,
+#if defined(CONFIG_SH_ETH)
+ &sh_eth0_device,
+ &sh_eth1_device,
+#endif
};
static int __init se_devices_setup(void)
diff -uprN a/include/asm-sh/se.h b/include/asm-sh/se.h
--- a/include/asm-sh/se.h 2008-01-18 10:55:02.000000000 +0900
+++ b/include/asm-sh/se.h 2008-01-18 16:36:53.000000000 +0900
@@ -76,6 +76,21 @@
#define IRQ_CFCARD 7
#endif
+/* SH Ethernet */
+#if defined(CONFIG_CPU_SUBTYPE_SH7710)
+#define PHY_ID 0x00
+#elif defined(CONFIG_CPU_SUBTYPE_SH7712)
+#define PHY_ID 0x01
+#endif
+/* Ether Base Address */
+#define SH_ETH0_BASE 0xA7000000
+#define SH_ETH1_BASE 0xA7000400
+#define SH_TSU_ADDR 0xA7000804
+/* Ether IRQs */
+#define IRQ_SH_ETH0 80
+#define IRQ_SH_ETH1 81
+#define IRQ_SH_TSU 82
+
#define __IO_PREFIX se
#include <asm/io_generic.h>
next reply other threads:[~2008-01-18 8:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 8:40 Yoshihiro Shimoda [this message]
2008-01-18 9:06 ` [PATCH] sh: Add SH Ethernet platform device for Solution Engine Paul Mundt
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=479065E5.70109@renesas.com \
--to=shimoda.yoshihiro@renesas.com \
--cc=linux-sh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.