From patchwork Thu Aug 18 05:45:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 1075662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7I5hA5N009005 for ; Thu, 18 Aug 2011 05:43:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752565Ab1HRFnp (ORCPT ); Thu, 18 Aug 2011 01:43:45 -0400 Received: from mail-iy0-f170.google.com ([209.85.210.170]:57826 "EHLO mail-iy0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043Ab1HRFno (ORCPT ); Thu, 18 Aug 2011 01:43:44 -0400 Received: by mail-iy0-f170.google.com with SMTP id 16so3298366iye.1 for ; Wed, 17 Aug 2011 22:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=9v/msX4lU973mkRg/gB3BLqFmdjtu1hkdeNNlH5VWg0=; b=R4yZ9jpfAB2OgXutb/x0RtgNGlBsWlOaW1BwUhUK/91muMKwC0j+hAq2hF/heJUL35 YG+xZqoIv6jdDRJdfG4YrPnJbx98ay3FABaJtu/kW8qVi4an2LKbJF/H1feD38kEMEsL A0bgq71z/cLAbzNNpXt47jmLbPeZWjCKrVYnQ= Received: by 10.231.41.69 with SMTP id n5mr704784ibe.92.1313646224614; Wed, 17 Aug 2011 22:43:44 -0700 (PDT) Received: from rxone.opensource.se (FL1-122-133-113-66.tky.mesh.ad.jp [122.133.113.66]) by mx.google.com with ESMTPS id a11sm785153ibg.38.2011.08.17.22.43.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Aug 2011 22:43:43 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 18 Aug 2011 14:45:00 +0900 Message-Id: <20110818054500.23410.44730.sendpatchset@rxone.opensource.se> In-Reply-To: <20110818054359.23410.4526.sendpatchset@rxone.opensource.se> References: <20110818054359.23410.4526.sendpatchset@rxone.opensource.se> Subject: [PATCH 07/07] ARM: mach-shmobile: Kota2 SDHI0 and SDHI1 support 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.6 (demeter2.kernel.org [140.211.167.43]); Thu, 18 Aug 2011 05:43:45 +0000 (UTC) From: Magnus Damm Add SDHI0 and SDHI1 support to the Kota2 board. SDHI0 is hooked up to a microSD card slot and SDHI1 to a wireless module that also connects to SCIFB. This depends on the recently merged code for TMIO_MMC_HAS_IDLE_WAIT together with PFC support for pull-ups on SDHI0 and SDHI1. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/board-kota2.c | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0010/arch/arm/mach-shmobile/board-kota2.c +++ work/arch/arm/mach-shmobile/board-kota2.c 2011-08-18 13:26:52.000000000 +0900 @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -205,12 +207,86 @@ static struct platform_device mmcif_devi .resource = mmcif_resources, }; +static struct sh_mobile_sdhi_info sdhi0_info = { + .tmio_caps = MMC_CAP_SD_HIGHSPEED, + .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, +}; + +static struct resource sdhi0_resources[] = { + [0] = { + .name = "SDHI0", + .start = 0xee100000, + .end = 0xee1000ff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(83), + .flags = IORESOURCE_IRQ, + }, + [2] = { + .start = gic_spi(84), + .flags = IORESOURCE_IRQ, + }, + [3] = { + .start = gic_spi(85), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device sdhi0_device = { + .name = "sh_mobile_sdhi", + .id = 0, + .num_resources = ARRAY_SIZE(sdhi0_resources), + .resource = sdhi0_resources, + .dev = { + .platform_data = &sdhi0_info, + }, +}; + +static struct sh_mobile_sdhi_info sdhi1_info = { + .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, + .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, +}; + +static struct resource sdhi1_resources[] = { + [0] = { + .name = "SDHI1", + .start = 0xee120000, + .end = 0xee1200ff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(87), + .flags = IORESOURCE_IRQ, + }, + [2] = { + .start = gic_spi(88), + .flags = IORESOURCE_IRQ, + }, + [3] = { + .start = gic_spi(89), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device sdhi1_device = { + .name = "sh_mobile_sdhi", + .id = 1, + .num_resources = ARRAY_SIZE(sdhi1_resources), + .resource = sdhi1_resources, + .dev = { + .platform_data = &sdhi1_info, + }, +}; + static struct platform_device *kota2_devices[] __initdata = { ð_device, &keysc_device, &gpio_keys_device, &gpio_leds_device, &mmcif_device, + &sdhi0_device, + &sdhi1_device, }; static struct map_desc kota2_io_desc[] __initdata = { @@ -319,6 +395,15 @@ static void __init kota2_init(void) gpio_request(GPIO_PORT208, NULL); /* Reset */ gpio_direction_output(GPIO_PORT208, 1); + /* SDHI0 (microSD) */ + gpio_request(GPIO_FN_SDHICD0_PU, NULL); + gpio_request(GPIO_FN_SDHICMD0_PU, NULL); + gpio_request(GPIO_FN_SDHICLK0, NULL); + gpio_request(GPIO_FN_SDHID0_3_PU, NULL); + gpio_request(GPIO_FN_SDHID0_2_PU, NULL); + gpio_request(GPIO_FN_SDHID0_1_PU, NULL); + gpio_request(GPIO_FN_SDHID0_0_PU, NULL); + /* SCIFB (BT) */ gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL); gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL); @@ -326,6 +411,14 @@ static void __init kota2_init(void) gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL); gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL); + /* SDHI1 (BCM4330) */ + gpio_request(GPIO_FN_SDHICLK1, NULL); + gpio_request(GPIO_FN_SDHICMD1_PU, NULL); + gpio_request(GPIO_FN_SDHID1_3_PU, NULL); + gpio_request(GPIO_FN_SDHID1_2_PU, NULL); + gpio_request(GPIO_FN_SDHID1_1_PU, NULL); + gpio_request(GPIO_FN_SDHID1_0_PU, NULL); + #ifdef CONFIG_CACHE_L2X0 /* Early BRESP enable, Shared attribute override enable, 64K*8way */ l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);