Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7258975ybp; Wed, 16 Oct 2019 06:14:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAM2CaQ92H78ySjXqQmrsWLghxntwwIZ75IBWaqrixT6C1PuPA+f2j/mfYacuSa9FMVuSk X-Received: by 2002:a17:906:480a:: with SMTP id w10mr39795144ejq.212.1571231686626; Wed, 16 Oct 2019 06:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571231686; cv=none; d=google.com; s=arc-20160816; b=Hky6n/pfbwWLmLk7Mk879X2ie5PiMaiGWFDM55Pk8t0wSlLKybT9v1MBV6QqpLe/uv PlavgS4lWM6SHcoV8tfQM/4lON4ToK/L4HsubAEsa781ywqnjB0RtvD0WH8Hiu+NAaXd VOVIPVxlr9QAhqhJ6bMcxht3zj/6ryicFocZQCXpCc8Ge3P8ljJYhZBbLYJyONZU5CCT PpiwovFvmhBrgf1Mn9EyfZdjp6cWbm+kWTk3TLnntD4+KnmeW32ap7IyRB5fN2WuIAI0 WRkS3axfiqyNfpKU0b+Ca8AFTJCs8Z8V0GSXieTNdldxd4b1ZQv1Iail3k2b8jkY3lC4 sGaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EABtktVLjFBL96nfy4rJ2iqYuOFhRh37CIKzHbdtVSE=; b=jsG+2sQt9D3OmAgNSQzK2qF4J5cPm+rTPUuEmWGj6S9MOeTLor0cx55XDhrnsCHWK2 6BS4bLa+lOAso1vM7pmOCugszcwDf6NDt8BfpUBFocQnTvIo6ioDCSd6v3bJkWyNZ+z6 YxLKmk0EjuvnWRreM6+3nKdMHopr2U3+z8JiPUgIuLu1Ph+DBe9p4iCn/lB/iFzHHi8Z 4/4FILNwSQV+h9xx/8tAP/q95iFhViBCJS7nf6h9BoGtNOF/V/2FCJT8XXSYSe45gkwd LZ3IOrjkhIVck3T+3HUh06GlfiEO9PlpIUYj6Y4g2WfPxU73SbLB+pX9Gr7iR6P0n1Pj TNcA== 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 b8si16273392edc.231.2019.10.16.06.14.23; Wed, 16 Oct 2019 06:14:46 -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 S2390151AbfJPIsW (ORCPT + 99 others); Wed, 16 Oct 2019 04:48:22 -0400 Received: from mga14.intel.com ([192.55.52.115]:6542 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388188AbfJPIsV (ORCPT ); Wed, 16 Oct 2019 04:48:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 01:48:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="208368132" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 16 Oct 2019 01:48:20 -0700 Received: from [10.226.38.27] (unknown [10.226.38.27]) by linux.intel.com (Postfix) with ESMTP id 791205803C5; Wed, 16 Oct 2019 01:48:16 -0700 (PDT) Subject: Re: [PATCH v3 2/3] mtd: spi-nor: cadence-quadspi: Disable the DAC for Intel LGM SoC To: Vignesh Raghavendra , 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, andriy.shevchenko@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com References: <20190909104733.14273-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20190909104733.14273-3-vadivel.muruganx.ramuthevar@linux.intel.com> <85355c80-1344-db22-ae31-0f20f30b9754@ti.com> From: "Ramuthevar, Vadivel MuruganX" Message-ID: <9b91e39e-a1ab-d99d-50b1-483d6acf5357@linux.intel.com> Date: Wed, 16 Oct 2019 16:48:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <85355c80-1344-db22-ae31-0f20f30b9754@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vignesh,       Thank you for the review comments. On 16/10/2019 4:32 PM, Vignesh Raghavendra wrote: > > On 09/09/19 4:17 PM, Ramuthevar,Vadivel MuruganX wrote: >> From: Ramuthevar Vadivel Murugan >> >> on Intel's Lightning Mountain(LGM) SoCs QSPI controller do not use > s/on/On Agreed, will update. >> Direct Access Controller(DAC). >> >> This patch introduces to properly disable the Direct Access Controller > "This patch adds a quirk to disable..." or something something similar okay, will update. >> for data transfer instead it uses indirect data transfer. >> >> Signed-off-by: Ramuthevar Vadivel Murugan >> --- >> drivers/mtd/spi-nor/Kconfig | 2 +- >> drivers/mtd/spi-nor/cadence-quadspi.c | 21 +++++++++++++++++++++ >> 2 files changed, 22 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig >> index 6de83277ce8b..ba2e372ae514 100644 >> --- a/drivers/mtd/spi-nor/Kconfig >> +++ b/drivers/mtd/spi-nor/Kconfig >> @@ -34,7 +34,7 @@ config SPI_ASPEED_SMC >> >> config SPI_CADENCE_QUADSPI >> tristate "Cadence Quad SPI controller" >> - depends on OF && (ARM || ARM64 || COMPILE_TEST) >> + depends on OF && (ARM || ARM64 || COMPILE_TEST || X86) >> help >> Enable support for the Cadence Quad SPI Flash controller. >> >> diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c >> index 67f15a1f16fd..73b9fbd1508a 100644 >> --- a/drivers/mtd/spi-nor/cadence-quadspi.c >> +++ b/drivers/mtd/spi-nor/cadence-quadspi.c >> @@ -33,6 +33,7 @@ >> >> /* Quirks */ >> #define CQSPI_NEEDS_WR_DELAY BIT(0) >> +#define CQSPI_DISABLE_DAC_MODE BIT(1) >> >> /* Capabilities mask */ >> #define CQSPI_BASE_HWCAPS_MASK \ >> @@ -609,6 +610,13 @@ static int cqspi_write_setup(struct spi_nor *nor) >> struct cqspi_st *cqspi = f_pdata->cqspi; >> void __iomem *reg_base = cqspi->iobase; >> >> + /* Disable direct access controller */ >> + if (!f_pdata->use_direct_mode) { >> + reg = readl(reg_base + CQSPI_REG_CONFIG); >> + reg &= ~CQSPI_REG_CONFIG_ENB_DIR_ACC_CTRL; >> + writel(reg, reg_base + CQSPI_REG_CONFIG); >> + } >> + >> /* Set opcode. */ >> reg = nor->program_opcode << CQSPI_REG_WR_INSTR_OPCODE_LSB; >> writel(reg, reg_base + CQSPI_REG_WR_INSTR); >> @@ -1328,6 +1336,7 @@ static int cqspi_probe(struct platform_device *pdev) >> struct resource *res_ahb; >> struct reset_control *rstc, *rstc_ocp; >> const struct cqspi_driver_platdata *ddata; >> + struct cqspi_flash_pdata *f_pdata; >> int ret; >> int irq; >> >> @@ -1436,6 +1445,9 @@ static int cqspi_probe(struct platform_device *pdev) >> goto probe_setup_failed; >> } >> >> + if (ddata && (ddata->quirks & CQSPI_DISABLE_DAC_MODE)) >> + f_pdata->use_direct_mode = false; >> + > If you do this here, you will still end up acquiring a DMA channel in > cqspi_request_mmap_dma() (called from cqspi_setup_flash()). So, please > move the check to cqspi_setup_flash(). will fix it. --- Regards Vadivel >> return ret; >> probe_setup_failed: >> cqspi_controller_enable(cqspi, 0); >> @@ -1510,6 +1522,11 @@ static const struct cqspi_driver_platdata am654_ospi = { >> .quirks = CQSPI_NEEDS_WR_DELAY, >> }; >> >> +static const struct cqspi_driver_platdata intel_lgm_qspi = { >> + .hwcaps_mask = CQSPI_BASE_HWCAPS_MASK, >> + .quirks = CQSPI_DISABLE_DAC_MODE, >> +}; >> + >> static const struct of_device_id cqspi_dt_ids[] = { >> { >> .compatible = "cdns,qspi-nor", >> @@ -1523,6 +1540,10 @@ static const struct of_device_id cqspi_dt_ids[] = { >> .compatible = "ti,am654-ospi", >> .data = &am654_ospi, >> }, >> + { >> + .compatible = "intel,lgm-qspi", >> + .data = &intel_lgm_qspi, >> + }, >> { /* end of table */ } >> }; >> >>