From 7ee90a82974aa08ab97755dbaeb558020eb40efb Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Wed, 18 Jun 2008 18:29:06 +0900 Subject: [PATCH] --- yaml --- r: 106823 b: refs/heads/master c: ffb91ad2751723bcc9925cd38e37013e2169e256 h: refs/heads/master i: 106821: 60dfa876ebf3f97588f541c0aa9905c4f517ab7f 106819: 5de78ee0d80900b7a872de3627e799218ffcdc81 106815: bc74c20dbe8c5eab14b4a7b00ff35a8422c24b23 v: v3 --- [refs] | 2 +- trunk/arch/sh/boards/se/770x/setup.c | 49 ++++++++++++++++++++++++++++ trunk/include/asm-sh/se.h | 15 +++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a9b152b73aa6..ff243a0a40e4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4c1cfab1e0f9a41246cfdcca78f3700fb67f0a5c +refs/heads/master: ffb91ad2751723bcc9925cd38e37013e2169e256 diff --git a/trunk/arch/sh/boards/se/770x/setup.c b/trunk/arch/sh/boards/se/770x/setup.c index 318bc8a3969c..25767cc3a50d 100644 --- a/trunk/arch/sh/boards/se/770x/setup.c +++ b/trunk/arch/sh/boards/se/770x/setup.c @@ -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) diff --git a/trunk/include/asm-sh/se.h b/trunk/include/asm-sh/se.h index bd2596c014a9..0e2f720b9664 100644 --- a/trunk/include/asm-sh/se.h +++ b/trunk/include/asm-sh/se.h @@ -76,6 +76,21 @@ #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