From patchwork Fri Jul 5 15:25:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2824263 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4ADD19F3EB for ; Fri, 5 Jul 2013 15:25:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 025322016C for ; Fri, 5 Jul 2013 15:25:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13B4620179 for ; Fri, 5 Jul 2013 15:25:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757466Ab3GEPZl (ORCPT ); Fri, 5 Jul 2013 11:25:41 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:52802 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757369Ab3GEPZk (ORCPT ); Fri, 5 Jul 2013 11:25:40 -0400 Received: from axis700.grange (dslb-178-001-146-173.pools.arcor-ip.net [178.1.146.173]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M2d6r-1U3IFM3pGn-00svBE; Fri, 05 Jul 2013 17:25:34 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 4C79640BB4; Fri, 5 Jul 2013 17:25:33 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1Uv7t7-0005Bo-3b; Fri, 05 Jul 2013 17:25:33 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , Guennadi Liakhovetski Subject: [PATCH v2 3/6] ARM: shmobile: APE6EVM: add SDHI interfaces Date: Fri, 5 Jul 2013 17:25:29 +0200 Message-Id: <1373037932-19918-4-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1373037932-19918-1-git-send-email-g.liakhovetski@gmx.de> References: <1373037932-19918-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:/RXc2PuFujG624F85l3Q6Nh6BsF8G0WOwINm0VRG7tf lGtpnSKzZvK3n9dxcnhXf2vmTdJn49p4jxAOmoLR0SyOdZXWyQ n1/BodbSdGOPdbptLp2RkRPEv+7UOqAlj6snajV0dj2yu2UXHB oMLrgR5mEfMa1AupykYmqVxUqya2LBR4NKNxkjo+PsZJxLBlxK 3pf5dqW/ib7rM7l4p0+m6y7uqh3ZSTclOaILtEFk+BCSteBEyM 1dPIYz+Wu4YMvKr/Xkt+DGEpSlihPzKg6KkI/e6Xy7qtw9/t0t PzGnN3S2q+98WXr8Q0dsvQw0rFEKxCNE9voS/eAkeA/jAXkTOC dqTHqAUdbhaQMPXOZ5thlDsPC8zmH96QjQseUIFRUsQYz56o7f DOpbxptg7DsiA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for SDHI0 and SDHI1 on APE6EVM in PIO mode only. Signed-off-by: Guennadi Liakhovetski --- v2: no change arch/arm/mach-shmobile/board-ape6evm.c | 50 +++++++++++++++++++++++++++++++- 1 files changed, 49 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index ab33030..e9e2108e 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -58,11 +60,16 @@ static const struct smsc911x_platform_config lan9220_data = { /* * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we - * model a VDD supply to MMCIF, using a fixed 3.3V regulator. + * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the + * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also + * supplied by the same tps80032 regulator and thus can also be adjusted + * dynamically. */ static struct regulator_consumer_supply fixed3v3_power_consumers[] = { REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), }; /* MMCIF */ @@ -77,6 +84,29 @@ static struct resource mmcif0_resources[] = { DEFINE_RES_IRQ(gic_spi(169)), }; +/* SDHI0 */ +static struct sh_mobile_sdhi_info sdhi0_pdata = { + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, +}; + +static struct resource sdhi0_resources[] = { + DEFINE_RES_MEM_NAMED(0xee100000, 0x100, "SDHI0"), + DEFINE_RES_IRQ(gic_spi(165)), +}; + +/* SDHI1 */ +static struct sh_mobile_sdhi_info sdhi1_pdata = { + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | + MMC_CAP_NEEDS_POLL, +}; + +static struct resource sdhi1_resources[] = { + DEFINE_RES_MEM_NAMED(0xee120000, 0x100, "SDHI1"), + DEFINE_RES_IRQ(gic_spi(166)), +}; + static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SCIFA0 console */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", @@ -89,6 +119,18 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { "mmc0_data8", "mmc0"), PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", "mmc0_ctrl", "mmc0"), + /* SDHI0: uSD: no WP */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_data4", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_ctrl", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_cd", "sdhi0"), + /* SDHI1 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", + "sdhi1_data4", "sdhi1"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", + "sdhi1_ctrl", "sdhi1"), }; static void __init ape6evm_add_standard_devices(void) @@ -126,6 +168,12 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "sh_mmcif", 0, mmcif0_resources, ARRAY_SIZE(mmcif0_resources), &mmcif0_pdata, sizeof(mmcif0_pdata)); + platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0, + sdhi0_resources, ARRAY_SIZE(sdhi0_resources), + &sdhi0_pdata, sizeof(sdhi0_pdata)); + platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1, + sdhi1_resources, ARRAY_SIZE(sdhi1_resources), + &sdhi1_pdata, sizeof(sdhi1_pdata)); } static const char *ape6evm_boards_compat_dt[] __initdata = {