All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/
@ 2019-09-16 15:48 Philippe Mathieu-Daudé
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
                   ` (12 more replies)
  0 siblings, 13 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

When working on timers, I found it confuse to have RTC devices
mixed in the hw/timer/ directory.

We can see the models use slighly different APIs:

  $ git grep '#include' hw/timer/|cut -d: -f3-|sort|uniq -c|egrep -v '^      1 '|sort -rn
     33 #include "qemu/osdep.h"
     29 #include "hw/irq.h"
     28 #include "qemu/module.h"
     23 #include "migration/vmstate.h"
     21 #include "hw/sysbus.h"
     20 #include "qemu/timer.h"
     20 #include "qemu/main-loop.h"
     17 #include "qemu/log.h"
     14 #include "hw/qdev-properties.h"
     14 #include "hw/ptimer.h"
      9 #include "trace.h"
      7 #include "qapi/error.h"
      5 #include "hw/hw.h"
      3 #include "sysemu/runstate.h"
      3 #include "qemu/error-report.h"
      3 #include "hw/timer/i8254.h"
      2 #include "qemu/bitops.h"
      2 #include "hw/timer/i8254_internal.h"
      2 #include "hw/registerfields.h"
      2 #include "hw/core/cpu.h"
      2 #include "hw/arm/omap.h"
      2 #include "hw/arm/exynos4210.h"

  $ git grep '#include' hw/rtc/|cut -d: -f3-|sort|uniq -c|egrep -v '^      1 '|sort -rn
     11 #include "qemu/osdep.h"
     10 #include "qemu/module.h"
      9 #include "qemu-common.h"
      8 #include "qemu/timer.h"
      8 #include "migration/vmstate.h"
      6 #include "qemu/bcd.h"
      6 #include "hw/irq.h"
      5 #include "sysemu/sysemu.h"
      5 #include "qemu/log.h"
      5 #include "hw/sysbus.h"
      4 #include "trace.h"
      4 #include "hw/qdev-properties.h"
      3 #include "qemu/cutils.h"
      3 #include "hw/i2c/i2c.h"
      2 #include "sysemu/runstate.h"
      2 #include "m48t59-internal.h"
      2 #include "hw/rtc/m48t59.h"
      2 #include "exec/address-spaces.h"

Split the RTC-related files in the new hw/rtc/ directory.

Philippe Mathieu-Daudé (13):
  hw/timer: Compile devices not target-dependent as common object
  hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory
  hw: Move TWL92230 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory
  hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory
  hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory
  hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory
  hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less
  hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include

 MAINTAINERS                                  | 20 +++----
 Makefile.objs                                |  1 +
 hw/Kconfig                                   |  1 +
 hw/Makefile.objs                             |  1 +
 hw/alpha/dp264.c                             |  2 +-
 hw/arm/musca.c                               |  2 +-
 hw/hppa/machine.c                            |  2 +-
 hw/i386/acpi-build.c                         |  2 +-
 hw/i386/pc.c                                 |  2 +-
 hw/i386/pc_q35.c                             |  2 +-
 hw/mips/mips_fulong2e.c                      |  2 +-
 hw/mips/mips_jazz.c                          |  2 +-
 hw/mips/mips_malta.c                         |  2 +-
 hw/mips/mips_r4k.c                           |  2 +-
 hw/ppc/pnv.c                                 |  2 +-
 hw/ppc/ppc405_boards.c                       |  2 +-
 hw/ppc/prep.c                                |  4 +-
 hw/rtc/Kconfig                               | 23 ++++++++
 hw/rtc/Makefile.objs                         | 13 +++++
 hw/{timer => rtc}/aspeed_rtc.c               |  2 +-
 hw/{timer => rtc}/ds1338.c                   |  0
 hw/{timer => rtc}/exynos4210_rtc.c           |  0
 hw/{timer => rtc}/m41t80.c                   |  0
 hw/{timer => rtc}/m48t59-internal.h          |  0
 hw/{timer => rtc}/m48t59-isa.c               |  4 +-
 hw/{timer => rtc}/m48t59.c                   |  2 +-
 hw/{timer => rtc}/mc146818rtc.c              |  3 +-
 hw/{timer => rtc}/pl031.c                    |  2 +-
 hw/{timer => rtc}/sun4v-rtc.c                |  2 +-
 hw/rtc/trace-events                          | 19 +++++++
 hw/{timer => rtc}/twl92230.c                 |  0
 hw/{timer => rtc}/xlnx-zynqmp-rtc.c          |  3 +-
 hw/sparc/sun4m.c                             |  2 +-
 hw/sparc64/niagara.c                         |  2 +-
 hw/sparc64/sun4u.c                           |  2 +-
 hw/timer/Kconfig                             | 24 ---------
 hw/timer/Makefile.objs                       | 35 ++++--------
 hw/timer/hpet.c                              |  3 +-
 hw/timer/trace-events                        | 18 -------
 include/hw/arm/aspeed_soc.h                  |  2 +-
 include/hw/arm/xlnx-zynqmp.h                 |  2 +-
 include/hw/{timer => rtc}/aspeed_rtc.h       |  3 --
 include/hw/rtc/m48t59.h                      | 57 ++++++++++++++++++++
 include/hw/rtc/mc146818rtc.h                 | 37 +++++++++++++
 include/hw/{timer => rtc}/mc146818rtc_regs.h |  1 +
 include/hw/{timer => rtc}/pl031.h            |  5 +-
 include/hw/rtc/sun4v-rtc.h                   | 19 +++++++
 include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h  |  6 +--
 include/hw/timer/mc146818rtc.h               | 14 -----
 include/hw/timer/sun4v-rtc.h                 |  1 -
 tests/rtc-test.c                             |  2 +-
 51 files changed, 230 insertions(+), 129 deletions(-)
 create mode 100644 hw/rtc/Kconfig
 create mode 100644 hw/rtc/Makefile.objs
 rename hw/{timer => rtc}/aspeed_rtc.c (99%)
 rename hw/{timer => rtc}/ds1338.c (100%)
 rename hw/{timer => rtc}/exynos4210_rtc.c (100%)
 rename hw/{timer => rtc}/m41t80.c (100%)
 rename hw/{timer => rtc}/m48t59-internal.h (100%)
 rename hw/{timer => rtc}/m48t59-isa.c (98%)
 rename hw/{timer => rtc}/m48t59.c (99%)
 rename hw/{timer => rtc}/mc146818rtc.c (99%)
 rename hw/{timer => rtc}/pl031.c (99%)
 rename hw/{timer => rtc}/sun4v-rtc.c (98%)
 create mode 100644 hw/rtc/trace-events
 rename hw/{timer => rtc}/twl92230.c (100%)
 rename hw/{timer => rtc}/xlnx-zynqmp-rtc.c (99%)
 rename include/hw/{timer => rtc}/aspeed_rtc.h (92%)
 create mode 100644 include/hw/rtc/m48t59.h
 create mode 100644 include/hw/rtc/mc146818rtc.h
 rename include/hw/{timer => rtc}/mc146818rtc_regs.h (98%)
 rename include/hw/{timer => rtc}/pl031.h (93%)
 create mode 100644 include/hw/rtc/sun4v-rtc.h
 rename include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h (95%)
 delete mode 100644 include/hw/timer/mc146818rtc.h
 delete mode 100644 include/hw/timer/sun4v-rtc.h

-- 
2.20.1



^ permalink raw reply	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 17:28   ` Alistair Francis
  2019-09-17  4:57   ` Thomas Huth
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  12 siblings, 2 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

All these devices do not contain any target-specific. While most
of them are arch-specific, they are shared between different
targets of the same arch family (ARM and AArch64, MIPS32/MIPS64,
endianess, ...).
Put them into common-obj-y to compile them once for all targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/timer/Makefile.objs | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 123d92c969..f407523aa4 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -25,20 +25,20 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
 common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
 common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
 
-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
-obj-$(CONFIG_OMAP) += omap_gptimer.o
-obj-$(CONFIG_OMAP) += omap_synctimer.o
-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
-obj-$(CONFIG_SH4) += sh_timer.o
-obj-$(CONFIG_DIGIC) += digic-timer.o
-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
+common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
+common-obj-$(CONFIG_OMAP) += omap_gptimer.o
+common-obj-$(CONFIG_OMAP) += omap_synctimer.o
+common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
+common-obj-$(CONFIG_SH4) += sh_timer.o
+common-obj-$(CONFIG_DIGIC) += digic-timer.o
+common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
 
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
 
-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
+common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
 
 common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
 common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 18:12   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

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

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 f0e30b5248..5562d2c6d0 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 6a143dcd57..1bcde315f7 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



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:22   ` Alistair Francis
                     ` (3 more replies)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 04/13] hw: Move M48T59 " Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  12 siblings, 4 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                                  |  4 +--
 hw/alpha/dp264.c                             |  2 +-
 hw/hppa/machine.c                            |  2 +-
 hw/i386/acpi-build.c                         |  2 +-
 hw/i386/pc.c                                 |  2 +-
 hw/i386/pc_q35.c                             |  2 +-
 hw/mips/mips_fulong2e.c                      |  2 +-
 hw/mips/mips_jazz.c                          |  2 +-
 hw/mips/mips_malta.c                         |  2 +-
 hw/mips/mips_r4k.c                           |  2 +-
 hw/ppc/pnv.c                                 |  2 +-
 hw/ppc/prep.c                                |  2 +-
 hw/rtc/Kconfig                               |  3 ++
 hw/rtc/Makefile.objs                         |  1 +
 hw/{timer => rtc}/mc146818rtc.c              |  2 +-
 hw/timer/Kconfig                             |  3 --
 hw/timer/Makefile.objs                       |  2 --
 hw/timer/hpet.c                              |  2 +-
 include/hw/rtc/mc146818rtc.h                 | 38 ++++++++++++++++++++
 include/hw/{timer => rtc}/mc146818rtc_regs.h |  1 +
 include/hw/timer/mc146818rtc.h               | 14 --------
 tests/rtc-test.c                             |  2 +-
 22 files changed, 59 insertions(+), 35 deletions(-)
 rename hw/{timer => rtc}/mc146818rtc.c (99%)
 create mode 100644 include/hw/rtc/mc146818rtc.h
 rename include/hw/{timer => rtc}/mc146818rtc_regs.h (98%)
 delete mode 100644 include/hw/timer/mc146818rtc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 5562d2c6d0..481f2318cb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1263,7 +1263,7 @@ F: hw/misc/debugexit.c
 F: hw/misc/pc-testdev.c
 F: hw/timer/hpet*
 F: hw/timer/i8254*
-F: hw/timer/mc146818rtc*
+F: hw/rtc/mc146818rtc*
 F: hw/watchdog/wdt_ib700.c
 F: hw/watchdog/wdt_i6300esb.c
 F: include/hw/display/vga.h
@@ -1275,7 +1275,7 @@ F: include/hw/isa/i8259_internal.h
 F: include/hw/isa/superio.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
-F: include/hw/timer/mc146818rtc*
+F: include/hw/rtc/mc146818rtc*
 
 Machine core
 M: Eduardo Habkost <ehabkost@redhat.com>
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 51feee8558..51b3cf7a61 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -14,7 +14,7 @@
 #include "alpha_sys.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
 #include "hw/isa/superio.h"
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 2736ce835e..6598e2469d 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -12,7 +12,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
 #include "hw/char/serial.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e54e571a75..44a8073507 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -45,7 +45,7 @@
 #include "hw/acpi/vmgenid.h"
 #include "hw/boards.h"
 #include "sysemu/tpm_backend.h"
-#include "hw/timer/mc146818rtc_regs.h"
+#include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "hw/mem/memory-device.h"
 #include "sysemu/numa.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index bad866fe44..beef7a992d 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -42,7 +42,7 @@
 #include "elf.h"
 #include "migration/vmstate.h"
 #include "multiboot.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d4e8a1cb9f..a976af9a2a 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -33,7 +33,7 @@
 #include "hw/loader.h"
 #include "sysemu/arch_init.h"
 #include "hw/i2c/smbus_eeprom.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/xen/xen.h"
 #include "sysemu/kvm.h"
 #include "kvm_i386.h"
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index cf537dd7e6..03a27e1767 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -39,7 +39,7 @@
 #include "hw/ide.h"
 #include "elf.h"
 #include "hw/isa/vt82c686.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index c967b97d80..2811a4bd90 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -39,7 +39,7 @@
 #include "hw/scsi/esp.h"
 #include "hw/mips/bios.h"
 #include "hw/loader.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/timer/i8254.h"
 #include "hw/display/vga.h"
 #include "hw/audio/pcspk.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 4d9c64b36a..c1c8810e71 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -45,7 +45,7 @@
 #include "hw/irq.h"
 #include "hw/loader.h"
 #include "elf.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"             /* SysBusDevice */
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index bc0be26544..70024235ae 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -28,7 +28,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "elf.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 3f08db7b9e..4b2649d95b 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -48,7 +48,7 @@
 #include "hw/isa/isa.h"
 #include "hw/boards.h"
 #include "hw/char/serial.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 
 #include <libfdt.h>
 
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 4f3c6bf190..3a51536e1a 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -40,7 +40,7 @@
 #include "hw/ide.h"
 #include "hw/irq.h"
 #include "hw/loader.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "hw/isa/pc87312.h"
 #include "hw/net/ne2000-isa.h"
 #include "sysemu/arch_init.h"
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index 8a4383bca9..7ffd702268 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -1,2 +1,5 @@
 config PL031
     bool
+
+config MC146818RTC
+    bool
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 3e1eb42563..3cac0d5a63 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -1 +1,2 @@
 common-obj-$(CONFIG_PL031) += pl031.o
+obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
diff --git a/hw/timer/mc146818rtc.c b/hw/rtc/mc146818rtc.c
similarity index 99%
rename from hw/timer/mc146818rtc.c
rename to hw/rtc/mc146818rtc.c
index 6cb378751b..ced15f764f 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -34,7 +34,7 @@
 #include "sysemu/replay.h"
 #include "sysemu/reset.h"
 #include "sysemu/runstate.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "migration/vmstate.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc-target.h"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 27c5dce09e..af415c8ef8 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -35,9 +35,6 @@ config ALTERA_TIMER
     bool
     select PTIMER
 
-config MC146818RTC
-    bool
-
 config ALLWINNER_A10_PIT
     bool
     select PTIMER
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 9f64f6e11e..b0159189cf 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -35,8 +35,6 @@ common-obj-$(CONFIG_SH4) += sh_timer.o
 common-obj-$(CONFIG_DIGIC) += digic-timer.o
 common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
 
-obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
-
 common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
 
 common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 1ddae4e7d7..02bf8a8ce8 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -33,7 +33,7 @@
 #include "qemu/timer.h"
 #include "hw/timer/hpet.h"
 #include "hw/sysbus.h"
-#include "hw/timer/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc.h"
 #include "migration/vmstate.h"
 #include "hw/timer/i8254.h"
 
diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
new file mode 100644
index 0000000000..888e04f9ab
--- /dev/null
+++ b/include/hw/rtc/mc146818rtc.h
@@ -0,0 +1,38 @@
+/*
+ * QEMU MC146818 RTC emulation
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MC146818RTC_H
+#define MC146818RTC_H
+
+#include "hw/isa/isa.h"
+#include "hw/rtc/mc146818rtc_regs.h"
+
+#define TYPE_MC146818_RTC "mc146818rtc"
+
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
+                             qemu_irq intercept_irq);
+void rtc_set_memory(ISADevice *dev, int addr, int val);
+int rtc_get_memory(ISADevice *dev, int addr);
+
+#endif /* MC146818RTC_H */
diff --git a/include/hw/timer/mc146818rtc_regs.h b/include/hw/rtc/mc146818rtc_regs.h
similarity index 98%
rename from include/hw/timer/mc146818rtc_regs.h
rename to include/hw/rtc/mc146818rtc_regs.h
index bfbb57e570..c4c6305473 100644
--- a/include/hw/timer/mc146818rtc_regs.h
+++ b/include/hw/rtc/mc146818rtc_regs.h
@@ -26,6 +26,7 @@
 #define MC146818RTC_REGS_H
 
 #include "qemu/timer.h"
+#include "qemu/host-utils.h"
 
 #define RTC_ISA_IRQ 8
 
diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
deleted file mode 100644
index fe6ed63f71..0000000000
--- a/include/hw/timer/mc146818rtc.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef MC146818RTC_H
-#define MC146818RTC_H
-
-#include "hw/isa/isa.h"
-#include "hw/timer/mc146818rtc_regs.h"
-
-#define TYPE_MC146818_RTC "mc146818rtc"
-
-ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
-                             qemu_irq intercept_irq);
-void rtc_set_memory(ISADevice *dev, int addr, int val);
-int rtc_get_memory(ISADevice *dev, int addr);
-
-#endif /* MC146818RTC_H */
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 6309b0ef6c..79a4ff1ed6 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -15,7 +15,7 @@
 
 #include "libqtest-single.h"
 #include "qemu/timer.h"
-#include "hw/timer/mc146818rtc_regs.h"
+#include "hw/rtc/mc146818rtc_regs.h"
 
 #define UIP_HOLD_LENGTH           (8 * NANOSECONDS_PER_SECOND / 32768)
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 04/13] hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:23   ` Alistair Francis
  2019-09-17  2:25   ` David Gibson
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 05/13] hw: Move M41T80 " Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  12 siblings, 2 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                         |  4 +-
 hw/ppc/ppc405_boards.c              |  2 +-
 hw/ppc/prep.c                       |  2 +-
 hw/rtc/Kconfig                      |  3 ++
 hw/rtc/Makefile.objs                |  4 ++
 hw/{timer => rtc}/m48t59-internal.h |  0
 hw/{timer => rtc}/m48t59-isa.c      |  4 +-
 hw/{timer => rtc}/m48t59.c          |  2 +-
 hw/sparc/sun4m.c                    |  2 +-
 hw/sparc64/sun4u.c                  |  2 +-
 hw/timer/Kconfig                    |  3 --
 hw/timer/Makefile.objs              |  4 --
 include/hw/rtc/m48t59.h             | 57 +++++++++++++++++++++++++++++
 13 files changed, 73 insertions(+), 16 deletions(-)
 rename hw/{timer => rtc}/m48t59-internal.h (100%)
 rename hw/{timer => rtc}/m48t59-isa.c (98%)
 rename hw/{timer => rtc}/m48t59.c (99%)
 create mode 100644 include/hw/rtc/m48t59.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 481f2318cb..679b026fe0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1064,9 +1064,9 @@ F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.c
 F: hw/dma/i82374.c
-F: hw/timer/m48t59-isa.c
+F: hw/rtc/m48t59-isa.c
 F: include/hw/isa/pc87312.h
-F: include/hw/timer/m48t59.h
+F: include/hw/rtc/m48t59.h
 F: pc-bios/ppc_rom.bin
 
 sPAPR
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 388cae0b43..1f721feed6 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -29,7 +29,7 @@
 #include "cpu.h"
 #include "hw/ppc/ppc.h"
 #include "ppc405.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 3a51536e1a..862345c2ac 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "hw/char/serial.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index 7ffd702268..159c233517 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -1,3 +1,6 @@
+config M48T59
+    bool
+
 config PL031
     bool
 
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 3cac0d5a63..c87f81405e 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -1,2 +1,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
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
diff --git a/hw/timer/m48t59-internal.h b/hw/rtc/m48t59-internal.h
similarity index 100%
rename from hw/timer/m48t59-internal.h
rename to hw/rtc/m48t59-internal.h
diff --git a/hw/timer/m48t59-isa.c b/hw/rtc/m48t59-isa.c
similarity index 98%
rename from hw/timer/m48t59-isa.c
rename to hw/rtc/m48t59-isa.c
index 5e5432abfd..7fde854c0f 100644
--- a/hw/timer/m48t59-isa.c
+++ b/hw/rtc/m48t59-isa.c
@@ -1,5 +1,5 @@
 /*
- * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface
+ * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface)
  *
  * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
  * Copyright (c) 2013 Hervé Poussineau
@@ -26,7 +26,7 @@
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "m48t59-internal.h"
 #include "qemu/module.h"
 
diff --git a/hw/timer/m48t59.c b/hw/rtc/m48t59.c
similarity index 99%
rename from hw/timer/m48t59.c
rename to hw/rtc/m48t59.c
index a9fc2f981a..fc592b9fb1 100644
--- a/hw/timer/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -27,7 +27,7 @@
 #include "qemu-common.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "qemu/timer.h"
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 6c5a17a020..2aaa5bf1ae 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -31,7 +31,7 @@
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "hw/sparc/sun4m_iommu.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "migration/vmstate.h"
 #include "hw/sparc/sparc32_dma.h"
 #include "hw/block/fdc.h"
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 1ded2a4c9a..955082773b 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -36,7 +36,7 @@
 #include "hw/pci-host/sabre.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
-#include "hw/timer/m48t59.h"
+#include "hw/rtc/m48t59.h"
 #include "migration/vmstate.h"
 #include "hw/input/i8042.h"
 #include "hw/block/fdc.h"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index af415c8ef8..a57e9b59fc 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -24,9 +24,6 @@ config M41T80
     bool
     depends on I2C
 
-config M48T59
-    bool
-
 config TWL92230
     bool
     depends on I2C
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index b0159189cf..fe2d1fbc40 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -7,10 +7,6 @@ common-obj-$(CONFIG_DS1338) += ds1338.o
 common-obj-$(CONFIG_HPET) += hpet.o
 common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_M41T80) += m41t80.o
-common-obj-$(CONFIG_M48T59) += m48t59.o
-ifeq ($(CONFIG_ISA_BUS),y)
-common-obj-$(CONFIG_M48T59) += m48t59-isa.o
-endif
 common-obj-$(CONFIG_PUV3) += puv3_ost.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XILINX) += xilinx_timer.o
diff --git a/include/hw/rtc/m48t59.h b/include/hw/rtc/m48t59.h
new file mode 100644
index 0000000000..e7ea4e8761
--- /dev/null
+++ b/include/hw/rtc/m48t59.h
@@ -0,0 +1,57 @@
+/*
+ * QEMU M48T59 and M48T08 NVRAM emulation
+ *
+ * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
+ * Copyright (c) 2013 Hervé Poussineau
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef HW_RTC_M48T59_H
+#define HW_RTC_M48T59_H
+
+#include "exec/hwaddr.h"
+#include "qom/object.h"
+
+#define TYPE_NVRAM "nvram"
+
+#define NVRAM_CLASS(klass) \
+    OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM)
+#define NVRAM_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM)
+#define NVRAM(obj) \
+    INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM)
+
+typedef struct Nvram Nvram;
+
+typedef struct NvramClass {
+    InterfaceClass parent;
+
+    uint32_t (*read)(Nvram *obj, uint32_t addr);
+    void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
+    void (*toggle_lock)(Nvram *obj, int lock);
+} NvramClass;
+
+Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
+                       int base_year, int type);
+Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
+                   uint32_t io_base, uint16_t size, int base_year,
+                   int type);
+
+#endif /* HW_M48T59_H */
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 05/13] hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 04/13] hw: Move M48T59 " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:26   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC " Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                | 2 +-
 hw/rtc/Kconfig             | 4 ++++
 hw/rtc/Makefile.objs       | 1 +
 hw/{timer => rtc}/m41t80.c | 0
 hw/timer/Kconfig           | 4 ----
 hw/timer/Makefile.objs     | 1 -
 6 files changed, 6 insertions(+), 6 deletions(-)
 rename hw/{timer => rtc}/m41t80.c (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 679b026fe0..fd68b2383a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1113,7 +1113,7 @@ F: hw/ppc/sam460ex.c
 F: hw/ppc/ppc440_pcix.c
 F: hw/display/sm501*
 F: hw/ide/sii3112.c
-F: hw/timer/m41t80.c
+F: hw/rtc/m41t80.c
 F: pc-bios/canyonlands.dt[sb]
 F: pc-bios/u-boot-sam460ex-20100605.bin
 F: roms/u-boot-sam460ex
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index 159c233517..434b20b2b1 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -1,3 +1,7 @@
+config M41T80
+    bool
+    depends on I2C
+
 config M48T59
     bool
 
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index c87f81405e..89e8e48c64 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -1,3 +1,4 @@
+common-obj-$(CONFIG_M41T80) += m41t80.o
 common-obj-$(CONFIG_M48T59) += m48t59.o
 ifeq ($(CONFIG_ISA_BUS),y)
 common-obj-$(CONFIG_M48T59) += m48t59-isa.o
diff --git a/hw/timer/m41t80.c b/hw/rtc/m41t80.c
similarity index 100%
rename from hw/timer/m41t80.c
rename to hw/rtc/m41t80.c
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index a57e9b59fc..a6b668b255 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -20,10 +20,6 @@ config HPET
 config I8254
     bool
 
-config M41T80
-    bool
-    depends on I2C
-
 config TWL92230
     bool
     depends on I2C
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index fe2d1fbc40..2fb12162a6 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -6,7 +6,6 @@ common-obj-$(CONFIG_CADENCE) += cadence_ttc.o
 common-obj-$(CONFIG_DS1338) += ds1338.o
 common-obj-$(CONFIG_HPET) += hpet.o
 common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
-common-obj-$(CONFIG_M41T80) += m41t80.o
 common-obj-$(CONFIG_PUV3) += puv3_ost.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XILINX) += xilinx_timer.o
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 05/13] hw: Move M41T80 " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:27   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device " Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

Move RTC devices under the hw/rtc/ subdirectory.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                   |  4 ++--
 hw/rtc/Kconfig                |  3 +++
 hw/rtc/Makefile.objs          |  1 +
 hw/{timer => rtc}/sun4v-rtc.c |  2 +-
 hw/rtc/trace-events           |  4 ++++
 hw/sparc64/niagara.c          |  2 +-
 hw/timer/Kconfig              |  3 ---
 hw/timer/Makefile.objs        |  1 -
 hw/timer/trace-events         |  4 ----
 include/hw/rtc/sun4v-rtc.h    | 19 +++++++++++++++++++
 include/hw/timer/sun4v-rtc.h  |  1 -
 11 files changed, 31 insertions(+), 13 deletions(-)
 rename hw/{timer => rtc}/sun4v-rtc.c (98%)
 create mode 100644 include/hw/rtc/sun4v-rtc.h
 delete mode 100644 include/hw/timer/sun4v-rtc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index fd68b2383a..fb9a1ed075 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1165,8 +1165,8 @@ Sun4v
 M: Artyom Tarasenko <atar4qemu@gmail.com>
 S: Maintained
 F: hw/sparc64/niagara.c
-F: hw/timer/sun4v-rtc.c
-F: include/hw/timer/sun4v-rtc.h
+F: hw/rtc/sun4v-rtc.c
+F: include/hw/rtc/sun4v-rtc.h
 
 Leon3
 M: Fabien Chouteau <chouteau@adacore.com>
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index 434b20b2b1..cc7fead764 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -10,3 +10,6 @@ config PL031
 
 config MC146818RTC
     bool
+
+config SUN4V_RTC
+    bool
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 89e8e48c64..4621b37bc2 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -5,3 +5,4 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
 endif
 common-obj-$(CONFIG_PL031) += pl031.o
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
+common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
diff --git a/hw/timer/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c
similarity index 98%
rename from hw/timer/sun4v-rtc.c
rename to hw/rtc/sun4v-rtc.c
index 54272a822f..ada01b5774 100644
--- a/hw/timer/sun4v-rtc.c
+++ b/hw/rtc/sun4v-rtc.c
@@ -13,7 +13,7 @@
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
-#include "hw/timer/sun4v-rtc.h"
+#include "hw/rtc/sun4v-rtc.h"
 #include "trace.h"
 
 
diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
index 54c94ac557..ac9e0e0fba 100644
--- a/hw/rtc/trace-events
+++ b/hw/rtc/trace-events
@@ -1,5 +1,9 @@
 # See docs/devel/tracing.txt for syntax documentation.
 
+# sun4v-rtc.c
+sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
+sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
+
 # pl031.c
 pl031_irq_state(int level) "irq state %d"
 pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
index 167143bffe..dfa0817eae 100644
--- a/hw/sparc64/niagara.c
+++ b/hw/sparc64/niagara.c
@@ -30,7 +30,7 @@
 #include "hw/misc/unimp.h"
 #include "hw/loader.h"
 #include "hw/sparc/sparc64.h"
-#include "hw/timer/sun4v-rtc.h"
+#include "hw/rtc/sun4v-rtc.h"
 #include "exec/address-spaces.h"
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index a6b668b255..b04c928136 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -35,9 +35,6 @@ config ALLWINNER_A10_PIT
 config STM32F2XX_TIMER
     bool
 
-config SUN4V_RTC
-    bool
-
 config CMSDK_APB_TIMER
     bool
     select PTIMER
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 2fb12162a6..034bd30255 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -35,7 +35,6 @@ common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
 common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
 common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
 
-common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
 common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
 common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
 common-obj-$(CONFIG_MSF2) += mss-timer.o
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index 6936fe8573..ce34b967db 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -70,10 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
 aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
 aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
 
-# sun4v-rtc.c
-sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
-sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
-
 # xlnx-zynqmp-rtc.c
 xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
 
diff --git a/include/hw/rtc/sun4v-rtc.h b/include/hw/rtc/sun4v-rtc.h
new file mode 100644
index 0000000000..fd868f6ed2
--- /dev/null
+++ b/include/hw/rtc/sun4v-rtc.h
@@ -0,0 +1,19 @@
+/*
+ * QEMU sun4v Real Time Clock device
+ *
+ * The sun4v_rtc device (sun4v tod clock)
+ *
+ * Copyright (c) 2016 Artyom Tarasenko
+ *
+ * This code is licensed under the GNU GPL v3 or (at your option) any later
+ * version.
+ */
+
+#ifndef HW_RTC_SUN4V
+#define HW_RTC_SUN4V
+
+#include "exec/hwaddr.h"
+
+void sun4v_rtc_init(hwaddr addr);
+
+#endif
diff --git a/include/hw/timer/sun4v-rtc.h b/include/hw/timer/sun4v-rtc.h
deleted file mode 100644
index 407278f918..0000000000
--- a/include/hw/timer/sun4v-rtc.h
+++ /dev/null
@@ -1 +0,0 @@
-void sun4v_rtc_init(hwaddr addr);
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:39   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 08/13] hw: Move DS1338 " Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

The TWL92230 is an "energy management device" companion with
a RTC. Since we mostly model the RTC, move it under the hw/rtc/
subdirectory.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 MAINTAINERS                  | 2 +-
 hw/rtc/Kconfig               | 4 ++++
 hw/rtc/Makefile.objs         | 1 +
 hw/{timer => rtc}/twl92230.c | 0
 hw/timer/Kconfig             | 4 ----
 hw/timer/Makefile.objs       | 1 -
 6 files changed, 6 insertions(+), 6 deletions(-)
 rename hw/{timer => rtc}/twl92230.c (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index fb9a1ed075..d17058264b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -663,7 +663,7 @@ F: hw/display/blizzard.c
 F: hw/input/lm832x.c
 F: hw/input/tsc2005.c
 F: hw/misc/cbus.c
-F: hw/timer/twl92230.c
+F: hw/rtc/twl92230.c
 F: include/hw/display/blizzard.h
 F: include/hw/input/tsc2xxx.h
 F: include/hw/misc/cbus.h
diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index cc7fead764..dff9d60946 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -8,6 +8,10 @@ config M48T59
 config PL031
     bool
 
+config TWL92230
+    bool
+    depends on I2C
+
 config MC146818RTC
     bool
 
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 4621b37bc2..810a38ee7b 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -4,5 +4,6 @@ ifeq ($(CONFIG_ISA_BUS),y)
 common-obj-$(CONFIG_M48T59) += m48t59-isa.o
 endif
 common-obj-$(CONFIG_PL031) += pl031.o
+common-obj-$(CONFIG_TWL92230) += twl92230.o
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
 common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
diff --git a/hw/timer/twl92230.c b/hw/rtc/twl92230.c
similarity index 100%
rename from hw/timer/twl92230.c
rename to hw/rtc/twl92230.c
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index b04c928136..9357875f28 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -20,10 +20,6 @@ config HPET
 config I8254
     bool
 
-config TWL92230
-    bool
-    depends on I2C
-
 config ALTERA_TIMER
     bool
     select PTIMER
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 034bd30255..23be70b71d 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -7,7 +7,6 @@ common-obj-$(CONFIG_DS1338) += ds1338.o
 common-obj-$(CONFIG_HPET) += hpet.o
 common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PUV3) += puv3_ost.o
-common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XILINX) += xilinx_timer.o
 common-obj-$(CONFIG_SLAVIO) += slavio_timer.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 08/13] hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:43   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/Kconfig             | 4 ++++
 hw/rtc/Makefile.objs       | 1 +
 hw/{timer => rtc}/ds1338.c | 0
 hw/timer/Kconfig           | 4 ----
 hw/timer/Makefile.objs     | 1 -
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename hw/{timer => rtc}/ds1338.c (100%)

diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
index dff9d60946..45daa8d655 100644
--- a/hw/rtc/Kconfig
+++ b/hw/rtc/Kconfig
@@ -1,3 +1,7 @@
+config DS1338
+    bool
+    depends on I2C
+
 config M41T80
     bool
     depends on I2C
diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 810a38ee7b..b195863291 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -1,3 +1,4 @@
+common-obj-$(CONFIG_DS1338) += ds1338.o
 common-obj-$(CONFIG_M41T80) += m41t80.o
 common-obj-$(CONFIG_M48T59) += m48t59.o
 ifeq ($(CONFIG_ISA_BUS),y)
diff --git a/hw/timer/ds1338.c b/hw/rtc/ds1338.c
similarity index 100%
rename from hw/timer/ds1338.c
rename to hw/rtc/ds1338.c
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 9357875f28..a990f9fe35 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -9,10 +9,6 @@ config ARM_MPTIMER
 config A9_GTIMER
     bool
 
-config DS1338
-    bool
-    depends on I2C
-
 config HPET
     bool
     default y if PC
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 23be70b71d..70b61b69c7 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -3,7 +3,6 @@ common-obj-$(CONFIG_ARM_MPTIMER) += arm_mptimer.o
 common-obj-$(CONFIG_ARM_V7M) += armv7m_systick.o
 common-obj-$(CONFIG_A9_GTIMER) += a9gtimer.o
 common-obj-$(CONFIG_CADENCE) += cadence_ttc.o
-common-obj-$(CONFIG_DS1338) += ds1338.o
 common-obj-$(CONFIG_HPET) += hpet.o
 common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PUV3) += puv3_ost.o
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 08/13] hw: Move DS1338 " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:44   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 " Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

Move RTC devices under the hw/rtc/ subdirectory.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/Makefile.objs                        | 1 +
 hw/rtc/trace-events                         | 3 +++
 hw/{timer => rtc}/xlnx-zynqmp-rtc.c         | 2 +-
 hw/timer/Makefile.objs                      | 1 -
 hw/timer/trace-events                       | 3 ---
 include/hw/arm/xlnx-zynqmp.h                | 2 +-
 include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h | 6 +++---
 7 files changed, 9 insertions(+), 9 deletions(-)
 rename hw/{timer => rtc}/xlnx-zynqmp-rtc.c (99%)
 rename include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h (95%)

diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index b195863291..543a550a0f 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -6,5 +6,6 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
 endif
 common-obj-$(CONFIG_PL031) += pl031.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
+common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
 common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
index ac9e0e0fba..7f1945ad4c 100644
--- a/hw/rtc/trace-events
+++ b/hw/rtc/trace-events
@@ -4,6 +4,9 @@
 sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
 sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
 
+# xlnx-zynqmp-rtc.c
+xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
+
 # pl031.c
 pl031_irq_state(int level) "irq state %d"
 pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
diff --git a/hw/timer/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
similarity index 99%
rename from hw/timer/xlnx-zynqmp-rtc.c
rename to hw/rtc/xlnx-zynqmp-rtc.c
index 5692db98c2..f9f09b7296 100644
--- a/hw/timer/xlnx-zynqmp-rtc.c
+++ b/hw/rtc/xlnx-zynqmp-rtc.c
@@ -36,7 +36,7 @@
 #include "qemu/cutils.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
-#include "hw/timer/xlnx-zynqmp-rtc.h"
+#include "hw/rtc/xlnx-zynqmp-rtc.h"
 #include "migration/vmstate.h"
 
 #ifndef XLNX_ZYNQMP_RTC_ERR_DEBUG
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 70b61b69c7..294465ef47 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -14,7 +14,6 @@ common-obj-$(CONFIG_IMX) += imx_epit.o
 common-obj-$(CONFIG_IMX) += imx_gpt.o
 common-obj-$(CONFIG_LM32) += lm32_timer.o
 common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
-common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
 common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
 
 common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index ce34b967db..1459d07237 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -70,9 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
 aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
 aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
 
-# xlnx-zynqmp-rtc.c
-xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
-
 # 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"
diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
index d7483c3b42..53076fa29a 100644
--- a/include/hw/arm/xlnx-zynqmp.h
+++ b/include/hw/arm/xlnx-zynqmp.h
@@ -29,7 +29,7 @@
 #include "hw/dma/xlnx-zdma.h"
 #include "hw/display/xlnx_dp.h"
 #include "hw/intc/xlnx-zynqmp-ipi.h"
-#include "hw/timer/xlnx-zynqmp-rtc.h"
+#include "hw/rtc/xlnx-zynqmp-rtc.h"
 #include "hw/cpu/cluster.h"
 #include "target/arm/cpu.h"
 
diff --git a/include/hw/timer/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-rtc.h
similarity index 95%
rename from include/hw/timer/xlnx-zynqmp-rtc.h
rename to include/hw/rtc/xlnx-zynqmp-rtc.h
index 97e32322ed..6fa1cb2f43 100644
--- a/include/hw/timer/xlnx-zynqmp-rtc.h
+++ b/include/hw/rtc/xlnx-zynqmp-rtc.h
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2017 Xilinx Inc.
  *
- * Written-by: Alistair Francis <alistair.francis@xilinx.com>
+ * Written-by: Alistair Francis
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,8 +24,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef HW_TIMER_XLNX_ZYNQMP_RTC_H
-#define HW_TIMER_XLNX_ZYNQMP_RTC_H
+#ifndef HW_RTC_XLNX_ZYNQMP_H
+#define HW_RTC_XLNX_ZYNQMP_H
 
 #include "hw/register.h"
 #include "hw/sysbus.h"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:45   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 11/13] hw: Move Aspeed " Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

Move RTC devices under the hw/rtc/ subdirectory.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/Makefile.objs               | 1 +
 hw/{timer => rtc}/exynos4210_rtc.c | 0
 hw/timer/Makefile.objs             | 1 -
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename hw/{timer => rtc}/exynos4210_rtc.c (100%)

diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 543a550a0f..3d4763fc26 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -7,5 +7,6 @@ endif
 common-obj-$(CONFIG_PL031) += pl031.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
 common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
diff --git a/hw/timer/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c
similarity index 100%
rename from hw/timer/exynos4210_rtc.c
rename to hw/rtc/exynos4210_rtc.c
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 294465ef47..33191d74cb 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -19,7 +19,6 @@ common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
 common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
 common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
 common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
-common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
 common-obj-$(CONFIG_OMAP) += omap_gptimer.o
 common-obj-$(CONFIG_OMAP) += omap_synctimer.o
 common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 11/13] hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 17:21   ` Cédric Le Goater
  2019-09-16 21:46   ` [Qemu-devel] " Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less Philippe Mathieu-Daudé
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include Philippe Mathieu-Daudé
  12 siblings, 2 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

Move RTC devices under the hw/rtc/ subdirectory.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/Makefile.objs                   | 1 +
 hw/{timer => rtc}/aspeed_rtc.c         | 2 +-
 hw/rtc/trace-events                    | 4 ++++
 hw/timer/Makefile.objs                 | 2 +-
 hw/timer/trace-events                  | 4 ----
 include/hw/arm/aspeed_soc.h            | 2 +-
 include/hw/{timer => rtc}/aspeed_rtc.h | 3 ---
 7 files changed, 8 insertions(+), 10 deletions(-)
 rename hw/{timer => rtc}/aspeed_rtc.c (99%)
 rename include/hw/{timer => rtc}/aspeed_rtc.h (92%)

diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
index 3d4763fc26..8dc9fcd3a9 100644
--- a/hw/rtc/Makefile.objs
+++ b/hw/rtc/Makefile.objs
@@ -10,3 +10,4 @@ common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
 common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
 common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
+common-obj-$(CONFIG_ASPEED_SOC) += aspeed_rtc.o
diff --git a/hw/timer/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
similarity index 99%
rename from hw/timer/aspeed_rtc.c
rename to hw/rtc/aspeed_rtc.c
index 5313017353..3ca1183558 100644
--- a/hw/timer/aspeed_rtc.c
+++ b/hw/rtc/aspeed_rtc.c
@@ -8,7 +8,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "hw/timer/aspeed_rtc.h"
+#include "hw/rtc/aspeed_rtc.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
 #include "qemu/timer.h"
diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
index 7f1945ad4c..d6749f4616 100644
--- a/hw/rtc/trace-events
+++ b/hw/rtc/trace-events
@@ -13,3 +13,7 @@ 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"
+
+# aspeed-rtc.c
+aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
+aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 33191d74cb..83091770df 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -29,7 +29,7 @@ common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
 common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
 
 common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
-common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
+common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o
 
 common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
 common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index 1459d07237..e18b87fc96 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -66,10 +66,6 @@ cmsdk_apb_dualtimer_read(uint64_t offset, uint64_t data, unsigned size) "CMSDK A
 cmsdk_apb_dualtimer_write(uint64_t offset, uint64_t data, unsigned size) "CMSDK APB dualtimer write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
 cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
 
-# hw/timer/aspeed-rtc.c
-aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
-aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
-
 # 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"
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index ab5052b12c..5a443006ed 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -17,7 +17,7 @@
 #include "hw/misc/aspeed_sdmc.h"
 #include "hw/misc/aspeed_xdma.h"
 #include "hw/timer/aspeed_timer.h"
-#include "hw/timer/aspeed_rtc.h"
+#include "hw/rtc/aspeed_rtc.h"
 #include "hw/i2c/aspeed_i2c.h"
 #include "hw/ssi/aspeed_smc.h"
 #include "hw/watchdog/wdt_aspeed.h"
diff --git a/include/hw/timer/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
similarity index 92%
rename from include/hw/timer/aspeed_rtc.h
rename to include/hw/rtc/aspeed_rtc.h
index 15ba42912b..156c8faee3 100644
--- a/include/hw/timer/aspeed_rtc.h
+++ b/include/hw/rtc/aspeed_rtc.h
@@ -8,9 +8,6 @@
 #ifndef ASPEED_RTC_H
 #define ASPEED_RTC_H
 
-#include <stdint.h>
-
-#include "hw/irq.h"
 #include "hw/sysbus.h"
 
 typedef struct AspeedRtcState {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 11/13] hw: Move Aspeed " Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:46   ` Alistair Francis
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include Philippe Mathieu-Daudé
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

