From patchwork Wed Aug 26 11:04:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 44018 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7QB4QjX020453 for ; Wed, 26 Aug 2009 11:04:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757287AbZHZLE1 (ORCPT ); Wed, 26 Aug 2009 07:04:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757288AbZHZLE1 (ORCPT ); Wed, 26 Aug 2009 07:04:27 -0400 Received: from mail.renesas.com ([202.234.163.13]:52461 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757287AbZHZLE0 (ORCPT ); Wed, 26 Aug 2009 07:04:26 -0400 X-AuditID: ac140386-0000000800003037-29-4a9516ba2938 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail03.idc.renesas.com (sendmail) with ESMTP id n7QB4QG3029601; Wed, 26 Aug 2009 20:04:26 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id n7QB4QKc006485; Wed, 26 Aug 2009 20:04:26 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id n7QB4Qc4006960; Wed, 26 Aug 2009 20:04:26 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KOZ00B0HDFE1O@ims05.idc.renesas.com>; Wed, 26 Aug 2009 20:04:26 +0900 (JST) Date: Wed, 26 Aug 2009 20:04:26 +0900 From: Kuninori Morimoto Subject: [PATCH 2/6] sh: Add SH-ETH support for EcoVec24 To: linux-sh@vger.kernel.org Cc: lethal@linux-sh.org Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Kuninori Morimoto --- arch/sh/boards/mach-ecovec24/setup.c | 53 +++++++++++++++++++++++++++++++++- 1 files changed, 52 insertions(+), 1 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index e555b92..8c0c845 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -14,8 +14,10 @@ #include #include #include -#include +#include +#include #include +#include #include /* @@ -93,9 +95,41 @@ static struct platform_device nor_flash_device = { }, }; +/* SH Eth */ +#define SH_ETH_ADDR (0xA4600000) +#define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0) +#define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8) +static struct resource sh_eth_resources[] = { + [0] = { + .start = SH_ETH_ADDR, + .end = SH_ETH_ADDR + 0x1FC, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 91, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + }, +}; + +struct sh_eth_plat_data sh_eth_plat = { + .phy = 0x1f, /* SMSC LAN8700 */ + .edmac_endian = EDMAC_LITTLE_ENDIAN, +}; + +static struct platform_device sh_eth_device = { + .name = "sh-eth", + .id = 0, + .dev = { + .platform_data = &sh_eth_plat, + }, + .num_resources = ARRAY_SIZE(sh_eth_resources), + .resource = sh_eth_resources, +}; + static struct platform_device *ecovec_devices[] __initdata = { &heartbeat_device, &nor_flash_device, + &sh_eth_device, }; static int __init devices_setup(void) @@ -114,6 +148,23 @@ static int __init devices_setup(void) gpio_direction_output(GPIO_PTG2, 0); gpio_direction_output(GPIO_PTG3, 0); + /* enable SH-Eth */ + gpio_request(GPIO_PTA1, NULL); + gpio_direction_output(GPIO_PTA1, 1); + mdelay(20); + + gpio_request(GPIO_FN_RMII_RXD0, NULL); + gpio_request(GPIO_FN_RMII_RXD1, NULL); + gpio_request(GPIO_FN_RMII_TXD0, NULL); + gpio_request(GPIO_FN_RMII_TXD1, NULL); + gpio_request(GPIO_FN_RMII_REF_CLK, NULL); + gpio_request(GPIO_FN_RMII_TX_EN, NULL); + gpio_request(GPIO_FN_RMII_RX_ER, NULL); + gpio_request(GPIO_FN_RMII_CRS_DV, NULL); + gpio_request(GPIO_FN_MDIO, NULL); + gpio_request(GPIO_FN_MDC, NULL); + gpio_request(GPIO_FN_LNKSTA, NULL); + return platform_add_devices(ecovec_devices, ARRAY_SIZE(ecovec_devices)); }