Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1223892pxy; Thu, 29 Apr 2021 02:22:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd+TeIZ97PfmVAWuzxjdxIp5AYRkCW+YMppeTR0JlZvKwuCJBo2fX4SdHQMxiFDQ36kyTu X-Received: by 2002:a05:6402:1519:: with SMTP id f25mr16669430edw.277.1619688144301; Thu, 29 Apr 2021 02:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619688144; cv=none; d=google.com; s=arc-20160816; b=IWO7+uu3qZQDh1oyV5AfTPgycYX5T5jyayj6jV9WyCPyaectSNOAa4edOES3s0fPDo 2f4N+VXuJ18QOTg2IyZZgwljLulrCPJJh1EvjT6wWVIoPsxJp4dT2D542qkDF7MFu4QT Dmam88KiR+Nj2rBtuv25P6rIjWMs9+uzjHwV9Q6M6cjUpSFMobIpkx7xaCyxoJJWZf42 lsaXlgd/ccLxdVMKdDSCzCqfVwM/7BeuX2TIzO8UsDO4MOB4Zl7BI8ozR06ypKbbUOqi VbtAPzZmAs5GaZIarKI/F2cABmD5frZ02viPv4QenixV1gHX5/nr7XCsMqgb9K50MrdW JSfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=OEnZFH+XYmfSP7g7WH0QI8W4ZYWs8ZUaoUGB+JuAxoM=; b=tVfmMHOiZ6j/7scKCZBCRimMOi6X9mhpsFBKbtBSaSDFOhAQnJ3yifv+/qVyK+V3re zAoisQ2ei82z4/DDjv0DDQ8PMM/d9RAirzirceu8gQCl4FqZcHIBqDlbXI4PtUigaq6N 5AyS+AzDttZs1W5038lVOzVAJdOAjAiFESCje0yE3UBPnjS82B7OcH1iST/1B3tWeUsq Rnvf5YiEy/QbM6UyEFJfwwfBPfZf2Zp4KApSVETFVulo45gU8B3v7J7zT2dhP29PS8s7 eu0jcjD0TBlcNJyvmZKxpKILTIjt0sLLgnGoW2URlCxQqp5DwAflD29ATSDaHvJqNDfk 1vbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Mm8xR36U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si2807998edb.41.2021.04.29.02.21.59; Thu, 29 Apr 2021 02:22:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Mm8xR36U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232775AbhD2JVh (ORCPT + 99 others); Thu, 29 Apr 2021 05:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbhD2JUv (ORCPT ); Thu, 29 Apr 2021 05:20:51 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94EBC06138C for ; Thu, 29 Apr 2021 02:20:03 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id d11so8247871wrw.8 for ; Thu, 29 Apr 2021 02:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OEnZFH+XYmfSP7g7WH0QI8W4ZYWs8ZUaoUGB+JuAxoM=; b=Mm8xR36UEWJ6cS/XVCZAg06SJ8bVoGQwtegzm0Efe0KzMFiqiX58kizt5BxUCmAct1 XNcx+mGKGlXGphDHdUG4u/f2it6Vn0QuWvYK52mYMVvDbtQGyOXAKbaGxcHfGISAg3Yh DeMttCvju5ZPiLWDNPvmxPqUzqM0QLYWmpiXtLFI0PT6tTLnXTnhUuQX3as6ClQmDFru jHiW5g7K8RvY8fTwdXhzC7ssqkEawqN7kie2i3PfCf+Ps82jEl6QCwTk9XV7NOvpJLDq OmtPqH8d98UaaR3ll3mvCB5dyZ8ZODNFu1nwAm8ueqcb+Z7VoPhrLiMWVx/2xk2838IP Ncfg== 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:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OEnZFH+XYmfSP7g7WH0QI8W4ZYWs8ZUaoUGB+JuAxoM=; b=MRNV2Lj9IP6oG97F2vyaYEb24C6HqwqHRK5u+aqHf0ygJZU8gdHTE3QexUamqsHrO6 O/ikPY8SUSlCHt0tLrefs04wrAOz9PUoGMAHVLNTLU14lC0I/VAG8cMFKbBRfwO/Cz+l 62xik1XOwdqPiZM6EVjuroGQeuV8J6SQ/SbmjjPrsrmupsshd+Zb6YK7obeat/uxO2hC fP1mM83Il3KmPySvsF2phNZwhqdCOhKPJjwA7F4bRVZcbFUq5JDmZvTJMAG7GY0zjMI+ Mn+IHQNWMax4uSO710L7jgiBVKuuiIUmW+UiYeWZwUWTMUR6bnKhmld0nck/BZik2Oac YFDg== X-Gm-Message-State: AOAM5306f42kcXofZBPfxq8n7eOl9uXi+HF3Lb5uxFP6pIflqfdAsLv7 F5XL+DSVvhs7G9wjyBzxyz30Uw8Z25WOY7FF X-Received: by 2002:a5d:6085:: with SMTP id w5mr28892118wrt.14.1619688001872; Thu, 29 Apr 2021 02:20:01 -0700 (PDT) Received: from ?IPv6:2a01:e0a:90c:e290:c304:4b2b:4a79:1da9? ([2a01:e0a:90c:e290:c304:4b2b:4a79:1da9]) by smtp.gmail.com with ESMTPSA id a9sm3960823wrw.26.2021.04.29.02.20.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Apr 2021 02:20:01 -0700 (PDT) Subject: Re: [PATCH] clk: meson: g12a: fix gp0 and hifi ranges To: Jerome Brunet Cc: Kevin Hilman , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210429090325.60970-1-jbrunet@baylibre.com> From: Neil Armstrong Organization: Baylibre Message-ID: <979eb290-6fc2-38df-0596-867b82d22226@baylibre.com> Date: Thu, 29 Apr 2021 11:20:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210429090325.60970-1-jbrunet@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/04/2021 11:03, Jerome Brunet wrote: > While some SoC samples are able to lock with a PLL factor of 55, others > samples can't. ATM, a minimum of 60 appears to work on all the samples > I have tried. > > Even with 60, it sometimes takes a long time for the PLL to eventually > lock. The documentation says that the minimum rate of these PLLs DCO > should be 3GHz, a factor of 125. Let's use that to be on the safe side. > > With factor range changed, the PLL seems to lock quickly (enough) so far. > It is still unclear if the range was the only reason for the delay. > > Fixes: 085a4ea93d54 ("clk: meson: g12a: add peripheral clock controller") > Signed-off-by: Jerome Brunet > --- > drivers/clk/meson/g12a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c > index b080359b4645..a805bac93c11 100644 > --- a/drivers/clk/meson/g12a.c > +++ b/drivers/clk/meson/g12a.c > @@ -1603,7 +1603,7 @@ static struct clk_regmap g12b_cpub_clk_trace = { > }; > > static const struct pll_mult_range g12a_gp0_pll_mult_range = { > - .min = 55, > + .min = 125, > .max = 255, > }; > > I got other issues with GP0 when trying to use it for DSI on VIM3 & VIM3L. I had to do change the following to have it lock correctly and achieve rates usable for MIPI-DSI requested bandwidth: diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index cde07f7ebad6..897cd6db5c0f 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -391,9 +391,9 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, meson_parm_write(clk->map, &pll->frac, frac); } - /* If the pll is stopped, bail out now */ + /* If the pll is stopped, bail out now * / if (!enabled) - return 0; + return 0;*/ if (meson_clk_pll_enable(hw)) { pr_warn("%s: pll did not lock, trying to restore old rate %lu\n", This one is tricky, for DSI the clock rate is set with assigned-clock-rates in DT, but then the GP0 is seen as stopped and then the rate is never set. When afterwards we enable the PLL, the rate set in the registers is invalid and never locks, this permits setting the rate in the registers even if the PLL is stopped. diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index 1b0167b8de3b..08174724a115 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -1602,8 +1602,8 @@ static struct clk_regmap g12b_cpub_clk_trace = { }; static const struct pll_mult_range g12a_gp0_pll_mult_range = { - .min = 55, - .max = 255, + .min = 120, + .max = 168, }; I had to change the min/max to achieve a stable and functional rate of 720MHz after the ODs. Neil