Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7235382ybp; Wed, 16 Oct 2019 05:56:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqx30zy+cIN0/H/xDWcHZCJoBJK0QzSIyzmldUDxR6TJr+83oAGYmaVuzVYzEfE8L1sAb1mg X-Received: by 2002:a05:6402:3054:: with SMTP id bu20mr37445300edb.97.1571230574691; Wed, 16 Oct 2019 05:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571230574; cv=none; d=google.com; s=arc-20160816; b=OowTPv/jLIk9EGivzvZxqBWhxdtB5A3t5zwmPcnmPCYNhg7HY857c0BhUtH7TbTGwD DXfjI2zJEoimajo5aLepJuzUeZeHpDLbLOF7Z/G6zpnMZsJ/Cl6W3QA6g6OKq4xaowfF C9b/VQvrguLMbrbkCIRrWxOArh5ldHonxtf7O6dJGEb4ZQLEaEQaZO8IzqXTBdzSPWpJ 2DSNxIbc+7wPuOrsesylPUW8+R6cydL5ttWoXC+kQm0WIIMW1mn6UAZVcz4wDBum3BCM F542pGa+4IoLAZ0AcJw0auQ/FrFKzE6LmTFtS+PJxWrPmQ0EFK3YYPD3+o4HFGna8iob /itw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=s39FpZDsIVijRksoigZfypRpHO/kfg6d4vyQscJS4zg=; b=KXBzl2zqpn45wpo9AXCvzvy3axukZpCkbh5/wLfqtPsv3ZA/7FRVD91PUjvbHOQLZF UKpKYk9oztsVQ5BLkBxnH+wcaeDvMkj/7yXFC7b8tfX98TM3ho1+4njAeVKLmQ6rV9TD 7PClZOjzQTW2izSuk/hEZOZpzA7Qp/QGFN+O2mcJZbUGo7XxzuIZjWXbjWzLRtQS2gtU YcaBPHt+wySt3IS6m0Bk29558IOxBFyYlszWzp1JgU3fI0QNUU27jry1mJISR0a1DwX/ qIf994XkqvyU1cN4oqsmJonUAtz3iJNMNcgfvIDaD5zEEuAk9rsnTdvrjVtjjxgfyDkP CxLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LIpQPLqR; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si14384321edt.298.2019.10.16.05.55.51; Wed, 16 Oct 2019 05:56:14 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LIpQPLqR; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389762AbfJPIdH (ORCPT + 99 others); Wed, 16 Oct 2019 04:33:07 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:39400 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388364AbfJPIdG (ORCPT ); Wed, 16 Oct 2019 04:33:06 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9G8WSR3035081; Wed, 16 Oct 2019 03:32:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571214748; bh=s39FpZDsIVijRksoigZfypRpHO/kfg6d4vyQscJS4zg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=LIpQPLqRojaXAO9e6h2CjCm6EfW3BMXspS/9xYx3A4KALSm/3UDMadNC/jHJ+JW3d oz8i6my0ueNEkbJRnwRO1wIN7oXK9JDg3SJ6K+NdhJTDqGFwTk7szvxN8BTnjpEb1/ m/YZuQGEOOFhtM3zGDYHW4/jTkdakRyh2jXAUF1E= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9G8WSmb033171 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Oct 2019 03:32:28 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 16 Oct 2019 03:32:21 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 16 Oct 2019 03:32:28 -0500 Received: from [172.24.145.136] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9G8WKU2052788; Wed, 16 Oct 2019 03:32:22 -0500 Subject: Re: [PATCH v3 2/3] mtd: spi-nor: cadence-quadspi: Disable the DAC for Intel LGM SoC To: "Ramuthevar,Vadivel MuruganX" , CC: , , , , , , , , , , , , , References: <20190909104733.14273-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20190909104733.14273-3-vadivel.muruganx.ramuthevar@linux.intel.com> From: Vignesh Raghavendra Message-ID: <85355c80-1344-db22-ae31-0f20f30b9754@ti.com> Date: Wed, 16 Oct 2019 14:02:50 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20190909104733.14273-3-vadivel.muruganx.ramuthevar@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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 > 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(). > 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 */ } > }; > > -- Regards Vignesh