From patchwork Mon Jan 18 12:32:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashok Reddy Soma X-Patchwork-Id: 1428121 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-xilinx-onmicrosoft-com header.b=ivcEGrbv; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DKB8p6Tdhz9sW0 for ; Mon, 18 Jan 2021 23:35:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CEF0E82805; Mon, 18 Jan 2021 13:35:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ivcEGrbv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0A5958276B; Mon, 18 Jan 2021 13:33:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::607]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AC518276B for ; Mon, 18 Jan 2021 13:33:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ashokred@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7fv+IRAme8t7gs5cuORuYZmtNuK5kK7osEegj9rnPre0R3Nnbn84fQtJTjoqNAevHvE8jxQZLLzJIZdWgFNmp4QOiPqndGJd9n3dxRp/7/rRPQjag4TEaRwN0IKDN9qW6gS39zPuLVju/fJNucxuNoq82Nv619w6D0pbLwX23viKuXDEuWEDmTyZbLTpYW+MRcuJ5bcwQvd6KjWW15KDK075vHbYaOwDhArn0f8qeswjvDr543XESIAofUdex8yrGx6LOBZsFr0HaVsHktgObVD8JLOehce4IJZ9BxVjiLioD5TMY0YOLMcpAHT1maIe8DE99MjnhTAzgdyh8HjeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RwowvV5QFyyVs0T6ieYX31rdc2KiOcH356yTl6GBG3c=; b=mxikyiWp+dFnUP71n1xiNbjsuWNYi4bmVfELjcLaKdrjdZaW/6lvE1pRuTv8Vwpoe3OUsWJxR+9CC8sW4BJkxXR+vpLE/wfYpA0xIkSmi4VY+sf/MUVm1Fe1CnjFn31fHr7SPgXP8eoGZalQkck1k0v0gOnxc/0cwQeRRHblrP5n+EY7wVOXKeDGan9lQ/Rn8GxiAvK/EoMhQSBCKe6AapX6AV0O94GVniY6yQoN0oYswxMChFGeM5rgq98Q8qOvl6F03bebRwOfjo56o0DKbzR2tGsHSKqqUgAoa1I6w26VTpQLLFO+ZLz+6H1OFb0qe9Lrza2NLbbYtBAsxHnkSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=amarulasolutions.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RwowvV5QFyyVs0T6ieYX31rdc2KiOcH356yTl6GBG3c=; b=ivcEGrbv4aGrbjNf3pmDIqPt4JEMz3IZaiXSVEzTXuVFP6wWw1ZDG9HhzjpAbu9MJnegLYClwPucxKw3ODiMsiElyQmYMKcEH8LiOkT10japtHGNJ5G8/GowMUOSlgew9uZEPKxpp3wBxmXiWNaG73N9E7REAXKzK1y6upxeL0c= Received: from DM5PR16CA0033.namprd16.prod.outlook.com (2603:10b6:4:15::19) by CY4PR02MB2311.namprd02.prod.outlook.com (2603:10b6:903:10::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.13; Mon, 18 Jan 2021 12:33:32 +0000 Received: from CY1NAM02FT058.eop-nam02.prod.protection.outlook.com (2603:10b6:4:15:cafe::a0) by DM5PR16CA0033.outlook.office365.com (2603:10b6:4:15::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Mon, 18 Jan 2021 12:33:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; amarulasolutions.com; dkim=none (message not signed) header.d=none;amarulasolutions.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT058.mail.protection.outlook.com (10.152.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3763.12 via Frontend Transport; Mon, 18 Jan 2021 12:33:31 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 18 Jan 2021 04:33:26 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Mon, 18 Jan 2021 04:33:26 -0800 Envelope-to: git@xilinx.com, jagan@amarulasolutions.com, ashok.409@gmail.com, u-boot@lists.denx.de, monstr@monstr.eu Received: from [172.23.64.106] (port=48327 helo=xhdvnc125.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1l1Tin-0004sb-Na; Mon, 18 Jan 2021 04:33:25 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 2896) id 57AA21222CE; Mon, 18 Jan 2021 18:02:31 +0530 (IST) From: Ashok Reddy Soma To: CC: , , , , Siva Durga Prasad Paladugu , Ashok Reddy Soma Subject: [PATCH 4/7] spi: zynqmp_gqspi: Fix tap delay values Date: Mon, 18 Jan 2021 18:02:25 +0530 Message-ID: <1610973148-22465-5-git-send-email-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1610973148-22465-1-git-send-email-ashok.reddy.soma@xilinx.com> References: <1610973148-22465-1-git-send-email-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7fd26d1-00b5-41f9-25cd-08d8bbad4403 X-MS-TrafficTypeDiagnostic: CY4PR02MB2311: X-LD-Processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eYHL5chBZzTVsPO1RBfKVFh7Jd8exUgiMODKxgpVAQ+d70vVfoGWYnmIdFKIyQa6uu8bAaf78FfI0nzf607tPXe3CcTla7GsNQMzYOIjlRLmMEao5UF6N6tbrXBK860rwzdc6RfW0pv39q4rdnPGmssFGZCvc17+igle8WLG+PmcZ7RKTqAkZ8KrFcwmfs6vtwRxV5W9JpHS8J4v8/vlhd9lhtAGHcq5guOvGBtLk1eGwCQeAAX19ed4KMssJqWTgF95Wkznt5U/AWWVjU6jaoR6G+gpE0W5TjJiV8cX/rUTUIWrmTl4Gk3TJsZ9EN1+/CXP0mjylL6DhHrPJpDMqj58a1dWbRqdb+ioWB9kd5Gie2UzXblSyzNoetn4hqH1MrHAWl6T1KGiNVkPpGNcx/9sRfUr7DnULcTbnbMzdkBBOlUWKmfpJaIOyAn0Lx6gE34KYmHGfK1fSEgAxrqsYyrabMJMGlNlr0ODU7mNJW87iuSSgjUFM4EqqJfxLXzH X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(376002)(39860400002)(46966006)(6666004)(70206006)(36906005)(8936002)(6266002)(5660300002)(2906002)(47076005)(2616005)(4326008)(426003)(107886003)(336012)(42186006)(82310400003)(356005)(478600001)(36756003)(26005)(54906003)(8676002)(70586007)(316002)(82740400003)(7636003)(83380400001)(186003)(6916009)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 12:33:31.7078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7fd26d1-00b5-41f9-25cd-08d8bbad4403 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT058.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2311 X-Mailman-Approved-At: Mon, 18 Jan 2021 13:34:57 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Siva Durga Prasad Paladugu There is no need of read modify write for tapdelay settings ans hence remove the read operations while setting tapdelays. Also, correct tapdelay value settings at 40MHZ by modifying the if check to <= instead of <. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Ashok Reddy Soma --- drivers/spi/zynqmp_gqspi.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) -- 2.17.1 This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c index ae7b70aa57..136c20f09e 100644 --- a/drivers/spi/zynqmp_gqspi.c +++ b/drivers/spi/zynqmp_gqspi.c @@ -282,24 +282,19 @@ void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval) debug("%s, req_hz:%d, clk_rate:%d, baudrateval:%d\n", __func__, reqhz, clk_rate, baudrateval); - if (reqhz < GQSPI_FREQ_40MHZ) { - zynqmp_mmio_read(IOU_TAPDLY_BYPASS_OFST, &tapdlybypass); - tapdlybypass |= (TAP_DLY_BYPASS_LQSPI_RX_VALUE << - TAP_DLY_BYPASS_LQSPI_RX_SHIFT); + if (reqhz <= GQSPI_FREQ_40MHZ) { + tapdlybypass = TAP_DLY_BYPASS_LQSPI_RX_VALUE << + TAP_DLY_BYPASS_LQSPI_RX_SHIFT; } else if (reqhz <= GQSPI_FREQ_100MHZ) { - zynqmp_mmio_read(IOU_TAPDLY_BYPASS_OFST, &tapdlybypass); - tapdlybypass |= (TAP_DLY_BYPASS_LQSPI_RX_VALUE << - TAP_DLY_BYPASS_LQSPI_RX_SHIFT); - lpbkdlyadj = readl(®s->lpbkdly); - lpbkdlyadj |= (GQSPI_LPBK_DLY_ADJ_LPBK_MASK); - datadlyadj = readl(®s->gqspidlyadj); - datadlyadj |= ((GQSPI_USE_DATA_DLY << GQSPI_USE_DATA_DLY_SHIFT) - | (GQSPI_DATA_DLY_ADJ_VALUE << - GQSPI_DATA_DLY_ADJ_SHIFT)); + tapdlybypass = TAP_DLY_BYPASS_LQSPI_RX_VALUE << + TAP_DLY_BYPASS_LQSPI_RX_SHIFT; + lpbkdlyadj = GQSPI_LPBK_DLY_ADJ_LPBK_MASK; + datadlyadj = (GQSPI_USE_DATA_DLY << GQSPI_USE_DATA_DLY_SHIFT) | + (GQSPI_DATA_DLY_ADJ_VALUE << + GQSPI_DATA_DLY_ADJ_SHIFT); } else if (reqhz <= GQSPI_FREQ_150MHZ) { - lpbkdlyadj = readl(®s->lpbkdly); - lpbkdlyadj |= ((GQSPI_LPBK_DLY_ADJ_LPBK_MASK) | - GQSPI_LPBK_DLY_ADJ_DLY_0); + lpbkdlyadj = GQSPI_LPBK_DLY_ADJ_LPBK_MASK | + GQSPI_LPBK_DLY_ADJ_DLY_0; } zynqmp_mmio_write(IOU_TAPDLY_BYPASS_OFST, IOU_TAPDLY_BYPASS_MASK,