Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp901850pxp; Wed, 16 Mar 2022 20:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ8dUE7UtzPehS6rHX8BJ9vClwrQ2CVPQN4gOUyPdMkjVUxhs4ZPK9WS21qJh/6kI2aAXr X-Received: by 2002:a17:90b:4b8d:b0:1bf:923e:a522 with SMTP id lr13-20020a17090b4b8d00b001bf923ea522mr13479660pjb.71.1647488508052; Wed, 16 Mar 2022 20:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488508; cv=none; d=google.com; s=arc-20160816; b=AR7HsmoExo71JLf3NyrTQ1ZbEPNFq5r2w5VmzaMPFgOhlqqZnADZce+fotY+FZXUwF r0/+PRjfw0dBePkHDDkkBGzS1zRXIMxFMDkdOpD18Hvw3AsZebUulh/EZwCExYOPGYqV btUK8AK52OM5BxKN0qPCiUPcj9wieKzamsobE42eR76jTrqoIGQbZffitNaDHlJkfeyS PwoLf3Jyyif3Hrx5t7GtUkwEzqLAZNgGsGdhgIgGcpTG5st9SEBpZKYes0/0gIiPhQqZ NxN7gwo4k/zRvuhgUTqIMIwiYcUHz+/FQ7rkU5EWha968M1H3rx45qdqmoAKziN/rxf0 FAzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NmcMmlO3H0sekW1yCioOxzYAx3WOSRgPbgSTCKvPOQw=; b=xOV5mAoA6oHkWZ/4LXSVds0d9V+Ay37Lkv7g0wbATC72vhbx1X60ksMpESZRanu10N HV2bQZNwEkddN8K6MOmZ/yk1Wb0s/Gat0lL4z4ysmhX6YnhSsRYX/vX1CIg7WezDjEfy WrRlYd8f6xcT54Jb5D0uJfc4IxTP5t2vbFCHW5Dq0PN8RKa+UUQsTfcmYOFB70g+z+vw S2bJvElTtcFPtyga13dLZOdySK/z3PXswv3AxCBwO98B15ytEseXAmMnzXwzDUlKmQMZ dwdftt3c5Q//r5nAMkt+Tyd04m0DoI6qd7IkbciTlmbpZnf/cbE7Shes1CuszNjJ+8C5 ADTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lr17-20020a17090b4b9100b001beef62c01asi1472284pjb.15.2022.03.16.20.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E79862A11; Wed, 16 Mar 2022 20:34:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241732AbiCOWxs (ORCPT + 99 others); Tue, 15 Mar 2022 18:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbiCOWxr (ORCPT ); Tue, 15 Mar 2022 18:53:47 -0400 Received: from hostingweb31-40.netsons.net (hostingweb31-40.netsons.net [89.40.174.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B7A456C21; Tue, 15 Mar 2022 15:52:34 -0700 (PDT) Received: from [77.244.183.192] (port=63206 helo=[192.168.178.39]) by hostingweb31.netsons.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nUG1o-0007pT-2P; Tue, 15 Mar 2022 23:52:32 +0100 Message-ID: <59ee78c2-7d05-6d97-1ff2-36ea326be188@lucaceresoli.net> Date: Tue, 15 Mar 2022 23:52:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [EXTERNAL] Re: [PATCH] clk: vc5: Enable VC5_HAS_PFD_FREQ_DBL on 5p49v6965 Content-Language: en-US To: "Fillion, Claude" , Adam Ford , "linux-clk@vger.kernel.org" Cc: "aford@beaconembedded.com" , "cstevens@beaconembedded.com" , Michael Turquette , Stephen Boyd , "linux-kernel@vger.kernel.org" , Marek Vasut References: <20220313115704.301718-1-aford173@gmail.com> From: Luca Ceresoli In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca@lucaceresoli.net X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Claude, [adding Marek in Cc:, the original author of the driver and also of the frequency doubler] On 15/03/22 20:34, Fillion, Claude wrote: > Hello Luca, > > I will defer to Adam, but a few comments: > >> -----Original Message----- >> From: Luca Ceresoli >> Sent: Tuesday, March 15, 2022 4:55 AM >> To: Adam Ford ; linux-clk@vger.kernel.org >> Cc: aford@beaconembedded.com; cstevens@beaconembedded.com; >> Fillion, Claude ; Michael Turquette >> ; Stephen Boyd ; linux- >> kernel@vger.kernel.org >> Subject: [EXTERNAL] Re: [PATCH] clk: vc5: Enable VC5_HAS_PFD_FREQ_DBL >> on 5p49v6965 >> >> This email originated outside of MKS. Use caution when sharing information >> or opening attachments and links. >> >> ---------------------------------------------------------------------------------------------- >> ---------------------------------------------- >> Hi Adam, Claude, >> >> thanks for your patch. >> >> On 13/03/22 12:57, Adam Ford wrote: >>> The 5p49v6965 has a reference clock frequency doubler. >>> Enabling it adds versaclock_som.dbl to the clock tree, but the output >>> frequency remains correct. >>> >>> Suggested-by: Claude Fillion >>> Signed-off-by: Adam Ford >>> >>> diff --git a/drivers/clk/clk-versaclock5.c >>> b/drivers/clk/clk-versaclock5.c index e7be3e54b9be..4d190579e874 >>> 100644 >>> --- a/drivers/clk/clk-versaclock5.c >>> +++ b/drivers/clk/clk-versaclock5.c >>> @@ -1211,7 +1211,7 @@ static const struct vc5_chip_info >> idt_5p49v6965_info = { >>> .model = IDT_VC6_5P49V6965, >>> .clk_fod_cnt = 4, >>> .clk_out_cnt = 5, >>> - .flags = VC5_HAS_BYPASS_SYNC_BIT, >>> + .flags = VC5_HAS_BYPASS_SYNC_BIT | VC5_HAS_PFD_FREQ_DBL, >> >> >> If my understanding is correct, the doubler is not mentioned by the >> datasheet, but it exists. Maybe it's worth a line of comment to help future >> readers not waste their time in finding out: >> /* Frequency doubler not mentioned on datasheet */ >> > > I see the doubler bit mentioned in Table 25 of both v6 and v6e specs. It is named differently, but appears to have the same purpose. Well, literally speaking what I wrote is correct: the _datasheet_ does not mention the doubler. Table 25 you mention is on the "Register Description and Programming Guide". Practically speaking I would expect the datasheet to mention the hardware blocks including the doubler, but apparently Renesas has a different opinion and perhaps they are not alone. So I think you can forget about my proposal to add a comment. >> Can you confirm that: >> - the en_ref_doubler bit value defaults to zero when reading it, as the >> register guide says? >> - if set to 1 the frequencies double? >> >> With that confirmed, the patch looks good. >> >> Thanks, >> -- >> Luca > > I played around a bit with the programming board today and did not see what I expected to see. > > Using i2cget I see that the register in question (0x10) has a default value of 0xA0 for both 6901 and 6965. Thus it seems disabled by default for both parts. Coherently with the Register guide. OK. > Starting at my base frequency of 46.8MHz, setting the bit to 1 (i2cset) changes the output frequency to 59.04MHz for the 6901 part, and to 47.7MHz for the 6965 part. So setting the 'doubler' bit changes output frequency for both parts, but not the same amount. > > Not sure of the meaning, just want to pass the information along. Me neither. I have no clever idea, only this one that I consider unlikely: by enabling the doubler you may have increased some internal frequency above its allowed range and thus the chip is not working properly anymore. Can you use a lower base frequency or check the PLL settings to ensure you are not exceeding some range? What output frequency are you measuring? OUT0 or another one? What frequency do you measure with en_ref_doubler = 0? -- Luca