Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1364901pxu; Mon, 23 Nov 2020 20:22:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFoUsYXqaXpMLxHYlt9sW2ySbqW3kF+5rdWtfggekhLVQGzUbXf0DUWyv95cNAk1Sm2X4Q X-Received: by 2002:a17:907:262d:: with SMTP id aq13mr2543199ejc.484.1606191770457; Mon, 23 Nov 2020 20:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606191770; cv=none; d=google.com; s=arc-20160816; b=LFMuh3XUxmJzfLAT9C02tu46MW0OnhCQd7WTskiwlf1Tn4HUKc5RD9j/VEWP5ne5cD xZSkFio6DF+K2wgkTQ0g6pwsC353e/eGwUwIPGWGrL7ObJ0h3aLS71u5gXZpZd6h55iX fOxDl758tSuj0sY2jO8QD6v70poJeg1k/oEq9qSe6eAqE2mcCoqChXmFdNSj/k8lfEYZ EQPJARvvALWU3CJgDwR7Wqomowz4Es+I0+FaIlsBElGSeYERU9nAL8+noVy7IO+U3a2d EaMy4EQtRQWbqo66S7s4MNpJ3WkSJXsOcC7cJRJsicHmZkWVp8KZDgLxQzxXbrCsn5VY jAaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=EJkzPVB6i+b9QK6q3SU/bxQTv+3JJTLbK77CHr5TyoQ=; b=FHdE6Y+DWg6xzXfVBREuepiDQH0N53wXwawF/1NgicafsQ21cBai2rSqiqTVwfgSsl iOT97BF+7SYjl7lk5j9FM6QXqpjBC0tvZmp1wcRGRGwSKboH3Sb83g+xA8eu/ehB67aN 65v3qRqT7kTMzqsERtoTcQxrHZ3FQKmgYD4wI+SsVAFYIfOfCEkf1pEQjZqm+m/HzfLP GGEIptD0OdhahHs8BvlDsUD00d3Hkqur2SKvYAXPhgXPYdUOFmH9INxuPjbuzbIsTQAC jxHO2UD0DGEA/VV2F27WfR6/j2oL8I7vFa6r+hx2WDid5aWcjL3jdz+h/ZggOiM+RSXy 1gCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w12si7689955ejb.135.2020.11.23.20.22.27; Mon, 23 Nov 2020 20:22:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728120AbgKXES4 (ORCPT + 99 others); Mon, 23 Nov 2020 23:18:56 -0500 Received: from mga11.intel.com ([192.55.52.93]:8580 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbgKXES4 (ORCPT ); Mon, 23 Nov 2020 23:18:56 -0500 IronPort-SDR: 4BvLlg7braVNUGWmkUcovuW/j+8MKB6R4ckeZ/eLB/J3BvpwpnCnBZC3P6Hay/oKzns47uYl6Y FrOXcsFR6m2Q== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="168378669" X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="168378669" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 20:18:56 -0800 IronPort-SDR: sBvWoYr74p3lWqqnUy+GsmydSZt6zi34vvPqv+loX2QigTV1lcwwOoglLotbf9NkFCuzUSrlK8 OWYwl0KvlQfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="343029843" Received: from sgsxdev004.isng.phoenix.local (HELO localhost) ([10.226.81.179]) by orsmga002.jf.intel.com with ESMTP; 23 Nov 2020 20:18:53 -0800 From: "Ramuthevar,Vadivel MuruganX" To: broonie@kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Cc: linux-mtd@lists.infradead.org, vigneshr@ti.com, p.yadav@ti.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v9 2/5] spi: cadence-quadspi: Disable the DAC for Intel LGM SoC Date: Tue, 24 Nov 2020 12:18:37 +0800 Message-Id: <20201124041840.31066-3-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124041840.31066-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20201124041840.31066-1-vadivel.muruganx.ramuthevar@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan On Intel Lightning Mountain(LGM) SoCs QSPI controller do not use Direct Access Controller(DAC). This patch adds a quirk to disable the Direct Access Controller for data transfer instead it uses indirect data transfe DAC bit resets to 1 so there is no need to explicitly set it. Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/spi/spi-cadence-quadspi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index d7b10c46fa70..d12b765e87be 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1101,10 +1101,12 @@ static void cqspi_controller_init(struct cqspi_st *cqspi) writel(cqspi->fifo_depth * cqspi->fifo_width / 8, cqspi->iobase + CQSPI_REG_INDIRECTWRWATERMARK); - /* Enable Direct Access Controller */ - reg = readl(cqspi->iobase + CQSPI_REG_CONFIG); - reg |= CQSPI_REG_CONFIG_ENB_DIR_ACC_CTRL; - writel(reg, cqspi->iobase + CQSPI_REG_CONFIG); + /* Disable direct access controller */ + if (!cqspi->use_direct_mode) { + reg = readl(cqspi->iobase + CQSPI_REG_CONFIG); + reg &= ~CQSPI_REG_CONFIG_ENB_DIR_ACC_CTRL; + writel(reg, cqspi->iobase + CQSPI_REG_CONFIG); + } cqspi_controller_enable(cqspi, 1); } @@ -1388,6 +1390,10 @@ static const struct cqspi_driver_platdata am654_ospi = { .quirks = CQSPI_NEEDS_WR_DELAY, }; +static const struct cqspi_driver_platdata intel_lgm_qspi = { + .quirks = CQSPI_DISABLE_DAC_MODE, +}; + static const struct of_device_id cqspi_dt_ids[] = { { .compatible = "cdns,qspi-nor", @@ -1403,6 +1409,7 @@ static const struct of_device_id cqspi_dt_ids[] = { }, { .compatible = "intel,lgm-qspi", + .data = &intel_lgm_qspi, }, { /* end of table */ } }; -- 2.11.0