]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/dma/zynq-devcfg: Fix register memory
authorYannick Voßen <y.vossen@beckhoff.com>
Tue, 11 Nov 2025 10:28:29 +0000 (11:28 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 18 Nov 2025 18:59:31 +0000 (19:59 +0100)
Registers are always 32 bit aligned. R_MAX is not the maximum
register address, it is the maximum register number. The memory
size can be determined by 4 * R_MAX.

Currently every register with an offset bigger than 0x40 will be
ignored, because the memory size is set wrong. This effects the
MCTRL register and makes it useless. This commit restores the
correct behaviour.

Cc: qemu-stable@nongnu.org
Fixes: 034c2e69023 ("dma: Add Xilinx Zynq devcfg device model")
Signed-off-by: YannickV <Y.Vossen@beckhoff.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251111102836.212535-9-corvin.koehne@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/dma/xlnx-zynq-devcfg.c

index 26845713ee55b969f472d269a912a51408df25de..8141d46033873408293d65105ca784f9975b4749 100644 (file)
@@ -372,7 +372,7 @@ static void xlnx_zynq_devcfg_init(Object *obj)
                               s->regs_info, s->regs,
                               &xlnx_zynq_devcfg_reg_ops,
                               XLNX_ZYNQ_DEVCFG_ERR_DEBUG,
-                              XLNX_ZYNQ_DEVCFG_R_MAX);
+                              XLNX_ZYNQ_DEVCFG_R_MAX * 4);
     memory_region_add_subregion(&s->iomem,
                                 A_CTRL,
                                 &reg_array->mem);