Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3361904imu; Sun, 23 Dec 2018 23:56:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN7c4lcSQfczxx58zQN7LFwIy1U8Q8JIUfNPxUSz8dshyc70uaSXZ5Z9me/zZ2+fmads+YMV X-Received: by 2002:a17:902:a710:: with SMTP id w16mr11865678plq.95.1545638204777; Sun, 23 Dec 2018 23:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545638204; cv=none; d=google.com; s=arc-20160816; b=C1/ATlnlOcBFtVDV+PfHYVjEkt2wGK7xq3GDmwhBy+SBzqJ/GyuKKmChAoeKqEDbIr NjzkUGFdOBx/LTL8hvaSWhI+u/PoL/KksMdx0zh2OkWBFoZZypGdEio12psjqIIkTITt 3bM16UdtuSRZ/swp/MFbSvHZKwGq5YlCiGwd3bhh5PzlPnBrQYw7M1iqdTwNK1pJ1aR5 4MY2yCbUttomktp+Zr+lfmZYC0+9/P0DqjnVd4OscMNEiBYtkXAeVe69UW791H4PICYe MeHZ13nmtQ8kBYsGO3FZTobKUavYU/O5H61z/Mpcg5TtSP9Zexc9GvGlDVndWG6nzhCS Txfg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/hYM4ReXmpsfoTYvx7mK74EIct19hcPcssqVQx/oxF8=; b=M8V1bCgKKFor3mwCS0UReM5NMJsjDWz4rDaTohzrKW6oyG4Bsfb6PcbbXCADMecjVR BaKdG/ZS7mPnc1LLmSTpP24JR7791SJduIBWDgxl5A9dvhPvp8r0kBaNCd8voQx8qW64 CUUxz90mIchFbP+Z44qNEKqDQwnmYzczcs8xmO67VLJ3bnk+LBQ2F5qU+ecIKkuaoZzY QkY8eaCn+ZqfIgjm+TXRlY1oLQhSYEZ+sN3D+TaQFpxInTA07mmbBzFQ/zAaAVhVWLrk 33ZwWO3GWbNL4JlTHkLhKkujquoKh6YRchZgSSCh1ebH/FCMPYfV3PMm9tH+GhBzQrun n0uA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si6094645pgm.467.2018.12.23.23.56.29; Sun, 23 Dec 2018 23:56:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbeLXHyj convert rfc822-to-8bit (ORCPT + 99 others); Mon, 24 Dec 2018 02:54:39 -0500 Received: from gloria.sntech.de ([185.11.138.130]:38018 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbeLXHyj (ORCPT ); Mon, 24 Dec 2018 02:54:39 -0500 Received: from [46.183.103.8] (helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gbL4K-0003Aj-4f; Mon, 24 Dec 2018 08:54:32 +0100 From: Heiko Stuebner To: "zhangqing@rock-chips.com" Cc: Katsuhiro Suzuki , Finley Xiao , linux-rockchip , linux-arm-kernel , linux-kernel Subject: Re: [PATCH] clk: rockchip: fix frac settings of GPLL clock for rk3328 Date: Mon, 24 Dec 2018 08:54:31 +0100 Message-ID: <2107849.4rvOjsJc15@phil> In-Reply-To: <20181224154804602776216@rock-chips.com> References: <20181222164249.25620-1-katsuhiro@katsuster.net> <1587344.DIk9eYpvKM@phil> <20181224154804602776216@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Elaine, Am Montag, 24. Dezember 2018, 08:48:05 CET schrieb zhangqing@rock-chips.com: > Hi: Heiko: > > This explanation and the change is OK. Thanks for Katsuhiro's correction. thanks for your quick confirmation. Can I make this an Acked-by: Elaine Zhang when applying the patch? Thanks Heiko > 张晴 > 福州瑞芯微电子股份有限公司 > Fuzhou Rockchip Electronics Co.,Ltd > 地址:福建省福州市铜盘路软件大道89号软件园A区21号楼 > Add:No.21 Building, A District, No.89 Software Boulevard Fuzhou, Fujian 350003, P.R.China > Tel:+86-0591-83991906-8601 > 邮编:350003 > E-mail:elaine.zhang@rock-chips.com > > From: Heiko Stuebner > Date: 2018-12-24 15:34 > To: Katsuhiro Suzuki; Finley Xiao; Elaine Zhang > CC: linux-rockchip; linux-arm-kernel; linux-kernel > Subject: Re: [PATCH] clk: rockchip: fix frac settings of GPLL clock for rk3328 > Hi, > > Am Samstag, 22. Dezember 2018, 17:42:49 CET schrieb Katsuhiro Suzuki: > > This patch fixes settings of GPLL frequency in fractional mode for > > rk3328. In this mode, FOUTVCO is calcurated by following formula: > > FOUTVCO = FREF * FBDIV / REFDIV + ((FREF * FRAC / REFDIV) >> 24) > > > > The problem is in FREF * FRAC >> 24 term. This result always lacks > > one from target value is specified by rate member. For example first > > itme of rk3328_pll_frac_rate originally has > > - rate : 1016064000 > > - refdiv: 3 > > - fbdiv : 127 > > - frac : 134217 > > - FREF * FBDIV / REFDIV = 1016000000 > > - (FREF * FRAC / REFDIV) >> 24 = 63999 > > Thus calculated rate is 1016063999. It seems wrong. > > > > If frac has 134218 (it is increased 1 from original value), second > > term is 64000. All other items have same situation. So this patch > > adds 1 to frac member in all items of rk3328_pll_frac_rate. > > > > Signed-off-by: Katsuhiro Suzuki > > so while this sounds all quite right to me, I've added some Rockchip > people that have clock experience to hopefully get an Ack on the > change :-) > > @Elaine + Finley: does this explanation and the below change look right? > > > Thanks > Heiko > > > --- > > drivers/clk/rockchip/clk-rk3328.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c > > index faa94adb2a37..65ab5c2f48b0 100644 > > --- a/drivers/clk/rockchip/clk-rk3328.c > > +++ b/drivers/clk/rockchip/clk-rk3328.c > > @@ -78,17 +78,17 @@ static struct rockchip_pll_rate_table rk3328_pll_rates[] = { > > > > static struct rockchip_pll_rate_table rk3328_pll_frac_rates[] = { > > /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */ > > - RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134217), > > + RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134218), > > /* vco = 1016064000 */ > > - RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671088), > > + RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671089), > > /* vco = 983040000 */ > > - RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671088), > > + RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671089), > > /* vco = 983040000 */ > > - RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671088), > > + RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671089), > > /* vco = 860156000 */ > > - RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797894), > > + RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797895), > > /* vco = 903168000 */ > > - RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066329), > > + RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066330), > > /* vco = 819200000 */ > > { /* sentinel */ }, > > }; > > > > > > > >