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: 9502905 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 ADCD560710 for ; Sat, 7 Jan 2017 08:52:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A01FA2848E for ; Sat, 7 Jan 2017 08:52:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92435284C5; Sat, 7 Jan 2017 08:52:48 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D165D284C0 for ; Sat, 7 Jan 2017 08:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941127AbdAGIwn (ORCPT ); Sat, 7 Jan 2017 03:52:43 -0500 Received: from mail.kernel.org ([198.145.29.136]:60952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941106AbdAGIwf (ORCPT ); Sat, 7 Jan 2017 03:52:35 -0500 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 Cc: Marek Szyprowski , Sylwester Nawrocki , Peter Chen , gregkh@linuxfoundation.org, stern@rowland.harvard.edu, ulf.hansson@linaro.org, broonie@kernel.org, sre@kernel.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, linux-pm@vger.kernel.org, hverkuil@xs4all.nl, Markus Reichl 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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";