Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4846853ybe; Mon, 9 Sep 2019 15:54:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2LIT0WK9EUy+UnkuJIk0OAflpBAxVsjWU8G9NDUBXbKZRMAk0ehQi5gZ8tmNj5dHzQTWZ X-Received: by 2002:a50:eac5:: with SMTP id u5mr22821390edp.207.1568069665617; Mon, 09 Sep 2019 15:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568069665; cv=none; d=google.com; s=arc-20160816; b=R6mZftNRZEh16C9LY2SplHQXkhlC/FrAVbfT2jvWkZmzgfLCsv9ZT+oo0TD1alPyQi o9Oi2hgUjqnb1Rw9eo/No6ckkmObgnrKwO8Qx3n58UkysQYk/yr5kCILWeGgwP3fTTe4 1xmuh0fHXM/eO2Qrhf6tkunruGHrS9OY2gNOHS8xkl0eRnqS4tXV5harAvnpOKFeIWk0 k4tUWpcZke+hUJajU7LFmZppST2HxSR71KpQZOdGjB3rMEwcjcAYucOgR206XNdzy2Xt 9TNy+zr8RpUCp4qzqtdjgYT39XIw5WDSQkbI5tigORg5Iz3+2/if0EMOdoxYdyOIs1T2 AgYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=qJok32nfwvalqcBF1hu7JQduf6uq1hxj94Fzr2rjG44=; b=l3yTPX1ILBbSTe4RzYSbExQqDvDJDL6gyhOKCuf64q3F95ydKeUt7MEpj8dkS/jWD6 5aglqDOeIXCeCbu7FvyXFOi3InzKVLFaNQAHUl5oa3zN4+JoRDFGFLySfCxELlwvbnPQ yLHMftMQeeV3NEPpsxFzj4Zuqop4ajl8D4nBkPc/ZEHE+lcjr2HoCfgBX5RDVATdoERm slgFFlMlZdplBbLUSn6j9KNV67BHeawalyLf5+it7waxrdZLY/5WxOgRYfo7S8wwG/2a tLTe0J5gYqoCDLnySgdEdJrTY64HWOxnAXer29k3Au7W07+mPnE3+4g1FtfSMjeYy1dr SzUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si9988584edb.346.2019.09.09.15.54.01; Mon, 09 Sep 2019 15:54:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388050AbfIIKr4 (ORCPT + 99 others); Mon, 9 Sep 2019 06:47:56 -0400 Received: from mga07.intel.com ([134.134.136.100]:17914 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726509AbfIIKrz (ORCPT ); Mon, 9 Sep 2019 06:47:55 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 03:47:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,484,1559545200"; d="scan'208";a="183782889" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by fmsmga008.fm.intel.com with ESMTP; 09 Sep 2019 03:47:49 -0700 From: "Ramuthevar,Vadivel MuruganX" To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dwmw2@infradead.org, computersforpeace@gmail.com, richard@nod.at, jwboyer@gmail.com, boris.brezillon@free-electrons.com, cyrille.pitchen@atmel.com, david.oberhollenzer@sigma-star.at, miquel.raynal@bootlin.com, tudor.ambarus@gmail.com, vigneshr@ti.com, andriy.shevchenko@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v3 3/3] mtd: spi-nor: cadence-quadspi: disable the auto-poll for Intel LGM Date: Mon, 9 Sep 2019 18:47:33 +0800 Message-Id: <20190909104733.14273-4-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190909104733.14273-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20190909104733.14273-1-vadivel.muruganx.ramuthevar@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan On Intel's Lightning Mountain(LGM) SoC QSPI controller do not auto-poll. This patch introduces to properly disable the auto-polling feature to improve the performance of cadence-quadspi. Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/mtd/spi-nor/cadence-quadspi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 73b9fbd1508a..60998eaad1cc 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -135,6 +135,8 @@ struct cqspi_driver_platdata { #define CQSPI_REG_RD_INSTR_TYPE_DATA_MASK 0x3 #define CQSPI_REG_RD_INSTR_DUMMY_MASK 0x1F +#define CQSPI_REG_WR_COMPLETION_CTRL 0x38 +#define CQSPI_REG_WR_COMPLETION_DISABLE_AUTO_POLL BIT(14) #define CQSPI_REG_WR_INSTR 0x08 #define CQSPI_REG_WR_INSTR_OPCODE_LSB 0 #define CQSPI_REG_WR_INSTR_TYPE_ADDR_LSB 12 @@ -471,6 +473,18 @@ static int cqspi_command_write_addr(struct spi_nor *nor, return cqspi_exec_flash_cmd(cqspi, reg); } +static int cqspi_disable_auto_poll(struct cqspi_st *cqspi) +{ + void __iomem *reg_base = cqspi->iobase; + unsigned int reg; + + reg = readl(reg_base + CQSPI_REG_WR_COMPLETION_CTRL); + reg |= CQSPI_REG_WR_COMPLETION_DISABLE_AUTO_POLL; + writel(reg, reg_base + CQSPI_REG_WR_COMPLETION_CTRL); + + return 0; +} + static int cqspi_read_setup(struct spi_nor *nor) { struct cqspi_flash_pdata *f_pdata = nor->priv; @@ -508,6 +522,11 @@ static int cqspi_read_setup(struct spi_nor *nor) reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK; reg |= (nor->addr_width - 1); writel(reg, reg_base + CQSPI_REG_SIZE); + + /* Disable auto-polling */ + if (!f_pdata->use_direct_mode) + cqspi_disable_auto_poll(cqspi); + return 0; } @@ -627,6 +646,11 @@ static int cqspi_write_setup(struct spi_nor *nor) reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK; reg |= (nor->addr_width - 1); writel(reg, reg_base + CQSPI_REG_SIZE); + + /* Disable auto-polling */ + if (!f_pdata->use_direct_mode) + cqspi_disable_auto_poll(cqspi); + return 0; } -- 2.11.0