[U-Boot] [PATCH v2 1/9] sunxi: initial sun7i clocks and timer support.

Ian Campbell ijc at hellion.org.uk
Sun Apr 13 21:55:57 CEST 2014


On Mon, 2014-03-24 at 23:42 +0100, Olliver Schinagl wrote:
> On 03/24/2014 09:52 PM, Marek Vasut wrote:
> >> +	/* Switch to 24MHz clock while changing PLL1 */
> >> +	writel(AXI_DIV_1 << AXI_DIV_SHIFT |
> >> +	       AHB_DIV_2 << AHB_DIV_SHIFT |
> >> +	       APB0_DIV_1 << APB0_DIV_SHIFT |
> >> +	       CPU_CLK_SRC_OSC24M << CPU_CLK_SRC_SHIFT,
> >> +	       &ccm->cpu_ahb_apb0_cfg);
> >> +	sdelay(20);
> > What is sdelay() function all about ?
> It also is from
> arch/arm/include/asm/arch-sunxi/sys_proto.h
> and I thought all where replaced with udelays

Since these sdelays() are used while we are frobbing around with the
clocks I'm not sure that switching to udelay is possible/wise. sdelay is
documented as:
 * sdelay() - simple spin loop.  Will be constant time as
 *  its generally used in bypass conditions only.  This
 *  is necessary until timers are accessible.

IOW it sounds like it is designed to be used in exactly these
circumstances.

Given the lack of documentation for what is actually required by the
hardware when changing these clocks I'm a bit reluctant to go changing
things.

Ian.



More information about the U-Boot mailing list