Received: by 10.223.185.116 with SMTP id b49csp2344678wrg; Thu, 22 Feb 2018 12:09:53 -0800 (PST) X-Google-Smtp-Source: AH8x226f1sHnJ9m31UOxrzA2Diup7tIDJQ0Ws8qpXcuExcpBuTz4Pe81VqabOW4MIlTVH5o6cEVU X-Received: by 2002:a17:902:968b:: with SMTP id n11-v6mr7631488plp.168.1519330193496; Thu, 22 Feb 2018 12:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519330193; cv=none; d=google.com; s=arc-20160816; b=C7guu4Wjn0uZwn23f40k84sqhtn/S1Si2VsVoNlkl5kmy72r7f/0BDhNjG6JX52pG4 iAF0I/C0t+PEZ9Ta3nLKM8z/vrLjhmUKtq1N/Rj2wcqbGFmmXOrqpqM2JgywpH24SLgP ygSCC5JpV9pXmn2EO4ju8Yc7ffVlScoJaB7Vewkwgo2h2VQQva0YgiVeiOH+rkVXZ+jI hD3ju8heDsqDWEnMHB7Oso6jD6AesFdgdx6SKOlG3MSCBlsVWJ8qs7vBkClDDC45AQAA fNEb62UtwrLFmqIl+kVXgJa7wi8y56po4VZHqTND++bLfA0NT8IwZ8XbD5dxNULY7ul8 it8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=hZOH41szmSt27hqryF2m+MFN7eYsZ664SRfXa+hK7dM=; b=tQ4N5WnzcWodTdZ240WcfBRcsaw/Jpu1AXS5H4dwVhgU8eVFd+N4nGoW30zhl4Yt/k 7qO6dVl3laHmroOss5A2gpzGYAjIFhcKRRr/8ckjDuYHdMgQ3tQBRWXknO+emaewUJ6t M1i4KIfKszQGO6LdIEA+VklwwqcHjCz0Y801k5saltTVakhHsq0PBYjXWXOq1v6AgI7/ gS0fC7i0geht9KWR3AH86ow6+2y9Dh9JDCRoiBpBAiYEPC6H2EAtKrCXfCkZ2wiUUi7h F6xsXw/0Y3XsS1FawxexeiQr1Z4mGWhdpiq/Kaa4/f/qGCdhALBra+iRMktDtNKnXso6 ZFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z2y4Y0CH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f84si538200pfe.128.2018.02.22.12.09.34; Thu, 22 Feb 2018 12:09:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z2y4Y0CH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbeBVUIw (ORCPT + 99 others); Thu, 22 Feb 2018 15:08:52 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:42041 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbeBVUIs (ORCPT ); Thu, 22 Feb 2018 15:08:48 -0500 Received: by mail-lf0-f66.google.com with SMTP id t204so9167871lff.9; Thu, 22 Feb 2018 12:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hZOH41szmSt27hqryF2m+MFN7eYsZ664SRfXa+hK7dM=; b=Z2y4Y0CHox/5H216L/TamszVF+p8Tijb6kzba+8V9fG+OdVbqu1njHGq7mdQwjfmsF t7bbup91WolQSYiG/+Uww8hU95f4xXv3yWwCabOXDRiLU3EUWn8s+X4+gKLygYoU4Gzd MA4ePHjLTC00R/rU0De8Zv/I0osbwCghsfD7alaGeJMpKrJkYNlHh7/JrShDswyEDmHb VgoD5tEodX6npeR31IL3gLL7868P3YoGHKEzxjpA0YIf/2S2tGqbrEmgEkmdxjo1dui1 pggKn7X/KWKnbK6cDrD1If0x9fyoQibl/7jd7p/RTa918xcGFWk/VQrBi/BmJs3XnrrK sq3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hZOH41szmSt27hqryF2m+MFN7eYsZ664SRfXa+hK7dM=; b=Lw1I7vwPMeh5iCzvsQCq9JQUjrfDbn3Uu5TopFb/PqLsjK5ECdvChUQUlrWn28Aa6p fQtgNjMCpHX7RkzLXbDagX61eiY8F92FttDY82j1bZEmAviiqmRowrBAXAg1QupuvcDn /8yHIgln9rE3m6kZ2tlQulbqehZ80yuhTxZ4Qut90CfOiniNOTivbTwN316lBzal6tda Q/8opo+JhsNLN1fSodm4qCnJ3ORHcm1X8oSNap5qHvK+jbFiz8G39ga8ZyrkQ4mtOfkq OLLlddqviad+3LNIYxQqCHhjN2B0ZmWW5p53qZHHJ1LwIKoZjo8dQ2TKZZnNqUuQvyzQ Sc0w== X-Gm-Message-State: APf1xPBxwiwEEa37ehr2oeKuy7Mb9mL+FhOOoCDyD18jWasklo/PO8A3 ejLLASC5Pzz5SIX30oX4XyQ= X-Received: by 10.46.108.6 with SMTP id h6mr5600798ljc.125.1519330126496; Thu, 22 Feb 2018 12:08:46 -0800 (PST) Received: from [192.168.1.145] (ppp109-252-55-234.pppoe.spdop.ru. [109.252.55.234]) by smtp.googlemail.com with ESMTPSA id p77sm154311lje.56.2018.02.22.12.08.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 12:08:45 -0800 (PST) Subject: Re: [PATCH v2] ARM: tegra: fix ulpi regression on tegra20 To: Marcel Ziswiler , linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Cc: Marcel Ziswiler , Thierry Reding , Jonathan Hunter , linux-kernel@vger.kernel.org, Rob Herring , Mark Rutland , Russell King , linux-arm-kernel@lists.infradead.org, Peter De Schrijver References: <20180222143825.1517-1-marcel@ziswiler.com> From: Dmitry Osipenko Message-ID: <278c02d3-7fc2-a92e-b309-1da8116e7c41@gmail.com> Date: Thu, 22 Feb 2018 23:08:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180222143825.1517-1-marcel@ziswiler.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.02.2018 17:38, Marcel Ziswiler wrote: > From: Marcel Ziswiler > > Since commit f8f8f1d04494 ("clk: Don't touch hardware when reparenting > during registration") ULPI has been broken on Tegra20 leading to the > following error message during boot: > > [ 1.974698] ulpi_phy_power_on: ulpi write failed > [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy > [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error -110 > > Debugging through the changes and finally also consulting the TRM > revealed that rather than the CDEV2 clock off OSC requiring such pin > muxing actually the PLL_P_OUT4 clock is in use. It looks like so far it > just worked by chance of that one having been enabled which Stephen's > commit now changed when reparenting sclk away from pll_p_out4 leaving > that one disabled. Fix this by properly assigning the PLL_P_OUT4 clock > as the ULPI PHY clock. > > Signed-off-by: Marcel Ziswiler Indeed CDEV2 clock doesn't exist on Tegra, but there is a CDEV2 pinmux pad group. Looks like another clk-related relic from downstream driver that was borrowed to upstream and stayed unnoticed for a long time. I think in practice all T20 boards have CDEV2 configured to PLL_P_OUT4, so this patch is correct to me. Probably it would also worth to set CDEV2 parent to PLL_P_OUT4 in the clk driver for DT backwards compatibility or even make clk driver to read the CDEV2 pinmux config and set the proper parent based on it. CC'ed Peter. Reviewed-by: Dmitry Osipenko > --- > > Changes in v2: > - Updated device tree binding documentation as well. > - CCing Dmitry as well. > > Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4 +++- > arch/arm/boot/dts/tegra20.dtsi | 2 +- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt > index a9aa79fb90ed..1aa6f2674af5 100644 > --- a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt > +++ b/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt > @@ -21,7 +21,9 @@ Required properties : > - timer: The timeout clock (clk_m). Present if phy_type == utmi. > - utmi-pads: The clock needed to access the UTMI pad control registers. > Present if phy_type == utmi. > - - ulpi-link: The clock Tegra provides to the ULPI PHY (cdev2). > + - ulpi-link: The clock Tegra provides to the ULPI PHY (usually pad DAP_MCLK2 > + with pad group aka "nvidia,pins" cdev2 and pin mux option config aka > + "nvidia,function" pllp_out4). > Present if phy_type == ulpi, and ULPI link mode is in use. > - resets : Must contain an entry for each entry in reset-names. > See ../reset/reset.txt for details. > diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi > index 864a95872b8d..e05b6bb2599f 100644 > --- a/arch/arm/boot/dts/tegra20.dtsi > +++ b/arch/arm/boot/dts/tegra20.dtsi > @@ -741,7 +741,7 @@ > phy_type = "ulpi"; > clocks = <&tegra_car TEGRA20_CLK_USB2>, > <&tegra_car TEGRA20_CLK_PLL_U>, > - <&tegra_car TEGRA20_CLK_CDEV2>; > + <&tegra_car TEGRA20_CLK_PLL_P_OUT4>; > clock-names = "reg", "pll_u", "ulpi-link"; > resets = <&tegra_car 58>, <&tegra_car 22>; > reset-names = "usb", "utmi-pads"; >