From patchwork Sat Jan 7 08:52:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9502921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F10EB606E1 for ; Sat, 7 Jan 2017 08:53:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25492848E for ; Sat, 7 Jan 2017 08:53:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D673E284AE; Sat, 7 Jan 2017 08:53:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 703562848E for ; Sat, 7 Jan 2017 08:53:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cPmkb-0005HV-8A; Sat, 07 Jan 2017 08:53:21 +0000 Received: from mail.kernel.org ([198.145.29.136]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cPmk9-0004RL-Kf for linux-arm-kernel@lists.infradead.org; Sat, 07 Jan 2017 08:52:55 +0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C0E62041B; Sat, 7 Jan 2017 08:52:33 +0000 (UTC) Received: from localhost.localdomain (bzq-109-66-157-170.red.bezeqint.net [109.66.157.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F0302041D; Sat, 7 Jan 2017 08:52:27 +0000 (UTC) From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , Anand Moon , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ARM: dts: exynos: Fix LAN9730 on Odroid U3 after tftpboot Date: Sat, 7 Jan 2017 10:52:01 +0200 Message-Id: <20170107085203.4431-3-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170107085203.4431-1-krzk@kernel.org> References: <20170107085203.4431-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170107_005253_829454_71F8CC4E X-CRM114-Status: GOOD ( 17.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Chen , ulf.hansson@linaro.org, Markus Reichl , linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, sre@kernel.org, robh+dt@kernel.org, hverkuil@xs4all.nl, broonie@kernel.org, stern@rowland.harvard.edu, Sylwester Nawrocki , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The ethernet adapter LAN9730, after enabling in bootloader (e.g. for tftpboot) requires reset during boot. Otherwise it won't come up. The schematics of Odroid U3 are detailed enough but after grabbing knowledge also from other sources (like U-Boot) the overall design looks like: 1. LAN9730 is connected to HSIC0 and USB3503 to HSIC1 of EHCI controller. 2. USB3503 comes with its own reset pin: gpx3-5. 3. Reset pin of LAN9730 is pulled up to 3.3 V so it cannot be used. 4. The supply of 3.3 V for LAN9730 is delivered from buck8. 5. Buck8 state is a logical OR of registry value (through I2C command) and ENB8 pin. The ENB8, not described in schematics, is in fact gpa1-1. 6. Missing or wrongly timed reset of LAN9730 might result in missing of two devices: LAN9730 and USB3503. Without reset, LAN9730 will not come up, if it was enabled by bootloader. To fix the issue use the generic power sequence driver and toggle the ENB8 (buck8) pin. Reset duration of 500 us was chosen by experiments (shortest working time was 400 us). This is an easiest way to fix the long standing LAN9730 reset issue. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Javier Martinez Canillas --- arch/arm/boot/dts/exynos4412-odroidu3.dts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts index 99634c54dca9..aef49007cba0 100644 --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts @@ -84,10 +84,23 @@ regulator-max-microvolt = <2800000>; }; +&max77686 { + pinctrl-0 = <&max77686_irq &max77686_enb8>; +}; + &mshc_0 { vqmmc-supply = <&ldo22_reg>; }; +&pinctrl_0 { + max77686_enb8: max77686-enb8 { + samsung,pins = "gpa1-1"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; +}; + &pwm { pinctrl-0 = <&pwm0_out>; pinctrl-names = "default"; @@ -103,7 +116,15 @@ &ehci { port@1 { + /* HSIC for LAN9730 */ status = "okay"; + /* buck8 enable pin, use it for power sequence */ + reset-gpios = <&gpa1 1 GPIO_ACTIVE_LOW>; + /* + * Reset duration of 500 us was chosen experimentally. + * Minimal working value was 400 us. Add some safe margin. + */ + reset-duration-us = <500>; }; port@2 { status = "okay";