qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Aleksandar Rikalo" <arikalo@wavecomp.com>,
	"Helge Deller" <deller@gmx.de>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Joel Stanley" <joel@jms.id.au>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	qemu-trivial@nongnu.org, qemu-ppc@nongnu.org,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH v2 02/14] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory
Date: Fri,  4 Oct 2019 01:03:52 +0200	[thread overview]
Message-ID: <20191003230404.19384-3-philmd@redhat.com> (raw)
In-Reply-To: <20191003230404.19384-1-philmd@redhat.com>

The PL031 is a Real Time Clock, not a timer.
Move it under the hw/rtc/ subdirectory.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                       | 4 ++--
 Makefile.objs                     | 1 +
 hw/Kconfig                        | 1 +
 hw/Makefile.objs                  | 1 +
 hw/arm/musca.c                    | 2 +-
 hw/rtc/Kconfig                    | 2 ++
 hw/rtc/Makefile.objs              | 1 +
 hw/{timer => rtc}/pl031.c         | 2 +-
 hw/rtc/trace-events               | 8 ++++++++
 hw/timer/Kconfig                  | 3 ---
 hw/timer/Makefile.objs            | 1 -
 hw/timer/trace-events             | 7 -------
 include/hw/{timer => rtc}/pl031.h | 5 +++--
 13 files changed, 21 insertions(+), 17 deletions(-)
 create mode 100644 hw/rtc/Kconfig
 create mode 100644 hw/rtc/Makefile.objs
 rename hw/{timer => rtc}/pl031.c (99%)
 create mode 100644 hw/rtc/trace-events
 rename include/hw/{timer => rtc}/pl031.h (93%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 21264eae9c..92d27f1206 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -495,8 +495,8 @@ F: hw/intc/pl190.c
 F: hw/sd/pl181.c
 F: hw/ssi/pl022.c
 F: include/hw/ssi/pl022.h
-F: hw/timer/pl031.c
-F: include/hw/timer/pl031.h
+F: hw/rtc/pl031.c
+F: include/hw/rtc/pl031.h
 F: include/hw/arm/primecell.h
 F: hw/timer/cmsdk-apb-timer.c
 F: include/hw/timer/cmsdk-apb-timer.h
diff --git a/Makefile.objs b/Makefile.objs
index abcbd89654..11ba1a36bd 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -173,6 +173,7 @@ trace-events-subdirs += hw/pci-host
 trace-events-subdirs += hw/ppc
 trace-events-subdirs += hw/rdma
 trace-events-subdirs += hw/rdma/vmw
+trace-events-subdirs += hw/rtc
 trace-events-subdirs += hw/s390x
 trace-events-subdirs += hw/scsi
 trace-events-subdirs += hw/sd
diff --git a/hw/Kconfig b/hw/Kconfig
index b45db3c813..4b53fee4d0 100644
--- a/hw/Kconfig
+++ b/hw/Kconfig
@@ -27,6 +27,7 @@ source pci-host/Kconfig
 source pcmcia/Kconfig
 source pci/Kconfig
 source rdma/Kconfig
+source rtc/Kconfig
 source scsi/Kconfig
 source sd/Kconfig
 source semihosting/Kconfig
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index ece6cc3755..fd9750e5f2 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -26,6 +26,7 @@ devices-dirs-y += nvram/
 devices-dirs-y += pci/
 devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/
 devices-dirs-y += pcmcia/
+devices-dirs-y += rtc/
 devices-dirs-$(CONFIG_SCSI) += scsi/
 devices-dirs-y += sd/
 devices-dirs-y += ssi/
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index 68db4b5b38..ba99dd1941 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -32,7 +32,7 @@
 #include "hw/misc/tz-mpc.h"
 #include "hw/misc/tz-ppc.h"
 #include "hw/misc/unimp.h"
-#include "hw/timer/pl031.h"
+#include "hw/rtc/pl031.h"
 
 #define MUSCA_NUMIRQ_MAX 96
 #define MUSCA_PPC_MAX 3
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
new file mode 100644
index 0000000000..8a4383bca9
--- /dev/null
+++ b/hw/rtc/Kconfig
@@ -0,0 +1,2 @@
+config PL031
+    bool
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
new file mode 100644
index 0000000000..3e1eb42563
--- /dev/null
+++ b/hw/rtc/Makefile.objs
@@ -0,0 +1 @@
+common-obj-$(CONFIG_PL031) += pl031.o
diff --git a/hw/timer/pl031.c b/hw/rtc/pl031.c
similarity index 99%
rename from hw/timer/pl031.c
rename to hw/rtc/pl031.c
index 2b3e261006..3a982752a2 100644
--- a/hw/timer/pl031.c
+++ b/hw/rtc/pl031.c
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "hw/timer/pl031.h"
+#include "hw/rtc/pl031.h"
 #include "migration/vmstate.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
new file mode 100644
index 0000000000..54c94ac557
--- /dev/null
+++ b/hw/rtc/trace-events
@@ -0,0 +1,8 @@
+# See docs/devel/tracing.txt for syntax documentation.
+
+# pl031.c
+pl031_irq_state(int level) "irq state %d"
+pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+pl031_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+pl031_alarm_raised(void) "alarm raised"
+pl031_set_alarm(uint32_t ticks) "alarm set for %u ticks"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index eefc95f35e..27c5dce09e 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -27,9 +27,6 @@ config M41T80
 config M48T59
     bool
 
-config PL031
-    bool
-
 config TWL92230
     bool
     depends on I2C
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index f407523aa4..9f64f6e11e 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -11,7 +11,6 @@ common-obj-$(CONFIG_M48T59) += m48t59.o
 ifeq ($(CONFIG_ISA_BUS),y)
 common-obj-$(CONFIG_M48T59) += m48t59-isa.o
 endif
-common-obj-$(CONFIG_PL031) += pl031.o
 common-obj-$(CONFIG_PUV3) += puv3_ost.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XILINX) += xilinx_timer.o
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index db02a9142c..6936fe8573 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -80,10 +80,3 @@ xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec
 # nrf51_timer.c
 nrf51_timer_read(uint64_t addr, uint32_t value, unsigned size) "read addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u"
 nrf51_timer_write(uint64_t addr, uint32_t value, unsigned size) "write addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u"