Only 2 source files require the "mc146818rtc_regs.h" header.
Instead of having it processed 12 times, by all objects
using "mc146818rtc.h", include it directly where used.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/mc146818rtc.c         | 1 +
 hw/timer/hpet.c              | 1 +
 include/hw/rtc/mc146818rtc.h | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index ced15f764f..9d4ed54f65 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -35,6 +35,7 @@
 #include "sysemu/reset.h"
 #include "sysemu/runstate.h"
 #include "hw/rtc/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc-target.h"
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 02bf8a8ce8..9f17aaa278 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -34,6 +34,7 @@
 #include "hw/timer/hpet.h"
 #include "hw/sysbus.h"
 #include "hw/rtc/mc146818rtc.h"
+#include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "hw/timer/i8254.h"
 
diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
index 888e04f9ab..09e273a2a1 100644
--- a/include/hw/rtc/mc146818rtc.h
+++ b/include/hw/rtc/mc146818rtc.h
@@ -26,7 +26,6 @@
 #define MC146818RTC_H
 
 #include "hw/isa/isa.h"
-#include "hw/rtc/mc146818rtc_regs.h"
 
 #define TYPE_MC146818_RTC "mc146818rtc"
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include
  2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less Philippe Mathieu-Daudé
@ 2019-09-16 15:48 ` Philippe Mathieu-Daudé
  2019-09-16 21:47   ` Alistair Francis
  12 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 15:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

