From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoKu-0003iv-Up for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:41:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmoKs-0007nt-Ne for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:41:43 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:33438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoKs-0007ap-Gw for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:41:42 -0400 Received: by mail-oi0-x243.google.com with SMTP id w11so4716269oia.0 for ; Wed, 21 Sep 2016 13:41:21 -0700 (PDT) MIME-Version: 1.0 Sender: alistair23@gmail.com In-Reply-To: <20160921180911.32289-1-nathan@nathanrossi.com> References: <20160921180911.32289-1-nathan@nathanrossi.com> From: Alistair Francis Date: Wed, 21 Sep 2016 13:40:50 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Rossi , Peter Maydell Cc: "qemu-devel@nongnu.org Developers" , "Edgar E. Iglesias" , Alistair Francis On Wed, Sep 21, 2016 at 11:09 AM, Nathan Rossi wrote: > Whilst according to the Zynq TRM this device covers a register region of > 0x000 - 0x120. The register region is also shared with XADCIF prefix > registers at 0x100 and above. Due to how the devcfg and the xadc devices > are implemented in QEMU these are separate models with individual mmio > regions. As such the region registered by the devcfg overlaps with the > xadc when initialized in a machine model (e.g. xilinx-zynq-a9). > > This patch fixes up the incorrect region size, where > XLNX_ZYNQ_DEVCFG_R_MAX is missing its '/ 4' causing it to be 0x460 in > size. As well as setting the region size to the 0x0 - 0x100 region so > that an xadc device instance can be registered in the correct region to > pair with the devcfg device instance. > > Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x118: > dev: xlnx.ps7-dev-cfg, id "" > mmio 00000000f8007000/0000000000000460 > dev: xlnx,zynq-xadc, id "" > mmio 00000000f8007100/0000000000000020 > > Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x100 / 4: > dev: xlnx.ps7-dev-cfg, id "" > mmio 00000000f8007000/0000000000000100 > dev: xlnx,zynq-xadc, id "" > mmio 00000000f8007100/0000000000000020 > > Signed-off-by: Nathan Rossi Good catch. What came up that caused you to find this? Can this go via the target-arm queue Peter? Reviewed-by: Alistair Francis Thanks, Alistair > --- > include/hw/dma/xlnx-zynq-devcfg.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/hw/dma/xlnx-zynq-devcfg.h b/include/hw/dma/xlnx-zynq-devcfg.h > index d40e5c8df6..9f5119a89a 100644 > --- a/include/hw/dma/xlnx-zynq-devcfg.h > +++ b/include/hw/dma/xlnx-zynq-devcfg.h > @@ -34,7 +34,7 @@ > #define XLNX_ZYNQ_DEVCFG(obj) \ > OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG) > > -#define XLNX_ZYNQ_DEVCFG_R_MAX 0x118 > +#define XLNX_ZYNQ_DEVCFG_R_MAX (0x100 / 4) > > #define XLNX_ZYNQ_DEVCFG_DMA_CMD_FIFO_LEN 10 > > -- > 2.9.3 >