-
-# pl031.c
-pl031_irq_state(int level) "irq state %d"
-pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-pl031_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-pl031_alarm_raised(void) "alarm raised"
-pl031_set_alarm(uint32_t ticks) "alarm set for %u ticks"
diff --git a/include/hw/timer/pl031.h b/include/hw/rtc/pl031.h
similarity index 93%
rename from include/hw/timer/pl031.h
rename to include/hw/rtc/pl031.h
index 8c3f555ee2..e3cb1d646f 100644
--- a/include/hw/timer/pl031.h
+++ b/include/hw/rtc/pl031.h
@@ -11,10 +11,11 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
-#ifndef HW_TIMER_PL031_H
-#define HW_TIMER_PL031_H
+#ifndef HW_RTC_PL031_H
+#define HW_RTC_PL031_H
 
 #include "hw/sysbus.h"
+#include "qemu/timer.h"
 
 #define TYPE_PL031 "pl031"
 #define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031)
-- 
2.20.1



  parent reply	other threads:[~2019-10-03 23:14 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 23:03 [PATCH v2 00/14] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
2019-10-03 23:03 ` [PATCH v2 01/14] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
2019-10-24 18:02   ` Laurent Vivier
2019-10-03 23:03 ` Philippe Mathieu-Daudé [this message]
2019-10-24 18:04   ` [PATCH v2 02/14] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 03/14] hw: Move MC146818 " Philippe Mathieu-Daudé
2019-10-24 18:14   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 04/14] hw: Move M48T59 " Philippe Mathieu-Daudé
2019-10-24 18:21   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 05/14] hw: Move M41T80 " Philippe Mathieu-Daudé
2019-10-24 18:22   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 06/14] hw: Move sun4v hypervisor RTC " Philippe Mathieu-Daudé
2019-10-24 14:10   ` Philippe Mathieu-Daudé
2019-10-24 16:41     ` Artyom Tarasenko
2019-10-24 18:23   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 07/14] hw: Move TWL92230 device " Philippe Mathieu-Daudé
2019-10-24 18:25   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 08/14] hw: Move DS1338 " Philippe Mathieu-Daudé
2019-10-24 18:26   ` Laurent Vivier
2019-10-03 23:03 ` [PATCH v2 09/14] hw: Move Xilinx ZynqMP RTC " Philippe Mathieu-Daudé
2019-10-24 18:28   ` Laurent Vivier
2019-10-03 23:04 ` [PATCH v2 10/14] hw: Move Exynos4210 " Philippe Mathieu-Daudé
2019-10-24 18:30   ` Laurent Vivier
2019-10-03 23:04 ` [PATCH v2 11/14] hw: Move Aspeed " Philippe Mathieu-Daudé
2019-10-24 18:32   ` Laurent Vivier
2019-10-03 23:04 ` [PATCH v2 12/14] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less Philippe Mathieu-Daudé
2019-10-24 18:33   ` Laurent Vivier
2019-10-03 23:04 ` [PATCH v2 13/14] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include Philippe Mathieu-Daudé
2019-10-24 18:34   ` Laurent Vivier
2019-10-03 23:04 ` [PATCH v2 14/14] hw/rtc/aspeed_rtc: Remove unused includes Philippe Mathieu-Daudé
2019-10-24 18:35   ` Laurent Vivier
2019-10-24 15:51 ` [PATCH v2 00/14] hw: Split RTC devices from hw/timer/ to hw/rtc/ Peter Maydell
2019-10-24 17:36   ` Laurent Vivier
2019-10-24 17:55     ` Philippe Mathieu-Daudé

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=20191003230404.19384-3-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=alistair@alistair23.me \
    --cc=amarkovic@wavecomp.com \
    --cc=andrew@aj.id.au \
    --cc=arikalo@wavecomp.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=deller@gmx.de \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=imammedo@redhat.com \
    --cc=joel@jms.id.au \
    --cc=lvivier@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.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).