[PATCH 35/74] ST SPEAr: Enabling clocks before amba device registeration

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Sep 2 06:02:47 EDT 2010


On Mon, Aug 30, 2010 at 04:08:59PM +0530, Viresh KUMAR wrote:

No description, so I'm going to have to guess about this.

> +static inline void
> +spear_amba_device_register(struct amba_device **devices, u32 count)
> +{
> +	u32 i;
> +
> +	for (i = 0; i < count; i++) {
> +		struct clk *clk = clk_get_sys(devices[i]->dev.init_name, NULL);
> +		if (IS_ERR(clk))
> +			continue;
> +
> +		clk_enable(clk);
> +		amba_device_register(devices[i], &iomem_resource);
> +		clk_disable(clk);

My guess is that you're doing this to work around the fact that your
SoC enables/disables both the bus clock and the functional clock to
each primecell, and so you're finding that you need to enable the
clock to access the device registers.

We've fixed this in the generic code by introducing an 'apb_pclk' clock
which the core bus code controls (and eventually drivers.)  See discussion
earlier this month/last month on this list about this.

That makes this patch redundant.



More information about the linux-arm-kernel mailing list