From patchwork Wed Jun 20 14:17:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 10477631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9529860210 for ; Wed, 20 Jun 2018 14:19:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 856E428E3B for ; Wed, 20 Jun 2018 14:19:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7882828E89; Wed, 20 Jun 2018 14:19:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA60F28E3B for ; Wed, 20 Jun 2018 14:19:35 +0000 (UTC) Received: from localhost ([::1]:49989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVdxP-0006Ao-4e for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Jun 2018 10:19:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVdwO-0005UO-6u for qemu-devel@nongnu.org; Wed, 20 Jun 2018 10:18:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVdwJ-0002XH-6x for qemu-devel@nongnu.org; Wed, 20 Jun 2018 10:18:32 -0400 Received: from mail-eopbgr700064.outbound.protection.outlook.com ([40.107.70.64]:3563 helo=NAM04-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fVdwI-0002Wz-RU for qemu-devel@nongnu.org; Wed, 20 Jun 2018 10:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jp5wbhypAqDFgaaHGCdI16Q2eO2U8m7LQjJkDA6FKME=; b=Ggnu3lzeRPX/R/rz3Pr/t4Pj3YJH8DqUrJ4f8puIS+bl5TMPZiMXOpS8V8vQ6tD3hrIsVEdf8Cx356vYC/YEJGHOwJJIMY60UF+T07PF9D1zMhMxZqVJYemlGYjwDlCZd4OrYvKY4CwQZlGY3HoMPte4Iqzs3MHXF6e2bN2543s= Received: from BN7PR02CA0007.namprd02.prod.outlook.com (2603:10b6:408:20::20) by BL2PR02MB2148.namprd02.prod.outlook.com (2a01:111:e400:c74b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.17; Wed, 20 Jun 2018 14:18:24 +0000 Received: from BL2NAM02FT055.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BN7PR02CA0007.outlook.office365.com (2603:10b6:408:20::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.19 via Frontend Transport; Wed, 20 Jun 2018 14:18:24 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT055.mail.protection.outlook.com (10.152.77.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.884.17 via Frontend Transport; Wed, 20 Jun 2018 14:18:24 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35218 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fVdwF-0005Oa-E6; Wed, 20 Jun 2018 07:18:23 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fVdwA-0006ar-71; Wed, 20 Jun 2018 07:18:18 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w5KEIHuB021243; Wed, 20 Jun 2018 07:18:17 -0700 Received: from [172.23.37.96] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fVdw8-0006aY-V2; Wed, 20 Jun 2018 07:18:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id E4DBF13C1234; Wed, 20 Jun 2018 19:48:08 +0530 (IST) From: Sai Pavan Boddu To: Date: Wed, 20 Jun 2018 19:47:55 +0530 Message-ID: <1529504276-14942-1-git-send-email-saipava@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(396003)(376002)(346002)(2980300002)(438002)(199004)(189003)(47776003)(2906002)(42186006)(16586007)(316002)(8676002)(51416003)(356003)(575784001)(8936002)(5660300001)(106466001)(54906003)(63266004)(106002)(6916009)(6666003)(26005)(186003)(59450400001)(81166006)(81156014)(36756003)(6266002)(486006)(48376002)(305945005)(478600001)(426003)(2616005)(50226002)(476003)(103686004)(126002)(336012)(4326008)(39060400002)(90966002)(52956003)(50466002)(2351001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB2148; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT055; 1:TKlqqqiNveI4xiay8jQLgpKQ49CQD0J3zpWXo3Ifey9RQ7iE3ppgHYp1SDDk8a0GtTPtjtd8itWCpd6/FxsYQxkJKt856B02Ypx2pNaDK3MKB3XZIte3fphxXj5z5qfR MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a2bc1eef-1f4a-4d3c-3271-08d5d6b8af18 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(4608076)(2017052603328)(7153060); SRVR:BL2PR02MB2148; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2148; 3:96bG990SkCU+iVksjewW+WpsPKTSuynADfiH4JkIZ1zmSwTK/B92K6YOgtYm1Al98OE3zBDQRj/fq5uvwWrO8/Qxby2MdK3j/rBgHpKeHwof/y5M93LRt4hrYOggyQB7nih7BLxVvCr7VPYLGevXjWA32tLZZu6XJGKp5014UKL73c0UcTMGd59SJ/BkDphROMEK40KgV8j3WhB0Ls5p/PixZdtdozaYTL8KLgZX+7aJhA3tDWhNWB5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IKL/SIJGSyfVekauG7fXWDpalZ7mXl199ziGuE2OkwPy7Gd+NNijt/31Nlaf/fgWNRQ4gofDdXgkWZaRwbLFp+ex+HTskiEUT9jfuGUBTGgHbgxJMp336b9kDPRjkscjaI3Lxrt4zxZoRoPgPo7/Wmc14sa+tlTcGIx17HjSrqVG9Zdfx78wzPOF7cgNX7DeBVi3eOuu5GWJI8/mZFFGgUSp X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BL2PR02MB2148; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02MB2148; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2148; 4:lzzpZb3/9TRVITu2BwHDA5v3PTE8sh4MSdsJjfVj8Gju8nr/BHDR8T4+nP5kMD/9V+zcNt4dd4yLFg2tGuDaADZKJkLLUMtYLcIuv1Y2nG2T5VEIoXLDrJFj6Sux8XzicZJQ/Z9zWGzzQnaOG5L5yZUo10qK0VsTttcIgQ+kL51E6bMguGCxp8784Gn4vABlOl29PQwn8nnCi32nZHtNkgVGrrum/8I7utcSJGBgnTCCMZogavX8u3RLhQhZ/zhRR9AK9JY62g/u86cUYcKpLmdVLbiCu3oqv1xdkIaxJi/sKc/s7UspP3uhOiuW+vyV X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR02MB2148; 23:teCNxFDFhddKNOfr2nhdSGGwg+9WBjoepoYrtzmIQ?= =?us-ascii?Q?7vuV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A?= =?us-ascii?Q?uQRtbtdZB4mm/bkyo7MnkgvxU3letzypi63RkzKEnax42Qv9Gri54j6OE4io?= =?us-ascii?Q?hosq2WCqmI9K57JrpOoLie3HaMVmnl1DSrfNtYnOMeigk83YC0/SGLtZ2c+H?= =?us-ascii?Q?pkxDeLh1+5/TCijqCm+HulXWMRbnCwbGVI62kd8fCV4UevFRO5X6PSreCYL9?= =?us-ascii?Q?IQ2e+w621V2xxR7ytLMB7STuwsMHsyUn1dqxWvDencDJR4nT3qhZJdswcMQp?= =?us-ascii?Q?9xVvX0KzTwkj5E=3D?= X-Microsoft-Antispam-Message-Info: CBsvws4T15WHAC4AUqpqamCHQg81QAd9Yab8ku9pFpNj359q0yufTBWWdxZEtNYy7HTkxeFHwIf5ucSZc31yPiVwDWc8fQRDFV+4kUy12BR8Kh1fjzaIWE/z4FeifdlJVYi8eF7ERtCE4x1G4hM73dgChJQ4kueVo3TbnkID1BApawj65A1sNeQnIYOyOBO8Op8CG76dm71g07eFc5JUhx2eCawAO0VDS01+zhNt86aZKBlE7SGH1tUOh6eqEAB2FqF9WrTvHqLA9MxEXWUHrM47/cQ02MQ461zpsxXwC90RKQirg205W/TY81v2wHlAoiDK+rvvjuDjKT+oOg97kg== X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2148; 6:pjn9BspLSymEEayUw+1m4pVJfa03/SE+AQKSOJA7R1ZY4POBul7l5IHKf4iEQrMc0qNt+YuePmCLHCob7ZQW/x6eMMFNgywdI9+Zp1MFwi05HuzyjfJpEgTIvEs84Pdb3vJOQpQdggoZ2dlRzSbKK5sQ2DagsuPQrtGJmHOk1rBTk8dhORbqdUEY+ZTylEAo99IpZKRrCtS0URgBJElriJHCSN0/GHnOmxelh+aCpLPp/VieAg/EU+MNbO/vRM0A6Y7aLlXQ/QkB5/EsjXNOMM4RdRypR0F4n5pO1eodmhHAlx0gtt0wXSpTPTlyEY6WJYKRi3I+ZumgAZdqE4IFrJPYhMnKQ/uC45DanT7CsCeM34mPB4MvHrq6kJ3vXzg228TH4zyvYE/DUUB3flKhR3GD9xsjXNxAEINx94I10qbsrNIfXsXga6SuGew7wnSY8wPFtyl288xYJLLVrOrk6Q==; 5:NEKyfchsqhlTjZrGpfW1+G3+IQGRFBlCylsyFKuSVWFX8aDY1A4hFrlFiOe022mxTCMqx5gnzRaSB++hQvY/k1FRAX7rbICkB2WK8xVLexkkbvTuXKfXkBO78oCEeLk1+byG04euSV4ZRsZvOeJbwq7fWqw9rCgnYXRUebDE7mU=; 24:heQBKc6jBzhtg8J1bHMyEo8iAxfRKUHYd0n+8s86jIB4rQ3rqD8HfZbtYQBGBxg6+aUhnGjwgamiFez5lyKduMwTqep+d/i8GlitGt401h8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2148; 7:RMomnt+cVcrJ3rMoeotpWVPGbbumH9zMJMTe6fa3ez6ge/EXdJKqFm1q2i8PldtLsWEkfDrntupVY9p88KQRTorz6tJi8s54Nr+FQ9s+1s81ache1yGpVMWQMIt44YCeV35o6PAG7nvAZWuGudlQNZuEKcjzD8Ny6Vg8cFNkCTUBhPOsJG7CE7tYrOJ4FJYWNC/48GB5/PzPwZJFphldLe+t+lb3nkfByUq4E6WXNCEIcPKaDUdPWOdGOQGlPQj9 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 14:18:24.0218 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2bc1eef-1f4a-4d3c-3271-08d5d6b8af18 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR02MB2148 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.70.64 Subject: [Qemu-devel] [PATCH v3] xilinx_spips: Make dma transactions as per dma_burst_size 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" , Peter Maydell , Peter Crosthwaite , Francisco Iglesias , Alistair Francis , KONRAD Frederic Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Qspi dma has a burst length of 64 bytes, So limit the transactions w.r.t dma-burst-size property. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias --- Changes for V2: Remove dynamic allocation of dma_buf and limit burst size to 2k Changes for V3: Instead of proceeding with max burst size, report user the error. hw/ssi/xilinx_spips.c | 23 ++++++++++++++++++++--- include/hw/ssi/xilinx_spips.h | 5 ++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index 03f5fae..d6ca36e 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -851,12 +851,17 @@ static void xlnx_zynqmp_qspips_notify(void *opaque) { size_t ret; uint32_t num; - const void *rxd = pop_buf(recv_fifo, 4, &num); + const void *rxd; + int len; + + len = recv_fifo->num >= rq->dma_burst_size ? rq->dma_burst_size : + recv_fifo->num; + rxd = pop_buf(recv_fifo, len, &num); memcpy(rq->dma_buf, rxd, num); - ret = stream_push(rq->dma, rq->dma_buf, 4); - assert(ret == 4); + ret = stream_push(rq->dma, rq->dma_buf, num); + assert(ret == num); xlnx_zynqmp_qspips_check_flush(rq); } } @@ -1333,6 +1338,12 @@ static void xlnx_zynqmp_qspips_realize(DeviceState *dev, Error **errp) XlnxZynqMPQSPIPS *s = XLNX_ZYNQMP_QSPIPS(dev); XilinxSPIPSClass *xsc = XILINX_SPIPS_GET_CLASS(s); + if (s->dma_burst_size > QSPI_DMA_MAX_BURST_SIZE) { + error_setg(errp, + "qspi dma burst size %u exceeds maximum limit %d", + s->dma_burst_size, QSPI_DMA_MAX_BURST_SIZE); + return; + } xilinx_qspips_realize(dev, errp); fifo8_create(&s->rx_fifo_g, xsc->rx_fifo_size); fifo8_create(&s->tx_fifo_g, xsc->tx_fifo_size); @@ -1411,6 +1422,11 @@ static const VMStateDescription vmstate_xlnx_zynqmp_qspips = { } }; +static Property xilinx_zynqmp_qspips_properties[] = { + DEFINE_PROP_UINT32("dma-burst-size", XlnxZynqMPQSPIPS, dma_burst_size, 64), + DEFINE_PROP_END_OF_LIST(), +}; + static Property xilinx_qspips_properties[] = { /* We had to turn this off for 2.10 as it is not compatible with migration. * It can be enabled but will prevent the device to be migrated. @@ -1463,6 +1479,7 @@ static void xlnx_zynqmp_qspips_class_init(ObjectClass *klass, void * data) dc->realize = xlnx_zynqmp_qspips_realize; dc->reset = xlnx_zynqmp_qspips_reset; dc->vmsd = &vmstate_xlnx_zynqmp_qspips; + dc->props = xilinx_zynqmp_qspips_properties; xsc->reg_ops = &xlnx_zynqmp_qspips_ops; xsc->rx_fifo_size = RXFF_A_Q; xsc->tx_fifo_size = TXFF_A_Q; diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index d398a4e..bc5596a 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -37,6 +37,8 @@ typedef struct XilinxSPIPS XilinxSPIPS; /* Bite off 4k chunks at a time */ #define LQSPI_CACHE_SIZE 1024 +#define QSPI_DMA_MAX_BURST_SIZE 2048 + typedef enum { READ = 0x3, READ_4 = 0x13, FAST_READ = 0xb, FAST_READ_4 = 0x0c, @@ -95,7 +97,8 @@ typedef struct { XilinxQSPIPS parent_obj; StreamSlave *dma; - uint8_t dma_buf[4]; + uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE]; + uint32_t dma_burst_size; int gqspi_irqline; uint32_t regs[XLNX_ZYNQMP_SPIPS_R_MAX];