From patchwork Fri Jun 22 09:47:58 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: 10481595 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 3CDC060230 for ; Fri, 22 Jun 2018 09:49:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 188DD28815 for ; Fri, 22 Jun 2018 09:49:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AFFE289F8; Fri, 22 Jun 2018 09:49:53 +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 695E328815 for ; Fri, 22 Jun 2018 09:49:51 +0000 (UTC) Received: from localhost ([::1]:60398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWIhS-0000Gk-LW for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jun 2018 05:49:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWIgP-00080Y-9N for qemu-devel@nongnu.org; Fri, 22 Jun 2018 05:48:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWIgK-0008NM-Bm for qemu-devel@nongnu.org; Fri, 22 Jun 2018 05:48:45 -0400 Received: from mail-co1nam03on0057.outbound.protection.outlook.com ([104.47.40.57]:64960 helo=NAM03-CO1-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 1fWIgJ-0008Mu-V6 for qemu-devel@nongnu.org; Fri, 22 Jun 2018 05:48:40 -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=rBrmDEKLGzhP46yjRTqiKEtZ05d2rvEp0W70idqI8/g=; b=ezqw0b3qOIAFIjBdKVrBStJRzeSB08rEByrJV4k0Gmyn9aQC3X+lVGTiGXBv6GqH9rF+NCKAYNePD73oHjEswlhXrjh/QODDcpvAi+xFk4k1pP9IvMjecYwFiYOw9kezcs6ldu68u9zYEY0ZNSsKkmQ6Ou/rHj5Df29vsSNeA30= Received: from BN6PR02CA0031.namprd02.prod.outlook.com (2603:10b6:404:5f::17) by MWHPR02MB2654.namprd02.prod.outlook.com (2603:10b6:300:44::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Fri, 22 Jun 2018 09:48:34 +0000 Received: from BL2NAM02FT039.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by BN6PR02CA0031.outlook.office365.com (2603:10b6:404:5f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.19 via Frontend Transport; Fri, 22 Jun 2018 09:48:33 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) 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.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT039.mail.protection.outlook.com (10.152.77.152) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.884.17 via Frontend Transport; Fri, 22 Jun 2018 09:48:33 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fWIgC-0001We-Iy; Fri, 22 Jun 2018 02:48:32 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fWIg7-0007RY-Em; Fri, 22 Jun 2018 02:48:27 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w5M9mQFA003912; Fri, 22 Jun 2018 02:48:26 -0700 Received: from [172.23.37.96] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fWIg6-0007RV-6K; Fri, 22 Jun 2018 02:48:26 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 77A3613C294C; Fri, 22 Jun 2018 15:18:13 +0530 (IST) From: Sai Pavan Boddu To: Date: Fri, 22 Jun 2018 15:17:58 +0530 Message-ID: <1529660880-30376-1-git-send-email-sai.pavan.boddu@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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39380400002)(376002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(478600001)(2351001)(39060400002)(2616005)(476003)(486006)(126002)(48376002)(426003)(103686004)(106466001)(63266004)(51416003)(4326008)(50466002)(26005)(5660300001)(90966002)(8936002)(186003)(52956003)(6666003)(336012)(6266002)(50226002)(16586007)(54906003)(42186006)(316002)(59450400001)(47776003)(106002)(305945005)(6916009)(356003)(2906002)(81166006)(36756003)(81156014)(575784001)(8676002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2654; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT039; 1:vB4S23caanC7RKUoGHW/iA2dNLaJqBCqSxkDW48eq4rG2jxy5nvvdrLU3yELBnoqWnNC14Y+PaZehE2WyZbx1pKOIyvXqA69QQ8cJKe8SLkHc1RXbfB4S7t6McdR6/ZG MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e8e72f3-aeb0-49bc-8b78-08d5d825516f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989114)(4534165)(4627221)(201703031133081)(201702281549075)(8990104)(5600026)(711020)(4608076)(2017052603328)(7153060); SRVR:MWHPR02MB2654; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2654; 3:zWGegE+F3hF0r1dxNuDC/qW99EV6OfHcMLQ4UnFxI18n/XATLmdtoYO0rTCNA+4lw6cjxlLPjIWirQJVpT/UGOlyJiRGs40hbhrzlPZduFWkw9wguFz16JA0FMY0zX06Xl/N+BFT72uYEjK5XZbxktlkFVCMj4Kv/Y7hoKCnlHnQeIDX1vX1bSby1yFakF6XiBa4aHNipeVSCgXs0JXD+09N9tkAbQzh38yBECwyDJPpnYsRBF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Csu9+jGyZ/AVg81iCTQl2xaIXcPZ+tBTuaQfHpqGV7AKaY7anPyB7swxwN+vlpyzqGgRwFOWw2FwEOpZkV2FQiw+5n0Mgjs3dKKmhhe0lEqDRSjnYRA1rQJvswjNsYHv339syYfYdn4I5UfGy+UR39op762I+SxjeWfbx86fcTD1jRMQB+nYqvpyX3pltChrJ1g/yVBoOGIZJ77jft 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)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:MWHPR02MB2654; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2654; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2654; 4:MaaVbVTDtlfDF6MbrSjpRe+TNHsAPswBPj21LYmbMogDecaRPJzoPaHZNRSZPDKywjhrxRk6b1NFpSljAvoKIyDKgevLfAX+S6mEkUN6JauiQFzb4IpnS2+KadPYH6e7X49DpVGdFICyLWHFAxED7/DMnMIPx/lzMX2jSJAHW9mCDKhkdoRtqQYU1sWlJvg5b5qbT22sg20XpPVpL+bdMYFH9PmQ2+G0YiTVBpO/2fXsKCfQncxzVd6lZvitKaW1gjJkINeru7wWxK1dDGm3KEaAcnPw07leDKPmJBLis/Qx+KWGsqxHm7PQVURnASAi X-Forefront-PRVS: 071156160B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB2654; 23:hjgvFz/vE2dw18F4Cqyh5yKq6AT5IO5tRaJ8lw3dl?= =?us-ascii?Q?H9Y8DUElA/SrG/U2K5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2FTVhVRPXAxf9OV9S7IhuMUHjKcThG9ejGg6r2KOb49GLStAZ33GHbHEL6IVCclr6ksmD6cbc/Z0wmXzsn+xa8ckutySroB3yY7zV86AxpFA==; 5:dmv0DBGzXYo9Vy/euTKPyQYAkQ7JWFwGPR7H88soQEsolQC8CQRmK+yDOmWtcdyl9rk4jQTkSgGoVhgNJgCVIHgw5SJ7Bsfoz9aVUGJXq9lMAuvHTjQj5yBMDNX/AStBpVqxTXyzolsKD6Z1C8LCNMpBJVzmjQiCRL4spJeX82Y=; 24:GwQjuusiUmwamwHavUApB33ElG+mHYfswFaK7rW03wu64xPQKnOMyeTOkBQ24jvC1aFKaAcqtlO6PkdeMAIcuPT08LliKnvuWHREgWkG6bA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2654; 7:moyCe5zAUUjM5oEqToeAfajCxHMkhxiaEJ39mxog0H5S7NIvb4CHTiMyyikLt55T4/B33gw5hGdGaqhRIg+kQNlb0iE8d2Bj4uHY4HgYtM5fAH2eTECeWS158L68HSIPefGXVKL1PzIQaW8uGASRlpTtHCh0QzOMyfXmaH+rVcCntaQi0ksp1JPFdOwF9Vbbdp9NAfVlwZ4wPm8unlL9BakrVk5D5k6fEgJk6UjCFs78X1YR1oNfgK/zcrv3vqHv X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2018 09:48:33.1947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e8e72f3-aeb0-49bc-8b78-08d5d825516f 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.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2654 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.57 Subject: [Qemu-devel] [PATCH v4] 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sai Pavan Boddu , KONRAD Frederic Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sai Pavan Boddu 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. Changes for V4: move dma_buf to the bottom of XlnxZynqMPQSPIPS 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..a0a0ae7 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,6 @@ typedef struct { XilinxQSPIPS parent_obj; StreamSlave *dma; - uint8_t dma_buf[4]; int gqspi_irqline; uint32_t regs[XLNX_ZYNQMP_SPIPS_R_MAX]; @@ -113,6 +114,8 @@ typedef struct { uint8_t rx_fifo_g_align; uint8_t tx_fifo_g_align; bool man_start_com_g; + uint32_t dma_burst_size; + uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE]; } XlnxZynqMPQSPIPS; typedef struct XilinxSPIPSClass {