Received: by 10.223.185.116 with SMTP id b49csp6437626wrg; Wed, 28 Feb 2018 09:22:42 -0800 (PST) X-Google-Smtp-Source: AH8x227MbPX0r/AuBlIctbIagK0sI46Uaz/CvcKomSUNtePP6ZEpOwt1Th98dJIJV0QIMQku/4cA X-Received: by 2002:a17:902:6b88:: with SMTP id p8-v6mr18243672plk.261.1519838562750; Wed, 28 Feb 2018 09:22:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519838562; cv=none; d=google.com; s=arc-20160816; b=1FaZuR+YUl91+96XNgvuPnudCMxESZ0vcCbO9KYOOW65ly51MiZnq50IdjcCM0TrBd NN5dQACA3qWcBfiH/MkCtKMuFj54fIjSy6Bg7ZXpjgarAgB/MsO1dFddk65/EBTHghnN DMWyjnxdm8kr6IZHm9+Z17J4Gr4hmPH9LRB89r75oU08v7saDdh0lTxnZG1+zKAjNOkT NOxy0l4Y2EYOkPzgD7iHh7ToBQ0APSkSFb42XeWo+Fqr0faEmOFtYll8YI6PtRFJHPnP 5YoERIoEWKRwQkn7LLeXS5CCeTHpCf3eSXAY4li7IoKXkYteQ9rST05wbdvf8ALOtJLm 6YeA== 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=t/q5OXJcuvNpr/Ez8gpp/Hy7qFTFflpTo4fGGY4WRr4=; b=cDJWFHy21SAMTm1kKCeVSELotVZAtTuguT6h3s/oP75lWPTSeGIQoC1vQHBpW9FB3t zw08fCUqVAJRxT8Ao261P17XxeXssCnkmtwK3Vz+k7+7ivVq28xZNX8KJN2T4q2MTDQq 36vTL1mcqVAQWOTfruYfDLmUHj7VHCLdhrVBNUkabCldom3s4H0sXP7af7oBKcDKCGQm dUMYWC5iPH/7Yedar74CBZneYI5evFAZiSkMOrbUtFRqepg1JXOgXeXlSHF0R6GS2mq+ 7kqDQW2E8wA5zTnmW2b+AwvGiix+aAPXMdP5A5N9O1RGGH9UgoSe0pt41YdH1TYXOxGZ +6ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=auGlKJOc; 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 r26si1466583pfi.378.2018.02.28.09.22.28; Wed, 28 Feb 2018 09:22:42 -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=auGlKJOc; 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 S1753224AbeB1RVE (ORCPT + 99 others); Wed, 28 Feb 2018 12:21:04 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:44071 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbeB1RUv (ORCPT ); Wed, 28 Feb 2018 12:20:51 -0500 Received: by mail-lf0-f68.google.com with SMTP id v9so4633488lfa.11; Wed, 28 Feb 2018 09:20:50 -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=t/q5OXJcuvNpr/Ez8gpp/Hy7qFTFflpTo4fGGY4WRr4=; b=auGlKJOcqXF3YzppZKf/Ra0xkfwV9RkYKvingClpK/1DNlAWKWFi8Ebe8cihlgWG6T BdRYhes+Tkv3fqWv0hbTBC2hrkUVYEgLX9hFNjZ4A3J8VpQJ8CZVOD3mOebQttiEbyu0 BvhFu1z/1tRiUDvlfzHlWFdtUCeVKQ97XSAQmYjkflseXSd+vvebLrNxwbE3iH0Hz/mL moAxRgOLThTi6CU5i7pPQnp8JIjNyVDPneKHRhB+dm2Cafr9i64PI43t4qD58mWYvG9K 3M0IjrtnLOY2sBIREHvr+SBY/isS/XjlZN3RQ+DsietXtuib+8M2onvwf0C+J14hOZ/B uJwQ== 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=t/q5OXJcuvNpr/Ez8gpp/Hy7qFTFflpTo4fGGY4WRr4=; b=BtJSfzoVAzm+DESnPkplytFRuJWrAcSKqFSMU2UbExZ3FhsyNNtVoQSkKqwsjm+ES9 xEQbuI+yVIVxdI7h2ZDcm/qpV49YhnLUxkWfivtj1RWsOPqln0Fm2RgXa+CeERUT3ZUc 2I1BLnXMuqp0fRrd6KrRpDORe9NlVFqLPCw1JrLB3g1OctiumkQmcZbQn0AZG/Pi2yX3 wg+k5bpf3bDsdxEBaofpH7PvKg70nI9zIxcNJCLAz3xTMSZW/Sd1VgApliMBSQNUUvBq yothqIhxcwt/WU17W74NH9ELobu2UzjZQNbi2c4BE+XmX3IlZ8Wk3QwZHHXRyEEeu2lr YeYA== X-Gm-Message-State: APf1xPCwqtkIkpmC50++O2XtYB9TzsZ20A2GZrJILETkeX+hfzkJRTBf Z6ukdzDS2xeb4Qrnh8YLB87xa0bA X-Received: by 10.46.65.211 with SMTP id d80mr12809465ljf.109.1519838449560; Wed, 28 Feb 2018 09:20:49 -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 l76sm460835lfe.51.2018.02.28.09.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 09:20:48 -0800 (PST) Subject: Re: [PATCH] clk: tegra: fix pllu rate configuration 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> From: Dmitry Osipenko Message-ID: <7d8d77ca-e18d-6e37-1aca-6dd7c6e1964d@gmail.com> Date: Wed, 28 Feb 2018 20:20:47 +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: <20180228141448.GD6190@tbergstrom-lnx.Nvidia.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 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. >>> This is how it's done for Tegra210. The reason is that the USB IP blocks >>> can control the pll_u state in hw. This means that if sw would disable >>> and then re-enable the pll_u clock, but there is no USB activity, pll_u >>> will still be disable and therefor not lock, causing an error. Today >>> this is worked around by not polling the lock bit for pll_u, but a better >>> solution would be to just remove all sw controls for pll_u. >> >> SW controls could be removed, but I don't think it is really necessary as in our >> case SW is the PHY driver and we know what it does. Alternatively we can enable >> PLL_U in the init table to keep it "always" enabled.