Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3134133imd; Mon, 29 Oct 2018 02:09:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5erm71lu/14fJor6sDljn1S6B6iKoOQi4yy3VwiAH693JuxHL0bUTkqyNjO+Kfb2sXgb900 X-Received: by 2002:a63:2c8a:: with SMTP id s132-v6mr12725919pgs.73.1540804189045; Mon, 29 Oct 2018 02:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540804189; cv=none; d=google.com; s=arc-20160816; b=PLXRWKRICLYapuraLNlStxaKBRwoF2PqadEFOCW5qE+0M/5tBp7J9fOYtv9Es6xjEY mgoolOTQRtcWuOn8nVJ92UZlENpQCwNtYU5ZG/qXrpfR/GHk6CCBQRPQP3ufB3EdEjgO RGcGhbwA0wxZ1VTXUWcJ6t9l9KQgDXARXnYvlLKSZR+XOJHzljKLmvpuxbqrEUvdqbbL s5RRZ5HR88U0uMbFG10Sgejfich7pDaa3lIl3nd1dshekpTDBsESylBxDoQDacrIy4sp I92Vy3mo1aMRw09wRe417liCXeF4Bw5eXXbAwwt+SeunZ3bJSxp3lmgl+1SAAdwhl9gM evGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yTuilzxJqQfdEvzXCscbhukcoTsilp1p2S28b4qwiPs=; b=R+v3RApyM+1n+KAaJDVd2kNVhaOophPlcxmDYt4e8F3bRg2lJmTmWDyYgTdliTeOTt 2yKiJNtYfxEgbY6pfLN/eL/dpLWyOwTaQzQCs51V2inmgyTwOJyxLs6U+l65LhUBN6/v i/QZjmLP0QaGt7Jj/bHqKuWI4KvUhu/oow0lWXbiYqnBkKf/kNWEnvCP+1udYHgvvYoY hL57VO8DP0RVafoEST026iQ3zutzBfJG2mxmU1AhwGT9VXPRAGTl3MD1OqQdU8V+jwCr SCxG8LY8xwKh4MGzFyORA3IVx9oeclCJkgK5tNgffef0CkJkZHo5d8itxCGYKYe6pQdO tmmA== 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 a5-v6si19711557pgj.275.2018.10.29.02.09.32; Mon, 29 Oct 2018 02:09:48 -0700 (PDT) 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 S1729578AbeJ2R4y (ORCPT + 99 others); Mon, 29 Oct 2018 13:56:54 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54810 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbeJ2R4x (ORCPT ); Mon, 29 Oct 2018 13:56:53 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 49D3B207D4; Mon, 29 Oct 2018 10:09:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (aaubervilliers-681-1-12-210.w90-88.abo.wanadoo.fr [90.88.133.210]) by mail.bootlin.com (Postfix) with ESMTPSA id 1562720711; Mon, 29 Oct 2018 10:08:56 +0100 (CET) Date: Mon, 29 Oct 2018 10:08:56 +0100 From: Maxime Ripard To: Jagan Teki Cc: Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel , Michael Turquette , Stephen Boyd , linux-clk , Michael Trimarchi , linux-arm-kernel , devicetree , linux-kernel , linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 12/15] clk: sunxi-ng: a64: Add min and max rate for PLL_MIPI Message-ID: <20181029090856.yyjnvaruyasgnzyz@flea> References: <20181023155035.9101-1-jagan@amarulasolutions.com> <20181023155035.9101-13-jagan@amarulasolutions.com> <20181024181334.lul7ta7ijluwfb7v@flea> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lcwzkqyl6fqt7dzg" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lcwzkqyl6fqt7dzg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 25, 2018 at 09:21:31PM +0530, Jagan Teki wrote: > On Wed, Oct 24, 2018 at 11:43 PM Maxime Ripard > wrote: > > > > On Tue, Oct 23, 2018 at 09:20:32PM +0530, Jagan Teki wrote: > > > A64 manual say PLL_MIPI rates are 500MHz to 1.4GHz, but > > > using minimum 500MHz can't release the clock and which > > > is not working. > > > > > > So use working minimum rate as 300MHz which is tested on > > > Bananapi DSI panel. > > > > I'm not quite sure what you mean by that. What do you mean by "500MHz > > can't release the clock"? Why would 300MHz work better then? Should be > > avoid reaching 500MHz if it's a frequency in the valid range? >=20 > PLL_MIPI can't be work with existing nkm where rate set to 270MHz > (from PLL_VIDEO) > /*** round rate call in ccu_nkm.c */ > [ 2.408356] round: rate =3D 118800000 > [ 2.408359] round: parent_rate =3D 158740688 > [ 2.408417] round: rate =3D 148500000 > [ 2.408420] round: parent_rate =3D 158740688 > [ 2.408439] round: rate =3D 178200000 > [ 2.408441] round: parent_rate =3D 158740688 > [ 2.408460] round: rate =3D 205615384 > [ 2.408462] round: parent_rate =3D 158740688 > [ 2.408481] round: rate =3D 237600000 > [ 2.408483] round: parent_rate =3D 158740688 > [ 2.408502] round: rate =3D 270000000 > [ 2.408504] round: parent_rate =3D 158740688 > [ 2.408523] round: rate =3D 118800000 > [ 2.408525] round: parent_rate =3D 158740560 > [ 2.408544] round: rate =3D 148500000 > [ 2.408546] round: parent_rate =3D 158740560 > [ 2.408565] round: rate =3D 178200000 > [ 2.408567] round: parent_rate =3D 158740560 > [ 2.408586] round: rate =3D 205615384 > [ 2.408588] round: parent_rate =3D 158740560 > [ 2.408607] round: rate =3D 237600000 > [ 2.408609] round: parent_rate =3D 158740560 > [ 2.408627] round: rate =3D 270000000 > [ 2.408630] round: parent_rate =3D 158740560 > [ 2.408648] round: rate =3D 270000000 > [ 2.408651] round: parent_rate =3D 158740640 > [ 2.408670] round: rate =3D 270000000 > [ 2.408672] round: parent_rate =3D 158740704 >=20 > /** set rate call in ccu_nkm **/ > [ 2.408685] set: rate =3D 270000000 > [ 2.408688] set: parent_rate =3D 297000000 >=20 > By using min and max rate as per A64 manual page 94 range of PLL can > be 500MHz~1.4GHz getting 1,2,1 nkm dividers which can't be work. > [ 2.423589] sun4i_dclk_round_rate: min_div =3D 4 max_div =3D 127, rate= =3D 55000000 > [ 2.423643] ideal =3D 220000000, rounded =3D 0 > [ 2.423647] ideal =3D 275000000, rounded =3D 0 > [ 2.423651] ideal =3D 330000000, rounded =3D 0 > [ 2.423692] ideal =3D 385000000, rounded =3D 384000000 > [ 2.423732] ideal =3D 440000000, rounded =3D 440000000 > [ 2.423736] sun4i_dclk_round_rate: div =3D 8 rate =3D 55000000 > [ 2.423740] sun4i_dclk_round_rate: min_div =3D 4 max_div =3D 127, rate= =3D 55000000 > [ 2.423744] ideal =3D 220000000, rounded =3D 0 > [ 2.423748] ideal =3D 275000000, rounded =3D 0 > [ 2.423751] ideal =3D 330000000, rounded =3D 0 > [ 2.423791] ideal =3D 385000000, rounded =3D 384000000 > [ 2.423831] ideal =3D 440000000, rounded =3D 440000000 > [ 2.423834] sun4i_dclk_round_rate: div =3D 8 rate =3D 55000000 > [ 2.423957] sun4i_dclk_recalc_rate: val =3D 1, rate =3D 440000000 > [ 2.423961] sun4i_dclk_recalc_rate: val =3D 1, rate =3D 440000000 > [ 2.424378] ccu_nkm_set_rate: rate =3D 440000000, parent_rate =3D 2200= 00000 > [ 2.424381] ccu_nkm_set_rate: _nkm.n =3D 1 > [ 2.424383] ccu_nkm_set_rate: _nkm.k =3D 2 > [ 2.424385] ccu_nkm_set_rate: _nkm.m =3D 1 > [ 2.424725] sun4i_dclk_set_rate div 8 > [ 2.424732] sun4i_dclk_recalc_rate: val =3D 8, rate =3D 55000000 > [ 2.561271] usb 3-1: new high-speed USB device number 2 using ehci-pla= tform > [ 2.718486] hub 3-1:1.0: USB hub found > [ 2.718606] hub 3-1:1.0: 4 ports detected > [ 3.437263] ------------[ cut here ]------------ > [ 3.437270] [CRTC:36:crtc-0] vblank wait timed out >=20 > So, lowering the min rate by 300MHz seems working with bounded nkm > dividers 5, 2, 9. Tested on two different panels. >=20 > [ 2.415773] [drm] No driver support for vblank timestamp query. > [ 2.424116] sun4i_dclk_round_rate: min_div =3D 4 max_div =3D 127, rate= =3D 55000000 > [ 2.424172] ideal =3D 220000000, rounded =3D 0 > [ 2.424176] ideal =3D 275000000, rounded =3D 0 > [ 2.424194] ccu_nkm_round_rate: rate =3D 330000000 > [ 2.424197] ideal =3D 330000000, rounded =3D 330000000 > [ 2.424201] sun4i_dclk_round_rate: div =3D 6 rate =3D 55000000 > [ 2.424205] sun4i_dclk_round_rate: min_div =3D 4 max_div =3D 127, rate= =3D 55000000 > [ 2.424209] ideal =3D 220000000, rounded =3D 0 > [ 2.424213] ideal =3D 275000000, rounded =3D 0 > [ 2.424230] ccu_nkm_round_rate: rate =3D 330000000 > [ 2.424233] ideal =3D 330000000, rounded =3D 330000000 > [ 2.424236] sun4i_dclk_round_rate: div =3D 6 rate =3D 55000000 > [ 2.424253] ccu_nkm_round_rate: rate =3D 330000000 > [ 2.424270] ccu_nkm_round_rate: rate =3D 330000000 > [ 2.424278] sun4i_dclk_recalc_rate: val =3D 1, rate =3D 330000000 > [ 2.424281] sun4i_dclk_recalc_rate: val =3D 1, rate =3D 330000000 > [ 2.424306] ccu_nkm_set_rate: rate =3D 330000000, parent_rate =3D 2970= 00000 > [ 2.424309] ccu_nkm_set_rate: _nkm.n =3D 5 > [ 2.424311] ccu_nkm_set_rate: _nkm.k =3D 2 > [ 2.424313] ccu_nkm_set_rate: _nkm.m =3D 9 > [ 2.424661] sun4i_dclk_set_rate div 6 > [ 2.424668] sun4i_dclk_recalc_rate: val =3D 6, rate =3D 55000000 >=20 > Note: BPI-M64-bsp is setting the rate directly to 180MHz with 297MHz > parent with resulting dividers as 1, 2, 5. ans we can't produce this > 180MHz rate with dclk_round_rate and ccu_nkm. I'm still not quite sure what you mean by "500MHz can't release the clock". =46rom what you're saying, this seems to be related to the boundaries of the dividers rather than the rate itself. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --lcwzkqyl6fqt7dzg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW9bOKAAKCRDj7w1vZxhR xTvpAP9bDZZoJC5eah5D5XltfM9QjZurgMCE/aLANzNHKFnHsAEApZh7dHjeh6Cr 1UuUfqW9uwjyGIduMA3zs7v2LpIGUQo= =PTeb -----END PGP SIGNATURE----- --lcwzkqyl6fqt7dzg--