[RFC,PATCH 1/7] arm: add a common struct clk
Russell King - ARM Linux
linux at arm.linux.org.uk
Fri Jan 8 07:59:34 EST 2010
On Fri, Jan 08, 2010 at 10:45:03PM +1100, Benjamin Herrenschmidt wrote:
> I don't think Jeremy (again he will have to confirm) is aiming toward a
> common implementation of the entire clock subsystem. The idea is that
> the struct clk is a clock object. You can have many struct clk, they can
> have many different capabilities and features.
Taking the two machine types that are most likely to want to use this:
On PXA, there are 67 struct clk's, each of which has a single pointer
to an operations structure. Each operations structure is three pointers
and there are 11 such structures. That's 67 * 4 + 11 * 12 = 400 bytes.
PXA is simple enough that these operations structures can be swallowed
up into this struct clk. So, switching PXA to this will mean 67 * 32 =
2144 bytes. That's an increase in overhead of 5x.
On OMAP, there are 16 clkops structures of 16 bytes each, and each
struct clk has a pointer to this structure. Due to the way OMAP works,
these can't be directly called from the proposed generic version
because of the additional clock domain/power domain code, so we can
There are two function pointers in the struct clk which would be
identical to the versions proposed in this generic struct clk.
There's a total of 219 clk structures in OMAP3. So, 219 * (4 + 8)
= 2628. Switching OMAP means 219 * (4 + 32) = 7884, which is an
increase in overhead of 3x.
This is the problem - you can have "generic" versions of stuff provided
you're willing to put up with the additional overhead that comes with
More information about the linux-arm-kernel