]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 31 Mar 2020 09:59:49 +0000 (11:59 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 9 Jun 2020 07:21:10 +0000 (09:21 +0200)
The Plug & Play region of the AHB/APB bridge can be accessed
by various word size, however the implementation is clearly
restricted to 32-bit:

  static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
  {
      AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);

      return ahb_pnp->regs[offset >> 2];
  }

Similarly to commit 0fbe394a64 with the APB PnP registers,
set the MemoryRegionOps::impl min/max fields to 32-bit, so
memory.c::access_with_adjusted_size() can adjust when the
access is not 32-bit.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20200331105048.27989-4-f4bug@amsat.org>

hw/misc/grlib_ahb_apb_pnp.c

index 72a876477667c8d6ef49fea9ac995487666c3023..d22ed00206b2455b6e968a87c9a836299aee02ae 100644 (file)
@@ -146,6 +146,10 @@ static const MemoryRegionOps grlib_ahb_pnp_ops = {
     .read       = grlib_ahb_pnp_read,
     .write      = grlib_ahb_pnp_write,
     .endianness = DEVICE_BIG_ENDIAN,
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
 };
 
 static void grlib_ahb_pnp_realize(DeviceState *dev, Error **errp)