From patchwork Mon Nov 29 02:21:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 362722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAT2LPnw012961 for ; Mon, 29 Nov 2010 02:21:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754569Ab0K2CVk (ORCPT ); Sun, 28 Nov 2010 21:21:40 -0500 Received: from mail.renesas.com ([202.234.163.13]:52045 "EHLO mail01.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754404Ab0K2CVk (ORCPT ); Sun, 28 Nov 2010 21:21:40 -0500 X-AuditID: ac140384-00000004000004f6-4d-4cf30e317fd9 Received: from guardian05.idc.renesas.com ([172.20.8.207]) by mail01.idc.renesas.com (sendmail) with ESMTP id oAT2LbOV013101; Mon, 29 Nov 2010 11:21:37 +0900 (JST) Received: (from root@localhost) by guardian05.idc.renesas.com with id oAT2LboW018660; Mon, 29 Nov 2010 11:21:37 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id oAT2LcHr004072; Mon, 29 Nov 2010 11:21:38 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0LCM004U2JW07C@ims05.idc.renesas.com>; Mon, 29 Nov 2010 11:21:37 +0900 (JST) Date: Mon, 29 Nov 2010 11:21:37 +0900 (JST) Date-warning: Date header was inserted by ims05.idc.renesas.com From: Kuninori Morimoto Subject: [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support In-reply-to: To: Paul Mundt Cc: Magnus , Linux-SH 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.7 (=?ISO-2022-JP-2?B?U2Fuag==?= =?ISO-2022-JP-2?B?GyQoRCtXGyhC?=) APEL/10.6 Emacs/23.2 (i386-mingw-nt5.1.2600) MULE/6.0 (HANACHIRUSATO) References: X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Nov 2010 02:21:41 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index b8df709..e2def7e 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -109,8 +110,37 @@ static struct platform_device nor_flash_device = { .resource = nor_flash_resources, }; +/* SMSC */ +static struct resource smc911x_resources[] = { + { + .start = 0x14000000, + .end = 0x16000000 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = evt2irq(0x02c0) /* IRQ6A */, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, + }, +}; + +static struct smsc911x_platform_config smsc911x_info = { + .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, +}; + +static struct platform_device smc911x_device = { + .name = "smsc911x", + .id = -1, + .num_resources = ARRAY_SIZE(smc911x_resources), + .resource = smc911x_resources, + .dev = { + .platform_data = &smsc911x_info, + }, +}; + static struct platform_device *mackerel_devices[] __initdata = { &nor_flash_device, + &smc911x_device, }; static struct map_desc mackerel_io_desc[] __initdata = { @@ -142,6 +172,10 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_SCIFA0_TXD, NULL); gpio_request(GPIO_FN_SCIFA0_RXD, NULL); + /* enable SMSC911X */ + gpio_request(GPIO_FN_CS5A, NULL); + gpio_request(GPIO_FN_IRQ6_39, NULL); + sh7372_add_standard_devices(); platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));