All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: Sean Anderson <sean.anderson@seco.com>
Cc: "Fillion, Claude" <Claude.Fillion@mksinst.com>,
	linux-clk <linux-clk@vger.kernel.org>,
	Luca Ceresoli <luca@lucaceresoli.net>
Subject: Re: Questions regarding regarding idt/renesas versaclock5 driver
Date: Mon, 28 Feb 2022 11:06:58 -0600	[thread overview]
Message-ID: <CAHCN7xKVMCC_Sgqp_Dgpwyi4X4rq4qKi2MheA_CK1vcrm3JjyA@mail.gmail.com> (raw)
In-Reply-To: <9e4e542f-6f73-164e-581e-17369aada2f3@seco.com>

On Mon, Feb 28, 2022 at 10:04 AM Sean Anderson <sean.anderson@seco.com> wrote:
>
>
>
> On 2/28/22 7:35 AM, Fillion, Claude wrote:
> >
> > You don't often get email from claude.fillion@mksinst.com. Learn why this is important <http://aka.ms/LearnAboutSenderIdentification>
> >
> >
> > Hello  Sean,
> >
> >

+ Luca Ceresoli

> >
> > I have a design that is looking to use the Renesas 5P49V6965 or 5P49V690 clock chip and am looking to use the versaclock 5 driver (https://github.com/Xilinx/linux-xlnx/blob/master/drivers/clk/clk-versaclock5.c).
> >
> >
> >
> > I am new to writing drivers and have two questions I am hoping you can help me with:
> >
> > 1) In the driver I see the following code:
> >
> > static const struct vc5_chip_info idt_5p49v6901_info = {
> >
> >             .model = IDT_VC6_5P49V6901,
> >
> >             .clk_fod_cnt = 4,
> >
> >             .clk_out_cnt = 5,
> >
> >             .flags = VC5_HAS_PFD_FREQ_DBL,
> >
> > };
> >
> >
> >
> > 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,
> >
> > };
> >
> >
> >
> > However, the 6965 part also has the same frequency doubling bit as the 6901.  Would it be better to set the flags for the 6965 to something like this?
> >
> >
> >
> > static const struct vc5_chip_info idt_5p49v6965_info = {
> >
> >             .model = IDT_VC6_5P49V6965,
> >
> >             .clk_fod_cnt = 4,
> >
> >             .clk_out_cnt = 5,
> >
> >             .flags = VC5_HAS_PFD_FREQ_DBL | VC5_HAS_BYPASS_SYNC_BIT,
> >
> > };
>
> I think Adam will have a better idea about this.
>
> > 2) I am unclear how to set the output frequencies for the device. For my application I would like to set output clock 1 to 250MHz and output clock 2 to 46.8MHz but I am unclear how to do so.  I have looked at the documentation at https://mjmwired.net/kernel/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml but remain unclear how to set the output frequencies.  Any insight you could provide would be greatly appreciated.
>
> Use assigned-clock-frequencies as described in
> Documentation/devicetree/bindings/clock/clock-bindings.txt
>

I agree that the clock-bindings have the instructions on how to set
them.  If you check
arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi, there are some
examples of how to set the frequency.
In my instance,  the chip wasn't enabling the output by default, so I
needed to submit some patches upstream to make sure the device that
was being clocked by this device had get and enable functions to make
sure the clock chip would turn on the clock when requested.

>
> > I saw your name mentioned so I am emailing  you directly.  If there is a better place to ask these questions can you please direct me there?  Thanks you so much.
>
> Adam (CC'd) wrote the original driver, so he's probably a
> better person to start with. You should also CC the linux-clk
> mailing list for questions about clock drivers.

I've reviewed the datasheet for the 6965, and it doesn't explicitly
show the multiplier, but the programmer's guide does appear to show
the existence of bit that when set, it will "double the reference
frequency for the Phase frequency detector" but on the programmer's
guide for the 6901, the same bit reads "Enables frequency doubler when
set to 1" so it's not clear to me that these functions are exactly the
same, but implies that it might be.  I'll need some time to test this,
but if I find it works, I can push a patch to this driver.  I added
Luca, as he is the maintainer for this driver as well.

adam
>
> --Sean

  reply	other threads:[~2022-02-28 17:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <MN2PR03MB5008EB5F50B680C2A2E271D893019@MN2PR03MB5008.namprd03.prod.outlook.com>
2022-02-28 16:03 ` Questions regarding regarding idt/renesas versaclock5 driver Sean Anderson
2022-02-28 17:06   ` Adam Ford [this message]
2022-02-28 22:13     ` Luca Ceresoli
     [not found]       ` <MN2PR03MB5008747FDF505CA30970ADE293029@MN2PR03MB5008.namprd03.prod.outlook.com>
2022-03-01 14:29         ` [EXTERNAL] " Adam Ford
2022-03-01 18:16           ` Fillion, Claude
2022-03-01 18:28             ` Adam Ford
2022-03-02 14:43               ` Fillion, Claude
2022-03-02 15:45                 ` Adam Ford
2022-03-02 17:26                   ` Luca Ceresoli
2022-03-02 20:49                     ` Fillion, Claude
2022-03-03 14:41                       ` Luca Ceresoli
2022-03-03 18:15                         ` Fillion, Claude
2022-03-03 22:33                           ` Luca Ceresoli
2022-03-04 20:07                             ` Fillion, Claude
2022-03-04 20:30                               ` Luca Ceresoli
2022-03-07 20:39                                 ` Fillion, Claude
2022-03-07 20:41                                   ` Fillion, Claude
2022-03-09 17:20                                   ` Luca Ceresoli
2022-03-09 18:02                                     ` Fillion, Claude
2022-03-09 18:44                                       ` Adam Ford
2022-03-04 20:53                           ` Sean Anderson
2022-03-07 20:39                             ` Fillion, Claude
2022-03-21 21:21                   ` Fillion, Claude
2022-03-22 15:59                     ` Luca Ceresoli
2022-03-22 20:09                       ` Fillion, Claude
2022-04-14 22:37                         ` Luca Ceresoli
2022-04-15 14:26                           ` Fillion, Claude

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHCN7xKVMCC_Sgqp_Dgpwyi4X4rq4qKi2MheA_CK1vcrm3JjyA@mail.gmail.com \
    --to=aford173@gmail.com \
    --cc=Claude.Fillion@mksinst.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=luca@lucaceresoli.net \
    --cc=sean.anderson@seco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.