From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941148AbdAGIwx (ORCPT ); Sat, 7 Jan 2017 03:52:53 -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 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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"; -- 2.9.3