Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp503501ybg; Fri, 18 Oct 2019 03:10:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzI3baJLHQfU929h0cH9JwE/yJNvXeEPwkTbWFoUu36NmY0+qvbnd9h5s7T5N2aoBXz4i+X X-Received: by 2002:a17:906:8308:: with SMTP id j8mr7921006ejx.29.1571393450385; Fri, 18 Oct 2019 03:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571393450; cv=none; d=google.com; s=arc-20160816; b=bmiNNDKIyzf85kstp8aUislg1LBnaM14VzZzZUrJmLh4atBHr9c2yDxaoB3WNZb8uJ 8YI88din/Ff7iZkIHWc0KX3ncdJRKb5cOP+RkI5Yruvh+iXBbMdjpip93PQSxkO40kcJ PEpusLRoj6oEF6e0Ddc6HJY5nTJ1fqnA0aSZfqLXc4ligHGIdccOBteFWjIl2UOKRtXw mirj1yUFOTt+KTvk7OxYhiWUHaJ/BDzccnpAt5l0YdgQPzTnG0yxoeLcSdH0wxqe4NUh bZWYx2OYgF0A59V7HuPf5MDOHTpZHF6Vjs1LZ3CyOXkdf7AsL/3bm7sk71LZF+p1R92o lSOA== 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=N3MLqJIrMoHIAbd4Lfq+HOwjk+DwtF4yp5fZJAnyjC4=; b=OunybNz3s2ZQdQto2d0HlPLG8otjivG6VceqqwqMo4RUKyEtPkqjnrE3skhdqWb5p6 hn36WsNro04x2AOR58ES/k7VcInvQ5kNHuomPQfNFfGA+siFVFvyQdXWZqt72M27+INO OrfwO8TvXeVNmh0AsuLVU20dgwRa3JzMM6jmYBjfWsbFHVMSIQ5D82QAkh4tGqWXcCDk fwi6nW9OjiUZBNktrr7FF8DFIuCC95v0Ilhk8HTb5jraWa/XA9IbG0s82yYWEXAmnzsT WTedpNznST875stHPIh5CvS6ixa23mRmcH+S3YSkVzIF630W5VfPkCRaa/OHZfOlBfQn H4Nw== 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 oq3si3103230ejb.220.2019.10.18.03.10.26; Fri, 18 Oct 2019 03:10:50 -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 S2408104AbfJQHUT (ORCPT + 99 others); Thu, 17 Oct 2019 03:20:19 -0400 Received: from mga12.intel.com ([192.55.52.136]:33969 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408044AbfJQHUS (ORCPT ); Thu, 17 Oct 2019 03:20:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 00:20:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,306,1566889200"; d="scan'208";a="186404307" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga007.jf.intel.com with ESMTP; 17 Oct 2019 00:20:13 -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 v4 2/2] mtd: spi-nor: cadence-quadspi: Disable the auto-poll for Intel LGM SoC Date: Thu, 17 Oct 2019 15:20:00 +0800 Message-Id: <20191017072000.48860-3-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191017072000.48860-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20191017072000.48860-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 Lightning Mountain SoCs QSPI controller do not use auto-poll. This patch disables auto polling when direct access mode is disabled Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/mtd/spi-nor/cadence-quadspi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 0ad076eaa81b..c2333f0473e3 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -88,6 +88,7 @@ struct cqspi_st { bool rclk_en; u32 trigger_address; u32 wr_delay; + bool auto_poll; struct cqspi_flash_pdata f_pdata[CQSPI_MAX_CHIPSELECT]; }; @@ -136,6 +137,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 @@ -1175,6 +1178,18 @@ static int cqspi_of_get_pdata(struct platform_device *pdev) return 0; } +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 void cqspi_controller_init(struct cqspi_st *cqspi) { u32 reg; @@ -1206,6 +1221,10 @@ static void cqspi_controller_init(struct cqspi_st *cqspi) reg |= CQSPI_REG_CONFIG_ENB_DIR_ACC_CTRL; writel(reg, cqspi->iobase + CQSPI_REG_CONFIG); + /* Disable auto-polling */ + if (!cqspi->auto_poll) + cqspi_disable_auto_poll(cqspi); + cqspi_controller_enable(cqspi, 1); } @@ -1421,6 +1440,9 @@ static int cqspi_probe(struct platform_device *pdev) cqspi->wr_delay = 5 * DIV_ROUND_UP(NSEC_PER_SEC, cqspi->master_ref_clk_hz); + if (ddata && (ddata->quirks & CQSPI_DISABLE_DAC_MODE)) + cqspi->auto_poll = false; + ret = devm_request_irq(dev, irq, cqspi_irq_handler, 0, pdev->name, cqspi); if (ret) { -- 2.11.0