From: Damien Hedde <damien.hedde@greensocs.com>
To: qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: qemu-arm@nongnu.org, pbonzini@redhat.com, alistair@alistair23.me,
saipava@xilinx.com, mark.burton@greensocs.com,
luc.michel@greensocs.com, konrad@adacore.com,
edgar.iglesias@xilinx.com
Subject: Re: [Qemu-devel] [PATCH v5 0/9] Clock framework API.
Date: Fri, 12 Oct 2018 17:26:18 +0200 [thread overview]
Message-ID: <09e1483c-298e-d41a-f9c9-4f186f530dcb@greensocs.com> (raw)
In-Reply-To: <20181002142443.30976-1-damien.hedde@greensocs.com>
Hi Peter,
Sorry to bother you with this, but you said some time ago you would
write something about reset.
On 10/2/18 4:24 PM, Damien Hedde wrote:
> There is also the problem of initialization which is very much like the
> migration. Currently, in the zynq example, clocks outputs are initialized in
> the clock controller device_reset. According to Peter, outputs should not be
> set in device_reset, so we need a better way.
To illustrate the problem, lets take an example with the zynq case in
the patchset. We have a 2-stage clock tree:
+--------+ +----------------+ +------+
| Machine|>>base_clk>>|Clock controller|>>uart_clock>>| UART |
+--------+ +----------------+ +------+
At the end of the tree, the uart uses the clock to setup the backend
baudrate. The problem is that we need the whole clock path initialized
before having the right final frequency.
I've had some thought about it and I see several solutions
1. Set clock outputs in device_reset. But It can trigger side effects in
yet-non-reseted devices.
2. Have some kind of global 2nd stage reset to do all the output
propagation.
3. Try to propagate init values at platform building when doing the
clock connection.
4. (1) and (2) mixed. Have a per device 2nd stage reset "clock_reset"
(or any better name) method called when device_reset has been called and
all clock inputs have been initialized (by other device "clock_reset").
At the end of reset phase everything should have been propagated.
(1) being not-an-option and also (2) I think.
(3) seems complicated at best due to the unknown clock connection order.
And I'm not sure clock connection is the right moment to do this. In the
general case, a clock init value can depend on on some user-set/config
properties which will be applied later on I suppose (But I don't have a
clue at which point this operation -- the "realize" thing -- cab be done
in the platform startup sequence)
Do you think (4) is sensible ? It means any device requiring clock input
value will need to implement this new method. Basically this
"clock_reset" is just a part of the actual device_reset being delayed.
Obviously if there is a clock loop, the method will never be called.
--
Damien
next prev parent reply other threads:[~2018-10-12 15:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 14:24 [Qemu-devel] [PATCH v5 0/9] Clock framework API Damien Hedde
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 1/9] hw/core/clock-port: introduce clock port objects Damien Hedde
2018-10-02 23:53 ` Philippe Mathieu-Daudé
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 2/9] qdev: add clock input&output support to devices Damien Hedde
2018-10-02 23:36 ` Philippe Mathieu-Daudé
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree Damien Hedde
2018-10-02 22:42 ` Philippe Mathieu-Daudé
2018-10-12 10:20 ` Damien Hedde
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 4/9] qdev-clock: introduce an init array to ease the device construction Damien Hedde
2018-10-03 8:23 ` Philippe Mathieu-Daudé
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 5/9] docs/clocks: add device's clock documentation Damien Hedde
2018-10-02 23:48 ` Philippe Mathieu-Daudé
2018-10-03 8:18 ` Philippe Mathieu-Daudé
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 6/9] hw/misc/zynq_slcr: use standard register definition Damien Hedde
2018-10-04 17:24 ` Alistair Francis
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 7/9] hw/misc/zynq_slcr: add clock generation for uarts Damien Hedde
2018-10-02 23:10 ` Philippe Mathieu-Daudé
2018-10-12 13:24 ` Damien Hedde
2018-10-12 13:27 ` Peter Maydell
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 8/9] hw/char/cadence_uart: add clock support Damien Hedde
2018-10-02 23:26 ` Philippe Mathieu-Daudé
2018-10-12 13:42 ` Damien Hedde
2018-10-02 14:24 ` [Qemu-devel] [PATCH v5 9/9] hw/arm/xilinx_zynq: connect uart clocks to slcr Damien Hedde
2018-10-02 23:28 ` Philippe Mathieu-Daudé
2018-10-04 16:13 ` [Qemu-devel] [PATCH v5 0/9] Clock framework API Philippe Mathieu-Daudé
2018-10-11 16:20 ` Damien Hedde
2018-10-11 16:23 ` Peter Maydell
2018-10-11 17:00 ` Philippe Mathieu-Daudé
2018-10-11 17:12 ` Peter Maydell
2018-10-11 17:16 ` Philippe Mathieu-Daudé
2018-10-12 15:26 ` Damien Hedde [this message]
2018-10-16 15:48 ` Peter Maydell
2018-12-18 15:24 ` Damien Hedde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=09e1483c-298e-d41a-f9c9-4f186f530dcb@greensocs.com \
--to=damien.hedde@greensocs.com \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@xilinx.com \
--cc=konrad@adacore.com \
--cc=luc.michel@greensocs.com \
--cc=mark.burton@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=saipava@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).