From patchwork Thu Jan 31 16:15:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10790871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FBC613B4 for ; Thu, 31 Jan 2019 16:15:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A1223133D for ; Thu, 31 Jan 2019 16:15:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D5F03134C; Thu, 31 Jan 2019 16:15:34 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F7CF3133D for ; Thu, 31 Jan 2019 16:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388212AbfAaQPc (ORCPT ); Thu, 31 Jan 2019 11:15:32 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:10133 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388065AbfAaQPb (ORCPT ); Thu, 31 Jan 2019 11:15:31 -0500 X-IronPort-AV: E=Sophos;i="5.56,545,1539673200"; d="scan'208";a="24072842" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 31 Jan 2019 09:15:31 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 31 Jan 2019 09:15:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ebZoX02BIUVl/c7RPJ/TiAnts4tU9d7VKoLF6wM4x2Q=; b=KZu92Hi1MgMl+8MDZ+BBjbg9PhK7FTWBbARnkHcKwsq4ZrC0ImSy5S/n9E69IuR7Z9OH0g57RQcOVP5GDGvsZzbAVvVp9NtDiXcQCpL1X0TAB755lwheN4BJ/FOB1O0G4E17k167tS8WgfvxNsXnii4NWtAuSeodmBpC/v0B91o= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1874.namprd11.prod.outlook.com (10.175.101.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.17; Thu, 31 Jan 2019 16:15:29 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Thu, 31 Jan 2019 16:15:29 +0000 From: To: , , , , , , CC: , , , , , Subject: [PATCH v2 01/10] spi: atmel-quadspi: cache MR value to avoid a write access Thread-Topic: [PATCH v2 01/10] spi: atmel-quadspi: cache MR value to avoid a write access Thread-Index: AQHUuYAu+viSD5s94E+u9UEZBRyorg== Date: Thu, 31 Jan 2019 16:15:28 +0000 Message-ID: <20190131161515.21605-2-tudor.ambarus@microchip.com> References: <20190131161515.21605-1-tudor.ambarus@microchip.com> In-Reply-To: <20190131161515.21605-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR02CA0046.eurprd02.prod.outlook.com (2603:10a6:802:14::17) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1874;6:BzLNUzNL8RZusRCyEOH7UOV2/cCumLRKc2LZF0IFI67EtzGiX2b2T1LJ2b1qusxQWy8/9u9YXOEe9m8fXmpTwbFskMm7x5Sy7IA9w/njmsfZL1uozURLd27134zj7x9/l9USKu00xlzJn2iUc6k7EUxrQWB926AqtlQ5MGNDedOL2uOfDCeqBV5u2q/CkISaMkTWinnjbf7+QF1i0oWc3/WGxISa1ZQpI7P0U6LS7Okmc8QKcnVr4nWLG6eu+Qwaps+mGRUy8USMkzEsWqLy9NyYcGbMfTSiKc25DoFTXXb1FYsnVJB9eohEZdNuqaaSPx5tNlcNPLplt3+EesGBCfUB/I1oE81rNrbf+KFubR1ZHglifNMA3e0SDkAJ/V4uDxI1d/x3FIUz9HAMwg7ywTwrY/Z46jbJ+jNcuHT16ENE+n6YgHtA7hlrk4szL61tvxjwFHNG7EwuMB3jC75OhA==;5:3UQ5NSXUqZEz4Gw++kdvB1GeSrItnwAaxww7b+bIu8enscOeEqLxJ3PST6Htlgb7nxVNipwQyV2SIQXaKG4zb9YdR6ifX3qjVXr75pImwG5whtgQBItRc5Z6LEVxiUkcCmK3BT//GNB2g02VU6KUOPjbGNWmV33mpXHsGEvdFivp3XSUiH+67W6jwRxtYecT3o4obfYulM/bfIL5bW/1nw==;7:UU1Jmv0ePdPaTYIfwp/TJWIz6F96g8fbItbPRC+Mb9FX1Ci8fE8eNZSSmlP6qzAwvbEKDKuKUSe93PBOk5n7D7CLfyTfAA6E+nV2zhOBLcbuv3dAKQBLcXfudmiLJN1SpumrI+N5dGHAOPPWl/lPEw== x-ms-office365-filtering-correlation-id: 0c971f3e-7c53-43af-9658-08d6879750e9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1874; x-ms-traffictypediagnostic: BN6PR11MB1874: x-microsoft-antispam-prvs: x-forefront-prvs: 09347618C4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(186003)(107886003)(26005)(4326008)(68736007)(97736004)(14444005)(72206003)(478600001)(256004)(106356001)(105586002)(36756003)(99286004)(54906003)(50226002)(8936002)(7416002)(6116002)(3846002)(7736002)(8676002)(81156014)(81166006)(71200400001)(71190400001)(76176011)(52116002)(2906002)(1076003)(305945005)(2501003)(14454004)(102836004)(6436002)(66066001)(11346002)(446003)(25786009)(476003)(486006)(2616005)(110136005)(316002)(86362001)(53936002)(6486002)(6506007)(386003)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1874;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LqntUc5PA8+tCcRQKvjllraJlLQwIWaXFeNitnWXD70kd5g7VfB1YIO1ixhiSTS+Rhxr0Mq8MZWlXw/yJD1e6DiGvp1wneJnzm3ZmcRv1IaIH5inszah1dTfAj56CyJG+cJkoBLa+gX7+ClfQOCOvpekX0qiNfzmFOR9DBobYbqZ+Lw/m+UTjvO4tPpAjL1tUxz5dZ9WdKevrjZY+uzi+IGBOgSVfWkAy+/UCQ5P9JUlwoOqedtvMln7p0eAHAkgG7NzxXSsDVUPnyd2nRcfB+/K4BzVqAXHlKCVKa5T80P/NAw0cc1Hb6l/vdCLTvsvDvgnxtCkh8b8GkqrpMivNppp6zAAQwjfYlVSJere5H44KIx/nzNbivEJT88hhstDIfCKhjkK/yx+tVEW+1c1u1R+SSHoUhkMiqqB7pdTRYo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0c971f3e-7c53-43af-9658-08d6879750e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2019 16:15:25.7446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1874 X-OriginatorOrg: microchip.com Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tudor Ambarus Cache MR value to avoid write access when setting the controller in Serial Memory Mode (SMM). SMM is set in exec_op() and not at probe time, to let room for future regular SPI support. Signed-off-by: Tudor Ambarus --- v2: cache MR value instead of moving the write access at probe drivers/spi/atmel-quadspi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index ddc712410812..fe05aee5d845 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -155,6 +155,7 @@ struct atmel_qspi { struct clk *clk; struct platform_device *pdev; u32 pending; + u32 mr; struct completion cmd_completion; }; @@ -238,7 +239,9 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) icr = QSPI_ICR_INST(op->cmd.opcode); ifr = QSPI_IFR_INSTEN; - qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); + /* Set the QSPI controller in Serial Memory Mode */ + if (!(aq->mr & QSPI_MR_SMM)) + qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); mode = find_mode(op); if (mode < 0)