The "hw/ptimer.h" header is not used, remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/xlnx-zynqmp-rtc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/rtc/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
index f9f09b7296..2bcd14d779 100644
--- a/hw/rtc/xlnx-zynqmp-rtc.c
+++ b/hw/rtc/xlnx-zynqmp-rtc.c
@@ -32,7 +32,6 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/irq.h"
-#include "hw/ptimer.h"
 #include "qemu/cutils.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 11/13] hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 11/13] hw: Move Aspeed " Philippe Mathieu-Daudé
@ 2019-09-16 17:21   ` Cédric Le Goater
  2019-10-03 10:55     ` Philippe Mathieu-Daudé
  2019-09-16 21:46   ` [Qemu-devel] " Alistair Francis
  1 sibling, 1 reply; 41+ messages in thread
From: Cédric Le Goater @ 2019-09-16 17:21 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Paolo Bonzini, Richard Henderson,
	Andrew Jeffery, qemu-ppc, Aleksandar Markovic, Igor Mammedov,
	Aurelien Jarno

On 16/09/2019 17:48, Philippe Mathieu-Daudé wrote:
> Move RTC devices under the hw/rtc/ subdirectory.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

I suppose the removal of the header files in "aspeed_rtc.h" is OK.  

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>  hw/rtc/Makefile.objs                   | 1 +
>  hw/{timer => rtc}/aspeed_rtc.c         | 2 +-
>  hw/rtc/trace-events                    | 4 ++++
>  hw/timer/Makefile.objs                 | 2 +-
>  hw/timer/trace-events                  | 4 ----
>  include/hw/arm/aspeed_soc.h            | 2 +-
>  include/hw/{timer => rtc}/aspeed_rtc.h | 3 ---
>  7 files changed, 8 insertions(+), 10 deletions(-)
>  rename hw/{timer => rtc}/aspeed_rtc.c (99%)
>  rename include/hw/{timer => rtc}/aspeed_rtc.h (92%)
> 
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3d4763fc26..8dc9fcd3a9 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -10,3 +10,4 @@ common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> +common-obj-$(CONFIG_ASPEED_SOC) += aspeed_rtc.o
> diff --git a/hw/timer/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
> similarity index 99%
> rename from hw/timer/aspeed_rtc.c
> rename to hw/rtc/aspeed_rtc.c
> index 5313017353..3ca1183558 100644
> --- a/hw/timer/aspeed_rtc.c
> +++ b/hw/rtc/aspeed_rtc.c
> @@ -8,7 +8,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> -#include "hw/timer/aspeed_rtc.h"
> +#include "hw/rtc/aspeed_rtc.h"
>  #include "migration/vmstate.h"
>  #include "qemu/log.h"
>  #include "qemu/timer.h"
> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
> index 7f1945ad4c..d6749f4616 100644
> --- a/hw/rtc/trace-events
> +++ b/hw/rtc/trace-events
> @@ -13,3 +13,7 @@ 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"
> +
> +# aspeed-rtc.c
> +aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> +aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 33191d74cb..83091770df 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -29,7 +29,7 @@ common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>  common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>  
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
> -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
> +common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o
>  
>  common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
>  common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
> index 1459d07237..e18b87fc96 100644
> --- a/hw/timer/trace-events
> +++ b/hw/timer/trace-events
> @@ -66,10 +66,6 @@ cmsdk_apb_dualtimer_read(uint64_t offset, uint64_t data, unsigned size) "CMSDK A
>  cmsdk_apb_dualtimer_write(uint64_t offset, uint64_t data, unsigned size) "CMSDK APB dualtimer write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
>  cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
>  
> -# hw/timer/aspeed-rtc.c
> -aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> -aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> -
>  # 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"
> diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
> index ab5052b12c..5a443006ed 100644
> --- a/include/hw/arm/aspeed_soc.h
> +++ b/include/hw/arm/aspeed_soc.h
> @@ -17,7 +17,7 @@
>  #include "hw/misc/aspeed_sdmc.h"
>  #include "hw/misc/aspeed_xdma.h"
>  #include "hw/timer/aspeed_timer.h"
> -#include "hw/timer/aspeed_rtc.h"
> +#include "hw/rtc/aspeed_rtc.h"
>  #include "hw/i2c/aspeed_i2c.h"
>  #include "hw/ssi/aspeed_smc.h"
>  #include "hw/watchdog/wdt_aspeed.h"
> diff --git a/include/hw/timer/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
> similarity index 92%
> rename from include/hw/timer/aspeed_rtc.h
> rename to include/hw/rtc/aspeed_rtc.h
> index 15ba42912b..156c8faee3 100644
> --- a/include/hw/timer/aspeed_rtc.h
> +++ b/include/hw/rtc/aspeed_rtc.h
> @@ -8,9 +8,6 @@
>  #ifndef ASPEED_RTC_H
>  #define ASPEED_RTC_H
>  
> -#include <stdint.h>
> -
> -#include "hw/irq.h"
>  #include "hw/sysbus.h"
>  
>  typedef struct AspeedRtcState {
> 



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
@ 2019-09-16 17:28   ` Alistair Francis
  2019-09-17  4:57   ` Thomas Huth
  1 sibling, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 17:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:02 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> All these devices do not contain any target-specific. While most
> of them are arch-specific, they are shared between different
> targets of the same arch family (ARM and AArch64, MIPS32/MIPS64,
> endianess, ...).
> Put them into common-obj-y to compile them once for all targets.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/timer/Makefile.objs | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 123d92c969..f407523aa4 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -25,20 +25,20 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
>  common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
>
> -obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
> -obj-$(CONFIG_OMAP) += omap_gptimer.o
> -obj-$(CONFIG_OMAP) += omap_synctimer.o
> -obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
> -obj-$(CONFIG_SH4) += sh_timer.o
> -obj-$(CONFIG_DIGIC) += digic-timer.o
> -obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
> +common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
> +common-obj-$(CONFIG_OMAP) += omap_gptimer.o
> +common-obj-$(CONFIG_OMAP) += omap_synctimer.o
> +common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
> +common-obj-$(CONFIG_SH4) += sh_timer.o
> +common-obj-$(CONFIG_DIGIC) += digic-timer.o
> +common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>
> -obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
> +common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
>  common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory Philippe Mathieu-Daudé
@ 2019-09-16 18:12   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 18:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:06 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The PL031 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  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 f0e30b5248..5562d2c6d0 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 6a143dcd57..1bcde315f7 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
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
@ 2019-09-16 21:22   ` Alistair Francis
  2019-09-17  2:23   ` David Gibson
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:22 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:31 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The MC146818 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  MAINTAINERS                                  |  4 +--
>  hw/alpha/dp264.c                             |  2 +-
>  hw/hppa/machine.c                            |  2 +-
>  hw/i386/acpi-build.c                         |  2 +-
>  hw/i386/pc.c                                 |  2 +-
>  hw/i386/pc_q35.c                             |  2 +-
>  hw/mips/mips_fulong2e.c                      |  2 +-
>  hw/mips/mips_jazz.c                          |  2 +-
>  hw/mips/mips_malta.c                         |  2 +-
>  hw/mips/mips_r4k.c                           |  2 +-
>  hw/ppc/pnv.c                                 |  2 +-
>  hw/ppc/prep.c                                |  2 +-
>  hw/rtc/Kconfig                               |  3 ++
>  hw/rtc/Makefile.objs                         |  1 +
>  hw/{timer => rtc}/mc146818rtc.c              |  2 +-
>  hw/timer/Kconfig                             |  3 --
>  hw/timer/Makefile.objs                       |  2 --
>  hw/timer/hpet.c                              |  2 +-
>  include/hw/rtc/mc146818rtc.h                 | 38 ++++++++++++++++++++
>  include/hw/{timer => rtc}/mc146818rtc_regs.h |  1 +
>  include/hw/timer/mc146818rtc.h               | 14 --------
>  tests/rtc-test.c                             |  2 +-
>  22 files changed, 59 insertions(+), 35 deletions(-)
>  rename hw/{timer => rtc}/mc146818rtc.c (99%)
>  create mode 100644 include/hw/rtc/mc146818rtc.h
>  rename include/hw/{timer => rtc}/mc146818rtc_regs.h (98%)
>  delete mode 100644 include/hw/timer/mc146818rtc.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5562d2c6d0..481f2318cb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1263,7 +1263,7 @@ F: hw/misc/debugexit.c
>  F: hw/misc/pc-testdev.c
>  F: hw/timer/hpet*
>  F: hw/timer/i8254*
> -F: hw/timer/mc146818rtc*
> +F: hw/rtc/mc146818rtc*
>  F: hw/watchdog/wdt_ib700.c
>  F: hw/watchdog/wdt_i6300esb.c
>  F: include/hw/display/vga.h
> @@ -1275,7 +1275,7 @@ F: include/hw/isa/i8259_internal.h
>  F: include/hw/isa/superio.h
>  F: include/hw/timer/hpet.h
>  F: include/hw/timer/i8254*
> -F: include/hw/timer/mc146818rtc*
> +F: include/hw/rtc/mc146818rtc*
>
>  Machine core
>  M: Eduardo Habkost <ehabkost@redhat.com>
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 51feee8558..51b3cf7a61 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -14,7 +14,7 @@
>  #include "alpha_sys.h"
>  #include "qemu/error-report.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/isa/superio.h"
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index 2736ce835e..6598e2469d 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -12,7 +12,7 @@
>  #include "qemu/error-report.h"
>  #include "sysemu/reset.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/char/serial.h"
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index e54e571a75..44a8073507 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -45,7 +45,7 @@
>  #include "hw/acpi/vmgenid.h"
>  #include "hw/boards.h"
>  #include "sysemu/tpm_backend.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>  #include "migration/vmstate.h"
>  #include "hw/mem/memory-device.h"
>  #include "sysemu/numa.h"
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index bad866fe44..beef7a992d 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -42,7 +42,7 @@
>  #include "elf.h"
>  #include "migration/vmstate.h"
>  #include "multiboot.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/dma/i8257.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/input/i8042.h"
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index d4e8a1cb9f..a976af9a2a 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -33,7 +33,7 @@
>  #include "hw/loader.h"
>  #include "sysemu/arch_init.h"
>  #include "hw/i2c/smbus_eeprom.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/xen/xen.h"
>  #include "sysemu/kvm.h"
>  #include "kvm_i386.h"
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index cf537dd7e6..03a27e1767 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -39,7 +39,7 @@
>  #include "hw/ide.h"
>  #include "elf.h"
>  #include "hw/isa/vt82c686.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/qtest.h"
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index c967b97d80..2811a4bd90 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -39,7 +39,7 @@
>  #include "hw/scsi/esp.h"
>  #include "hw/mips/bios.h"
>  #include "hw/loader.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/display/vga.h"
>  #include "hw/audio/pcspk.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 4d9c64b36a..c1c8810e71 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -45,7 +45,7 @@
>  #include "hw/irq.h"
>  #include "hw/loader.h"
>  #include "elf.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
>  #include "hw/sysbus.h"             /* SysBusDevice */
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index bc0be26544..70024235ae 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -28,7 +28,7 @@
>  #include "hw/ide.h"
>  #include "hw/loader.h"
>  #include "elf.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 3f08db7b9e..4b2649d95b 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -48,7 +48,7 @@
>  #include "hw/isa/isa.h"
>  #include "hw/boards.h"
>  #include "hw/char/serial.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>
>  #include <libfdt.h>
>
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 4f3c6bf190..3a51536e1a 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -40,7 +40,7 @@
>  #include "hw/ide.h"
>  #include "hw/irq.h"
>  #include "hw/loader.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/isa/pc87312.h"
>  #include "hw/net/ne2000-isa.h"
>  #include "sysemu/arch_init.h"
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 8a4383bca9..7ffd702268 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,2 +1,5 @@
>  config PL031
>      bool
> +
> +config MC146818RTC
> +    bool
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3e1eb42563..3cac0d5a63 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1 +1,2 @@
>  common-obj-$(CONFIG_PL031) += pl031.o
> +obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> diff --git a/hw/timer/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> similarity index 99%
> rename from hw/timer/mc146818rtc.c
> rename to hw/rtc/mc146818rtc.c
> index 6cb378751b..ced15f764f 100644
> --- a/hw/timer/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -34,7 +34,7 @@
>  #include "sysemu/replay.h"
>  #include "sysemu/reset.h"
>  #include "sysemu/runstate.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
>  #include "qapi/qapi-commands-misc-target.h"
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index 27c5dce09e..af415c8ef8 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -35,9 +35,6 @@ config ALTERA_TIMER
>      bool
>      select PTIMER
>
> -config MC146818RTC
> -    bool
> -
>  config ALLWINNER_A10_PIT
>      bool
>      select PTIMER
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 9f64f6e11e..b0159189cf 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -35,8 +35,6 @@ common-obj-$(CONFIG_SH4) += sh_timer.o
>  common-obj-$(CONFIG_DIGIC) += digic-timer.o
>  common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>
> -obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> -
>  common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
> diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
> index 1ddae4e7d7..02bf8a8ce8 100644
> --- a/hw/timer/hpet.c
> +++ b/hw/timer/hpet.c
> @@ -33,7 +33,7 @@
>  #include "qemu/timer.h"
>  #include "hw/timer/hpet.h"
>  #include "hw/sysbus.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "migration/vmstate.h"
>  #include "hw/timer/i8254.h"
>
> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
> new file mode 100644
> index 0000000000..888e04f9ab
> --- /dev/null
> +++ b/include/hw/rtc/mc146818rtc.h
> @@ -0,0 +1,38 @@
> +/*
> + * QEMU MC146818 RTC emulation
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */
> +
> +#ifndef MC146818RTC_H
> +#define MC146818RTC_H
> +
> +#include "hw/isa/isa.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
> +
> +#define TYPE_MC146818_RTC "mc146818rtc"
> +
> +ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
> +                             qemu_irq intercept_irq);
> +void rtc_set_memory(ISADevice *dev, int addr, int val);
> +int rtc_get_memory(ISADevice *dev, int addr);
> +
> +#endif /* MC146818RTC_H */
> diff --git a/include/hw/timer/mc146818rtc_regs.h b/include/hw/rtc/mc146818rtc_regs.h
> similarity index 98%
> rename from include/hw/timer/mc146818rtc_regs.h
> rename to include/hw/rtc/mc146818rtc_regs.h
> index bfbb57e570..c4c6305473 100644
> --- a/include/hw/timer/mc146818rtc_regs.h
> +++ b/include/hw/rtc/mc146818rtc_regs.h
> @@ -26,6 +26,7 @@
>  #define MC146818RTC_REGS_H
>
>  #include "qemu/timer.h"
> +#include "qemu/host-utils.h"
>
>  #define RTC_ISA_IRQ 8
>
> diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
> deleted file mode 100644
> index fe6ed63f71..0000000000
> --- a/include/hw/timer/mc146818rtc.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -#ifndef MC146818RTC_H
> -#define MC146818RTC_H
> -
> -#include "hw/isa/isa.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> -
> -#define TYPE_MC146818_RTC "mc146818rtc"
> -
> -ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
> -                             qemu_irq intercept_irq);
> -void rtc_set_memory(ISADevice *dev, int addr, int val);
> -int rtc_get_memory(ISADevice *dev, int addr);
> -
> -#endif /* MC146818RTC_H */
> diff --git a/tests/rtc-test.c b/tests/rtc-test.c
> index 6309b0ef6c..79a4ff1ed6 100644
> --- a/tests/rtc-test.c
> +++ b/tests/rtc-test.c
> @@ -15,7 +15,7 @@
>
>  #include "libqtest-single.h"
>  #include "qemu/timer.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>
>  #define UIP_HOLD_LENGTH           (8 * NANOSECONDS_PER_SECOND / 32768)
>
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 04/13] hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 04/13] hw: Move M48T59 " Philippe Mathieu-Daudé
@ 2019-09-16 21:23   ` Alistair Francis
  2019-09-17  2:25   ` David Gibson
  1 sibling, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:26 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The M48T59 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  MAINTAINERS                         |  4 +-
>  hw/ppc/ppc405_boards.c              |  2 +-
>  hw/ppc/prep.c                       |  2 +-
>  hw/rtc/Kconfig                      |  3 ++
>  hw/rtc/Makefile.objs                |  4 ++
>  hw/{timer => rtc}/m48t59-internal.h |  0
>  hw/{timer => rtc}/m48t59-isa.c      |  4 +-
>  hw/{timer => rtc}/m48t59.c          |  2 +-
>  hw/sparc/sun4m.c                    |  2 +-
>  hw/sparc64/sun4u.c                  |  2 +-
>  hw/timer/Kconfig                    |  3 --
>  hw/timer/Makefile.objs              |  4 --
>  include/hw/rtc/m48t59.h             | 57 +++++++++++++++++++++++++++++
>  13 files changed, 73 insertions(+), 16 deletions(-)
>  rename hw/{timer => rtc}/m48t59-internal.h (100%)
>  rename hw/{timer => rtc}/m48t59-isa.c (98%)
>  rename hw/{timer => rtc}/m48t59.c (99%)
>  create mode 100644 include/hw/rtc/m48t59.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 481f2318cb..679b026fe0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1064,9 +1064,9 @@ F: hw/pci-host/prep.[hc]
>  F: hw/isa/i82378.c
>  F: hw/isa/pc87312.c
>  F: hw/dma/i82374.c
> -F: hw/timer/m48t59-isa.c
> +F: hw/rtc/m48t59-isa.c
>  F: include/hw/isa/pc87312.h
> -F: include/hw/timer/m48t59.h
> +F: include/hw/rtc/m48t59.h
>  F: pc-bios/ppc_rom.bin
>
>  sPAPR
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 388cae0b43..1f721feed6 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -29,7 +29,7 @@
>  #include "cpu.h"
>  #include "hw/ppc/ppc.h"
>  #include "ppc405.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "hw/block/flash.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/qtest.h"
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 3a51536e1a..862345c2ac 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -25,7 +25,7 @@
>
>  #include "qemu/osdep.h"
>  #include "cpu.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "hw/char/serial.h"
>  #include "hw/block/fdc.h"
>  #include "net/net.h"
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 7ffd702268..159c233517 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,3 +1,6 @@
> +config M48T59
> +    bool
> +
>  config PL031
>      bool
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3cac0d5a63..c87f81405e 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1,2 +1,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
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> diff --git a/hw/timer/m48t59-internal.h b/hw/rtc/m48t59-internal.h
> similarity index 100%
> rename from hw/timer/m48t59-internal.h
> rename to hw/rtc/m48t59-internal.h
> diff --git a/hw/timer/m48t59-isa.c b/hw/rtc/m48t59-isa.c
> similarity index 98%
> rename from hw/timer/m48t59-isa.c
> rename to hw/rtc/m48t59-isa.c
> index 5e5432abfd..7fde854c0f 100644
> --- a/hw/timer/m48t59-isa.c
> +++ b/hw/rtc/m48t59-isa.c
> @@ -1,5 +1,5 @@
>  /*
> - * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface
> + * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface)
>   *
>   * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
>   * Copyright (c) 2013 Hervé Poussineau
> @@ -26,7 +26,7 @@
>  #include "qemu/osdep.h"
>  #include "hw/isa/isa.h"
>  #include "hw/qdev-properties.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "m48t59-internal.h"
>  #include "qemu/module.h"
>
> diff --git a/hw/timer/m48t59.c b/hw/rtc/m48t59.c
> similarity index 99%
> rename from hw/timer/m48t59.c
> rename to hw/rtc/m48t59.c
> index a9fc2f981a..fc592b9fb1 100644
> --- a/hw/timer/m48t59.c
> +++ b/hw/rtc/m48t59.c
> @@ -27,7 +27,7 @@
>  #include "qemu-common.h"
>  #include "hw/irq.h"
>  #include "hw/qdev-properties.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "qemu/timer.h"
>  #include "sysemu/runstate.h"
>  #include "sysemu/sysemu.h"
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 6c5a17a020..2aaa5bf1ae 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -31,7 +31,7 @@
>  #include "qemu/error-report.h"
>  #include "qemu/timer.h"
>  #include "hw/sparc/sun4m_iommu.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "migration/vmstate.h"
>  #include "hw/sparc/sparc32_dma.h"
>  #include "hw/block/fdc.h"
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index 1ded2a4c9a..955082773b 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -36,7 +36,7 @@
>  #include "hw/pci-host/sabre.h"
>  #include "hw/char/serial.h"
>  #include "hw/char/parallel.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "migration/vmstate.h"
>  #include "hw/input/i8042.h"
>  #include "hw/block/fdc.h"
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index af415c8ef8..a57e9b59fc 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -24,9 +24,6 @@ config M41T80
>      bool
>      depends on I2C
>
> -config M48T59
> -    bool
> -
>  config TWL92230
>      bool
>      depends on I2C
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index b0159189cf..fe2d1fbc40 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -7,10 +7,6 @@ common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_HPET) += hpet.o
>  common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
>  common-obj-$(CONFIG_M41T80) += m41t80.o
> -common-obj-$(CONFIG_M48T59) += m48t59.o
> -ifeq ($(CONFIG_ISA_BUS),y)
> -common-obj-$(CONFIG_M48T59) += m48t59-isa.o
> -endif
>  common-obj-$(CONFIG_PUV3) += puv3_ost.o
>  common-obj-$(CONFIG_TWL92230) += twl92230.o
>  common-obj-$(CONFIG_XILINX) += xilinx_timer.o
> diff --git a/include/hw/rtc/m48t59.h b/include/hw/rtc/m48t59.h
> new file mode 100644
> index 0000000000..e7ea4e8761
> --- /dev/null
> +++ b/include/hw/rtc/m48t59.h
> @@ -0,0 +1,57 @@
> +/*
> + * QEMU M48T59 and M48T08 NVRAM emulation
> + *
> + * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
> + * Copyright (c) 2013 Hervé Poussineau
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */
> +
> +#ifndef HW_RTC_M48T59_H
> +#define HW_RTC_M48T59_H
> +
> +#include "exec/hwaddr.h"
> +#include "qom/object.h"
> +
> +#define TYPE_NVRAM "nvram"
> +
> +#define NVRAM_CLASS(klass) \
> +    OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM)
> +#define NVRAM_GET_CLASS(obj) \
> +    OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM)
> +#define NVRAM(obj) \
> +    INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM)
> +
> +typedef struct Nvram Nvram;
> +
> +typedef struct NvramClass {
> +    InterfaceClass parent;
> +
> +    uint32_t (*read)(Nvram *obj, uint32_t addr);
> +    void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
> +    void (*toggle_lock)(Nvram *obj, int lock);
> +} NvramClass;
> +
> +Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
> +                       int base_year, int type);
> +Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
> +                   uint32_t io_base, uint16_t size, int base_year,
> +                   int type);
> +
> +#endif /* HW_M48T59_H */
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 05/13] hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 05/13] hw: Move M41T80 " Philippe Mathieu-Daudé
@ 2019-09-16 21:26   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:35 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The M41T80 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  MAINTAINERS                | 2 +-
>  hw/rtc/Kconfig             | 4 ++++
>  hw/rtc/Makefile.objs       | 1 +
>  hw/{timer => rtc}/m41t80.c | 0
>  hw/timer/Kconfig           | 4 ----
>  hw/timer/Makefile.objs     | 1 -
>  6 files changed, 6 insertions(+), 6 deletions(-)
>  rename hw/{timer => rtc}/m41t80.c (100%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 679b026fe0..fd68b2383a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1113,7 +1113,7 @@ F: hw/ppc/sam460ex.c
>  F: hw/ppc/ppc440_pcix.c
>  F: hw/display/sm501*
>  F: hw/ide/sii3112.c
> -F: hw/timer/m41t80.c
> +F: hw/rtc/m41t80.c
>  F: pc-bios/canyonlands.dt[sb]
>  F: pc-bios/u-boot-sam460ex-20100605.bin
>  F: roms/u-boot-sam460ex
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 159c233517..434b20b2b1 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,3 +1,7 @@
> +config M41T80
> +    bool
> +    depends on I2C
> +
>  config M48T59
>      bool
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index c87f81405e..89e8e48c64 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1,3 +1,4 @@
> +common-obj-$(CONFIG_M41T80) += m41t80.o
>  common-obj-$(CONFIG_M48T59) += m48t59.o
>  ifeq ($(CONFIG_ISA_BUS),y)
>  common-obj-$(CONFIG_M48T59) += m48t59-isa.o
> diff --git a/hw/timer/m41t80.c b/hw/rtc/m41t80.c
> similarity index 100%
> rename from hw/timer/m41t80.c
> rename to hw/rtc/m41t80.c
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index a57e9b59fc..a6b668b255 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -20,10 +20,6 @@ config HPET
>  config I8254
>      bool
>
> -config M41T80
> -    bool
> -    depends on I2C
> -
>  config TWL92230
>      bool
>      depends on I2C
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index fe2d1fbc40..2fb12162a6 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -6,7 +6,6 @@ common-obj-$(CONFIG_CADENCE) += cadence_ttc.o
>  common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_HPET) += hpet.o
>  common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
> -common-obj-$(CONFIG_M41T80) += m41t80.o
>  common-obj-$(CONFIG_PUV3) += puv3_ost.o
>  common-obj-$(CONFIG_TWL92230) += twl92230.o
>  common-obj-$(CONFIG_XILINX) += xilinx_timer.o
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC " Philippe Mathieu-Daudé
@ 2019-09-16 21:27   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:30 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Move RTC devices under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  MAINTAINERS                   |  4 ++--
>  hw/rtc/Kconfig                |  3 +++
>  hw/rtc/Makefile.objs          |  1 +
>  hw/{timer => rtc}/sun4v-rtc.c |  2 +-
>  hw/rtc/trace-events           |  4 ++++
>  hw/sparc64/niagara.c          |  2 +-
>  hw/timer/Kconfig              |  3 ---
>  hw/timer/Makefile.objs        |  1 -
>  hw/timer/trace-events         |  4 ----
>  include/hw/rtc/sun4v-rtc.h    | 19 +++++++++++++++++++
>  include/hw/timer/sun4v-rtc.h  |  1 -
>  11 files changed, 31 insertions(+), 13 deletions(-)
>  rename hw/{timer => rtc}/sun4v-rtc.c (98%)
>  create mode 100644 include/hw/rtc/sun4v-rtc.h
>  delete mode 100644 include/hw/timer/sun4v-rtc.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fd68b2383a..fb9a1ed075 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1165,8 +1165,8 @@ Sun4v
>  M: Artyom Tarasenko <atar4qemu@gmail.com>
>  S: Maintained
>  F: hw/sparc64/niagara.c
> -F: hw/timer/sun4v-rtc.c
> -F: include/hw/timer/sun4v-rtc.h
> +F: hw/rtc/sun4v-rtc.c
> +F: include/hw/rtc/sun4v-rtc.h
>
>  Leon3
>  M: Fabien Chouteau <chouteau@adacore.com>
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 434b20b2b1..cc7fead764 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -10,3 +10,6 @@ config PL031
>
>  config MC146818RTC
>      bool
> +
> +config SUN4V_RTC
> +    bool
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 89e8e48c64..4621b37bc2 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -5,3 +5,4 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
>  endif
>  common-obj-$(CONFIG_PL031) += pl031.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> +common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> diff --git a/hw/timer/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c
> similarity index 98%
> rename from hw/timer/sun4v-rtc.c
> rename to hw/rtc/sun4v-rtc.c
> index 54272a822f..ada01b5774 100644
> --- a/hw/timer/sun4v-rtc.c
> +++ b/hw/rtc/sun4v-rtc.c
> @@ -13,7 +13,7 @@
>  #include "hw/sysbus.h"
>  #include "qemu/module.h"
>  #include "qemu/timer.h"
> -#include "hw/timer/sun4v-rtc.h"
> +#include "hw/rtc/sun4v-rtc.h"
>  #include "trace.h"
>
>
> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
> index 54c94ac557..ac9e0e0fba 100644
> --- a/hw/rtc/trace-events
> +++ b/hw/rtc/trace-events
> @@ -1,5 +1,9 @@
>  # See docs/devel/tracing.txt for syntax documentation.
>
> +# sun4v-rtc.c
> +sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
> +sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
> +
>  # pl031.c
>  pl031_irq_state(int level) "irq state %d"
>  pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
> diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
> index 167143bffe..dfa0817eae 100644
> --- a/hw/sparc64/niagara.c
> +++ b/hw/sparc64/niagara.c
> @@ -30,7 +30,7 @@
>  #include "hw/misc/unimp.h"
>  #include "hw/loader.h"
>  #include "hw/sparc/sparc64.h"
> -#include "hw/timer/sun4v-rtc.h"
> +#include "hw/rtc/sun4v-rtc.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/block-backend.h"
>  #include "qemu/error-report.h"
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index a6b668b255..b04c928136 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -35,9 +35,6 @@ config ALLWINNER_A10_PIT
>  config STM32F2XX_TIMER
>      bool
>
> -config SUN4V_RTC
> -    bool
> -
>  config CMSDK_APB_TIMER
>      bool
>      select PTIMER
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 2fb12162a6..034bd30255 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -35,7 +35,6 @@ common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
>  common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
>
> -common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
>  common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
>  common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
>  common-obj-$(CONFIG_MSF2) += mss-timer.o
> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
> index 6936fe8573..ce34b967db 100644
> --- a/hw/timer/trace-events
> +++ b/hw/timer/trace-events
> @@ -70,10 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
>  aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>  aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>
> -# sun4v-rtc.c
> -sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
> -sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
> -
>  # xlnx-zynqmp-rtc.c
>  xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
>
> diff --git a/include/hw/rtc/sun4v-rtc.h b/include/hw/rtc/sun4v-rtc.h
> new file mode 100644
> index 0000000000..fd868f6ed2
> --- /dev/null
> +++ b/include/hw/rtc/sun4v-rtc.h
> @@ -0,0 +1,19 @@
> +/*
> + * QEMU sun4v Real Time Clock device
> + *
> + * The sun4v_rtc device (sun4v tod clock)
> + *
> + * Copyright (c) 2016 Artyom Tarasenko
> + *
> + * This code is licensed under the GNU GPL v3 or (at your option) any later
> + * version.
> + */
> +
> +#ifndef HW_RTC_SUN4V
> +#define HW_RTC_SUN4V
> +
> +#include "exec/hwaddr.h"
> +
> +void sun4v_rtc_init(hwaddr addr);
> +
> +#endif
> diff --git a/include/hw/timer/sun4v-rtc.h b/include/hw/timer/sun4v-rtc.h
> deleted file mode 100644
> index 407278f918..0000000000
> --- a/include/hw/timer/sun4v-rtc.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -void sun4v_rtc_init(hwaddr addr);
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device " Philippe Mathieu-Daudé
@ 2019-09-16 21:39   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:37 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The TWL92230 is an "energy management device" companion with
> a RTC. Since we mostly model the RTC, move it under the hw/rtc/
> subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  MAINTAINERS                  | 2 +-
>  hw/rtc/Kconfig               | 4 ++++
>  hw/rtc/Makefile.objs         | 1 +
>  hw/{timer => rtc}/twl92230.c | 0
>  hw/timer/Kconfig             | 4 ----
>  hw/timer/Makefile.objs       | 1 -
>  6 files changed, 6 insertions(+), 6 deletions(-)
>  rename hw/{timer => rtc}/twl92230.c (100%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fb9a1ed075..d17058264b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -663,7 +663,7 @@ F: hw/display/blizzard.c
>  F: hw/input/lm832x.c
>  F: hw/input/tsc2005.c
>  F: hw/misc/cbus.c
> -F: hw/timer/twl92230.c
> +F: hw/rtc/twl92230.c
>  F: include/hw/display/blizzard.h
>  F: include/hw/input/tsc2xxx.h
>  F: include/hw/misc/cbus.h
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index cc7fead764..dff9d60946 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -8,6 +8,10 @@ config M48T59
>  config PL031
>      bool
>
> +config TWL92230
> +    bool
> +    depends on I2C
> +
>  config MC146818RTC
>      bool
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 4621b37bc2..810a38ee7b 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -4,5 +4,6 @@ ifeq ($(CONFIG_ISA_BUS),y)
>  common-obj-$(CONFIG_M48T59) += m48t59-isa.o
>  endif
>  common-obj-$(CONFIG_PL031) += pl031.o
> +common-obj-$(CONFIG_TWL92230) += twl92230.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> diff --git a/hw/timer/twl92230.c b/hw/rtc/twl92230.c
> similarity index 100%
> rename from hw/timer/twl92230.c
> rename to hw/rtc/twl92230.c
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index b04c928136..9357875f28 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -20,10 +20,6 @@ config HPET
>  config I8254
>      bool
>
> -config TWL92230
> -    bool
> -    depends on I2C
> -
>  config ALTERA_TIMER
>      bool
>      select PTIMER
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 034bd30255..23be70b71d 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -7,7 +7,6 @@ common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_HPET) += hpet.o
>  common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
>  common-obj-$(CONFIG_PUV3) += puv3_ost.o
> -common-obj-$(CONFIG_TWL92230) += twl92230.o
>  common-obj-$(CONFIG_XILINX) += xilinx_timer.o
>  common-obj-$(CONFIG_SLAVIO) += slavio_timer.o
>  common-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 08/13] hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 08/13] hw: Move DS1338 " Philippe Mathieu-Daudé
@ 2019-09-16 21:43   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:39 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The DS1338 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/rtc/Kconfig             | 4 ++++
>  hw/rtc/Makefile.objs       | 1 +
>  hw/{timer => rtc}/ds1338.c | 0
>  hw/timer/Kconfig           | 4 ----
>  hw/timer/Makefile.objs     | 1 -
>  5 files changed, 5 insertions(+), 5 deletions(-)
>  rename hw/{timer => rtc}/ds1338.c (100%)
>
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index dff9d60946..45daa8d655 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,3 +1,7 @@
> +config DS1338
> +    bool
> +    depends on I2C
> +
>  config M41T80
>      bool
>      depends on I2C
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 810a38ee7b..b195863291 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1,3 +1,4 @@
> +common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_M41T80) += m41t80.o
>  common-obj-$(CONFIG_M48T59) += m48t59.o
>  ifeq ($(CONFIG_ISA_BUS),y)
> diff --git a/hw/timer/ds1338.c b/hw/rtc/ds1338.c
> similarity index 100%
> rename from hw/timer/ds1338.c
> rename to hw/rtc/ds1338.c
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index 9357875f28..a990f9fe35 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -9,10 +9,6 @@ config ARM_MPTIMER
>  config A9_GTIMER
>      bool
>
> -config DS1338
> -    bool
> -    depends on I2C
> -
>  config HPET
>      bool
>      default y if PC
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 23be70b71d..70b61b69c7 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -3,7 +3,6 @@ common-obj-$(CONFIG_ARM_MPTIMER) += arm_mptimer.o
>  common-obj-$(CONFIG_ARM_V7M) += armv7m_systick.o
>  common-obj-$(CONFIG_A9_GTIMER) += a9gtimer.o
>  common-obj-$(CONFIG_CADENCE) += cadence_ttc.o
> -common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_HPET) += hpet.o
>  common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
>  common-obj-$(CONFIG_PUV3) += puv3_ost.o
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC " Philippe Mathieu-Daudé
@ 2019-09-16 21:44   ` Alistair Francis
  2019-09-17 10:28     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 8:56 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Move RTC devices under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/rtc/Makefile.objs                        | 1 +
