mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jules Maselbas <jmaselbas@zdiv.net>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/6] clk: Add clock driver for sun50i-a64
Date: Wed, 13 Nov 2024 09:42:29 +0100	[thread overview]
Message-ID: <ZzRmdRndcIhe9D88@pengutronix.de> (raw)
In-Reply-To: <D5KBOYOWSVP6.N4RAVEQKZM4U@zdiv.net>

On Tue, Nov 12, 2024 at 04:58:49PM +0100, Jules Maselbas wrote:
> resent, as i forgot barebox ml in CC
> 
> On Fri Nov 8, 2024 at 1:59 PM CET, Sascha Hauer wrote:
> > On Fri, Nov 08, 2024 at 12:08:45PM +0100, Jules Maselbas wrote:
> > > Hi Sascha,
> > >
> > > On Fri Nov 8, 2024 at 11:39 AM CET, Sascha Hauer wrote:
> > > > Hi Jules,
> > > >
> > > > On Thu, Nov 07, 2024 at 03:57:19PM +0100, Jules Maselbas wrote:
> > > > > Clock driver adapted from Linux.
> > > > > The pll-cpux is set to 816MHz and pll-periph0-2x is set to 1.2GHz.
> > > >
> > > > From which driver did you adapt this from? I tried copying
> > > > drivers/clk/sunxi-ng/ccu-sun50i-a64.c from Linux over your driver and it
> > > > looks quite different.
> > > Yes this is adapted from drivers/clk/sunxi-ng/ccu-sun50i-a64.c, but it is very
> > > different. This is a very stripped down version. I wanted to avoid having to
> > > porting all the clock/gate/div code for sunxi and use as much as possible the
> > > one available in barebox.
> > >
> > > > Would it be possible to get closer to the Linux driver? This would pay
> > > > off once we want to do an update from Linux.
> > > Humm...
> > > I could try to get it closer, i would like to not having to copy all the ccu*
> > > drivers, but maybe i could define barebox version of SUNXI_CCU_* macros
> >
> > In my experience Linux clk drivers fit quite nicely into barebox when
> > just blindly throwing the code into it. I haven't got any experience
> > with the allwinner clk code though, so your mileage may vary.
> 
> Allwinner clk driver doesn't uses any common clk such as generic div/mux/gate,
> but redefines a lot of different small clk driver.
> 
> I tried to port the Allwinner clk into barebox, but it requires some changes:
>  - get_parent function signatures doesn't match barebox's callback signatures
>  - include <linux/delay.h> is missing and should include clock.h
>  - clk drivers uses `struct notifier_block` which isn't supported
>  - clk drivers uses get_rate_range which isn't supported either

Yes, there are some more, like we don't support determine_rate and
likely other things as well.

> 
> > Putting the (mostly) unmodified versions into barebox has the advantage
> > that updating from Linux is easy and adding new SoC support is easy as
> > well.
> >
> > That said, it's fine to have heavily modified ckl driver versions in
> > barebox and we can try that if you like. We can always revisit this
> > decision should we have to.
> 
> I think that right now i don't have the energy to look further into porting
> the Linux sunxi clock code to barebox.
> I am fine with keeping this modified clk driver.
> However, i would like for the V2 to put some functions into a common file
> so they can be shared with other sunxi SoC.

Ok, let's go for it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2024-11-13  8:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 14:57 [PATCH 0/6] Initial support for Allwinner A64 SoC Jules Maselbas
2024-11-07 14:57 ` [PATCH 1/6] clk: clk-composite: fix callback guard in clk_composite_round_rate Jules Maselbas
2024-11-07 15:05   ` Ahmad Fatoum
2024-11-08 10:21   ` (subset) " Sascha Hauer
2024-11-07 14:57 ` [PATCH 2/6] clk: divider: add error code propagation Jules Maselbas
2024-11-13  8:47   ` Ahmad Fatoum
2024-11-07 14:57 ` [PATCH 3/6] clk: Add clock driver for sun50i-a64 Jules Maselbas
2024-11-08 10:39   ` Sascha Hauer
2024-11-08 11:08     ` Jules Maselbas
2024-11-08 12:59       ` Sascha Hauer
2024-11-12 15:58         ` Jules Maselbas
2024-11-13  8:42           ` Sascha Hauer [this message]
2024-11-07 14:57 ` [PATCH 4/6] pinctrl: Add sun50i-a64 pinctrl driver Jules Maselbas
2024-11-08 10:48   ` Sascha Hauer
2024-11-07 14:57 ` [PATCH 5/6] mci: Add sunxi-mmc driver Jules Maselbas
2024-11-07 14:57 ` [PATCH 6/6] ARM: sunxi: Introduce mach-sunxi Jules Maselbas

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=ZzRmdRndcIhe9D88@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jmaselbas@zdiv.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox