From patchwork Thu Nov 14 10:34:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3181801 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8DFADC045B for ; Thu, 14 Nov 2013 10:34:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CB9420174 for ; Thu, 14 Nov 2013 10:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5A7A20969 for ; Thu, 14 Nov 2013 10:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752887Ab3KNKer (ORCPT ); Thu, 14 Nov 2013 05:34:47 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:51206 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752714Ab3KNKeq (ORCPT ); Thu, 14 Nov 2013 05:34:46 -0500 Received: by mail-pd0-f171.google.com with SMTP id z10so260408pdj.30 for ; Thu, 14 Nov 2013 02:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=Wrd9YXCtoOnS2UutB56sntiSFd4zCzvDjNYdOVonvlk=; b=Bl512SXqNTkHQlQ9BZlWZzsKCnzAtai7qcb7adwX9vsy+ww78jZtA5ciRO5dqIrYK/ +eicRb18E+lg3Ke5Ta8d9P90uFQcymdSbVQgNjX5OkXO73O2lfHrbP3HuMrWwiefM93g FFBddbmhxxmKL2fQfvjlmFeKx6O9EXph7juMqIV0KomvwvNB0sazZwGc52pSQY525uPY BBLo/JB+XQPvUKoUdR3Cg8bkZ1FDnT/omV9QfzbTQmQ+aYtdiwsYDFb5jPqp8ThF1+xj X9UVRZOSl0jWVH7dJEVeIf6gXGSVu/FTEO9SVl/5pYB0wBrTKJa2NBKHBvnFHAkbl176 I4Zw== X-Received: by 10.68.110.196 with SMTP id ic4mr732311pbb.84.1384425286075; Thu, 14 Nov 2013 02:34:46 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id nj9sm50570637pbc.13.2013.11.14.02.34.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Nov 2013 02:34:45 -0800 (PST) Date: Thu, 14 Nov 2013 02:34:45 -0800 (PST) Message-ID: <87siuzxoe7.wl%kuninori.morimoto.gx@renesas.com> To: Simon Cc: Laurent , Chris Ball , Magnus , Linux-SH , Kuninori Morimoto , linux-mmc@vger.kernel.org In-Reply-To: <87txffxofc.wl%kuninori.morimoto.gx@renesas.com> References: <87li0rz3to.wl%kuninori.morimoto.gx@renesas.com> <87txffxofc.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 16/17] ARM: shmobile: lager: add SDHI0/2 support MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 SDHI0 (CN8) needs JP/SW settings Signed-off-by: Kuninori Morimoto --- arch/arm/mach-shmobile/board-lager.c | 75 +++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index fcf06fd..2e529dc 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -40,6 +42,19 @@ #include #include +/* + * SDHI0 (CN8) + * + * JP3: pin1 + * SW20: pin1 + + * GP5_24: 1: VDD 3.3V (defult) + * 0: VDD 0.0V + * GP5_29: 1: VccQ 3.3V (defult) + * 0: VccQ 1.8V + * + */ + /* DU */ static struct rcar_du_encoder_data lager_du_encoders[] = { { @@ -139,6 +154,10 @@ static const struct gpio_keys_platform_data lager_keys_pdata __initconst = { static struct regulator_consumer_supply fixed3v3_power_consumers[] = { REGULATOR_SUPPLY("vmmc", "sh_mmcif.1"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"), + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"), }; /* MMCIF */ @@ -166,6 +185,32 @@ static const struct resource ether_resources[] __initconst = { DEFINE_RES_IRQ(gic_spi(162)), }; +/* SDHI0 */ +static struct sh_mobile_sdhi_info sdhi0_info __initdata = { + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, + .tmio_caps2 = MMC_CAP2_NO_MULTI_READ, + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | + TMIO_MMC_WRPROTECT_DISABLE, +}; + +static struct resource sdhi0_resources[] __initdata = { + DEFINE_RES_MEM(0xee100000, 0x200), + DEFINE_RES_IRQ(gic_spi(165)), +}; + +/* SDHI2 */ +static struct sh_mobile_sdhi_info sdhi2_info __initdata = { + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, + .tmio_caps2 = MMC_CAP2_NO_MULTI_READ, + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | + TMIO_MMC_WRPROTECT_DISABLE, +}; + +static struct resource sdhi2_resources[] __initdata = { + DEFINE_RES_MEM(0xee140000, 0x100), + DEFINE_RES_IRQ(gic_spi(167)), +}; + static const struct pinctrl_map lager_pinctrl_map[] = { /* DU (CN10: ARGB0, CN13: LVDS) */ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", @@ -174,6 +219,22 @@ static const struct pinctrl_map lager_pinctrl_map[] = { "du_sync_1", "du"), PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", "du_clk_out_0", "du"), + /* SDHI */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790", + "sdhi0_data4", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790", + "sdhi0_ctrl", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790", + "sdhi0_cd", "sdhi0"), + + /* SDHI2 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790", + "sdhi2_data4", "sdhi2"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790", + "sdhi2_ctrl", "sdhi2"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790", + "sdhi2_cd", "sdhi2"), + /* SCIF0 (CN19: DEBUG SERIAL0) */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", "scif0_data", "scif0"), @@ -223,7 +284,19 @@ static void __init lager_add_standard_devices(void) ðer_pdata, sizeof(ether_pdata)); lager_add_du_device(); -} + + gpio_request_one(RCAR_GP_PIN(5, 24), GPIOF_OUT_INIT_HIGH, NULL); /* SD0 VDD 3.3V */ + gpio_request_one(RCAR_GP_PIN(5, 25), GPIOF_OUT_INIT_HIGH, NULL); /* SD2 VDD 3.3V */ + gpio_request_one(RCAR_GP_PIN(5, 29), GPIOF_OUT_INIT_HIGH, NULL); /* SD0 VccQ 3.3V */ + gpio_request_one(RCAR_GP_PIN(5, 30), GPIOF_OUT_INIT_HIGH, NULL); /* SD2 VccQ 3.3V */ + platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0, + sdhi0_resources, ARRAY_SIZE(sdhi0_resources), + &sdhi0_info, sizeof(struct sh_mobile_sdhi_info)); + platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2, + sdhi2_resources, ARRAY_SIZE(sdhi2_resources), + &sdhi2_info, sizeof(struct sh_mobile_sdhi_info)); + +}; /* * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds