From patchwork Tue Feb 16 02:30:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 79527 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1G2bxAW015252 for ; Tue, 16 Feb 2010 02:38:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255Ab0BPCh6 (ORCPT ); Mon, 15 Feb 2010 21:37:58 -0500 Received: from mail.renesas.com ([202.234.163.13]:53956 "EHLO mail02.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751969Ab0BPCh5 (ORCPT ); Mon, 15 Feb 2010 21:37:57 -0500 X-AuditID: ac140385-00000005000002de-0a-4b7a05036d34 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail02.idc.renesas.com (sendmail) with ESMTP id o1G2btjS014419; Tue, 16 Feb 2010 11:37:55 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id o1G2buT7004096; Tue, 16 Feb 2010 11:37:56 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id o1G2buVg010017; Tue, 16 Feb 2010 11:37:56 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KXW005K9XZ7R7@ims05.idc.renesas.com>; Tue, 16 Feb 2010 11:37:55 +0900 (JST) Date: Tue, 16 Feb 2010 11:30:25 +0900 From: Kuninori Morimoto Subject: [PATCH] ARM: ap4evb: Add SMSC 9220 network support 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.3 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.02-dev (RINDOU) (2009-06-17 Rev.4261) 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 (demeter.kernel.org [140.211.167.41]); Tue, 16 Feb 2010 02:38:00 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 94b545b..f9af231 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -27,11 +27,13 @@ #include #include #include +#include #include #include #include #include +/* MTD */ static struct mtd_partition nor_flash_partitions[] = { { .name = "loader", @@ -84,9 +86,37 @@ static struct platform_device nor_flash_device = { .resource = nor_flash_resources, }; +/* SMSC 9220 */ +static struct resource smc911x_resources[] = { + { + .start = 0x14000000, + .end = 0x16000000 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = 6, + .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 *ap4evb_devices[] __initdata = { &nor_flash_device, + &smc911x_device, }; static struct map_desc ap4evb_io_desc[] __initdata = { @@ -111,10 +141,24 @@ static void __init ap4evb_map_io(void) shmobile_setup_console(); } +#define PORT39CR 0xE6051027 +#define PORT65CR 0xE6052041 static void __init ap4evb_init(void) { sh7372_add_standard_devices(); + /* + * enable SMSC911X + * + * FIXME + * + * AP4 doesn't have pinmux support now. + * So, set the value directly here + */ + __raw_writeb(0x01, PORT65CR); /* enable CS5A */ + __raw_writeb(0x00, PORT39CR); /* enable IRQ6 */ + enable_irq(6); + platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices)); }