17.07.2012 01:05, Peter Maydell пишет:
On 4 July 2012 17:27, Maksim Kozlov<m.koz...@samsung.com>  wrote:
Add exynos4210 Clock Management Units emulation

General comment, which I suspect you're not going to like...

Underlying the exynos-specific code here, there's a general
mechanism of "I'm a device, I have a clock input, I want to be
able to find out when that clock is reprogrammed so I can
adjust my behaviour, and I want to do things like ask what
its rate is", and there's a provider of clock signals which
has some kind of clock tree, possibly rearrangable at runtime
by reprogramming the clock management unit. This is basically
the same thing the OMAP clock code in hw/omap_clk.c also provides
(though again the commonality is obscured under a heap of OMAP
specific stuff).

I think we need a generic interface for providing clocks
and plumbing them together, which can then be used by both
OMAP and Exynos and whatever later platforms come along
with clock trees. I'd also really like to see this use QOM
links rather than being a set of ad-hoc C functions for
register/get rate/etc.

You're platform number two, which I'm afraid means you get
the pain of writing a generic mechanism...

(There is a conceptual parallel with the kernel efforts to
move to a common struct_clk infrastructure, I think; I'd
much rather we did this while we have two clock tree models
rather than waiting until we have half a dozen.)

I've added some specific code review comments below, but
this is the biggie.

Ok, I will think what I can do in this direction.
Thanks



Reply via email to