qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 00/10] Clock framework API.


From: KONRAD Frederic
Subject: Re: [Qemu-devel] [PATCH v3 00/10] Clock framework API.
Date: Tue, 27 Jun 2017 09:04:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0



Le 06/23/2017 à 03:58 PM, Peter Maydell a écrit :
On 23 June 2017 at 14:07, KONRAD Frederic <address@hidden> wrote:
Le 06/23/2017 à 02:47 PM, Peter Maydell a écrit :
Each device "owns" its output clock objects, but input
clocks are just pointers to the clock object owned by the
device at the other end. In the board you wire up CI1 to C1,
and CI2 to C2 (using link properties I guess).
Then in device C you can implement the clock switching by
some kind of bind(s->CI1, &s->C3) call because you have
pointers to all the relevant clock objects.

As I understand it your current implementation makes not
just the output clocks C1 C2 C2 be clock objects, but also
the inputs CI1 CI2, so effectively each link from a clock
source to a clock sink has two objects involved.

Yes that makes sense but you won't have the name.

I don't think that's a big deal.

And one other thing I wanted to have is beeing able to refresh
the clock tree without refreshing everything. If you start a
refresh from the "pointer" and it is bind to other things you
will refresh the other devices as well. Maybe we don't care or we
can workaround that but..

The pointer is for your clock inputs -- when would you
want to start a refresh from that? I would expect
refreshes to only ever go downstream -- you update
the config of your clock outputs and things downstream
of them will update in turn.

I started with the goal in mind that the binding + the callback
can refresh themself without user intervention.

So actually the user only have to change the binding in case of a
clock selector.. Everything else is done by the framework.

For example if we want to change a multiplier through a register:

void register_write(..)
{
  /* Refresh related clock input. */
}

void clock_cb(..)
{
  return register_value * rate_in;
}

If we drop the clock first possibility:

void register_write(..)
{
  /* refresh all depending clock with
   * rate_in * register value.
   * Either this can be tricky as we need to know exactly which
   * clock need to be refreshed or we need to refresh everybody.
   * On the device example in the patch-set this can become a
   * mess.
   */
}

void clock_cb(..)
{
  return register_value * rate_in;
}

Second possibility:

void register_write(..)
{
  /* refresh the clock which is referenced as input.
   * This is easy BUT it will refresh all other devices bound to
   * this clock.
   */
}

void clock_cb(..)
{
  return register_value * rate_in;
}

Thanks,
Fred


thanks
-- PMM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]