From patchwork Wed Sep 21 18:09:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 672999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sfSNK1JWYz9sD5 for ; Thu, 22 Sep 2016 04:10:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nathanrossi.com header.i=@nathanrossi.com header.b=GkoYSx58; dkim-atps=neutral Received: from localhost ([::1]:48350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmlye-0005mn-Lw for incoming@patchwork.ozlabs.org; Wed, 21 Sep 2016 14:10:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmlxy-0005N8-5D for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmlxs-0000HF-Lq for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:09:53 -0400 Received: from rs224.mailgun.us ([209.61.151.224]:55814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmlxs-0000H8-GK for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:09:48 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=nathanrossi.com; q=dns/txt; s=pic; t=1474481387; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=M5PqEGGErrrvpi3KP5/KlLIBMHfDNqD+zgKTfe4xK3o=; b=GkoYSx58grTRpSY25UEVT6gm9xHrJAQT8hKR+utJXGXL3OVADZGaEU0d4BRotKlMgDNhRsKg 85ZDDIORyFhoog0p2MlJkb3NqRltkmdqMOp8yCIB8b5KcTs1A1PoFDqVz7+fMqPonz2Ulx0Y pAWho5anaB+vPhXwHCL3YPI2tCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=nathanrossi.com; s=pic; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id; b=S/eaNb7aOTmFZFJbCTyTHSW3XDkpiL6r3Z2KvH5Zdkl1IEV0Msz0nShXNk/YerVZRyHXh2 ASjXohhR7xeou783/DYdoWgdvrLlNo9p2UGKG7SmvPJ/oc4FGyESpXnomVSXSxO5kApYmNqV 7jKAFHS8t2CsWeRzFa+q83vDKJA3o= X-Mailgun-Sending-Ip: 209.61.151.224 X-Mailgun-Sid: WyIwNWEzZCIsICJxZW11LWRldmVsQG5vbmdudS5vcmciLCAiNjJkOTViIl0= Received: from nathanbox.home.rossihq.com (CPE-124-186-123-69.lns10.woo.bigpond.net.au [124.186.123.69]) by mxa.mailgun.org with ESMTP id 57e2cceb.7fe779d223b0-in8; Wed, 21 Sep 2016 18:09:47 -0000 (UTC) From: Nathan Rossi To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 04:09:11 +1000 Message-Id: <20160921180911.32289-1-nathan@nathanrossi.com> X-Mailer: git-send-email 2.9.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.61.151.224 Subject: [Qemu-devel] [PATCH] dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Alistair Francis , Nathan Rossi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Alistair Francis --- 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