OSDN Git Service

hw/core/clock: introduce clock object
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 17 Apr 2020 15:54:28 +0000 (16:54 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Apr 2020 10:52:28 +0000 (11:52 +0100)
commit4cba075efedde66f0a8658001da7fc09a09024e1
tree2ab5240b37dbddf56b0ef0aa18308d8b88d941ad
parent70d7857f935ab3fd6a5c0ff8b7586d0aef20f8b0
hw/core/clock: introduce clock object

This object may be used to represent a clock inside a clock tree.

A clock may be connected to another clock so that it receives update,
through a callback, whenever the source/parent clock is updated.

Although only the root clock of a clock tree controls the values
(represented as periods) of all clocks in tree, each clock holds
a local state containing the current value so that it can be fetched
independently. It will allows us to fullfill migration requirements
by migrating each clock independently of others.

This is based on the original work of Frederic Konrad.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20200406135251.157596-2-damien.hedde@greensocs.com
[PMM: Use uint64_t rather than unsigned long long in trace events;
 the dtrace backend can't handle the latter]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/core/Makefile.objs
hw/core/clock.c [new file with mode: 0644]
hw/core/trace-events
include/hw/clock.h [new file with mode: 0644]