sh: Solution Enginge 7710/7712 SH-Ether support
authorNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Wed, 18 Jun 2008 09:29:06 +0000 (18:29 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 28 Jul 2008 09:10:30 +0000 (18:10 +0900)
Add support SH-Ether for Hitachi Solution Engine.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/boards/se/770x/setup.c
include/asm-sh/se.h

index 318bc8a3969c2d1d03fbbbb68a8b75225287302a..25767cc3a50db7eed84f6e82c4bd02324cb814b0 100644 (file)
@@ -115,9 +115,58 @@ static struct platform_device heartbeat_device = {
        .resource       = heartbeat_resources,
 };
 
+/* SH771X Ethernet driver */
+static struct resource sh_eth0_resources[] = {
+       [0] = {
+               .start = SH_ETH0_BASE,
+               .end = SH_ETH0_BASE + 0x1B8,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = SH_ETH0_IRQ,
+               .end = SH_ETH0_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth0_device = {
+       .name = "sh-eth",
+       .id     = 0,
+       .dev = {
+               .platform_data = 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 = SH_ETH1_IRQ,
+               .end = SH_ETH1_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth1_device = {
+       .name = "sh-eth",
+       .id     = 1,
+       .dev = {
+               .platform_data = PHY_ID,
+       },
+       .num_resources = ARRAY_SIZE(sh_eth1_resources),
+       .resource = sh_eth1_resources,
+};
+
 static struct platform_device *se_devices[] __initdata = {
        &heartbeat_device,
        &cf_ide_device,
+       &sh_eth0_device,
+       &sh_eth1_device,
 };
 
 static int __init se_devices_setup(void)
index bd2596c014a9d9e77cec4a1f942a27534b7b24e6..0e2f720b96648247bdfa174cb6282e58eacd5e05 100644 (file)
 #define IRQ_CFCARD     7
 #endif
 
+/* SH Ether support (SH7710/SH7712) */
+/* Base address */
+#define SH_ETH0_BASE 0xA7000000
+#define SH_ETH1_BASE 0xA7000400
+/* PHY ID */
+#if defined(CONFIG_CPU_SUBTYPE_SH7710)
+# define PHY_ID 0x00
+#elif defined(CONFIG_CPU_SUBTYPE_SH7712)
+# define PHY_ID 0x01
+#endif
+/* Ether IRQ */
+#define SH_ETH0_IRQ    80
+#define SH_ETH1_IRQ    81
+#define SH_TSU_IRQ     82
+
 #define __IO_PREFIX    se
 #include <asm/io_generic.h>