From patchwork Mon Dec 7 13:59:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11956059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C6D7C433FE for ; Mon, 7 Dec 2020 14:02:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E65BC23444 for ; Mon, 7 Dec 2020 14:02:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E65BC23444 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HL+tWMgqXIp18muG61G3sfy9y4KOaJjfurRXECgkIAk=; b=UaId9RbebnSpVTlA/DcsnXWaN MKDemcFAuCYxlppNARsl0/1SOw1GlNJAfYCPi5eDFZFA2/AQZkOTYnUDofK7XWCqWhewZYYspOrWL 6Cpl/8rhD18yvugTeC8oStRVO/5sSWOqV9tHQJkMmHEviy8dNlf0W48NG1ULUjVf97iYR+Q48S2DR daCuJQYiqT2N4skjnsRWUrl9yHA08PluphlGkKpO2RO8iKTjSs9eaC2x5SpmAR1UK6zteg52JuSC7 PUtHBLdt4MJ5zHDTxlmiyzLjaQa/2EG6q5F48kHlSwKUvlPZtvAeejKmF/QsHRGCZt+CIAmVNX0+1 t4UQ0HOlA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmH4Z-0008SF-VD; Mon, 07 Dec 2020 14:01:04 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmH4H-0008KT-U1 for linux-arm-kernel@lists.infradead.org; Mon, 07 Dec 2020 14:00:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607349645; x=1638885645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EZu7eRgTCyJ0MdARgyamRkTg/cOik+X698PnPvls7qg=; b=vmx0ofcQiHkDLoSCDkbFy8+oGMBeSM56IIQJzDfPM/uzC59e4m1FoRsZ Fzmm96jOyUnfASe93sICDbZOdsFNPYa0zGoDuZoL5CdCOPF0hDHhkfXpv iD3PYnJ+tdl4EKPKftcSw1mfcIeDseB0orqgfTamTNdM8bNJSrhdztM8z 0XKJiCsbyoHl2gqblBDfywBjFu2hRg/7cQ55QqrgZxmpMgOtVDsPwt2Bx UJJR6mB7SN6nrpMQ1VrWQf8CFwnRv2yuSoTiefiPZD0Qhuqs8lgZKu3/q 849CN2hFW4FRwT+JuuepXehnvJ5b8ro/vARORJsgyih/xKAVDULVX0kjJ A==; IronPort-SDR: zqbibeXiu4l+V1rijRuK1HqjUf38CHsMWsZW9xBt8VoPp5RjDUjAgZdQcrJZGvpULurKaBtSoR rxZ4eRIk4DJH806JFPdPTeBO32W477ncSLh/qy4x2ZgtwIgrq+A7edcdv2eJLhT32+RqtGGSA/ eMaoqguswWzrgBvBMZqUmbyQquRWtBBJ35+SlbUximFmoT8CCh7G0qAcaV4euQ4txQRjxX++1H LNYtZdjUf9paymw+GZCWQ/bOZVSmjfX5cNsixdH2Ep8ADJOlaRKF1x2naTwbUOXegHTC6J4nvG 9Vw= X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="96128975" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Dec 2020 07:00:45 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 7 Dec 2020 07:00:45 -0700 Received: from atudor-ThinkPad-T470p.amer.actel.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 7 Dec 2020 07:00:42 -0700 From: Tudor Ambarus To: , Subject: [PATCH 3/4] spi: atmel-quadspi: Write QSPI_IAR only when needed Date: Mon, 7 Dec 2020 15:59:58 +0200 Message-ID: <20201207135959.154124-4-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207135959.154124-1-tudor.ambarus@microchip.com> References: <20201207135959.154124-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201207_090046_332266_5A1866DC X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, bugalski.piotr@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The address must be written in QSPI_IAR only when we have a instruction frame with address but no data. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 30533ab82c7b..5fd0dc70bd74 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -385,9 +385,11 @@ static int atmel_qspi_set_cfg(struct atmel_qspi *aq, /* Clear pending interrupts */ (void)atmel_qspi_read(aq, QSPI_SR); - if (aq->caps->has_ricr) { - /* Set QSPI Instruction Frame registers */ + /* Set QSPI Instruction Frame registers. */ + if (op->addr.nbytes && !op->data.nbytes) atmel_qspi_write(iar, aq, QSPI_IAR); + + if (aq->caps->has_ricr) { if (op->data.dir == SPI_MEM_DATA_IN) atmel_qspi_write(icr, aq, QSPI_RICR); else @@ -397,8 +399,6 @@ static int atmel_qspi_set_cfg(struct atmel_qspi *aq, if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) ifr |= QSPI_IFR_SAMA5D2_WRITE_TRSFR; - /* Set QSPI Instruction Frame registers */ - atmel_qspi_write(iar, aq, QSPI_IAR); atmel_qspi_write(icr, aq, QSPI_ICR); atmel_qspi_write(ifr, aq, QSPI_IFR); }