Skip to contentSkip to conversation

Drop support for qdev taddr properties

PATCH Applied Peter Maydell 2 participants 4 messages Apr 20, 2013 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

v3 cover Drop support for qdev taddr properties

There is currently only one user of the qdev taddr (target addr, now hwaddr) property code, and that user is wrong anyway, since the property it's trying to set isn't actually a taddr property. Fix the erroneous use in sm501 and drop all the taddr property code.

The justification for dropping the support is that a device should generally not be exposing properties whose width (conceptually) depends on the target CPU type. (This is the same rationale for not supporting hwaddr fields in migration state.) Instead the device should expose either a 32 bit or 64 bit property, depending on what the actual hardware does.

Changes v2->v3:
* rebased and fixed trivial textual conflict in xilinx_axidma.c
Changes v1->v2:
* no functional changes, just rebased since Paolo's moved everything around and the old patches won't apply

Peter Maydell (2):
hw/sm501: Use correct setter for sysbus-ohci dma-address property
qdev: Drop taddr properties

 hw/block/fdc.c              |    1 -
 hw/core/Makefile.objs       |    1 -
 hw/core/qdev-addr.c         |   78 -------------------------------------------
 hw/display/sm501.c          |    3 +-
 hw/display/tcx.c            |    1 -
 hw/dma/xilinx_axidma.c      |    1 -
 hw/lm32/milkymist-hw.h      |    1 -
 hw/net/milkymist-minimac2.c |    1 -
 hw/sparc/sun4m.c            |    1 -
 include/hw/qdev-addr.h      |   10 ------
 10 files changed, 1 insertion(+), 97 deletions(-)
 delete mode 100644 hw/core/qdev-addr.c
 delete mode 100644 include/hw/qdev-addr.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/2 hw/sm501: Use correct setter for sysbus-ohci dma-address property

The sysbus-ohci dma-address property is declared as a HEX64 property, not a TADDR, so use the correct setter for it.

---
 hw/display/sm501.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/sm501.c +1 -1
index f0e6d70..fc5e539 100644
@@ -1434,7 +1434,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
     /* bridge to usb host emulation module */
     dev = qdev_create(NULL, "sysbus-ohci");
     qdev_prop_set_uint32(dev, "num-ports", 2);
-    qdev_prop_set_taddr(dev, "dma-offset", base);
+    qdev_prop_set_uint64(dev, "dma-offset", base);
     qdev_init_nofail(dev);
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
                     base + MMIO_BASE_OFFSET + SM501_USB_HOST);
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 2/2 qdev: Drop taddr properties

In reply to Peter Maydell

Drop all the infrastructure for taddr properties (ie ones which are 'hwaddr' sized). These are now unused, and any further desired use would be rather questionable since device properties shouldn't generally depend on a type that is conceptually variable based on the target CPU. 32 or 64 bit integer properties should be used instead as appropriate for the specific device.

---
 hw/block/fdc.c              |    1 -
 hw/core/Makefile.objs       |    1 -
 hw/core/qdev-addr.c         |   78 -------------------------------------------
 hw/display/sm501.c          |    1 -
 hw/display/tcx.c            |    1 -
 hw/dma/xilinx_axidma.c      |    1 -
 hw/lm32/milkymist-hw.h      |    1 -
 hw/net/milkymist-minimac2.c |    1 -
 hw/sparc/sun4m.c            |    1 -
 include/hw/qdev-addr.h      |   10 ------
 10 files changed, 96 deletions(-)
 delete mode 100644 hw/core/qdev-addr.c
 delete mode 100644 include/hw/qdev-addr.h
hw/block/fdc.c +0 -1
index 1ed874f..f1f1fd7 100644
@@ -33,7 +33,6 @@
 #include "qemu/timer.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
hw/core/Makefile.objs +0 -1
index 94109f3..950146c 100644
@@ -9,6 +9,5 @@ common-obj-$(CONFIG_PTIMER) += ptimer.o
 common-obj-$(CONFIG_SOFTMMU) += sysbus.o
 common-obj-$(CONFIG_SOFTMMU) += null-machine.o
 common-obj-$(CONFIG_SOFTMMU) += loader.o
