From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Damien Hedde" <damien.hedde@greensocs.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Luc Michel" <luc@lmichel.fr>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>
Subject: [RFC PATCH-for-6.1 6/9] hw/misc/bcm2835_cprman: Use qdev_ground_clock() helper
Date: Fri, 9 Apr 2021 08:23:58 +0200 [thread overview]
Message-ID: <20210409062401.2350436-7-f4bug@amsat.org> (raw)
In-Reply-To: <20210409062401.2350436-1-f4bug@amsat.org>
The ground clock isn't really an internal component of the CPRMAN
peripheral. Use the qdev_ground_clock() helper to access the board
ground plane.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/misc/bcm2835_cprman.h | 1 -
hw/misc/bcm2835_cprman.c | 7 ++-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/include/hw/misc/bcm2835_cprman.h b/include/hw/misc/bcm2835_cprman.h
index 3df4ceedd2e..2996ccb4632 100644
--- a/include/hw/misc/bcm2835_cprman.h
+++ b/include/hw/misc/bcm2835_cprman.h
@@ -204,7 +204,6 @@ struct BCM2835CprmanState {
uint32_t xosc_freq;
Clock *xosc;
- Clock *gnd;
};
#endif
diff --git a/hw/misc/bcm2835_cprman.c b/hw/misc/bcm2835_cprman.c
index 75e6c574d46..5039b7632b4 100644
--- a/hw/misc/bcm2835_cprman.c
+++ b/hw/misc/bcm2835_cprman.c
@@ -678,9 +678,6 @@ static void cprman_init(Object *obj)
}
s->xosc = clock_new(obj, "xosc");
- s->gnd = clock_new(obj, "gnd");
-
- clock_set(s->gnd, 0);
memory_region_init_io(&s->iomem, obj, &cprman_ops,
s, "bcm2835-cprman", 0x2000);
@@ -697,7 +694,7 @@ static void connect_mux_sources(BCM2835CprmanState *s,
/* For sources from 0 to 3. Source 4 to 9 are mux specific */
Clock * const CLK_SRC_MAPPING[] = {
- [CPRMAN_CLOCK_SRC_GND] = s->gnd,
+ [CPRMAN_CLOCK_SRC_GND] = qdev_ground_clock(),
[CPRMAN_CLOCK_SRC_XOSC] = s->xosc,
[CPRMAN_CLOCK_SRC_TD0] = td0,
[CPRMAN_CLOCK_SRC_TD1] = td1,
@@ -708,7 +705,7 @@ static void connect_mux_sources(BCM2835CprmanState *s,
Clock *src;
if (mapping == CPRMAN_CLOCK_SRC_FORCE_GROUND) {
- src = s->gnd;
+ src = qdev_ground_clock();
} else if (mapping == CPRMAN_CLOCK_SRC_DSI0HSCK) {
src = s->dsi0hsck_mux.out;
} else if (i < CPRMAN_CLOCK_SRC_PLLA) {
--
2.26.3
next prev parent reply other threads:[~2021-04-09 6:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 6:23 [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation Philippe Mathieu-Daudé
2021-04-09 6:23 ` [RFC PATCH-for-6.1 1/9] hw/core/clock: Increase clock propagation trace events verbosity Philippe Mathieu-Daudé
2021-04-09 6:23 ` [RFC PATCH-for-6.1 2/9] hw/core/machine: Add machine_create_constant_clock() helper Philippe Mathieu-Daudé
2021-04-09 6:23 ` [RFC PATCH-for-6.1 3/9] hw/arm: Use new " Philippe Mathieu-Daudé
2021-04-09 6:23 ` [RFC PATCH-for-6.1 4/9] hw/mips: " Philippe Mathieu-Daudé
2021-04-09 6:23 ` [RFC PATCH-for-6.1 5/9] hw/core/qdev-clock: Add qdev_ground_clock() helper Philippe Mathieu-Daudé
2021-04-19 14:22 ` Peter Maydell
2021-04-09 6:23 ` Philippe Mathieu-Daudé [this message]
2021-04-09 6:23 ` [RFC PATCH-for-6.1 7/9] hw/misc/bcm2835_cprman: Feed 'xosc' from the board Philippe Mathieu-Daudé
2021-04-19 14:24 ` Peter Maydell
2021-04-09 6:24 ` [RFC PATCH-for-6.1 8/9] hw/clock: Declare clock_new() internally Philippe Mathieu-Daudé
2021-04-19 14:26 ` Peter Maydell
2021-04-20 9:27 ` Philippe Mathieu-Daudé
2021-04-09 6:24 ` [RFC PATCH-for-6.1 9/9] hw/core/machine: Reset machine clocks using qemu_register_reset() Philippe Mathieu-Daudé
2021-04-19 14:27 ` Peter Maydell
2021-04-09 13:12 ` [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation Philippe Mathieu-Daudé
2021-04-09 14:11 ` Philippe Mathieu-Daudé
2021-04-09 14:20 ` Philippe Mathieu-Daudé
2021-04-10 13:19 ` Luc Michel
2021-04-10 13:53 ` Philippe Mathieu-Daudé
2021-04-10 15:15 ` Peter Maydell
2021-04-10 16:14 ` Philippe Mathieu-Daudé
2021-04-12 10:11 ` Peter Maydell
2021-04-12 10:31 ` Philippe Mathieu-Daudé
2021-04-12 10:44 ` Peter Maydell
2021-04-12 11:00 ` Philippe Mathieu-Daudé
2021-04-13 19:43 ` Eduardo Habkost
2021-05-03 15:20 ` Igor Mammedov
2021-05-03 16:37 ` Philippe Mathieu-Daudé
2021-04-19 19:39 ` Luc Michel
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=20210409062401.2350436-7-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=Andrew.Baumann@microsoft.com \
--cc=damien.hedde@greensocs.com \
--cc=ehabkost@redhat.com \
--cc=luc@lmichel.fr \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).