>  hw/rtc/trace-events                         | 3 +++
>  hw/{timer => rtc}/xlnx-zynqmp-rtc.c         | 2 +-
>  hw/timer/Makefile.objs                      | 1 -
>  hw/timer/trace-events                       | 3 ---
>  include/hw/arm/xlnx-zynqmp.h                | 2 +-
>  include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h | 6 +++---
>  7 files changed, 9 insertions(+), 9 deletions(-)
>  rename hw/{timer => rtc}/xlnx-zynqmp-rtc.c (99%)
>  rename include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h (95%)
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index b195863291..543a550a0f 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -6,5 +6,6 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
>  endif
>  common-obj-$(CONFIG_PL031) += pl031.o
>  common-obj-$(CONFIG_TWL92230) += twl92230.o
> +common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
> index ac9e0e0fba..7f1945ad4c 100644
> --- a/hw/rtc/trace-events
> +++ b/hw/rtc/trace-events
> @@ -4,6 +4,9 @@
>  sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
>  sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
>
> +# xlnx-zynqmp-rtc.c
> +xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
> +
>  # pl031.c
>  pl031_irq_state(int level) "irq state %d"
>  pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
> diff --git a/hw/timer/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
> similarity index 99%
> rename from hw/timer/xlnx-zynqmp-rtc.c
> rename to hw/rtc/xlnx-zynqmp-rtc.c
> index 5692db98c2..f9f09b7296 100644
> --- a/hw/timer/xlnx-zynqmp-rtc.c
> +++ b/hw/rtc/xlnx-zynqmp-rtc.c
> @@ -36,7 +36,7 @@
>  #include "qemu/cutils.h"
>  #include "sysemu/sysemu.h"
>  #include "trace.h"
> -#include "hw/timer/xlnx-zynqmp-rtc.h"
> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
>  #include "migration/vmstate.h"
>
>  #ifndef XLNX_ZYNQMP_RTC_ERR_DEBUG
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 70b61b69c7..294465ef47 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -14,7 +14,6 @@ common-obj-$(CONFIG_IMX) += imx_epit.o
>  common-obj-$(CONFIG_IMX) += imx_gpt.o
>  common-obj-$(CONFIG_LM32) += lm32_timer.o
>  common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
> -common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
>
>  common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
> index ce34b967db..1459d07237 100644
> --- a/hw/timer/trace-events
> +++ b/hw/timer/trace-events
> @@ -70,9 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
>  aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>  aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>
> -# xlnx-zynqmp-rtc.c
> -xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
> -
>  # 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"
> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> index d7483c3b42..53076fa29a 100644
> --- a/include/hw/arm/xlnx-zynqmp.h
> +++ b/include/hw/arm/xlnx-zynqmp.h
> @@ -29,7 +29,7 @@
>  #include "hw/dma/xlnx-zdma.h"
>  #include "hw/display/xlnx_dp.h"
>  #include "hw/intc/xlnx-zynqmp-ipi.h"
> -#include "hw/timer/xlnx-zynqmp-rtc.h"
> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
>  #include "hw/cpu/cluster.h"
>  #include "target/arm/cpu.h"
>
> diff --git a/include/hw/timer/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-rtc.h
> similarity index 95%
> rename from include/hw/timer/xlnx-zynqmp-rtc.h
> rename to include/hw/rtc/xlnx-zynqmp-rtc.h
> index 97e32322ed..6fa1cb2f43 100644
> --- a/include/hw/timer/xlnx-zynqmp-rtc.h
> +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h
> @@ -3,7 +3,7 @@
>   *
>   * Copyright (c) 2017 Xilinx Inc.
>   *
> - * Written-by: Alistair Francis <alistair.francis@xilinx.com>
> + * Written-by: Alistair Francis

