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. 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. 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 |