| Message ID | 20190416105647.18437-9-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBFHK23SQKGQEWTXINFA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 16C7B3F0A0 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 16 Apr 2019 12:57:26 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id 18sf12320989pgx.11 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 16 Apr 2019 03:57:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1555412245; cv=pass; d=google.com; s=arc-20160816; b=qp9GC37XJ6v1YmGF8j2mWtI20J4MvUQfuetiR168lcKvjqxY5ArFAmSuQvoj60Jgus jN/BpuPQa5ypPv6MBQeGmzqNAEzqyYWgawfF1sA8HYj6xGLLzGTjcq3zSiZ1/6ZfOOci w00mvTcDy3VmW3wUkV5UXLzgKHInRnyJfsYBkNYyD6r5e/T2oWQB1PDtunFlCHnwP8ew 1MyFlnGlKfQANi7Zf/WTvKJM8nrozMkxGMNV+KnnEVgU9CsVEiyw8vNQqMOWq6ECOU+j Mt9xx/SZ4mQMmEb5Nv5+zPd1YhXHkSoZBKyuNjcGcD6PuTfIJansqx9PvuG/PsAzIkVv AK1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3qtdi6LS4SWotQUDTzKbMcJHyOsu68MwYrPM/HKAqlI=; b=gP0GrGYizG8qZyUM3MCIe6kjSIyxzg9C55n/M6HOnG+dSFEHgrsdoC1D28FZZk8/rQ GXk9d9uT/NPQagrJnMmJ9JcisFsZ7mPisPSdHGq5YHEkWMs3Zt6+gmIgqbnBzjEgcQgc QeM4pjOzhIzc/Kx2fBVT0cxORfxk1OiaI5bygzQDvsmml3A/V4LRqvvxUcNA5sCw00dL NsQzhlIW2K8fUD6aDjoDglCEAMZb4eSfrS9b0AlV44zHs/NMwpaI/VsW8L0PCFkjGJ56 rD3G6KeAZBC67EMFlx2/n1EL9zbBjR1IREydHLoK2A5633L9hbyVGvYCP7tTM+4sr/be Cg7Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MRv5DyuA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=3qtdi6LS4SWotQUDTzKbMcJHyOsu68MwYrPM/HKAqlI=; b=GsGYj1BfyBSPKCKDAv9vQ4VrAaiTAelz+Cuo3xFKcCA4uxq7r7/dn9Bzrci91o7jGW 30HPfc/E5D7etbh24+BdHgi/57+xEVlc6/YeoBTR5c4uCPGk1KLKem3pDwUCYiZdxCay fr1JEE2UI5Uku8jHxAJHCR2gtTwdG/5UZKsBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=3qtdi6LS4SWotQUDTzKbMcJHyOsu68MwYrPM/HKAqlI=; b=oUd3wTQ99S83VyDcCbbMhE2kqgc9hzBeTxzViFz9pLjWncYKdRmL8MfH3PpVuIwa1j 60xlaD7mUNKabs4K56Xc/3tuIIeoJKKnRf73tfX9xV4vjFlXkEw9KKnCngwStf9SMgoE bEKfBWuYqF5RKUj+tQ+sPRvT2UyJFW1qXZFvRtN+aC2xxKoFp/I9CHX4Ckt+DRW7whNc Rf/ymwrsuOavSxyfTj9otJ8D+2GEjFWR5qdWUI6F24sTiDFpiG2iUv2blV0+ZCbXI5XB smzkDzNOUb6bgOUotJIC6pNN7YAcmUkJ7Cq97I11JPBXNQhyQA7WjUFrhv5ZrNrD/CWs 6Qtg== X-Gm-Message-State: APjAAAW3XWijYtlqwOokgdjAnjhWREze0MtHmidUGLCOFwJSV/iIS9Lq QsfahrCNFl16dR4U8xAUvW35IbN7 X-Google-Smtp-Source: APXvYqxxX4n/nXmjhXZ2bbdEZF3VGmSmo3k8tYAaDiB+6Vgp9Lp4foxQp7X1ub+sWg5NeImLoafSlg== X-Received: by 2002:a17:902:e78d:: with SMTP id cp13mr3277284plb.14.1555412244924; Tue, 16 Apr 2019 03:57:24 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:2962:: with SMTP id g89ls5756667plb.8.gmail; Tue, 16 Apr 2019 03:57:24 -0700 (PDT) X-Received: by 2002:a17:902:7b87:: with SMTP id w7mr5960974pll.247.1555412244575; Tue, 16 Apr 2019 03:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555412244; cv=none; d=google.com; s=arc-20160816; b=ayNga+PPTqZ3WiLiGQvFe9HI90QTOnkjzD/dgPhCkvQjBYF3NF7WjInRrjxRdxh7zy yRPddEHrMQsXlHbYT+LAwi9EmFEBDpmOFETECiaHQa8IB4UL85/L+ACprhOcTbA6Qg89 VT1BYx3fhkpawW4zFFMfb1ruV4Mks1RPVYEuLRj0Ygm7RTzW4/7buIAMZx23f72aJQa/ ldgXrFh5iAqy+QsW8rS0gqvaka8D9R0gu9CXfqx9KHu05m5DA3x+bsLkGTJLRnGCZv8p aG9phK4cwyyiMrRYijt+T7AwZqRCSlOtNULEJaurYkmfToq9JOpRaAjNHoaKLsamWoP5 I9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=PiYZMOX80wZSHPhENBnJGRyCTrVO/g/JLSVYDiJ8I64=; b=xeYAYGIlX1ZzvhdhsXTRlC1+UzxogXCL71b1lwKk6gB6mHMXWmuZamlbhD2f4Z+9P9 VxVWHSrpwPIIUW8xQBJAMdnWhMz89rgTMjWApxNh5PjaI3iuAwH/vw+bGS6YYsc3RDxL E1xf35pPsihmxyKHUFPZXFZRPNU2R9dmbjmuI5meOkGk/sWy2UiLkOe+4BB05n6VdK11 Sew72wmpUNPR/oQ56oI+36LbXDCPaPLVJJN91PAkKMLcM6yd6XD9dKx+XTUTT3+lIea3 K1gEJiciE18wTndZLo2hhvZEz1+KMPo/I5i4HrmFwlooMyTISupF0lGXtn+ThSoTxr+F XeJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MRv5DyuA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u69sor17780831pgd.37.2019.04.16.03.57.24 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 16 Apr 2019 03:57:24 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:ff0f:: with SMTP id k15mr74964077pgi.407.1555412244312; Tue, 16 Apr 2019 03:57:24 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x24sm70368953pfn.128.2019.04.16.03.57.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 03:57:23 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Simon Glass <sjg@chromium.org>, Philipp Tomsich <philipp.tomsich@theobroma-systems.com>, Kever Yang <kever.yang@rock-chips.com>, Akash Gajjar <akash@openedev.com> Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v2 08/14] rockchip: dts: rk3399: nanopi4: Use CD pin as RK_FUNC_1 Date: Tue, 16 Apr 2019 16:26:41 +0530 Message-Id: <20190416105647.18437-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190416105647.18437-1-jagan@amarulasolutions.com> References: <20190416105647.18437-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MRv5DyuA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
rockchip: Add new rk3399 boards
|
|
Commit Message
Jagan Teki
April 16, 2019, 10:56 a.m. UTC
sdmmc cd pin is configured as RK_FUNC_GPIO which is wrong and
indeed failed to detect the sdcard on the board with below error
Card did not respond to voltage select!
So, fix it by replacing RK_FUNC_GPIO with RK_FUNC_1 which
is already defined in rk3399.dts so make use of same like
other boards.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/dts/rk3399-nanopi4.dtsi | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Comments
On 16/04/2019 11:56, Jagan Teki wrote: > sdmmc cd pin is configured as RK_FUNC_GPIO which is wrong and > indeed failed to detect the sdcard on the board with below error > > Card did not respond to voltage select! > > So, fix it by replacing RK_FUNC_GPIO with RK_FUNC_1 which > is already defined in rk3399.dts so make use of same like > other boards. I guess the U-Boot dwmmc driver doesn't support using a GPIO? The reason we do this for Linux is that the dedicated function is not compatible with runtime power management - once we see that no card is present and suspend the idle controller, the CD logic is also powered off and thus no longer capable of generating the interrupt necessary to wake everything up again. The GPIO function of the same pin, however, is in an always-on power domain so is able to do the right thing. So it's not "wrong" as such, but this change should be fine for U-Boot as long as it never turns off PD_SD itself. Robin. > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > arch/arm/dts/rk3399-nanopi4.dtsi | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/arm/dts/rk3399-nanopi4.dtsi b/arch/arm/dts/rk3399-nanopi4.dtsi > index d325e11728..5dc8a8de16 100644 > --- a/arch/arm/dts/rk3399-nanopi4.dtsi > +++ b/arch/arm/dts/rk3399-nanopi4.dtsi > @@ -521,10 +521,6 @@ > }; > > sdmmc { > - sdmmc0_det_l: sdmmc0-det-l { > - rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; > - }; > - > sdmmc0_pwr_h: sdmmc0-pwr-h { > rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; > }; > @@ -582,7 +578,7 @@ > cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; > disable-wp; > pinctrl-names = "default"; > - pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc0_det_l>; > + pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_cd>; > sd-uhs-sdr104; > vmmc-supply = <&vcc3v0_sd>; > vqmmc-supply = <&vcc_sdio>; >
On Tue, Apr 16, 2019 at 4:40 PM Robin Murphy <robin.murphy@arm.com> wrote: > > On 16/04/2019 11:56, Jagan Teki wrote: > > sdmmc cd pin is configured as RK_FUNC_GPIO which is wrong and > > indeed failed to detect the sdcard on the board with below error > > > > Card did not respond to voltage select! > > > > So, fix it by replacing RK_FUNC_GPIO with RK_FUNC_1 which > > is already defined in rk3399.dts so make use of same like > > other boards. > > I guess the U-Boot dwmmc driver doesn't support using a GPIO? The reason > we do this for Linux is that the dedicated function is not compatible > with runtime power management - once we see that no card is present and > suspend the idle controller, the CD logic is also powered off and thus > no longer capable of generating the interrupt necessary to wake > everything up again. The GPIO function of the same pin, however, is in > an always-on power domain so is able to do the right thing. I can see these gpio pins were managed via drivers/pinctrl/rockchip/pinctrl-rk3399.c and drivers/gpio/rk_gpio.c . On the other hand other boards do use RKFUNC_1 for CD pin(even in Linux) but what is different in nanopi4? do other boards are yet to change?
diff --git a/arch/arm/dts/rk3399-nanopi4.dtsi b/arch/arm/dts/rk3399-nanopi4.dtsi index d325e11728..5dc8a8de16 100644 --- a/arch/arm/dts/rk3399-nanopi4.dtsi +++ b/arch/arm/dts/rk3399-nanopi4.dtsi @@ -521,10 +521,6 @@ }; sdmmc { - sdmmc0_det_l: sdmmc0-det-l { - rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; - }; - sdmmc0_pwr_h: sdmmc0-pwr-h { rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; }; @@ -582,7 +578,7 @@ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; disable-wp; pinctrl-names = "default"; - pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc0_det_l>; + pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_cd>; sd-uhs-sdr104; vmmc-supply = <&vcc3v0_sd>; vqmmc-supply = <&vcc_sdio>;