Why remove the email address?

Otherwise:

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

>   *
>   * Permission is hereby granted, free of charge, to any person obtaining a copy
>   * of this software and associated documentation files (the "Software"), to deal
> @@ -24,8 +24,8 @@
>   * THE SOFTWARE.
>   */
>
> -#ifndef HW_TIMER_XLNX_ZYNQMP_RTC_H
> -#define HW_TIMER_XLNX_ZYNQMP_RTC_H
> +#ifndef HW_RTC_XLNX_ZYNQMP_H
> +#define HW_RTC_XLNX_ZYNQMP_H
>
>  #include "hw/register.h"
>  #include "hw/sysbus.h"
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 " Philippe Mathieu-Daudé
@ 2019-09-16 21:45   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:00 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Move RTC devices under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/rtc/Makefile.objs               | 1 +
>  hw/{timer => rtc}/exynos4210_rtc.c | 0
>  hw/timer/Makefile.objs             | 1 -
>  3 files changed, 1 insertion(+), 1 deletion(-)
>  rename hw/{timer => rtc}/exynos4210_rtc.c (100%)
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 543a550a0f..3d4763fc26 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -7,5 +7,6 @@ endif
>  common-obj-$(CONFIG_PL031) += pl031.o
>  common-obj-$(CONFIG_TWL92230) += twl92230.o
>  common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> diff --git a/hw/timer/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c
> similarity index 100%
> rename from hw/timer/exynos4210_rtc.c
> rename to hw/rtc/exynos4210_rtc.c
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 294465ef47..33191d74cb 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -19,7 +19,6 @@ common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
>  common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
>  common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
>  common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
> -common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
>  common-obj-$(CONFIG_OMAP) += omap_gptimer.o
>  common-obj-$(CONFIG_OMAP) += omap_synctimer.o
>  common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 11/13] hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 11/13] hw: Move Aspeed " Philippe Mathieu-Daudé
  2019-09-16 17:21   ` Cédric Le Goater
@ 2019-09-16 21:46   ` Alistair Francis
  1 sibling, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:17 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Move RTC devices under the hw/rtc/ subdirectory.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/rtc/Makefile.objs                   | 1 +
>  hw/{timer => rtc}/aspeed_rtc.c         | 2 +-
>  hw/rtc/trace-events                    | 4 ++++
>  hw/timer/Makefile.objs                 | 2 +-
>  hw/timer/trace-events                  | 4 ----
>  include/hw/arm/aspeed_soc.h            | 2 +-
>  include/hw/{timer => rtc}/aspeed_rtc.h | 3 ---
>  7 files changed, 8 insertions(+), 10 deletions(-)
>  rename hw/{timer => rtc}/aspeed_rtc.c (99%)
>  rename include/hw/{timer => rtc}/aspeed_rtc.h (92%)
>
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3d4763fc26..8dc9fcd3a9 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -10,3 +10,4 @@ common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> +common-obj-$(CONFIG_ASPEED_SOC) += aspeed_rtc.o
> diff --git a/hw/timer/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
> similarity index 99%
> rename from hw/timer/aspeed_rtc.c
> rename to hw/rtc/aspeed_rtc.c
> index 5313017353..3ca1183558 100644
> --- a/hw/timer/aspeed_rtc.c
> +++ b/hw/rtc/aspeed_rtc.c
> @@ -8,7 +8,7 @@
>
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> -#include "hw/timer/aspeed_rtc.h"
> +#include "hw/rtc/aspeed_rtc.h"
>  #include "migration/vmstate.h"
>  #include "qemu/log.h"
>  #include "qemu/timer.h"
> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
> index 7f1945ad4c..d6749f4616 100644
> --- a/hw/rtc/trace-events
> +++ b/hw/rtc/trace-events
> @@ -13,3 +13,7 @@ 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"
> +
> +# aspeed-rtc.c
> +aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> +aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 33191d74cb..83091770df 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -29,7 +29,7 @@ common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>  common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
> -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
> +common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o
>
>  common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
>  common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
> index 1459d07237..e18b87fc96 100644
> --- a/hw/timer/trace-events
> +++ b/hw/timer/trace-events
> @@ -66,10 +66,6 @@ cmsdk_apb_dualtimer_read(uint64_t offset, uint64_t data, unsigned size) "CMSDK A
>  cmsdk_apb_dualtimer_write(uint64_t offset, uint64_t data, unsigned size) "CMSDK APB dualtimer write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
>  cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
>
> -# hw/timer/aspeed-rtc.c
> -aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> -aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> -
>  # 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"
> diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
> index ab5052b12c..5a443006ed 100644
> --- a/include/hw/arm/aspeed_soc.h
> +++ b/include/hw/arm/aspeed_soc.h
> @@ -17,7 +17,7 @@
>  #include "hw/misc/aspeed_sdmc.h"
>  #include "hw/misc/aspeed_xdma.h"
>  #include "hw/timer/aspeed_timer.h"
> -#include "hw/timer/aspeed_rtc.h"
> +#include "hw/rtc/aspeed_rtc.h"
>  #include "hw/i2c/aspeed_i2c.h"
>  #include "hw/ssi/aspeed_smc.h"
>  #include "hw/watchdog/wdt_aspeed.h"
> diff --git a/include/hw/timer/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
> similarity index 92%
> rename from include/hw/timer/aspeed_rtc.h
> rename to include/hw/rtc/aspeed_rtc.h
> index 15ba42912b..156c8faee3 100644
> --- a/include/hw/timer/aspeed_rtc.h
> +++ b/include/hw/rtc/aspeed_rtc.h
> @@ -8,9 +8,6 @@
>  #ifndef ASPEED_RTC_H
>  #define ASPEED_RTC_H
>
> -#include <stdint.h>
> -
> -#include "hw/irq.h"
>  #include "hw/sysbus.h"
>
>  typedef struct AspeedRtcState {
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less Philippe Mathieu-Daudé
@ 2019-09-16 21:46   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:42 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Only 2 source files require the "mc146818rtc_regs.h" header.
> Instead of having it processed 12 times, by all objects
> using "mc146818rtc.h", include it directly where used.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/rtc/mc146818rtc.c         | 1 +
>  hw/timer/hpet.c              | 1 +
>  include/hw/rtc/mc146818rtc.h | 1 -
>  3 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index ced15f764f..9d4ed54f65 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -35,6 +35,7 @@
>  #include "sysemu/reset.h"
>  #include "sysemu/runstate.h"
>  #include "hw/rtc/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
>  #include "qapi/qapi-commands-misc-target.h"
> diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
> index 02bf8a8ce8..9f17aaa278 100644
> --- a/hw/timer/hpet.c
> +++ b/hw/timer/hpet.c
> @@ -34,6 +34,7 @@
>  #include "hw/timer/hpet.h"
>  #include "hw/sysbus.h"
>  #include "hw/rtc/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>  #include "migration/vmstate.h"
>  #include "hw/timer/i8254.h"
>
> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
> index 888e04f9ab..09e273a2a1 100644
> --- a/include/hw/rtc/mc146818rtc.h
> +++ b/include/hw/rtc/mc146818rtc.h
> @@ -26,7 +26,6 @@
>  #define MC146818RTC_H
>
>  #include "hw/isa/isa.h"
> -#include "hw/rtc/mc146818rtc_regs.h"
>
>  #define TYPE_MC146818_RTC "mc146818rtc"
>
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include Philippe Mathieu-Daudé
@ 2019-09-16 21:47   ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-16 21:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Mon, Sep 16, 2019 at 9:46 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> The "hw/ptimer.h" header is not used, remove it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/rtc/xlnx-zynqmp-rtc.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/rtc/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
> index f9f09b7296..2bcd14d779 100644
> --- a/hw/rtc/xlnx-zynqmp-rtc.c
> +++ b/hw/rtc/xlnx-zynqmp-rtc.c
> @@ -32,7 +32,6 @@
>  #include "qemu/log.h"
>  #include "qemu/module.h"
>  #include "hw/irq.h"
> -#include "hw/ptimer.h"
>  #include "qemu/cutils.h"
>  #include "sysemu/sysemu.h"
>  #include "trace.h"
> --
> 2.20.1
>
>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
  2019-09-16 21:22   ` Alistair Francis
@ 2019-09-17  2:23   ` David Gibson
  2019-09-17  5:07   ` Thomas Huth
  2019-09-17 20:32   ` Richard Henderson
  3 siblings, 0 replies; 41+ messages in thread
From: David Gibson @ 2019-09-17  2:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland, qemu-devel,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, Artyom Tarasenko,
	Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
	qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 13116 bytes --]

