summaryrefslogtreecommitdiff
path: root/hw/gpio
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-09-16 17:46:14 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-21 16:34:27 +0100
commit940caf1f7e91619c58ed909914628d1473f8d9f6 (patch)
tree07667c0aac65324c4195c327b5c250ae2f3df425 /hw/gpio
parent7b675f1f971ba8a65711e38c2a2faac4244899c1 (diff)
downloadqemu-940caf1f7e91619c58ed909914628d1473f8d9f6.zip
hw/gpio/omap_gpio.c: Don't use old_mmio
Drop the use of old_mmio in the omap2_gpio memory ops. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 1505580378-9044-3-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/gpio')
-rw-r--r--hw/gpio/omap_gpio.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index 1df394eb12..17891e2d0f 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -525,17 +525,23 @@ static void omap2_gpio_module_write(void *opaque, hwaddr addr,
}
}
-static uint32_t omap2_gpio_module_readp(void *opaque, hwaddr addr)
+static uint64_t omap2_gpio_module_readp(void *opaque, hwaddr addr,
+ unsigned size)
{
return omap2_gpio_module_read(opaque, addr & ~3) >> ((addr & 3) << 3);
}
static void omap2_gpio_module_writep(void *opaque, hwaddr addr,
- uint32_t value)
+ uint64_t value, unsigned size)
{
uint32_t cur = 0;
uint32_t mask = 0xffff;
+ if (size == 4) {
+ omap2_gpio_module_write(opaque, addr, value);
+ return;
+ }
+
switch (addr & ~3) {
case 0x00: /* GPIO_REVISION */
case 0x14: /* GPIO_SYSSTATUS */
@@ -581,18 +587,10 @@ static void omap2_gpio_module_writep(void *opaque, hwaddr addr,
}
static const MemoryRegionOps omap2_gpio_module_ops = {
- .old_mmio = {
- .read = {
- omap2_gpio_module_readp,
- omap2_gpio_module_readp,
- omap2_gpio_module_read,
- },
- .write = {
- omap2_gpio_module_writep,
- omap2_gpio_module_writep,
- omap2_gpio_module_write,
- },
- },
+ .read = omap2_gpio_module_readp,
+ .write = omap2_gpio_module_writep,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
.endianness = DEVICE_NATIVE_ENDIAN,
};