Hello Rick, > -----Original Message----- > From: Rick Chen <rickche...@gmail.com> > Sent: Monday, June 22, 2020 7:24 AM > To: Sagar Kadam <sagar.ka...@sifive.com> > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Lukasz Majewski > <lu...@denx.de>; Bin Meng <bmeng...@gmail.com>; Jagan Teki > <ja...@amarulasolutions.com>; Pragnesh Patel > <pragnesh.pa...@sifive.com>; Anup Patel <anup.pa...@wdc.com>; Simon > Glass <s...@chromium.org>; Sean Anderson <sean...@gmail.com>; rick > <r...@andestech.com>; Alan Kao <alan...@andestech.com>; > ycli...@andestech.com > Subject: Re: [PATCH v4 1/4] fu540: prci: add request and free clock handlers > > [External Email] Do not click links or attachments unless you recognize the > sender and know the content is safe > > Hi Sagar, > > > From: Sagar Shrikant Kadam [mailto:sagar.ka...@sifive.com] > > Sent: Sunday, June 21, 2020 9:10 PM > > To: u-boot@lists.denx.de > > Cc: Rick Jian-Zhi Chen(陳建志); lu...@denx.de; bmeng...@gmail.com; > > ja...@amarulasolutions.com; pragnesh.pa...@sifive.com; > > anup.pa...@wdc.com; s...@chromium.org; sean...@gmail.com; Sagar > > Shrikant Kadam > > Subject: [PATCH v4 1/4] fu540: prci: add request and free clock > > handlers > > > > Add clk_request handler to check if a valid clock is requested. > > Here clk_free handler is added for debug purpose which will display > details of clock passed to clk_free. > > > > Signed-off-by: Sagar Shrikant Kadam <sagar.ka...@sifive.com> > > Reviewed-by: Pragnesh Patel <pragnesh.pa...@sifive.com> > > --- > > This v4 series still have some conflicts with master. > Please check about it. > > Applying: fu540: prci: add request and free clock handlers > Applying: riscv: dts: hifive-unleashed-a00: add cpu aliases > Applying: riscv: cpu: fixes to display proper CPU features > error: patch failed: drivers/cpu/riscv_cpu.c:38 > error: drivers/cpu/riscv_cpu.c: patch does not apply Patch failed at 0003 > riscv: cpu: fixes to display proper CPU features >
Thanks for trying this out This series is dependent on following two patches [1] and [2] below which are part of "Add Sipeed Maix support." series [1] https://patchwork.ozlabs.org/patch/1295345 [2] https://patchwork.ozlabs.org/patch/1295346 and I also mentioned in cover-letter. Sorry If I missed to add some additional information there. The dependent are added like -u-boot master [commit 2b8692bac1e8]. -Patches [1] + [2]. -This series. I guess the PR for the series was sent earlier followed with some discussion https://www.mail-archive.com/u-boot@lists.denx.de/msg370739.html and I think this series was deferred in that PR. Please let me know if you have some suggestions here? Thanks & BR, Sagar Kadam > Thanks, > Rick > > > drivers/clk/sifive/fu540-prci.c | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/drivers/clk/sifive/fu540-prci.c > > b/drivers/clk/sifive/fu540-prci.c index fe6e0d4..9a9ff6b 100644 > > --- a/drivers/clk/sifive/fu540-prci.c > > +++ b/drivers/clk/sifive/fu540-prci.c > > @@ -686,6 +686,25 @@ static ulong sifive_fu540_prci_set_rate(struct clk > *clk, ulong rate) > > return rate; > > } > > > > +static int sifive_fu540_prci_clk_request(struct clk *clk) { > > + debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev, > > + clk->id); > > + > > + if (clk->id >= ARRAY_SIZE(__prci_init_clocks)) > > + return -EINVAL; > > + > > + return 0; > > +} > > + > > +static int sifive_fu540_prci_clk_free(struct clk *clk) { > > + debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev, > > + clk->id); > > + > > + return 0; > > +} > > + > > static int sifive_fu540_prci_enable(struct clk *clk) { > > struct __prci_clock *pc; > > @@ -755,6 +774,8 @@ static struct clk_ops sifive_fu540_prci_ops = { > > .get_rate = sifive_fu540_prci_get_rate, > > .enable = sifive_fu540_prci_enable, > > .disable = sifive_fu540_prci_disable, > > + .request = sifive_fu540_prci_clk_request, > > + .rfree = sifive_fu540_prci_clk_free, > > }; > > > > static const struct udevice_id sifive_fu540_prci_ids[] = { > > -- > > 2.7.4 > >