On Mon, Sep 16, 2019 at 05:48:37PM +0200, Philippe Mathieu-Daudé wrote:
> The MC146818 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

ppc parts

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  MAINTAINERS                                  |  4 +--
>  hw/alpha/dp264.c                             |  2 +-
>  hw/hppa/machine.c                            |  2 +-
>  hw/i386/acpi-build.c                         |  2 +-
>  hw/i386/pc.c                                 |  2 +-
>  hw/i386/pc_q35.c                             |  2 +-
>  hw/mips/mips_fulong2e.c                      |  2 +-
>  hw/mips/mips_jazz.c                          |  2 +-
>  hw/mips/mips_malta.c                         |  2 +-
>  hw/mips/mips_r4k.c                           |  2 +-
>  hw/ppc/pnv.c                                 |  2 +-
>  hw/ppc/prep.c                                |  2 +-
>  hw/rtc/Kconfig                               |  3 ++
>  hw/rtc/Makefile.objs                         |  1 +
>  hw/{timer => rtc}/mc146818rtc.c              |  2 +-
>  hw/timer/Kconfig                             |  3 --
>  hw/timer/Makefile.objs                       |  2 --
>  hw/timer/hpet.c                              |  2 +-
>  include/hw/rtc/mc146818rtc.h                 | 38 ++++++++++++++++++++
>  include/hw/{timer => rtc}/mc146818rtc_regs.h |  1 +
>  include/hw/timer/mc146818rtc.h               | 14 --------
>  tests/rtc-test.c                             |  2 +-
>  22 files changed, 59 insertions(+), 35 deletions(-)
>  rename hw/{timer => rtc}/mc146818rtc.c (99%)
>  create mode 100644 include/hw/rtc/mc146818rtc.h
>  rename include/hw/{timer => rtc}/mc146818rtc_regs.h (98%)
>  delete mode 100644 include/hw/timer/mc146818rtc.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5562d2c6d0..481f2318cb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1263,7 +1263,7 @@ F: hw/misc/debugexit.c
>  F: hw/misc/pc-testdev.c
>  F: hw/timer/hpet*
>  F: hw/timer/i8254*
> -F: hw/timer/mc146818rtc*
> +F: hw/rtc/mc146818rtc*
>  F: hw/watchdog/wdt_ib700.c
>  F: hw/watchdog/wdt_i6300esb.c
>  F: include/hw/display/vga.h
> @@ -1275,7 +1275,7 @@ F: include/hw/isa/i8259_internal.h
>  F: include/hw/isa/superio.h
>  F: include/hw/timer/hpet.h
>  F: include/hw/timer/i8254*
> -F: include/hw/timer/mc146818rtc*
> +F: include/hw/rtc/mc146818rtc*
>  
>  Machine core
>  M: Eduardo Habkost <ehabkost@redhat.com>
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 51feee8558..51b3cf7a61 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -14,7 +14,7 @@
>  #include "alpha_sys.h"
>  #include "qemu/error-report.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/isa/superio.h"
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index 2736ce835e..6598e2469d 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -12,7 +12,7 @@
>  #include "qemu/error-report.h"
>  #include "sysemu/reset.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/char/serial.h"
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index e54e571a75..44a8073507 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -45,7 +45,7 @@
>  #include "hw/acpi/vmgenid.h"
>  #include "hw/boards.h"
>  #include "sysemu/tpm_backend.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>  #include "migration/vmstate.h"
>  #include "hw/mem/memory-device.h"
>  #include "sysemu/numa.h"
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index bad866fe44..beef7a992d 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -42,7 +42,7 @@
>  #include "elf.h"
>  #include "migration/vmstate.h"
>  #include "multiboot.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/dma/i8257.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/input/i8042.h"
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index d4e8a1cb9f..a976af9a2a 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -33,7 +33,7 @@
>  #include "hw/loader.h"
>  #include "sysemu/arch_init.h"
>  #include "hw/i2c/smbus_eeprom.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/xen/xen.h"
>  #include "sysemu/kvm.h"
>  #include "kvm_i386.h"
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index cf537dd7e6..03a27e1767 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -39,7 +39,7 @@
>  #include "hw/ide.h"
>  #include "elf.h"
>  #include "hw/isa/vt82c686.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/qtest.h"
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index c967b97d80..2811a4bd90 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -39,7 +39,7 @@
>  #include "hw/scsi/esp.h"
>  #include "hw/mips/bios.h"
>  #include "hw/loader.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "hw/display/vga.h"
>  #include "hw/audio/pcspk.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 4d9c64b36a..c1c8810e71 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -45,7 +45,7 @@
>  #include "hw/irq.h"
>  #include "hw/loader.h"
>  #include "elf.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
>  #include "hw/sysbus.h"             /* SysBusDevice */
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index bc0be26544..70024235ae 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -28,7 +28,7 @@
>  #include "hw/ide.h"
>  #include "hw/loader.h"
>  #include "elf.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "exec/address-spaces.h"
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 3f08db7b9e..4b2649d95b 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -48,7 +48,7 @@
>  #include "hw/isa/isa.h"
>  #include "hw/boards.h"
>  #include "hw/char/serial.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  
>  #include <libfdt.h>
>  
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 4f3c6bf190..3a51536e1a 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -40,7 +40,7 @@
>  #include "hw/ide.h"
>  #include "hw/irq.h"
>  #include "hw/loader.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "hw/isa/pc87312.h"
>  #include "hw/net/ne2000-isa.h"
>  #include "sysemu/arch_init.h"
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 8a4383bca9..7ffd702268 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,2 +1,5 @@
>  config PL031
>      bool
> +
> +config MC146818RTC
> +    bool
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3e1eb42563..3cac0d5a63 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1 +1,2 @@
>  common-obj-$(CONFIG_PL031) += pl031.o
> +obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> diff --git a/hw/timer/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> similarity index 99%
> rename from hw/timer/mc146818rtc.c
> rename to hw/rtc/mc146818rtc.c
> index 6cb378751b..ced15f764f 100644
> --- a/hw/timer/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -34,7 +34,7 @@
>  #include "sysemu/replay.h"
>  #include "sysemu/reset.h"
>  #include "sysemu/runstate.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
>  #include "qapi/qapi-commands-misc-target.h"
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index 27c5dce09e..af415c8ef8 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -35,9 +35,6 @@ config ALTERA_TIMER
>      bool
>      select PTIMER
>  
> -config MC146818RTC
> -    bool
> -
>  config ALLWINNER_A10_PIT
>      bool
>      select PTIMER
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 9f64f6e11e..b0159189cf 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -35,8 +35,6 @@ common-obj-$(CONFIG_SH4) += sh_timer.o
>  common-obj-$(CONFIG_DIGIC) += digic-timer.o
>  common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>  
> -obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> -
>  common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>  
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
> diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
> index 1ddae4e7d7..02bf8a8ce8 100644
> --- a/hw/timer/hpet.c
> +++ b/hw/timer/hpet.c
> @@ -33,7 +33,7 @@
>  #include "qemu/timer.h"
>  #include "hw/timer/hpet.h"
>  #include "hw/sysbus.h"
> -#include "hw/timer/mc146818rtc.h"
> +#include "hw/rtc/mc146818rtc.h"
>  #include "migration/vmstate.h"
>  #include "hw/timer/i8254.h"
>  
> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
> new file mode 100644
> index 0000000000..888e04f9ab
> --- /dev/null
> +++ b/include/hw/rtc/mc146818rtc.h
> @@ -0,0 +1,38 @@
> +/*
> + * QEMU MC146818 RTC emulation
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */
> +
> +#ifndef MC146818RTC_H
> +#define MC146818RTC_H
> +
> +#include "hw/isa/isa.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
> +
> +#define TYPE_MC146818_RTC "mc146818rtc"
> +
> +ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
> +                             qemu_irq intercept_irq);
> +void rtc_set_memory(ISADevice *dev, int addr, int val);
> +int rtc_get_memory(ISADevice *dev, int addr);
> +
> +#endif /* MC146818RTC_H */
> diff --git a/include/hw/timer/mc146818rtc_regs.h b/include/hw/rtc/mc146818rtc_regs.h
> similarity index 98%
> rename from include/hw/timer/mc146818rtc_regs.h
> rename to include/hw/rtc/mc146818rtc_regs.h
> index bfbb57e570..c4c6305473 100644
> --- a/include/hw/timer/mc146818rtc_regs.h
> +++ b/include/hw/rtc/mc146818rtc_regs.h
> @@ -26,6 +26,7 @@
>  #define MC146818RTC_REGS_H
>  
>  #include "qemu/timer.h"
> +#include "qemu/host-utils.h"
>  
>  #define RTC_ISA_IRQ 8
>  
> diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
> deleted file mode 100644
> index fe6ed63f71..0000000000
> --- a/include/hw/timer/mc146818rtc.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -#ifndef MC146818RTC_H
> -#define MC146818RTC_H
> -
> -#include "hw/isa/isa.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> -
> -#define TYPE_MC146818_RTC "mc146818rtc"
> -
> -ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
> -                             qemu_irq intercept_irq);
> -void rtc_set_memory(ISADevice *dev, int addr, int val);
> -int rtc_get_memory(ISADevice *dev, int addr);
> -
> -#endif /* MC146818RTC_H */
> diff --git a/tests/rtc-test.c b/tests/rtc-test.c
> index 6309b0ef6c..79a4ff1ed6 100644
> --- a/tests/rtc-test.c
> +++ b/tests/rtc-test.c
> @@ -15,7 +15,7 @@
>  
>  #include "libqtest-single.h"
>  #include "qemu/timer.h"
> -#include "hw/timer/mc146818rtc_regs.h"
> +#include "hw/rtc/mc146818rtc_regs.h"
>  
>  #define UIP_HOLD_LENGTH           (8 * NANOSECONDS_PER_SECOND / 32768)
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 04/13] hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 04/13] hw: Move M48T59 " Philippe Mathieu-Daudé
  2019-09-16 21:23   ` Alistair Francis
@ 2019-09-17  2:25   ` David Gibson
  2019-09-17 10:08     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 41+ messages in thread
From: David Gibson @ 2019-09-17  2:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland, qemu-devel,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, Artyom Tarasenko,
	Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
	qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 9060 bytes --]

On Mon, Sep 16, 2019 at 05:48:38PM +0200, Philippe Mathieu-Daudé wrote:
> The M48T59 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  MAINTAINERS                         |  4 +-
>  hw/ppc/ppc405_boards.c              |  2 +-
>  hw/ppc/prep.c                       |  2 +-
>  hw/rtc/Kconfig                      |  3 ++
>  hw/rtc/Makefile.objs                |  4 ++
>  hw/{timer => rtc}/m48t59-internal.h |  0
>  hw/{timer => rtc}/m48t59-isa.c      |  4 +-
>  hw/{timer => rtc}/m48t59.c          |  2 +-
>  hw/sparc/sun4m.c                    |  2 +-
>  hw/sparc64/sun4u.c                  |  2 +-
>  hw/timer/Kconfig                    |  3 --
>  hw/timer/Makefile.objs              |  4 --
>  include/hw/rtc/m48t59.h             | 57 +++++++++++++++++++++++++++++

Uh.. this file seems to be coming out of nowhere, which doesn't seem
right for a code motion.

>  13 files changed, 73 insertions(+), 16 deletions(-)
>  rename hw/{timer => rtc}/m48t59-internal.h (100%)
>  rename hw/{timer => rtc}/m48t59-isa.c (98%)
>  rename hw/{timer => rtc}/m48t59.c (99%)
>  create mode 100644 include/hw/rtc/m48t59.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 481f2318cb..679b026fe0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1064,9 +1064,9 @@ F: hw/pci-host/prep.[hc]
>  F: hw/isa/i82378.c
>  F: hw/isa/pc87312.c
>  F: hw/dma/i82374.c
> -F: hw/timer/m48t59-isa.c
> +F: hw/rtc/m48t59-isa.c
>  F: include/hw/isa/pc87312.h
> -F: include/hw/timer/m48t59.h
> +F: include/hw/rtc/m48t59.h
>  F: pc-bios/ppc_rom.bin
>  
>  sPAPR
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 388cae0b43..1f721feed6 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -29,7 +29,7 @@
>  #include "cpu.h"
>  #include "hw/ppc/ppc.h"
>  #include "ppc405.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "hw/block/flash.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/qtest.h"
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 3a51536e1a..862345c2ac 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -25,7 +25,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "cpu.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "hw/char/serial.h"
>  #include "hw/block/fdc.h"
>  #include "net/net.h"
> diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig
> index 7ffd702268..159c233517 100644
> --- a/hw/rtc/Kconfig
> +++ b/hw/rtc/Kconfig
> @@ -1,3 +1,6 @@
> +config M48T59
> +    bool
> +
>  config PL031
>      bool
>  
> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> index 3cac0d5a63..c87f81405e 100644
> --- a/hw/rtc/Makefile.objs
> +++ b/hw/rtc/Makefile.objs
> @@ -1,2 +1,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
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> diff --git a/hw/timer/m48t59-internal.h b/hw/rtc/m48t59-internal.h
> similarity index 100%
> rename from hw/timer/m48t59-internal.h
> rename to hw/rtc/m48t59-internal.h
> diff --git a/hw/timer/m48t59-isa.c b/hw/rtc/m48t59-isa.c
> similarity index 98%
> rename from hw/timer/m48t59-isa.c
> rename to hw/rtc/m48t59-isa.c
> index 5e5432abfd..7fde854c0f 100644
> --- a/hw/timer/m48t59-isa.c
> +++ b/hw/rtc/m48t59-isa.c
> @@ -1,5 +1,5 @@
>  /*
> - * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface
> + * QEMU M48T59 and M48T08 NVRAM emulation (ISA bus interface)
>   *
>   * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
>   * Copyright (c) 2013 Hervé Poussineau
> @@ -26,7 +26,7 @@
>  #include "qemu/osdep.h"
>  #include "hw/isa/isa.h"
>  #include "hw/qdev-properties.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "m48t59-internal.h"
>  #include "qemu/module.h"
>  
> diff --git a/hw/timer/m48t59.c b/hw/rtc/m48t59.c
> similarity index 99%
> rename from hw/timer/m48t59.c
> rename to hw/rtc/m48t59.c
> index a9fc2f981a..fc592b9fb1 100644
> --- a/hw/timer/m48t59.c
> +++ b/hw/rtc/m48t59.c
> @@ -27,7 +27,7 @@
>  #include "qemu-common.h"
>  #include "hw/irq.h"
>  #include "hw/qdev-properties.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "qemu/timer.h"
>  #include "sysemu/runstate.h"
>  #include "sysemu/sysemu.h"
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 6c5a17a020..2aaa5bf1ae 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -31,7 +31,7 @@
>  #include "qemu/error-report.h"
>  #include "qemu/timer.h"
>  #include "hw/sparc/sun4m_iommu.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "migration/vmstate.h"
>  #include "hw/sparc/sparc32_dma.h"
>  #include "hw/block/fdc.h"
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index 1ded2a4c9a..955082773b 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -36,7 +36,7 @@
>  #include "hw/pci-host/sabre.h"
>  #include "hw/char/serial.h"
>  #include "hw/char/parallel.h"
> -#include "hw/timer/m48t59.h"
> +#include "hw/rtc/m48t59.h"
>  #include "migration/vmstate.h"
>  #include "hw/input/i8042.h"
>  #include "hw/block/fdc.h"
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index af415c8ef8..a57e9b59fc 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -24,9 +24,6 @@ config M41T80
>      bool
>      depends on I2C
>  
> -config M48T59
> -    bool
> -
>  config TWL92230
>      bool
>      depends on I2C
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index b0159189cf..fe2d1fbc40 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -7,10 +7,6 @@ common-obj-$(CONFIG_DS1338) += ds1338.o
>  common-obj-$(CONFIG_HPET) += hpet.o
>  common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
>  common-obj-$(CONFIG_M41T80) += m41t80.o
> -common-obj-$(CONFIG_M48T59) += m48t59.o
> -ifeq ($(CONFIG_ISA_BUS),y)
> -common-obj-$(CONFIG_M48T59) += m48t59-isa.o
> -endif
>  common-obj-$(CONFIG_PUV3) += puv3_ost.o
>  common-obj-$(CONFIG_TWL92230) += twl92230.o
>  common-obj-$(CONFIG_XILINX) += xilinx_timer.o
> diff --git a/include/hw/rtc/m48t59.h b/include/hw/rtc/m48t59.h
> new file mode 100644
> index 0000000000..e7ea4e8761
> --- /dev/null
> +++ b/include/hw/rtc/m48t59.h
> @@ -0,0 +1,57 @@
> +/*
> + * QEMU M48T59 and M48T08 NVRAM emulation
> + *
> + * Copyright (c) 2003-2005, 2007 Jocelyn Mayer
> + * Copyright (c) 2013 Hervé Poussineau
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */
> +
> +#ifndef HW_RTC_M48T59_H
> +#define HW_RTC_M48T59_H
> +
> +#include "exec/hwaddr.h"
> +#include "qom/object.h"
> +
> +#define TYPE_NVRAM "nvram"
> +
> +#define NVRAM_CLASS(klass) \
> +    OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM)
> +#define NVRAM_GET_CLASS(obj) \
> +    OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM)
> +#define NVRAM(obj) \
> +    INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM)
> +
> +typedef struct Nvram Nvram;
> +
> +typedef struct NvramClass {
> +    InterfaceClass parent;
> +
> +    uint32_t (*read)(Nvram *obj, uint32_t addr);
> +    void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
> +    void (*toggle_lock)(Nvram *obj, int lock);
> +} NvramClass;
> +
> +Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
> +                       int base_year, int type);
> +Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
> +                   uint32_t io_base, uint16_t size, int base_year,
> +                   int type);
> +
> +#endif /* HW_M48T59_H */

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
  2019-09-16 17:28   ` Alistair Francis
@ 2019-09-17  4:57   ` Thomas Huth
  1 sibling, 0 replies; 41+ messages in thread
