Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp272124pxb; Wed, 15 Sep 2021 01:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEZRggMoQJbmf4dUobfoAOCW0lHtUeEj/g5pG6M/4q3lRz3ngDEORXHrhIWIMLF54/ccsK X-Received: by 2002:a5d:9e09:: with SMTP id h9mr17406696ioh.164.1631694466031; Wed, 15 Sep 2021 01:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631694466; cv=none; d=google.com; s=arc-20160816; b=rlS5BQIQxTGr5K7eyiqytxer/DRyZ2QHMZBx5N34zjF98vD3gqhvh6DU/PqOnu/yoL Alj83RW0IEPHfHHqwrXVP6iwIMVC6bmVKOwqsWJOoVYS95JRtLbWZjmiBwRm9KW/QSkm 4e4siEs+fk+rPBk+8R9IVW2X5yZ/bBr4LKDPNeeaZZQ4A+Qa5vL4AGLUkPzHf3HwrNsB BPZ4WS1Dqqac2diaCp/FbY+a2HjibR/d+rBAsyAqZr20DwuDni8I8+3FHbaBsT0p1LOC ex6gMa2IZgsCBDujAijO7+cgEBwK5m/CIejBztEOkiwItZBMRpNd913mUpvnkZf3lBsq 96fw== 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:from:references :cc:to:subject:dkim-signature; bh=ptvhp8j3x8Ftji47LhZR4Wys0W2gMYnRB4nsbyxXHrA=; b=0yJAXfakTPzkM4+GR4WQaiZW+U7e6cApeNiUA1+llbSC5tyqn7S3BYPqlbHiuH0MbC qpeIsmuIOBwulpLCCpCcLvH6KnvQkV+Anx+l5jGLYCM3p2XZ+S3qUIsJeeqoKQotvYY1 0yTf55WowMLM7AebqO3/2O90w38OVDiSpeGesCR2ukVhX7cHwCrIajTgvjqtbD85Nof0 QCfM7cyogYzP8BdCRC7+5G6aXfjlBvifQ5sh6D/H8jdNOWdpa8aUAzvsrDr83kXwhaF2 FXKWg/bH9UD5iXsKNyzW+cu93YgE6qdAh0+CSBsHRhvpNjnzj3AdpsXaRx4LbwGKw7Tz 1rGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FGjhIH9E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si11095950ila.182.2021.09.15.01.27.28; Wed, 15 Sep 2021 01:27:46 -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=@canonical.com header.s=20210705 header.b=FGjhIH9E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236685AbhIOI1a (ORCPT + 99 others); Wed, 15 Sep 2021 04:27:30 -0400 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]:46724 "EHLO smtp-relay-internal-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbhIOI1a (ORCPT ); Wed, 15 Sep 2021 04:27:30 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id CCAF040257 for ; Wed, 15 Sep 2021 08:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1631694370; bh=ptvhp8j3x8Ftji47LhZR4Wys0W2gMYnRB4nsbyxXHrA=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=FGjhIH9ECSBf4weqHJCueAM9m9b68EzO82vksw4V2IsfesDcNHl5PT3ab4YbgTm6Z oVH7Np4n4SSR2gyCFvgqREbCQPkCt2bvAo2K6c2SjgRvip9Oz6EM/OkLWue9D6UNC2 GA27UTqWpKu6btiXavsyVHNFQHwNN0cNFtG37pPIK82qL0zGiiBtg7y3sA/0gXPC2u c1e+h8VcRDHMTfnxB+nrJkVLYX1xo75P0lbiABpr8HJoO5ScaYcvJBrxWyN3u2surI isaNZAI8c8dmY5YK1Pyv/QlrzhUYpAIhWQY5jnFIht3HdgS/hEMDpsGHIVZ8+cOL1S Xq1UxAci+711g== Received: by mail-ed1-f71.google.com with SMTP id s15-20020a056402520f00b003cad788f1f6so1135877edd.22 for ; Wed, 15 Sep 2021 01:26:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ptvhp8j3x8Ftji47LhZR4Wys0W2gMYnRB4nsbyxXHrA=; b=yy2AT07T0YuGKx9xbNy6wJeZIRwUbxf5V4+sQz87ozHGBm9JoQk4uYoIi8EBXZGqYg WBlHhOjRi7lfejDoOIhyhKv3wv8fuUXwSEOicT0dPGcrc8v2bF1NJy7p75Pqoktd4CQn MWExnXGnGkKc/oCyb/QJrJVEW51wrsVg+8bsJODvnrk+kGwap6gnqmVcthh69hs542hw hBvzQGgZmW9IkG4Il+sUVGqCQbkGigozPVWTXaozTCCUCAkmaLcPJdXyjY9ChTLYOAX4 J6zq4818U6v2V6TFBNnSBhhxaXMSeLsgl8fyzJ+7YCeMATvE0i3COKGc8xmgcxfnLrUm hnUw== X-Gm-Message-State: AOAM531wPL0nR3H+VDJV3eXZnWMfFwKrvrSw02fJ3YWkU16btsNBtEa7 IF/a0rNLKOYs5+r8ntLRoxfpqeprwjH2fwroK2bY9I6PesCbpD21tmDay0La6gnio5/DpeyBqxS 2Uz2p0RN0oBoah3D5nLkZvSQaZr0fT38dEipzb6jl4Q== X-Received: by 2002:a17:906:72d0:: with SMTP id m16mr23559520ejl.282.1631694370556; Wed, 15 Sep 2021 01:26:10 -0700 (PDT) X-Received: by 2002:a17:906:72d0:: with SMTP id m16mr23559504ejl.282.1631694370363; Wed, 15 Sep 2021 01:26:10 -0700 (PDT) Received: from [192.168.3.211] (lk.84.20.244.219.dc.cable.static.lj-kabel.net. [84.20.244.219]) by smtp.gmail.com with ESMTPSA id a12sm2689234eje.27.2021.09.15.01.26.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Sep 2021 01:26:09 -0700 (PDT) Subject: Re: [PATCH 3/6] clk: samsung: clk-pll: Implement pll0831x PLL type To: Sam Protsenko , Sylwester Nawrocki , =?UTF-8?Q?Pawe=c5=82_Chmiel?= , Chanwoo Choi , Tomasz Figa , Rob Herring , Stephen Boyd , Michael Turquette Cc: Ryu Euiyoul , Tom Gall , Sumit Semwal , John Stultz , Amit Pundir , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org References: <20210914155607.14122-1-semen.protsenko@linaro.org> <20210914155607.14122-4-semen.protsenko@linaro.org> From: Krzysztof Kozlowski Message-ID: <4a6e73bb-617d-d849-d64a-7f0de46ea03b@canonical.com> Date: Wed, 15 Sep 2021 10:26:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210914155607.14122-4-semen.protsenko@linaro.org> 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 14/09/2021 17:56, Sam Protsenko wrote: > pll0831x PLL is used in Exynos850 SoC for top-level fractional PLLs. The > code was derived from very similar pll36xx type, with next differences: > > 1. Lock time for pll0831x is 500*P_DIV, when for pll36xx it's 3000*P_DIV > 2. It's not suggested in Exynos850 TRM that S_DIV change doesn't require > performing PLL lock procedure (which is done in pll36xx > implementation) > 3. The offset from PMS-values register to K-value register is 0x8 for > pll0831x, when for pll36xx it's 0x4 > > When defining pll0831x type, CON3 register offset should be provided as > a "con" parameter of PLL() macro, like this: > > PLL(pll_0831x, 0, "fout_mmc_pll", "oscclk", > PLL_LOCKTIME_PLL_MMC, PLL_CON3_PLL_MMC, pll0831x_26mhz_tbl), > > To define PLL rates table, one can use PLL_36XX_RATE() macro, e.g.: > > PLL_36XX_RATE(26 * MHZ, 799999877, 31, 1, 0, -15124) > > as it's completely appropriate for pl0831x type and there is no sense in > duplicating that. > > If bit #1 (MANUAL_PLL_CTRL) is not set in CON1 register, it won't be > possible to set new rate, with next error showing in kernel log: > > Could not lock PLL fout_mmc_pll > > That can happen for example if bootloader clears that bit beforehand. > PLL driver doesn't account for that, so if MANUAL_PLL_CTRL bit was > cleared, it's assumed it was done for a reason and it shouldn't be > possible to change that PLL's rate at all. > > Signed-off-by: Sam Protsenko > --- > drivers/clk/samsung/clk-pll.c | 105 ++++++++++++++++++++++++++++++++++ > drivers/clk/samsung/clk-pll.h | 1 + > 2 files changed, 106 insertions(+) > Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof