From patchwork Wed Jun 26 14:40:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2785561 Return-Path: X-Original-To: patchwork-linux-sh@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 5606AC0AB2 for ; Wed, 26 Jun 2013 14:41:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E462A2055D for ; Wed, 26 Jun 2013 14:41:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3E6D2055C for ; Wed, 26 Jun 2013 14:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751633Ab3FZOlD (ORCPT ); Wed, 26 Jun 2013 10:41:03 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:64255 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462Ab3FZOlA (ORCPT ); Wed, 26 Jun 2013 10:41:00 -0400 Received: from axis700.grange (dslb-178-001-151-028.pools.arcor-ip.net [178.1.151.28]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0Ll4mA-1UJ47L3ruw-00b15T; Wed, 26 Jun 2013 16:40:58 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 5664440BB7; Wed, 26 Jun 2013 16:40:57 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1Urqu1-0002b8-2H; Wed, 26 Jun 2013 16:40:57 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, Magnus Damm , Simon Horman Subject: [PATCH v3 6/7] ARM: shmobile: add SDHI and MMCIF interfaces to armadillo800eva-reference Date: Wed, 26 Jun 2013 16:40:55 +0200 Message-Id: <1372257656-9944-7-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1372257656-9944-1-git-send-email-g.liakhovetski@gmx.de> References: <1372257656-9944-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:23rWQkkLaKe9WP+yuCEMBjmbKy0Qlx+Q652hPniF2MB rUgBmJ+dz8xg738AoYOJDPxcnnV70c9lA/6Y+Cv0J7dcGiwZOU dHleLac6mD4sIEmIN/FfVkOX0N2OA7q2euI2774ZEQ4vxT//Uh rKtcMeDeu2c+XM3xVAGkQlN21PfVHxm7B4JZWgqJahhhVrY2jr 2aLECw04jTuJg8X45Q33QZiZMTNM8AMFFOHya6CCvALdk04yuH AkofAdistfgHEMm9wkY+7sRxRDsbYBv7asXJOJtRqnLROt0glz adtg6171LVB/LIVLLwILIjE803d9w6Y6Bi0WX/UYlScvF6IoIP tdFPOrtZ0EkdtbjBcrZi3HaaeRH81lqCgNTszP0ArqoGqXJ70+ 42TzVGfWMLf0w== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.2 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 SDHI0, SDHI1 and MMCIF interfaces to armadillo800eva-reference. With no pinctrl DT support we cannot use GPIO card-detection and regulator switching. Signed-off-by: Guennadi Liakhovetski --- .../boot/dts/r8a7740-armadillo800eva-reference.dts | 21 +++++++++++- arch/arm/boot/dts/r8a7740.dtsi | 33 ++++++++++++++++++ .../board-armadillo800eva-reference.c | 36 +++++++++++++++++++- 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts index 09ea22c..3752637 100644 --- a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +++ b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts @@ -32,7 +32,6 @@ regulator-always-on; regulator-boot-on; }; - }; &i2c0 { @@ -43,3 +42,23 @@ interrupts = <2 0>; /* IRQ10: hwirq 2 on irqpin1 */ }; }; + +&mmcif0 { + vmmc-supply = <®_3p3v>; + bus-width = <8>; + non-removable; + status = "okay"; +}; + +&sdhi0 { + vmmc-supply = <®_3p3v>; + bus-width = <4>; + broken-cd; + status = "okay"; +}; + +&sdhi1 { + vmmc-supply = <®_3p3v>; + bus-width = <4>; + status = "okay"; +}; diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi index 683751c..44fa11c 100644 --- a/arch/arm/boot/dts/r8a7740.dtsi +++ b/arch/arm/boot/dts/r8a7740.dtsi @@ -197,4 +197,37 @@ 0 72 0x4 0 73 0x4>; }; + + mmcif0: mmcif@e6bd0000 { + compatible = "renesas,sh-mmcif", "renesas,sh7372-mmcif"; + reg = <0xe6bd0000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 56 4 + 0 57 4>; + status = "disabled"; + }; + + sdhi0: sdhi@e6850000 { + compatible = "renesas,r8a7740-sdhi"; + reg = <0xe6850000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 117 4 + 0 118 4 + 0 119 4>; + cap-sd-highspeed; + cap-sdio-irq; + status = "disabled"; + }; + + sdhi1: sdhi@e6860000 { + compatible = "renesas,r8a7740-sdhi"; + reg = <0xe6860000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 121 4 + 0 122 4 + 0 123 4>; + cap-sd-highspeed; + cap-sdio-irq; + status = "disabled"; + }; }; diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index 03b85fe..d26a9da 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c @@ -123,6 +123,27 @@ static const struct pinctrl_map eva_pinctrl_map[] = { /* SCIFA1 */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.1", "pfc-r8a7740", "scifa1_data", "scifa1"), + /* MMCIF */ + PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.sh-mmcif", "pfc-r8a7740", + "mmc0_data8_1", "mmc0"), + PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.sh-mmcif", "pfc-r8a7740", + "mmc0_ctrl_1", "mmc0"), + /* SDHI0 */ + PIN_MAP_MUX_GROUP_DEFAULT("e6850000.sdhi", "pfc-r8a7740", + "sdhi0_data4", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("e6850000.sdhi", "pfc-r8a7740", + "sdhi0_ctrl", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("e6850000.sdhi", "pfc-r8a7740", + "sdhi0_wp", "sdhi0"), + /* SDHI1 */ + PIN_MAP_MUX_GROUP_DEFAULT("e6860000.sdhi", "pfc-r8a7740", + "sdhi1_data4", "sdhi1"), + PIN_MAP_MUX_GROUP_DEFAULT("e6860000.sdhi", "pfc-r8a7740", + "sdhi1_ctrl", "sdhi1"), + PIN_MAP_MUX_GROUP_DEFAULT("e6860000.sdhi", "pfc-r8a7740", + "sdhi1_cd", "sdhi1"), + PIN_MAP_MUX_GROUP_DEFAULT("e6860000.sdhi", "pfc-r8a7740", + "sdhi1_wp", "sdhi1"), }; static void __init eva_clock_init(void) @@ -165,7 +186,6 @@ clock_error: */ static void __init eva_init(void) { - r8a7740_clock_init(MD_CK0 | MD_CK2); eva_clock_init(); @@ -180,6 +200,20 @@ static void __init eva_init(void) */ gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */ + /* SDHI0 */ + gpio_request_one(17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */ + gpio_request_one(74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */ + gpio_request_one(75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */ + + /* We can switch CON8/CON14 by SW1.5, but only after DBGMD_SELECT_B */ + gpio_request_one(6, GPIOF_IN, NULL); + if (!gpio_get_value(6)) { + /* CON14 disabled, CON8 (SDHI1) enabled */ + + /* SDSLOT2_PON */ + gpio_request_one(16, GPIOF_OUT_INIT_HIGH, NULL); + } + #ifdef CONFIG_CACHE_L2X0 /* Early BRESP enable, Shared attribute override enable, 32K*8way */ l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);