From: Thomas Huth @ 2019-09-17  4:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 16/09/2019 17.48, Philippe Mathieu-Daudé wrote:
> All these devices do not contain any target-specific. While most
> of them are arch-specific, they are shared between different
> targets of the same arch family (ARM and AArch64, MIPS32/MIPS64,
> endianess, ...).
> Put them into common-obj-y to compile them once for all targets.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/timer/Makefile.objs | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> index 123d92c969..f407523aa4 100644
> --- a/hw/timer/Makefile.objs
> +++ b/hw/timer/Makefile.objs
> @@ -25,20 +25,20 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
>  common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>  common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
>  
> -obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
> -obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
> -obj-$(CONFIG_OMAP) += omap_gptimer.o
> -obj-$(CONFIG_OMAP) += omap_synctimer.o
> -obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
> -obj-$(CONFIG_SH4) += sh_timer.o
> -obj-$(CONFIG_DIGIC) += digic-timer.o
> -obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
> +common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
> +common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
> +common-obj-$(CONFIG_OMAP) += omap_gptimer.o
> +common-obj-$(CONFIG_OMAP) += omap_synctimer.o
> +common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
> +common-obj-$(CONFIG_SH4) += sh_timer.o
> +common-obj-$(CONFIG_DIGIC) += digic-timer.o
> +common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o
>  
>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>  
> -obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
> +common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
>  
>  common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
>  common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o aspeed_rtc.o
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

FWIW, that change is also part of my "hw/*/Makefile.objs: Move many .o
files to common-objs" patch ... but since it looks identical, it should
not matter, which patch goes in first.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
  2019-09-16 21:22   ` Alistair Francis
  2019-09-17  2:23   ` David Gibson
@ 2019-09-17  5:07   ` Thomas Huth
  2019-09-17 10:03     ` Philippe Mathieu-Daudé
  2019-09-17 20:32   ` Richard Henderson
  3 siblings, 1 reply; 41+ messages in thread
From: Thomas Huth @ 2019-09-17  5:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 16/09/2019 17.48, Philippe Mathieu-Daudé wrote:
> The MC146818 is a Real Time Clock, not a timer.
> Move it under the hw/rtc/ subdirectory.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[...]
> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
> new file mode 100644
> index 0000000000..888e04f9ab
> --- /dev/null
> +++ b/include/hw/rtc/mc146818rtc.h
> @@ -0,0 +1,38 @@
> +/*
> + * QEMU MC146818 RTC emulation
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */

If you run "git blame" on the old header file, it does not seem like
Fabrice wrote this header, so I'm not sure whether it makes sense to add
his (c) statement here?

Maybe rather use a one-line "SPDX-License-Identifier: GPL-2.0-or-later"
here?

 Thomas




^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-17  5:07   ` Thomas Huth
@ 2019-09-17 10:03     ` Philippe Mathieu-Daudé
  2019-09-18  7:43       ` Thomas Huth
  0 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-17 10:03 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 9/17/19 7:07 AM, Thomas Huth wrote:
> On 16/09/2019 17.48, Philippe Mathieu-Daudé wrote:
>> The MC146818 is a Real Time Clock, not a timer.
>> Move it under the hw/rtc/ subdirectory.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> [...]
>> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
>> new file mode 100644
>> index 0000000000..888e04f9ab
>> --- /dev/null
>> +++ b/include/hw/rtc/mc146818rtc.h
>> @@ -0,0 +1,38 @@
>> +/*
>> + * QEMU MC146818 RTC emulation
>> + *
>> + * Copyright (c) 2003-2004 Fabrice Bellard
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining a copy
>> + * of this software and associated documentation files (the "Software"), to deal
>> + * in the Software without restriction, including without limitation the rights
>> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
>> + * copies of the Software, and to permit persons to whom the Software is
>> + * furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be included in
>> + * all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>> + * THE SOFTWARE.
>> + */
> 
> If you run "git blame" on the old header file, it does not seem like
> Fabrice wrote this header, so I'm not sure whether it makes sense to add
> his (c) statement here?
> 
> Maybe rather use a one-line "SPDX-License-Identifier: GPL-2.0-or-later"
> here?

It was first added by Fabrice here:

$ git show 80cabfad163
[...]
> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
new file mode 100644
index 0000000000..cab76cfab2
--- /dev/null
+++ b/hw/mc146818rtc.c
@@ -0,0 +1,203 @@
+/*
+ * QEMU MC146818 RTC emulation
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a copy
+ * of this software and associated documentation files (the
"Software"), to deal
+ * in the Software without restriction, including without limitation
the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
+ * THE SOFTWARE.
+ */[...]
diff --git a/vl.h b/vl.h
index 35962d1985..026a5dee5a 100644
--- a/vl.h
+++ b/vl.h
+/* mc146818rtc.c */
+
+typedef struct RTCState {
+    uint8_t cmos_data[128];
+    uint8_t cmos_index;
+    int irq;
+} RTCState;
+
+extern RTCState rtc_state;
+
+void rtc_init(int base, int irq);
+void rtc_timer(void);

Then moved from vl.h to pc.h:

$ git show 87ecb68bdf8
commit 87ecb68bdf8a3e40ef885ddbb7ca1797dca40ebf
Author: pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Date:   Sat Nov 17 17:14:51 2007 +0000

    Break up vl.h.

Then moved from pc.h to mc146818rtc.h without adding the (c):

$ git show e1460e4707c
commit e1460e4707cd80982add597f5cb421289db84e4e
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Fri May 14 16:29:16 2010 +0900

    pc: move rtc declarations from pc.h into a dedicated header file.

    Move rtc_xxx declarations from pc.h into mc146818rtc.h.

    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Acked-by: Gerd Hoffmann <kraxel@redhat.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

diff --git a/hw/mc146818rtc.h b/hw/mc146818rtc.h
new file mode 100644
index 0000000000..7211dae37e
--- /dev/null
+++ b/hw/mc146818rtc.h
@@ -0,0 +1,10 @@
+#ifndef MC146818RTC_H
+#define MC146818RTC_H
+
+typedef struct RTCState RTCState;
+
+RTCState *rtc_init(int base_year);
+void rtc_set_memory(RTCState *s, int addr, int val);
+void rtc_set_date(RTCState *s, const struct tm *tm);
+
+#endif /* !MC146818RTC_H */
diff --git a/hw/pc.h b/hw/pc.h
index 8cfec6c0dc..e3cc0a58bd 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -5,6 +5,7 @@
 #include "ioport.h"
 #include "isa.h"
 #include "fdc.h"
+#include "mc146818rtc.h"

 /* PC-style peripherals (also used by other machines).  */

@@ -76,14 +77,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
                    target_phys_addr_t base, ram_addr_t size,
                    target_phys_addr_t mask);

-/* mc146818rtc.c */
-
-typedef struct RTCState RTCState;
-
-RTCState *rtc_init(int base_year);
-void rtc_set_memory(RTCState *s, int addr, int val);
-void rtc_set_date(RTCState *s, const struct tm *tm);

So the (c) looks correct to me. Do you still disagree?


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 04/13] hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-17  2:25   ` David Gibson
@ 2019-09-17 10:08     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-17 10:08 UTC (permalink / raw)
  To: David Gibson
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland, qemu-devel,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, Artyom Tarasenko,
	Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
	qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 9/17/19 4:25 AM, David Gibson wrote:
> On Mon, Sep 16, 2019 at 05:48:38PM +0200, Philippe Mathieu-Daudé wrote:
>> The M48T59 is a Real Time Clock, not a timer.
>> Move it under the hw/rtc/ subdirectory.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  MAINTAINERS                         |  4 +-
>>  hw/ppc/ppc405_boards.c              |  2 +-
>>  hw/ppc/prep.c                       |  2 +-
>>  hw/rtc/Kconfig                      |  3 ++
>>  hw/rtc/Makefile.objs                |  4 ++
>>  hw/{timer => rtc}/m48t59-internal.h |  0
>>  hw/{timer => rtc}/m48t59-isa.c      |  4 +-
>>  hw/{timer => rtc}/m48t59.c          |  2 +-
>>  hw/sparc/sun4m.c                    |  2 +-
>>  hw/sparc64/sun4u.c                  |  2 +-
>>  hw/timer/Kconfig                    |  3 --
>>  hw/timer/Makefile.objs              |  4 --
>>  include/hw/rtc/m48t59.h             | 57 +++++++++++++++++++++++++++++
> 
> Uh.. this file seems to be coming out of nowhere, which doesn't seem
> right for a code motion.

Good catch!

> 
>>  13 files changed, 73 insertions(+), 16 deletions(-)
>>  rename hw/{timer => rtc}/m48t59-internal.h (100%)
>>  rename hw/{timer => rtc}/m48t59-isa.c (98%)
>>  rename hw/{timer => rtc}/m48t59.c (99%)
>>  create mode 100644 include/hw/rtc/m48t59.h
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 481f2318cb..679b026fe0 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -1064,9 +1064,9 @@ F: hw/pci-host/prep.[hc]
>>  F: hw/isa/i82378.c
>>  F: hw/isa/pc87312.c
>>  F: hw/dma/i82374.c
>> -F: hw/timer/m48t59-isa.c
>> +F: hw/rtc/m48t59-isa.c
>>  F: include/hw/isa/pc87312.h
>> -F: include/hw/timer/m48t59.h
>> +F: include/hw/rtc/m48t59.h
[...]

Not sure how I ended not removing include/hw/timer/m48t59.h, since I
used 'git mv' in all the series. I might have missed a conflict when
switching between branches...
Ah I now remember, I had to rebase after Markus big header cleanup, this
is probably when I messed with this one :)


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 21:44   ` Alistair Francis
@ 2019-09-17 10:28     ` Philippe Mathieu-Daudé
  2019-09-17 23:29       ` Alistair Francis
  0 siblings, 1 reply; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-17 10:28 UTC (permalink / raw)
  To: Alistair Francis, Thomas Huth
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

Hi Alistair,

On 9/16/19 11:44 PM, Alistair Francis wrote:
> On Mon, Sep 16, 2019 at 8:56 AM Philippe Mathieu-Daudé
> <philmd@redhat.com> wrote:
>>
>> Move RTC devices under the hw/rtc/ subdirectory.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  hw/rtc/Makefile.objs                        | 1 +
>>  hw/rtc/trace-events                         | 3 +++
>>  hw/{timer => rtc}/xlnx-zynqmp-rtc.c         | 2 +-
>>  hw/timer/Makefile.objs                      | 1 -
>>  hw/timer/trace-events                       | 3 ---
>>  include/hw/arm/xlnx-zynqmp.h                | 2 +-
>>  include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h | 6 +++---
>>  7 files changed, 9 insertions(+), 9 deletions(-)
>>  rename hw/{timer => rtc}/xlnx-zynqmp-rtc.c (99%)
>>  rename include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h (95%)
>>
>> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
>> index b195863291..543a550a0f 100644
>> --- a/hw/rtc/Makefile.objs
>> +++ b/hw/rtc/Makefile.objs
>> @@ -6,5 +6,6 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
>>  endif
>>  common-obj-$(CONFIG_PL031) += pl031.o
>>  common-obj-$(CONFIG_TWL92230) += twl92230.o
>> +common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
>>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
>> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
>> index ac9e0e0fba..7f1945ad4c 100644
>> --- a/hw/rtc/trace-events
>> +++ b/hw/rtc/trace-events
>> @@ -4,6 +4,9 @@
>>  sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
>>  sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
>>
>> +# xlnx-zynqmp-rtc.c
>> +xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
>> +
>>  # pl031.c
>>  pl031_irq_state(int level) "irq state %d"
>>  pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
>> diff --git a/hw/timer/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
>> similarity index 99%
>> rename from hw/timer/xlnx-zynqmp-rtc.c
>> rename to hw/rtc/xlnx-zynqmp-rtc.c
>> index 5692db98c2..f9f09b7296 100644
>> --- a/hw/timer/xlnx-zynqmp-rtc.c
>> +++ b/hw/rtc/xlnx-zynqmp-rtc.c
>> @@ -36,7 +36,7 @@
>>  #include "qemu/cutils.h"
>>  #include "sysemu/sysemu.h"
>>  #include "trace.h"
>> -#include "hw/timer/xlnx-zynqmp-rtc.h"
>> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
>>  #include "migration/vmstate.h"
>>
>>  #ifndef XLNX_ZYNQMP_RTC_ERR_DEBUG
>> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
>> index 70b61b69c7..294465ef47 100644
>> --- a/hw/timer/Makefile.objs
>> +++ b/hw/timer/Makefile.objs
>> @@ -14,7 +14,6 @@ common-obj-$(CONFIG_IMX) += imx_epit.o
>>  common-obj-$(CONFIG_IMX) += imx_gpt.o
>>  common-obj-$(CONFIG_LM32) += lm32_timer.o
>>  common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
>> -common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
>>  common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
>>
>>  common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
>> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
>> index ce34b967db..1459d07237 100644
>> --- a/hw/timer/trace-events
>> +++ b/hw/timer/trace-events
>> @@ -70,9 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
>>  aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>>  aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
>>
>> -# xlnx-zynqmp-rtc.c
>> -xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
>> -
>>  # 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"
>> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
>> index d7483c3b42..53076fa29a 100644
>> --- a/include/hw/arm/xlnx-zynqmp.h
>> +++ b/include/hw/arm/xlnx-zynqmp.h
>> @@ -29,7 +29,7 @@
>>  #include "hw/dma/xlnx-zdma.h"
>>  #include "hw/display/xlnx_dp.h"
>>  #include "hw/intc/xlnx-zynqmp-ipi.h"
>> -#include "hw/timer/xlnx-zynqmp-rtc.h"
>> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
>>  #include "hw/cpu/cluster.h"
>>  #include "target/arm/cpu.h"
>>
>> diff --git a/include/hw/timer/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-rtc.h
>> similarity index 95%
>> rename from include/hw/timer/xlnx-zynqmp-rtc.h
>> rename to include/hw/rtc/xlnx-zynqmp-rtc.h
>> index 97e32322ed..6fa1cb2f43 100644
>> --- a/include/hw/timer/xlnx-zynqmp-rtc.h
>> +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h
>> @@ -3,7 +3,7 @@
>>   *
>>   * Copyright (c) 2017 Xilinx Inc.
>>   *
>> - * Written-by: Alistair Francis <alistair.francis@xilinx.com>
>> + * Written-by: Alistair Francis
> 
> Why remove the email address?

In https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00759.html
Thomas suggested to remove invalid email addresses:

  I don't think that this e-mail address is still valid since that
  company has been bought up > 10 years ago... so it likely does not
  make sense to mention it in new files anymore. So just mention the
  name?

In your case Xilinx still exists, but you warned us it might bounce:

$ git show c22e580c2ad
commit c22e580c2ad1cccef582e1490e732f254d4ac064 (tag:
pull-target-arm-20180301)
Author: Alistair Francis <alistair.francis@xilinx.com>
Date:   Thu Mar 1 11:05:58 2018 +0000

    MAINTAINERS: Update my email address

    I am leaving Xilinx, so to avoid having an email address that bounces
    update my maintainer address to point to my personal email address.

So I stripped your obsolete email.

Since the line is not "(c) Name <email>" but simply "Written by" and the
(C) remains to Xilinx, we could update the email by your personal one,
that seems fair (so if someone want to contact you to ask you question
about your code, he still can).

What do you prefer?

> 
> Otherwise:
> 
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Thanks!

> 
> Alistair
> 
>>   *
>>   * Permission is hereby granted, free of charge, to any person obtaining a copy
>>   * of this software and associated documentation files (the "Software"), to deal
>> @@ -24,8 +24,8 @@
>>   * THE SOFTWARE.
>>   */
>>
>> -#ifndef HW_TIMER_XLNX_ZYNQMP_RTC_H
>> -#define HW_TIMER_XLNX_ZYNQMP_RTC_H
>> +#ifndef HW_RTC_XLNX_ZYNQMP_H
>> +#define HW_RTC_XLNX_ZYNQMP_H
>>
>>  #include "hw/register.h"
>>  #include "hw/sysbus.h"
>> --
>> 2.20.1
>>
>>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
                     ` (2 preceding siblings ...)
  2019-09-17  5:07   ` Thomas Huth
@ 2019-09-17 20:32   ` Richard Henderson
  2019-09-18 10:52     ` Philippe Mathieu-Daudé
  3 siblings, 1 reply; 41+ messages in thread
From: Richard Henderson @ 2019-09-17 20:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Igor Mammedov,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On 9/16/19 11:48 AM, Philippe Mathieu-Daudé wrote:
>  include/hw/rtc/mc146818rtc.h                 | 38 ++++++++++++++++++++

Same rebase failure as for patch 4?


r~


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-17 10:28     ` Philippe Mathieu-Daudé
@ 2019-09-17 23:29       ` Alistair Francis
  0 siblings, 0 replies; 41+ messages in thread
From: Alistair Francis @ 2019-09-17 23:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	qemu-devel@nongnu.org Developers, Edgar E. Iglesias,
	Aleksandar Rikalo, Helge Deller, Hervé Poussineau,
	Joel Stanley, David Gibson, Artyom Tarasenko, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Alistair Francis, qemu-arm,
	Cédric Le Goater, Igor Mammedov, Richard Henderson,
	Andrew Jeffery, open list:New World, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On Tue, Sep 17, 2019 at 3:28 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Hi Alistair,
