Received: by 10.223.185.116 with SMTP id b49csp7444431wrg; Thu, 1 Mar 2018 05:46:26 -0800 (PST) X-Google-Smtp-Source: AG47ELuX3zeD+Htr5/ub2L5dTH48FFE+FjMWvKJXRZoUPZCWsQPC2dLpYK9FjqO5IsHE3x1/ZGbm X-Received: by 2002:a17:902:4201:: with SMTP id g1-v6mr2004103pld.62.1519911986117; Thu, 01 Mar 2018 05:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519911986; cv=none; d=google.com; s=arc-20160816; b=tqYkqDSBYWtGXpcaeFqqLUQZJwhX+jqn9P9cQlmXy8SP4x9NEKYsj9bpw4S9Vm6PXR n+gIpc/y0Y/kwZRt/Kt2ZcIhi7yHPTyh2xmpS9xljAurTGGXae+7cI9qsVyDa0QRH8XM pcIn2+RtvRqJGMfZjkvuSoXDavNnYQjg0+sIgSR6ZZMVfha8581RHvYOFhqYTkqT/o4X BVa106Nv12Svrzd1nyGID7r6hSNr+Gw8yUE9ZjwSx39nSlvopLdaUmQfUSpXTV2f7MED bh5tUQtTwqdsL+oWGjKytx9Ad/mdZ4rq33D7Hn6exVET3THil8i0k128FbalmGLl1jR7 HV3Q== 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:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=7KcYmVHZffOxwoMNkFceF3qkBLftd9P8a1xAIwq/gbw=; b=GNtacYvQjjcgcVGFZUDabCdHt1JWzXcDszIuttfIwF6n3J2+HwkMCxYNVep16wcdqC YQiyABxtGyT9txx5Aekd9UQhLJQga8H5eq5TEv91SevYek/1pUNYlN9omkEehD5oYX2x mPJEMxL0GomY3gyuQWrxiiQxEIi1bUSZr1lhD0or784CWT8vnHgxF/b22vy/f0gm+LSG Z9wOPPv66cOMg3ZcNAXC0CS8FBEKCqtt72giQiQo4Yl3xUsuyrvTMpMpPPtspStH5g2C zr7QANFPsmhhJ++mWlW/BBM6sjuceaxUp4HPVJQ8tEaNM7qriCAYmDP5EIlyCX4+JZON cK9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ojb4DAJp; 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 v12-v6si3076176plk.256.2018.03.01.05.46.11; Thu, 01 Mar 2018 05:46:26 -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=ojb4DAJp; 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 S1030951AbeCANos (ORCPT + 99 others); Thu, 1 Mar 2018 08:44:48 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36902 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030760AbeCANop (ORCPT ); Thu, 1 Mar 2018 08:44:45 -0500 Received: by mail-pf0-f196.google.com with SMTP id h11so2059701pfn.4; Thu, 01 Mar 2018 05:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7KcYmVHZffOxwoMNkFceF3qkBLftd9P8a1xAIwq/gbw=; b=ojb4DAJpBl4u7acn0kdyHf9gqNoJI9pilfXA/0SaCDlEwz5qSfmbSoA52P55t0zQoL l7VjEN+lg7Ej/nORdZvhipxWhDM93do1hkMBsrCEOhAFvHvPvCnEBEhrVSbhTAcuzYKA KYJKUGNPG/9cG04YpiGdXnaq/9qL6L0GwlnfIdr4alBckXR05setDSZvAh4NYPKlqyqf TM9PqAHIdWSLsSADoK2hmTCBWABZd8/lN1m1Dwt7+yEt/IEfnSG35cZcuC5VhQROwaP6 Cece9T0Sryz0jMCK7WPBgFXFsKV1+oE69w4a1f/kbQiICZ15YuR9Oabzeup/j04qCAJb Qnkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7KcYmVHZffOxwoMNkFceF3qkBLftd9P8a1xAIwq/gbw=; b=Hjw1dvfnq1yzICSvTATlqYxk/Za4IHuaNGwd0M9gPVh8BBxhaeGnRrqw9tAUDBs1lg PMJJMlvPuRDWK80htaejX9AFhGqIZqn1EIm0hrM6uN0ZlGM0J+TBpX9kiuw2dNfwunqa 51HWw8bU+liS7rRIAMZ+fI6JIDXerRtpyNYE8/fsASsPF1v9fmr2ieg1bMgIerrwhkEo osd70kvca2Yua4Il/OS5WZHCfk8jw++6crxjqKv4BX5a/D4s9QbHMH0YUEubANRyWbXO KMbvsNqOVBo0GVxnWlm0SKgqcCgboUrDf8/qG6urg4puALv7a5D60vVu77ZRHIssx67i B8Pw== X-Gm-Message-State: APf1xPAvMvrZinieliOuv4vIoskMiqNWe+K9zoa35NJLQ+qLNVUU6kCo p+RK5AJm3obPPcipuoL3rBuo3s7v X-Received: by 10.99.110.70 with SMTP id j67mr1605627pgc.202.1519911884948; Thu, 01 Mar 2018 05:44:44 -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 v12sm10179027pfd.141.2018.03.01.05.44.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 05:44:44 -0800 (PST) Subject: Re: [PATCH] clk: tegra: fix pllu rate configuration From: Dmitry Osipenko To: Peter De Schrijver Cc: Marcel Ziswiler , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jonathanh@nvidia.com" , "mturquette@baylibre.com" , "pgaikwad@nvidia.com" , "sboyd@kernel.org" , "thierry.reding@gmail.com" , "linux-clk@vger.kernel.org" References: <20180222230451.15515-1-marcel@ziswiler.com> <31f039e8-9afc-22d1-d478-a7f41db0dace@gmail.com> <1519686262.6374.3.camel@toradex.com> <20180228093620.GC6190@tbergstrom-lnx.Nvidia.com> <20180228141448.GD6190@tbergstrom-lnx.Nvidia.com> <7d8d77ca-e18d-6e37-1aca-6dd7c6e1964d@gmail.com> <20180301074129.GG6190@tbergstrom-lnx.Nvidia.com> <028b0ba5-33b9-d12e-77ba-aebbfa91a5fb@gmail.com> Message-ID: <0aa21b3e-0ace-33d5-31ec-ecd7bb36b1d0@gmail.com> Date: Thu, 1 Mar 2018 16:44:35 +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: <028b0ba5-33b9-d12e-77ba-aebbfa91a5fb@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.03.2018 16:19, Dmitry Osipenko wrote: > On 01.03.2018 10:41, Peter De Schrijver wrote: >> On Wed, Feb 28, 2018 at 08:20:47PM +0300, Dmitry Osipenko wrote: >>> On 28.02.2018 17:14, Peter De Schrijver wrote: >>>> On Wed, Feb 28, 2018 at 03:00:23PM +0300, Dmitry Osipenko wrote: >>>>> On 28.02.2018 12:36, Peter De Schrijver wrote: >>>>>> On Tue, Feb 27, 2018 at 02:59:11PM +0300, Dmitry Osipenko wrote: >>>>>>> On 27.02.2018 02:04, Marcel Ziswiler wrote: >>>>>>>> On Mon, 2018-02-26 at 15:42 +0300, Dmitry Osipenko wrote: >>>>>>>>> On 23.02.2018 02:04, Marcel Ziswiler wrote: >>>>>>>>>> Turns out latest upstream U-Boot does not configure/enable pllu >>>>>>>>>> which >>>>>>>>>> leaves it at some default rate of 500 kHz: >>>>>>>>>> >>>>>>>>>> root@apalis-t30:~# cat /sys/kernel/debug/clk/clk_summary | grep >>>>>>>>>> pll_u >>>>>>>>>> pll_u 3 3 0 500000 >>>>>>>>>> 0 >>>>>>>>>> >>>>>>>>>> Of course this won't quite work leading to the following messages: >>>>>>>>>> >>>>>>>>>> [ 6.559593] usb 2-1: new full-speed USB device number 2 using >>>>>>>>>> tegra- >>>>>>>>>> ehci >>>>>>>>>> [ 11.759173] usb 2-1: device descriptor read/64, error -110 >>>>>>>>>> [ 27.119453] usb 2-1: device descriptor read/64, error -110 >>>>>>>>>> [ 27.389217] usb 2-1: new full-speed USB device number 3 using >>>>>>>>>> tegra- >>>>>>>>>> ehci >>>>>>>>>> [ 32.559454] usb 2-1: device descriptor read/64, error -110 >>>>>>>>>> [ 47.929777] usb 2-1: device descriptor read/64, error -110 >>>>>>>>>> [ 48.049658] usb usb2-port1: attempt power cycle >>>>>>>>>> [ 48.759475] usb 2-1: new full-speed USB device number 4 using >>>>>>>>>> tegra- >>>>>>>>>> ehci >>>>>>>>>> [ 59.349457] usb 2-1: device not accepting address 4, error -110 >>>>>>>>>> [ 59.509449] usb 2-1: new full-speed USB device number 5 using >>>>>>>>>> tegra- >>>>>>>>>> ehci >>>>>>>>>> [ 70.069457] usb 2-1: device not accepting address 5, error -110 >>>>>>>>>> [ 70.079721] usb usb2-port1: unable to enumerate USB device >>>>>>>>>> >>>>>>>>>> Fix this by actually allowing the rate also being set from within >>>>>>>>>> the Linux kernel. >>>>>> >>>>>> I think the best solution to this problem would be to make pll_u a fixed >>>>>> clock and enable it and program the rate if it's not enabled at boot. >>>>> >>>>> Oh, right. PLL_U rate is actually configurable, somehow I missed it in TRM >>>>> yesterday.. So set/round_rate() for PLL_U are actually needed and the patch is >>>>> correct. Seems only T20 misses PLL_U in the init table, probably worth to add it >>>>> there. >>>>> >>>> >>>> AFAIK we only use one rate ever? >>> >>> IIUC, PLL_U has 3 outputs and output dividers are fixed in HW. So yes, we are >>> setting PLL_U to one rate - 480MHz to get out1-480MHz, out2-60MHz and out3-12MHz. >>> >> >> Indeed. And given that it's hw controlled anyway, I don't see why we can't make >> it a fixed clock and handle the init at kernel boot depending on what the >> bootloader has done. > > We can, I just don't think you can demand from Mark to do it. This patch is fine > on its own, everything else could be done later. I meant Marcel.