From patchwork Thu May 13 01:08:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 99166 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 o4D181Be031775 for ; Thu, 13 May 2010 01:08:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757881Ab0EMBIY (ORCPT ); Wed, 12 May 2010 21:08:24 -0400 Received: from mail.renesas.com ([202.234.163.13]:61129 "EHLO mail07.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757839Ab0EMBIX (ORCPT ); Wed, 12 May 2010 21:08:23 -0400 X-AuditID: ac14038b-0000000700000202-59-4beb5106367c Received: from guardian05.idc.renesas.com ([172.20.8.207]) by mail07.idc.renesas.com (sendmail) with ESMTP id o4D18M9q016192; Thu, 13 May 2010 10:08:22 +0900 (JST) Received: (from root@localhost) by guardian05.idc.renesas.com with id o4D18M28001629; Thu, 13 May 2010 10:08:22 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id o4D18KA7004344; Thu, 13 May 2010 10:08:20 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0L2C003BD35XHK@ims05.idc.renesas.com>; Thu, 13 May 2010 10:08:22 +0900 (JST) Date: Thu, 13 May 2010 10:08:21 +0900 (JST) Date-warning: Date header was inserted by ims05.idc.renesas.com From: Kuninori Morimoto Subject: [PATCH] ARM: mach-shmobile: ap4evb: Add MMC support To: Paul Mundt Cc: 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.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]); Thu, 13 May 2010 01:08:25 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index a553c16..0e74161 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -107,6 +109,18 @@ * S39: bit2: off */ +/* + * MMC (CN7) + * + * J22 : 1-2: 1.8v for MMC + * 2-3: 3.3v for MMC + * SW1 : OFF + * SW33: bit1: OFF + * bit2: ON + * bit3: ON + * bit4: X + */ + /* MTD */ static struct mtd_partition nor_flash_partitions[] = { { @@ -225,6 +239,46 @@ static struct platform_device keysc_device = { }, }; +/* SH_MMCIF */ +static struct resource sh_mmcif_resources[] = { + [0] = { + .name = "SH_MMCIF", + .start = 0xE6BD0000, + .end = 0xE6BD00FF, + .flags = IORESOURCE_MEM, + }, + [1] = { + /* MMC ERR */ + .start = 198, + .flags = IORESOURCE_IRQ, + }, + [2] = { + /* MMC NOR */ + .start = 199, + .flags = IORESOURCE_IRQ, + }, +}; + +struct sh_mmcif_plat_data sh_mmcif_plat = { + .sup_pclk = 0, + .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, + .caps = MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA | + MMC_CAP_NEEDS_POLL, +}; + +static struct platform_device sh_mmcif_device = { + .name = "sh_mmcif", + .id = 0, + .dev = { + .dma_mask = NULL, + .coherent_dma_mask = 0xffffffff, + .platform_data = &sh_mmcif_plat, + }, + .num_resources = ARRAY_SIZE(sh_mmcif_resources), + .resource = sh_mmcif_resources, +}; + /* SDHI0 */ static struct resource sdhi0_resources[] = { [0] = { @@ -350,6 +404,7 @@ static struct platform_device *ap4evb_devices[] __initdata = { &sdhi0_device, &usb1_host_device, &fsi_device, + &sh_mmcif_device }; /* TouchScreen (Needs SW3 set to OFF) */ @@ -485,6 +540,18 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_IRQ28_123, NULL); set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); + /* MMCIF */ + gpio_request(GPIO_FN_MMCD0_0, NULL); + gpio_request(GPIO_FN_MMCD0_1, NULL); + gpio_request(GPIO_FN_MMCD0_2, NULL); + gpio_request(GPIO_FN_MMCD0_3, NULL); + gpio_request(GPIO_FN_MMCD0_4, NULL); + gpio_request(GPIO_FN_MMCD0_5, NULL); + gpio_request(GPIO_FN_MMCD0_6, NULL); + gpio_request(GPIO_FN_MMCD0_7, NULL); + gpio_request(GPIO_FN_MMCCMD0, NULL); + gpio_request(GPIO_FN_MMCCLK0, NULL); + /* USB enable */ gpio_request(GPIO_FN_VBUS0_1, NULL); gpio_request(GPIO_FN_IDIN_1_18, NULL);