>
> On 9/16/19 11:44 PM, Alistair Francis wrote:
> > On Mon, Sep 16, 2019 at 8:56 AM Philippe Mathieu-Daudé
> > <philmd@redhat.com> wrote:
> >>
> >> Move RTC devices under the hw/rtc/ subdirectory.
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >> ---
> >>  hw/rtc/Makefile.objs                        | 1 +
> >>  hw/rtc/trace-events                         | 3 +++
> >>  hw/{timer => rtc}/xlnx-zynqmp-rtc.c         | 2 +-
> >>  hw/timer/Makefile.objs                      | 1 -
> >>  hw/timer/trace-events                       | 3 ---
> >>  include/hw/arm/xlnx-zynqmp.h                | 2 +-
> >>  include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h | 6 +++---
> >>  7 files changed, 9 insertions(+), 9 deletions(-)
> >>  rename hw/{timer => rtc}/xlnx-zynqmp-rtc.c (99%)
> >>  rename include/hw/{timer => rtc}/xlnx-zynqmp-rtc.h (95%)
> >>
> >> diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs
> >> index b195863291..543a550a0f 100644
> >> --- a/hw/rtc/Makefile.objs
> >> +++ b/hw/rtc/Makefile.objs
> >> @@ -6,5 +6,6 @@ common-obj-$(CONFIG_M48T59) += m48t59-isa.o
> >>  endif
> >>  common-obj-$(CONFIG_PL031) += pl031.o
> >>  common-obj-$(CONFIG_TWL92230) += twl92230.o
> >> +common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
> >>  obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
> >>  common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o
> >> diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
> >> index ac9e0e0fba..7f1945ad4c 100644
> >> --- a/hw/rtc/trace-events
> >> +++ b/hw/rtc/trace-events
> >> @@ -4,6 +4,9 @@
> >>  sun4v_rtc_read(uint64_t addr, uint64_t value) "read: addr 0x%" PRIx64 " value 0x%" PRIx64
> >>  sun4v_rtc_write(uint64_t addr, uint64_t value) "write: addr 0x%" PRIx64 " value 0x%" PRIx64
> >>
> >> +# xlnx-zynqmp-rtc.c
> >> +xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
> >> +
> >>  # pl031.c
> >>  pl031_irq_state(int level) "irq state %d"
> >>  pl031_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
> >> diff --git a/hw/timer/xlnx-zynqmp-rtc.c b/hw/rtc/xlnx-zynqmp-rtc.c
> >> similarity index 99%
> >> rename from hw/timer/xlnx-zynqmp-rtc.c
> >> rename to hw/rtc/xlnx-zynqmp-rtc.c
> >> index 5692db98c2..f9f09b7296 100644
> >> --- a/hw/timer/xlnx-zynqmp-rtc.c
> >> +++ b/hw/rtc/xlnx-zynqmp-rtc.c
> >> @@ -36,7 +36,7 @@
> >>  #include "qemu/cutils.h"
> >>  #include "sysemu/sysemu.h"
> >>  #include "trace.h"
> >> -#include "hw/timer/xlnx-zynqmp-rtc.h"
> >> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
> >>  #include "migration/vmstate.h"
> >>
> >>  #ifndef XLNX_ZYNQMP_RTC_ERR_DEBUG
> >> diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
> >> index 70b61b69c7..294465ef47 100644
> >> --- a/hw/timer/Makefile.objs
> >> +++ b/hw/timer/Makefile.objs
> >> @@ -14,7 +14,6 @@ common-obj-$(CONFIG_IMX) += imx_epit.o
> >>  common-obj-$(CONFIG_IMX) += imx_gpt.o
> >>  common-obj-$(CONFIG_LM32) += lm32_timer.o
> >>  common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o
> >> -common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o
> >>  common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o
> >>
> >>  common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
> >> diff --git a/hw/timer/trace-events b/hw/timer/trace-events
> >> index ce34b967db..1459d07237 100644
> >> --- a/hw/timer/trace-events
> >> +++ b/hw/timer/trace-events
> >> @@ -70,9 +70,6 @@ cmsdk_apb_dualtimer_reset(void) "CMSDK APB dualtimer: reset"
> >>  aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> >>  aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
> >>
> >> -# xlnx-zynqmp-rtc.c
> >> -xlnx_zynqmp_rtc_gettime(int year, int month, int day, int hour, int min, int sec) "Get time from host: %d-%d-%d %2d:%02d:%02d"
> >> -
> >>  # 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"
> >> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> >> index d7483c3b42..53076fa29a 100644
> >> --- a/include/hw/arm/xlnx-zynqmp.h
> >> +++ b/include/hw/arm/xlnx-zynqmp.h
> >> @@ -29,7 +29,7 @@
> >>  #include "hw/dma/xlnx-zdma.h"
> >>  #include "hw/display/xlnx_dp.h"
> >>  #include "hw/intc/xlnx-zynqmp-ipi.h"
> >> -#include "hw/timer/xlnx-zynqmp-rtc.h"
> >> +#include "hw/rtc/xlnx-zynqmp-rtc.h"
> >>  #include "hw/cpu/cluster.h"
> >>  #include "target/arm/cpu.h"
> >>
> >> diff --git a/include/hw/timer/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-rtc.h
> >> similarity index 95%
> >> rename from include/hw/timer/xlnx-zynqmp-rtc.h
> >> rename to include/hw/rtc/xlnx-zynqmp-rtc.h
> >> index 97e32322ed..6fa1cb2f43 100644
> >> --- a/include/hw/timer/xlnx-zynqmp-rtc.h
> >> +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h
> >> @@ -3,7 +3,7 @@
> >>   *
> >>   * Copyright (c) 2017 Xilinx Inc.
> >>   *
> >> - * Written-by: Alistair Francis <alistair.francis@xilinx.com>
> >> + * Written-by: Alistair Francis
> >
> > Why remove the email address?
>
> In https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00759.html
> Thomas suggested to remove invalid email addresses:
>
>   I don't think that this e-mail address is still valid since that
>   company has been bought up > 10 years ago... so it likely does not
>   make sense to mention it in new files anymore. So just mention the
>   name?
>
> In your case Xilinx still exists, but you warned us it might bounce:

Yeah, I assume it bounces now.

>
> $ git show c22e580c2ad
> commit c22e580c2ad1cccef582e1490e732f254d4ac064 (tag:
> pull-target-arm-20180301)
> Author: Alistair Francis <alistair.francis@xilinx.com>
> Date:   Thu Mar 1 11:05:58 2018 +0000
>
>     MAINTAINERS: Update my email address
>
>     I am leaving Xilinx, so to avoid having an email address that bounces
>     update my maintainer address to point to my personal email address.
>
> So I stripped your obsolete email.
>
> Since the line is not "(c) Name <email>" but simply "Written by" and the
> (C) remains to Xilinx, we could update the email by your personal one,
> that seems fair (so if someone want to contact you to ask you question
> about your code, he still can).

I always though that the email address indicated that "Alistair
Francis" wrote this, but while being funded by "Xilinx". It gave both
parties credit for the work. The email address is also unique (at
least somewhat) which helps tie things together if you have a common
name.

You are right though that the author and copyright tags do the same thing.

As for contact to ask questions that is where the maintainers file
comes in, so it probably doesn't matter too much.

>
> What do you prefer?

I'm not fussed, was just curious why you thought the email should be
removed. It's fine as it is.

Alistair

>
> >
> > Otherwise:
> >
> > Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>
> Thanks!
>
> >
> > Alistair
> >
> >>   *
> >>   * Permission is hereby granted, free of charge, to any person obtaining a copy
> >>   * of this software and associated documentation files (the "Software"), to deal
> >> @@ -24,8 +24,8 @@
> >>   * THE SOFTWARE.
> >>   */
> >>
> >> -#ifndef HW_TIMER_XLNX_ZYNQMP_RTC_H
> >> -#define HW_TIMER_XLNX_ZYNQMP_RTC_H
> >> +#ifndef HW_RTC_XLNX_ZYNQMP_H
> >> +#define HW_RTC_XLNX_ZYNQMP_H
> >>
> >>  #include "hw/register.h"
> >>  #include "hw/sysbus.h"
> >> --
> >> 2.20.1
> >>
> >>


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-17 10:03     ` Philippe Mathieu-Daudé
@ 2019-09-18  7:43       ` Thomas Huth
  2019-09-18 11:02         ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 41+ messages in thread
From: Thomas Huth @ 2019-09-18  7:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 17/09/2019 12.03, Philippe Mathieu-Daudé wrote:
> On 9/17/19 7:07 AM, Thomas Huth wrote:
>> On 16/09/2019 17.48, Philippe Mathieu-Daudé wrote:
>>> The MC146818 is a Real Time Clock, not a timer.
>>> Move it under the hw/rtc/ subdirectory.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> [...]
>>> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
>>> new file mode 100644
>>> index 0000000000..888e04f9ab
>>> --- /dev/null
>>> +++ b/include/hw/rtc/mc146818rtc.h
>>> @@ -0,0 +1,38 @@
>>> +/*
>>> + * QEMU MC146818 RTC emulation
>>> + *
>>> + * Copyright (c) 2003-2004 Fabrice Bellard
>>> + *
>>> + * Permission is hereby granted, free of charge, to any person obtaining a copy
>>> + * of this software and associated documentation files (the "Software"), to deal
>>> + * in the Software without restriction, including without limitation the rights
>>> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
>>> + * copies of the Software, and to permit persons to whom the Software is
>>> + * furnished to do so, subject to the following conditions:
>>> + *
>>> + * The above copyright notice and this permission notice shall be included in
>>> + * all copies or substantial portions of the Software.
>>> + *
>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
>>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>>> + * THE SOFTWARE.
>>> + */
>>
>> If you run "git blame" on the old header file, it does not seem like
>> Fabrice wrote this header, so I'm not sure whether it makes sense to add
>> his (c) statement here?
>>
>> Maybe rather use a one-line "SPDX-License-Identifier: GPL-2.0-or-later"
>> here?
> 
> It was first added by Fabrice here:
> 
> $ git show 80cabfad163
[...]
> diff --git a/vl.h b/vl.h
> index 35962d1985..026a5dee5a 100644
> --- a/vl.h
> +++ b/vl.h
> +/* mc146818rtc.c */
> +
> +typedef struct RTCState {
> +    uint8_t cmos_data[128];
> +    uint8_t cmos_index;
> +    int irq;
> +} RTCState;
> +
> +extern RTCState rtc_state;
> +
> +void rtc_init(int base, int irq);
> +void rtc_timer(void);

Ok, fair. But vl.h had a slightly different copyright statement than
vl.c, so I think you should rather use the one from vl.h.
But IMHO you could at least drop the "THE SOFTWARE IS PROVIDED ..."
paragraph and add a SPDX tag instead?

 Thomas


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-17 20:32   ` Richard Henderson
@ 2019-09-18 10:52     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-18 10:52 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Igor Mammedov,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Paolo Bonzini, Aurelien Jarno

On 9/17/19 10:32 PM, Richard Henderson wrote:
> On 9/16/19 11:48 AM, Philippe Mathieu-Daudé wrote:
>>  include/hw/rtc/mc146818rtc.h                 | 38 ++++++++++++++++++++
> 
> Same rebase failure as for patch 4?

This one is actually correct, it got moved from:

 include/hw/timer/mc146818rtc.h               | 14 --------

The difference is the addition of missing copyright/license.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [Qemu-devel] [PATCH 03/13] hw: Move MC146818 device from hw/timer/ to hw/rtc/ subdirectory
  2019-09-18  7:43       ` Thomas Huth
@ 2019-09-18 11:02         ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-18 11:02 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Eduardo Habkost,
	Alistair Francis, qemu-arm, Cédric Le Goater, Paolo Bonzini,
	Richard Henderson, Andrew Jeffery, qemu-ppc, Aleksandar Markovic,
	Igor Mammedov, Aurelien Jarno

On 9/18/19 9:43 AM, Thomas Huth wrote:
> On 17/09/2019 12.03, Philippe Mathieu-Daudé wrote:
>> On 9/17/19 7:07 AM, Thomas Huth wrote:
>>> On 16/09/2019 17.48, Philippe Mathieu-Daudé wrote:
>>>> The MC146818 is a Real Time Clock, not a timer.
>>>> Move it under the hw/rtc/ subdirectory.
>>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> [...]
>>>> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
>>>> new file mode 100644
>>>> index 0000000000..888e04f9ab
>>>> --- /dev/null
>>>> +++ b/include/hw/rtc/mc146818rtc.h
>>>> @@ -0,0 +1,38 @@
>>>> +/*
>>>> + * QEMU MC146818 RTC emulation
>>>> + *
>>>> + * Copyright (c) 2003-2004 Fabrice Bellard
>>>> + *
>>>> + * Permission is hereby granted, free of charge, to any person obtaining a copy
>>>> + * of this software and associated documentation files (the "Software"), to deal
>>>> + * in the Software without restriction, including without limitation the rights
>>>> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
>>>> + * copies of the Software, and to permit persons to whom the Software is
>>>> + * furnished to do so, subject to the following conditions:
>>>> + *
>>>> + * The above copyright notice and this permission notice shall be included in
>>>> + * all copies or substantial portions of the Software.
>>>> + *
>>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
>>>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>>>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>>>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>>>> + * THE SOFTWARE.
>>>> + */
>>>
>>> If you run "git blame" on the old header file, it does not seem like
>>> Fabrice wrote this header, so I'm not sure whether it makes sense to add
>>> his (c) statement here?
>>>
>>> Maybe rather use a one-line "SPDX-License-Identifier: GPL-2.0-or-later"
>>> here?
>>
>> It was first added by Fabrice here:
>>
>> $ git show 80cabfad163
> [...]
>> diff --git a/vl.h b/vl.h
>> index 35962d1985..026a5dee5a 100644
>> --- a/vl.h
>> +++ b/vl.h
>> +/* mc146818rtc.c */
>> +
>> +typedef struct RTCState {
>> +    uint8_t cmos_data[128];
>> +    uint8_t cmos_index;
>> +    int irq;
>> +} RTCState;
>> +
>> +extern RTCState rtc_state;
>> +
>> +void rtc_init(int base, int irq);
>> +void rtc_timer(void);
> 
> Ok, fair. But vl.h had a slightly different copyright statement than
> vl.c, so I think you should rather use the one from vl.h.
> But IMHO you could at least drop the "THE SOFTWARE IS PROVIDED ..."
> paragraph and add a SPDX tag instead?

I find SPDX tags clearer too, but last time I wanted to use them Peter said:

  I think we should not do that until/unless
  somebody (probably a corporate somebody) steps forward
  to make the argument for "this is why we should have them,
  we as a contributor to the project think they are worthwhile
  and a useful feature for us, and we will make the effort to
  add them, review that they are correct, update checkpatch to
  insist on tags for new files, etc". In other words, "if it
  ain't broke, don't fix it"; nobody is yet complaining that
  our current setup is broken.

https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg04151.html

At this time we had less:

$ git grep SPDX v3.1.0 | egrep -v linux-headers | wc -l
21

Since we few entered, so we have a mix:

$ git grep SPDX origin/master | egrep -v linux-headers | wc -l
79


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 11/13] hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory
  2019-09-16 17:21   ` Cédric Le Goater
@ 2019-10-03 10:55     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-03 10:55 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Mark Cave-Ayland,
	Edgar E. Iglesias, Aleksandar Rikalo, Helge Deller,
	Hervé Poussineau, Joel Stanley, David Gibson,
	Artyom Tarasenko, Laurent Vivier, Thomas Huth, Eduardo Habkost,
	Alistair Francis, qemu-arm, Paolo Bonzini, Richard Henderson,
	Andrew Jeffery, qemu-ppc, Aleksandar Markovic, Igor Mammedov,
	Aurelien Jarno

On 9/16/19 7:21 PM, Cédric Le Goater wrote:
> On 16/09/2019 17:48, Philippe Mathieu-Daudé wrote:
>> Move RTC devices under the hw/rtc/ subdirectory.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> I suppose the removal of the header files in "aspeed_rtc.h" is OK.

They are not used. It is probably cleaner to do this change in a 
separate patch.

> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks!

[...]
>> diff --git a/include/hw/timer/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
>> similarity index 92%
>> rename from include/hw/timer/aspeed_rtc.h
>> rename to include/hw/rtc/aspeed_rtc.h
>> index 15ba42912b..156c8faee3 100644
>> --- a/include/hw/timer/aspeed_rtc.h
>> +++ b/include/hw/rtc/aspeed_rtc.h
>> @@ -8,9 +8,6 @@
>>   #ifndef ASPEED_RTC_H
>>   #define ASPEED_RTC_H
>>   
>> -#include <stdint.h>
>> -
>> -#include "hw/irq.h"
>>   #include "hw/sysbus.h"
>>   
>>   typedef struct AspeedRtcState {
>>


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2019-10-03 10:56 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 15:48 [Qemu-devel] [PATCH 00/13] hw: Split RTC devices from hw/timer/ to hw/rtc/ Philippe Mathieu-Daudé
2019-09-16 15:48 ` [Qemu-devel] [PATCH 01/13] hw/timer: Compile devices not target-dependent as common object Philippe Mathieu-Daudé
2019-09-16 17:28   ` Alistair Francis
2019-09-17  4:57   ` Thomas Huth
2019-09-16 15:48 ` [Qemu-devel] [PATCH 02/13] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory Philippe Mathieu-Daudé
2019-09-16 18:12   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 03/13] hw: Move MC146818 " Philippe Mathieu-Daudé
2019-09-16 21:22   ` Alistair Francis
2019-09-17  2:23   ` David Gibson
2019-09-17  5:07   ` Thomas Huth
2019-09-17 10:03     ` Philippe Mathieu-Daudé
2019-09-18  7:43       ` Thomas Huth
2019-09-18 11:02         ` Philippe Mathieu-Daudé
2019-09-17 20:32   ` Richard Henderson
2019-09-18 10:52     ` Philippe Mathieu-Daudé
2019-09-16 15:48 ` [Qemu-devel] [PATCH 04/13] hw: Move M48T59 " Philippe Mathieu-Daudé
2019-09-16 21:23   ` Alistair Francis
2019-09-17  2:25   ` David Gibson
2019-09-17 10:08     ` Philippe Mathieu-Daudé
2019-09-16 15:48 ` [Qemu-devel] [PATCH 05/13] hw: Move M41T80 " Philippe Mathieu-Daudé
2019-09-16 21:26   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 06/13] hw: Move sun4v hypervisor RTC " Philippe Mathieu-Daudé
2019-09-16 21:27   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 07/13] hw: Move TWL92230 device " Philippe Mathieu-Daudé
2019-09-16 21:39   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 08/13] hw: Move DS1338 " Philippe Mathieu-Daudé
2019-09-16 21:43   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 09/13] hw: Move Xilinx ZynqMP RTC " Philippe Mathieu-Daudé
2019-09-16 21:44   ` Alistair Francis
2019-09-17 10:28     ` Philippe Mathieu-Daudé
2019-09-17 23:29       ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 10/13] hw: Move Exynos4210 " Philippe Mathieu-Daudé
2019-09-16 21:45   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 11/13] hw: Move Aspeed " Philippe Mathieu-Daudé
2019-09-16 17:21   ` Cédric Le Goater
2019-10-03 10:55     ` Philippe Mathieu-Daudé
2019-09-16 21:46   ` [Qemu-devel] " Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 12/13] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less Philippe Mathieu-Daudé
2019-09-16 21:46   ` Alistair Francis
2019-09-16 15:48 ` [Qemu-devel] [PATCH 13/13] hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include Philippe Mathieu-Daudé
2019-09-16 21:47   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.