From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org, Niek Linnenbank <nieklinnenbank@gmail.com>
Cc: "Beniamino Galvani" <b.galvani@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [RFC PATCH 10/13] hw/timer/allwinner: Rename AwA10PITState as AllwinnerTmrCtrlState
Date: Thu, 19 Dec 2019 19:51:24 +0100 [thread overview]
Message-ID: <20191219185127.24388-11-f4bug@amsat.org> (raw)
In-Reply-To: <20191219185127.24388-1-f4bug@amsat.org>
This structure will be common to various Allwinner timer
controllers, rename it.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/arm/allwinner-a10.h | 2 +-
include/hw/timer/allwinner-a10-pit.h | 6 ++--
hw/timer/allwinner-a10-pit.c | 42 ++++++++++++++--------------
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h
index 7d2d215630..28c043db39 100644
--- a/include/hw/arm/allwinner-a10.h
+++ b/include/hw/arm/allwinner-a10.h
@@ -30,7 +30,7 @@ typedef struct AwA10State {
ARMCPU cpu;
qemu_irq irq[AW_A10_PIC_INT_NR];
- AwA10PITState timer;
+ AllwinnerTmrCtrlState timer;
AwA10PICState intc;
AwEmacState emac;
AllwinnerAHCIState sata;
diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwinner-a10-pit.h
index 3a47633cc4..9e28c6697a 100644
--- a/include/hw/timer/allwinner-a10-pit.h
+++ b/include/hw/timer/allwinner-a10-pit.h
@@ -8,10 +8,10 @@
#define AW_PIT_TIMER_MAX 6
-typedef struct AwA10PITState AwA10PITState;
+typedef struct AllwinnerTmrCtrlState AllwinnerTmrCtrlState;
typedef struct AllwinnerTmrState {
- AwA10PITState *container;
+ AllwinnerTmrCtrlState *container;
int index;
ptimer_state *ptimer;
qemu_irq irq;
@@ -20,7 +20,7 @@ typedef struct AllwinnerTmrState {
uint32_t count;
} AllwinnerTmrState;
-struct AwA10PITState {
+struct AllwinnerTmrCtrlState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c
index ecfc198937..f2ac271e80 100644
--- a/hw/timer/allwinner-a10-pit.c
+++ b/hw/timer/allwinner-a10-pit.c
@@ -52,9 +52,9 @@
#define AW_A10_PIT_DEFAULT_CLOCK 0x4
#define AW_A10_PIT(obj) \
- OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT)
+ OBJECT_CHECK(AllwinnerTmrCtrlState, (obj), TYPE_AW_A10_PIT)
-static void a10_pit_update_irq(AwA10PITState *s)
+static void a10_pit_update_irq(AllwinnerTmrCtrlState *s)
{
int i;
@@ -66,7 +66,7 @@ static void a10_pit_update_irq(AwA10PITState *s)
static uint64_t a10_pit_read(void *opaque, hwaddr offset, unsigned size)
{
- AwA10PITState *s = AW_A10_PIT(opaque);
+ AllwinnerTmrCtrlState *s = AW_A10_PIT(opaque);
uint8_t index;
switch (offset) {
@@ -111,7 +111,7 @@ static uint64_t a10_pit_read(void *opaque, hwaddr offset, unsigned size)
}
/* Must be called inside a ptimer transaction block for s->timer[idx].ptimer */
-static void a10_pit_set_freq(AwA10PITState *s, int index)
+static void a10_pit_set_freq(AllwinnerTmrCtrlState *s, int index)
{
uint32_t prescaler, source, source_freq;
@@ -130,7 +130,7 @@ static void a10_pit_set_freq(AwA10PITState *s, int index)
static void a10_pit_write(void *opaque, hwaddr offset, uint64_t value,
unsigned size)
{
- AwA10PITState *s = AW_A10_PIT(opaque);
+ AllwinnerTmrCtrlState *s = AW_A10_PIT(opaque);
uint8_t index;
switch (offset) {
@@ -222,10 +222,10 @@ static const MemoryRegionOps a10_pit_ops = {
};
static Property a10_pit_properties[] = {
- DEFINE_PROP_UINT32("clk0-freq", AwA10PITState, clk_freq[0], 0),
- DEFINE_PROP_UINT32("clk1-freq", AwA10PITState, clk_freq[1], 0),
- DEFINE_PROP_UINT32("clk2-freq", AwA10PITState, clk_freq[2], 0),
- DEFINE_PROP_UINT32("clk3-freq", AwA10PITState, clk_freq[3], 0),
+ DEFINE_PROP_UINT32("clk0-freq", AllwinnerTmrCtrlState, clk_freq[0], 0),
+ DEFINE_PROP_UINT32("clk1-freq", AllwinnerTmrCtrlState, clk_freq[1], 0),
+ DEFINE_PROP_UINT32("clk2-freq", AllwinnerTmrCtrlState, clk_freq[2], 0),
+ DEFINE_PROP_UINT32("clk3-freq", AllwinnerTmrCtrlState, clk_freq[3], 0),
DEFINE_PROP_END_OF_LIST(),
};
@@ -247,24 +247,24 @@ static const VMStateDescription vmstate_a10_pit = {
.version_id = 2,
.minimum_version_id = 2,
.fields = (VMStateField[]) {
- VMSTATE_UINT32(irq_enable, AwA10PITState),
- VMSTATE_UINT32(irq_status, AwA10PITState),
- VMSTATE_STRUCT_ARRAY(timer, AwA10PITState,
+ VMSTATE_UINT32(irq_enable, AllwinnerTmrCtrlState),
+ VMSTATE_UINT32(irq_status, AllwinnerTmrCtrlState),
+ VMSTATE_STRUCT_ARRAY(timer, AllwinnerTmrCtrlState,
AW_PIT_TIMER_MAX,
0, vmstate_aw_timer,
AllwinnerTmrState),
- VMSTATE_UINT32(watch_dog_mode, AwA10PITState),
- VMSTATE_UINT32(watch_dog_control, AwA10PITState),
- VMSTATE_UINT32(count_lo, AwA10PITState),
- VMSTATE_UINT32(count_hi, AwA10PITState),
- VMSTATE_UINT32(count_ctl, AwA10PITState),
+ VMSTATE_UINT32(watch_dog_mode, AllwinnerTmrCtrlState),
+ VMSTATE_UINT32(watch_dog_control, AllwinnerTmrCtrlState),
+ VMSTATE_UINT32(count_lo, AllwinnerTmrCtrlState),
+ VMSTATE_UINT32(count_hi, AllwinnerTmrCtrlState),
+ VMSTATE_UINT32(count_ctl, AllwinnerTmrCtrlState),
VMSTATE_END_OF_LIST()
}
};
static void a10_pit_reset(DeviceState *dev)
{
- AwA10PITState *s = AW_A10_PIT(dev);
+ AllwinnerTmrCtrlState *s = AW_A10_PIT(dev);
uint8_t i;
s->irq_enable = 0;
@@ -290,7 +290,7 @@ static void a10_pit_reset(DeviceState *dev)
static void a10_pit_timer_cb(void *opaque)
{
AllwinnerTmrState *tc = opaque;
- AwA10PITState *s = tc->container;
+ AllwinnerTmrCtrlState *s = tc->container;
uint8_t i = tc->index;
if (s->timer[i].control & AW_A10_PIT_TIMER_EN) {
@@ -305,7 +305,7 @@ static void a10_pit_timer_cb(void *opaque)
static void a10_pit_init(Object *obj)
{
- AwA10PITState *s = AW_A10_PIT(obj);
+ AllwinnerTmrCtrlState *s = AW_A10_PIT(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
uint8_t i;
@@ -341,7 +341,7 @@ static void a10_pit_class_init(ObjectClass *klass, void *data)
static const TypeInfo a10_pit_info = {
.name = TYPE_AW_A10_PIT,
.parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(AwA10PITState),
+ .instance_size = sizeof(AllwinnerTmrCtrlState),
.instance_init = a10_pit_init,
.class_init = a10_pit_class_init,
};
--
2.21.0
next prev parent reply other threads:[~2019-12-19 18:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 18:51 [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable Philippe Mathieu-Daudé
2019-12-19 18:51 ` [PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition Philippe Mathieu-Daudé
2019-12-20 21:19 ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 02/13] hw/timer/allwinner: Add AW_PIT_TIMER_MAX definition Philippe Mathieu-Daudé
2019-12-20 21:27 ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 03/13] hw/timer/allwinner: Remove unused definitions Philippe Mathieu-Daudé
2019-12-20 21:36 ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 04/13] hw/timer/allwinner: Move definitions from header to source Philippe Mathieu-Daudé
2019-12-20 21:41 ` Niek Linnenbank
2019-12-19 18:51 ` [RFC PATCH 05/13] hw/timer/allwinner: Rename the ptimer field Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 06/13] hw/timer/allwinner: Rename 'timer_context' as 'timer' Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 07/13] hw/timer/allwinner: Move timer specific fields into AwA10TimerContext Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 08/13] hw/timer/allwinner: Add a timer_count field Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 09/13] hw/timer/allwinner: Rename AwA10TimerContext as AllwinnerTmrState Philippe Mathieu-Daudé
2019-12-19 18:51 ` Philippe Mathieu-Daudé [this message]
2019-12-19 18:51 ` [RFC PATCH 11/13] hw/timer/allwinner: Introduce TYPE_AW_COMMON_PIT abstract device Philippe Mathieu-Daudé
2019-12-20 21:11 ` Niek Linnenbank
2019-12-19 18:51 ` [RFC PATCH 12/13] hw/timer/allwinner: Rename AW_A10_PIT() as AW_TIMER_CTRL() Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 13/13] hw/timer/allwinner: Rename functions not specific to the A10 SoC Philippe Mathieu-Daudé
2019-12-20 20:53 ` [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable Niek Linnenbank
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=20191219185127.24388-11-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=b.galvani@gmail.com \
--cc=nieklinnenbank@gmail.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).