Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5017675ybl; Mon, 26 Aug 2019 21:01:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNoM4z83kRVPQnex+qjrEl0UDU67vKWbRCnVTnIgXMW5M2B0Tx6l7kmH9OGXL/p6p1flRu X-Received: by 2002:a17:902:e9:: with SMTP id a96mr10392535pla.169.1566878472131; Mon, 26 Aug 2019 21:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566878472; cv=none; d=google.com; s=arc-20160816; b=ehGwtNecuOYi5tj9yzhR1ZmlJZB2UXSwRYSdJUCg5kXC8Nfi3I70KIviGbnkQQV+JH VTyaktEirFHc8NXY6ksCGBCNOmJZBMG/khgwn67blmHG6Dg10R6UoDGokNmkgG2Qt2Cd TuPDYk/yGXgGpvq7mfzYsLUxq6ZFLlTjCa15hVkzZaNtrCbVO7//jhLRA/hRS0SA4oB6 q2DBeoeYAYTLh31tainhTCMINcVRSkGuAIDbLtHSKAAg3bltMq2Nv5s4+466E2kpXkbR aeNuO+q3uEkcqcQry6jPD0sSQ1P6TOkBYxKD5tbbhGmC6zBO5CN3aWO5/NxNRYaEFhyF KcAQ== 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=Snr24l+ROGrcBUplnI6p0pmArsmeQGVueq25iepqS14=; b=lzBKYk6Fldw0nIyPerSOc8BYni4wI7P7zDhF5Un7bnlGZ6K3CXZqnTS3QVb/SsB3e+ sq7SZJ7JfX32GeOAXl3sDKZPUJFB2ZVSgcz/mM+mTmsV5haZfIA9AihLJsUcCcnyfqT+ yUB6pjsfASWTflKZDWqdFkcDwTlnRGprjkVQOutqqVS9YML7cmqxeL462g9Iy5tmIDOJ 7ThKky6gCLJk9oGMw8mJLaH13H9u0lNsiVzG270NJZwBwFlFTHpRgvL536PLS7Kb92WP iFLLUIpxoccce6bRK3LlP7vBf8LuG/FNyWMTJj9LTF7HJQMUYQ/QSaLWNKmeQzJnjwmY hi1Q== 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 185si12860533pfv.39.2019.08.26.21.00.56; Mon, 26 Aug 2019 21:01:12 -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 S1729214AbfH0D7F (ORCPT + 99 others); Mon, 26 Aug 2019 23:59:05 -0400 Received: from mga05.intel.com ([192.55.52.43]:9631 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728820AbfH0D7F (ORCPT ); Mon, 26 Aug 2019 23:59:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Aug 2019 20:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,435,1559545200"; d="scan'208";a="355640671" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga005.jf.intel.com with ESMTP; 26 Aug 2019 20:59:00 -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 v2 3/3] mtd: spi-nor: cadence-quadspi: disable the auto-poll for Intel LGM Date: Tue, 27 Aug 2019 11:58:27 +0800 Message-Id: <20190827035827.21024-4-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190827035827.21024-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20190827035827.21024-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 69fa13e95110..94aa40e868a1 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -134,6 +134,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 @@ -470,6 +472,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; @@ -507,6 +521,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; } @@ -631,6 +650,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