-common-obj-$(CONFIG_SOFTMMU) += qdev-addr.o
 common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o
 
hw/core/qdev-addr.c deleted +0 -78

78 lines not on this page · raw message

hw/display/sm501.c +0 -1
index fc5e539..916816f 100644
@@ -28,7 +28,6 @@
 #include "ui/console.h"
 #include "hw/devices.h"
 #include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
 #include "qemu/range.h"
 #include "ui/pixel_ops.h"
 
hw/display/tcx.c +0 -1
index 77c7191..d7465c6 100644
@@ -26,7 +26,6 @@
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
 #include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
 
 #define MAXX 1024
 #define MAXY 768
hw/dma/xilinx_axidma.c +0 -1
index bc62664..3a3ef8a 100644
@@ -26,7 +26,6 @@
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
-#include "hw/qdev-addr.h"
 #include "qapi/qmp/qerror.h"
 
 #include "hw/stream.h"
hw/lm32/milkymist-hw.h +0 -1
index 4e86c4e..5317ce6 100644
@@ -2,7 +2,6 @@
 #define QEMU_HW_MILKYMIST_H
 
 #include "hw/qdev.h"
-#include "hw/qdev-addr.h"
 #include "net/net.h"
 
 static inline DeviceState *milkymist_uart_create(hwaddr base,
hw/net/milkymist-minimac2.c +0 -1
index 29618e8..4ef6318 100644
@@ -27,7 +27,6 @@
 #include "trace.h"
 #include "net/net.h"
 #include "qemu/error-report.h"
-#include "hw/qdev-addr.h"
 
 #include <zlib.h>
 
hw/sparc/sun4m.c +0 -1
index 31beb32..635115f 100644
@@ -37,7 +37,6 @@
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
 #include "hw/empty_slot.h"
-#include "hw/qdev-addr.h"
 #include "hw/loader.h"
 #include "elf.h"
 #include "sysemu/blockdev.h"
include/hw/qdev-addr.h deleted +0 -10
deleted file mode 100644
index 79708e6..0000000
@@ -1,10 +0,0 @@
-#ifndef HW_QDEV_ADDR_H
-#define HW_QDEV_ADDR_H 1
-
-#define DEFINE_PROP_TADDR(_n, _s, _f, _d)                               \
-    DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, hwaddr)
-
-extern PropertyInfo qdev_prop_taddr;
-void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value);
-
-#endif
Signature · 1 line
1.7.9.5
Applied
#3 lore raw
In reply to Peter Maydell

Thanks, applied all.

Quoted 39 lines · Peter Maydell

There is currently only one user of the qdev taddr (target addr, now hwaddr) property code, and that user is wrong anyway, since the property it's trying to set isn't actually a taddr property. Fix the erroneous use in sm501 and drop all the taddr property code.

The justification for dropping the support is that a device should generally not be exposing properties whose width (conceptually) depends on the target CPU type. (This is the same rationale for not supporting hwaddr fields in migration state.) Instead the device should expose either a 32 bit or 64 bit property, depending on what the actual hardware does.

Changes v2->v3:
* rebased and fixed trivial textual conflict in xilinx_axidma.c
Changes v1->v2:
* no functional changes, just rebased since Paolo's moved everything around and the old patches won't apply

Peter Maydell (2):
hw/sm501: Use correct setter for sysbus-ohci dma-address property
qdev: Drop taddr properties

 hw/block/fdc.c              |    1 -
 hw/core/Makefile.objs       |    1 -
 hw/core/qdev-addr.c         |   78 -------------------------------------------
 hw/display/sm501.c          |    3 +-
 hw/display/tcx.c            |    1 -
 hw/dma/xilinx_axidma.c      |    1 -
 hw/lm32/milkymist-hw.h      |    1 -
 hw/net/milkymist-minimac2.c |    1 -
 hw/sparc/sun4m.c            |    1 -
 include/hw/qdev-addr.h      |   10 ------
 10 files changed, 1 insertion(+), 97 deletions(-)
 delete mode 100644 hw/core/qdev-addr.c
 delete mode 100644 include/hw/qdev-addr.h

--
1.7.9.5