From patchwork Wed Jan 23 16:37:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2026041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 51AF9DF2E5 for ; Wed, 23 Jan 2013 16:42:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ty3Mf-000393-C2; Wed, 23 Jan 2013 16:39:53 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Ty3Ks-0002Le-RW for linux-arm-kernel@lists.infradead.org; Wed, 23 Jan 2013 16:38:03 +0000 Received: from axis700.grange (dslb-178-006-250-035.pools.arcor-ip.net [178.6.250.35]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MK8g5-1TzQmI1XMr-001PIP; Wed, 23 Jan 2013 17:37:59 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 2BD4740BC3; Wed, 23 Jan 2013 17:37:58 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1Ty3Kn-0000lJ-RP; Wed, 23 Jan 2013 17:37:57 +0100 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Subject: [PATCH v3 7/8] ARM: shmobile: completely switch MMC interfaces on mackerel-reference to DT Date: Wed, 23 Jan 2013 17:37:50 +0100 Message-Id: <1358959071-2873-8-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1358959071-2873-1-git-send-email-g.liakhovetski@gmx.de> References: <1358959071-2873-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:cMTjkxVjWFa62lm9cLdjS2lvi1FmnFe+cKKz0H7UGGK krvDVQjsueAVBVB7UAFWhiuF6xxj0TgiS0f70G4VaGuWIfw5gi cSoTDbH7n8ZIsN7slxQKJa5PWAZ6dine9KW91nwwbg7UoR6Q6m 3tsJ1aAXwSfBdo0bT+G/Usc/m2KQjRF3urmNz+wVOYwHUMsGl2 DdoR6zUD7QC36dwZug2CGZi/J+cUgql62wrozSpf1CAelFXAXn z4juE8uoGUd+UpksmwI4MZP5kJt8IkEK+yuNqQDRINx3vVEcTe I03JgdMGnBq5dFDgWkHU3C3CmgP6caaYOq904xsxCJjvBY+vOE UByjwd8kclp/KxG/9QMAGx4VrNx+gTaY2nHTE079zUervh6B/R Zj7t2lr1a1pAw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130123_113803_104253_9D889657 X-CRM114-Status: GOOD ( 13.49 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (g.liakhovetski[at]gmx.de) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.8 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , Magnus Damm , Simon Horman , Laurent Pinchart , Guennadi Liakhovetski , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Switch MMCIF, SDHI0 and SDHI2 to complete DT initialisation: use DT bindings to configure interface pins, card-detect GPIOs, various interface configuration parameters. Notice, since MMCIF and SDHI1 share the same card slot, both devices cannot be successfully probed simultaneously: they both would try to get the card-detection GPIO and only one would succeed. Ideally it should be possible to let the user decide which device to enable by, possibly, patching the DT at run-time. As long as this is unsupported, we choose to enable MMCIF and remove SDHI1 from DT completely. Signed-off-by: Guennadi Liakhovetski --- arch/arm/boot/dts/sh7372-mackerel-reference.dts | 42 +++++++++++++++---- arch/arm/mach-shmobile/board-mackerel-reference.c | 46 --------------------- 2 files changed, 33 insertions(+), 55 deletions(-) diff --git a/arch/arm/boot/dts/sh7372-mackerel-reference.dts b/arch/arm/boot/dts/sh7372-mackerel-reference.dts index 2fd1eff..aa72309 100644 --- a/arch/arm/boot/dts/sh7372-mackerel-reference.dts +++ b/arch/arm/boot/dts/sh7372-mackerel-reference.dts @@ -75,6 +75,11 @@ interrupt-parent = <&intca>; interrupts = <0x1ac0 0x1ae0>; vmmc-supply = <®_1p8v>; + bus-width = <8>; + cd-gpios = <&gpio 41 1>; + broken-cd; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; }; sdhi0: sdhi@0xe6850000 { @@ -83,22 +88,26 @@ interrupt-parent = <&intca>; interrupts = <0x0e00 0x0e20 0x0e40>; vmmc-supply = <®_3p3v>; - }; - - sdhi1: sdhi@0xe6860000 { - compatible = "renesas,shmobile-sdhi"; - reg = <0xe6860000 0x100>; - interrupt-parent = <&intca>; - interrupts = <0x0e80 0x0ea0 0x0ec0>; - vmmc-supply = <®_1p8v>; + bus-width = <4>; + cd-gpios = <&gpio 172 1>; + pinctrl-names = "default"; + pinctrl-0 = <&sdhi0_pins>; + toshiba,mmc-cap-sdio-irq; }; sdhi2: sdhi@0xe6870000 { compatible = "renesas,shmobile-sdhi"; reg = <0xe6870000 0x100>; interrupt-parent = <&intca>; - interrupts = <0x1200 0x1220 0x1240>; + interrupts = <0x1220 0x1240>; vmmc-supply = <®_3p3v>; + bus-width = <4>; + cd-gpios = <&gpio 162 1>; + broken-cd; + pinctrl-names = "default"; + pinctrl-0 = <&sdhi2_pins>; + toshiba,mmc-wrprotect-disable; + toshiba,mmc-cap-sdio-irq; }; flash@2000000 { @@ -129,3 +138,18 @@ }; }; }; + +&gpio { + sdhi0_pins: pfc_sdhi0_pins { + renesas,pins = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_wp"; + renesas,function = "sdhi0"; + }; + sdhi2_pins: pfc_sdhi2_pins { + renesas,pins = "sdhi2_data4", "sdhi2_ctrl"; + renesas,function = "sdhi2"; + }; + mmc0_pins: pfc_mmc0_pins { + renesas,pins = "mmc0_data8_0", "mmc0_ctrl_0"; + renesas,function = "mmc0"; + }; +}; diff --git a/arch/arm/mach-shmobile/board-mackerel-reference.c b/arch/arm/mach-shmobile/board-mackerel-reference.c index 1d83653..323a812 100644 --- a/arch/arm/mach-shmobile/board-mackerel-reference.c +++ b/arch/arm/mach-shmobile/board-mackerel-reference.c @@ -42,8 +42,6 @@ static void __init mackerel_init(void) /* External clock source */ clk_set_rate(&sh7372_dv_clki_clk, 27000000); - sh7372_pinmux_init(); - /* enable SCIFA0 */ gpio_request(GPIO_FN_SCIFA0_TXD, NULL); gpio_request(GPIO_FN_SCIFA0_RXD, NULL); @@ -59,50 +57,6 @@ static void __init mackerel_init(void) /* enable Accelerometer */ gpio_request(GPIO_FN_IRQ21, NULL); irq_set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); - - /* enable SDHI0 */ - gpio_request(GPIO_FN_SDHIWP0, NULL); - gpio_request(GPIO_FN_SDHICMD0, NULL); - gpio_request(GPIO_FN_SDHICLK0, NULL); - gpio_request(GPIO_FN_SDHID0_3, NULL); - gpio_request(GPIO_FN_SDHID0_2, NULL); - gpio_request(GPIO_FN_SDHID0_1, NULL); - gpio_request(GPIO_FN_SDHID0_0, NULL); - - /* SDHI0 PORT172 card-detect IRQ26 */ - gpio_request(GPIO_FN_IRQ26_172, NULL); - - /* enable SDHI1 */ - gpio_request(GPIO_FN_SDHICMD1, NULL); - gpio_request(GPIO_FN_SDHICLK1, NULL); - gpio_request(GPIO_FN_SDHID1_3, NULL); - gpio_request(GPIO_FN_SDHID1_2, NULL); - gpio_request(GPIO_FN_SDHID1_1, NULL); - gpio_request(GPIO_FN_SDHID1_0, NULL); - - /* enable SDHI2 */ - gpio_request(GPIO_FN_SDHICMD2, NULL); - gpio_request(GPIO_FN_SDHICLK2, NULL); - gpio_request(GPIO_FN_SDHID2_3, NULL); - gpio_request(GPIO_FN_SDHID2_2, NULL); - gpio_request(GPIO_FN_SDHID2_1, NULL); - gpio_request(GPIO_FN_SDHID2_0, NULL); - - /* card detect pin for microSD slot (CN23) */ - gpio_request(GPIO_PORT162, NULL); - gpio_direction_input(GPIO_PORT162); - - /* 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); } static const char *mackerel_compat_dt[] __initdata = {