Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1012753pxx; Thu, 29 Oct 2020 22:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySrQZLy0PHAI4FKc/4HmzR+8R8nFBnUD6P9T4qRMUEopGlsMLB2vTSIVMxZGeEFZZC8d5A X-Received: by 2002:a50:d69e:: with SMTP id r30mr447409edi.383.1604036048876; Thu, 29 Oct 2020 22:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604036048; cv=none; d=google.com; s=arc-20160816; b=a8uo3uNU6Q9GBhWD7ZITLcLxm3Sl1kjZAmxiFBFy2vIawRLtBwBAFzTQobgakhRqzt KEL7cgorHuSHzyNQBjyIvFUeJCmY+WX96aP0qmaInX/sVoeTTo8io5zRnm8JfjeSc3dI UPBPFi3xmIHFzn8u+64vYDpSuRXshwQ5qWPNGzmGdsj3rjAGy+ppAP84AoR1HUhbPp7l BEE3/w4BXkf05I568iWKYHwC8qGegq5mf6KLnDsAYo5v6gqbvhLmum566Dx2rJn+9WLI 4uPT1vOVzp5KiZR5SxheOl5DKMy0artMgXq7q2z91Y4i1dQaauHWEsm+/qQcv8zUU1x3 1VPA== 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=swRHmy1O7osNTJmGH/o0rijBm7BFp1D6OQy+Zlsfwss=; b=r63Chq6s7Ad11vqJ/dK2jjHAaRiehCn5f34I9w7CGJffZtsokMRpu+69QS6Gx/7JKa ScRn4dGCqdseTQ8jFLoQCtEe3h2B6WVeD7KR4LGJ1Q1CWpcrZh+8bXRpT7CSB83zfra3 HUInUXduofRrxyrx0CcgRR4Z3C1ASnBF5BCM1FrLqBq30yxAUClBV1MeLxSmrtlUBUGy GPnGgiVzC8YhmSEEcgAqWTn4CEdWHwJ14VuICYjNQwREBgo8jf+gp90328b5klKSus7c jbLKLkKDcs9eaLkkJBWJIZai04I1z48B6rynw1pph/lLqF1yP0aEIYpKxTQ56mNfriV+ q0qg== 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 g25si3695055eds.336.2020.10.29.22.33.46; Thu, 29 Oct 2020 22:34:08 -0700 (PDT) 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 S1725880AbgJ3FcO (ORCPT + 99 others); Fri, 30 Oct 2020 01:32:14 -0400 Received: from mga17.intel.com ([192.55.52.151]:57099 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbgJ3FcN (ORCPT ); Fri, 30 Oct 2020 01:32:13 -0400 IronPort-SDR: etHOk8SMQ8qeWmIrH7kOS+9E8pLuElsmfsBlXJf4hfUqVO+3Hx/DqxILi1NkIflaZrn3Cs5lFs U+2CXff8mjdA== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="148417471" X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="148417471" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 22:32:12 -0700 IronPort-SDR: ssnGR9mhC/kAR/asmwCVCdIWmSfdD76++wKogVqKGcS57g7rKviJWV6UsgIgE4nDA3vLWhDxaT 5KrrUM5nhZvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="351201557" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga008.jf.intel.com with ESMTP; 29 Oct 2020 22:32:09 -0700 From: "Ramuthevar,Vadivel MuruganX" To: broonie@kernel.org, vigneshr@ti.com, tudor.ambarus@microchip.com, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, miquel.raynal@bootlin.com, simon.k.r.goldschmidt@gmail.com, dinguyen@kernel.org, richard@nod.at, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v6 3/6] spi: cadence-quadspi: Add multi-chipselect support for Intel LGM SoC Date: Fri, 30 Oct 2020 13:31:50 +0800 Message-Id: <20201030053153.5319-4-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20201030053153.5319-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20201030053153.5319-1-vadivel.muruganx.ramuthevar@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan Add multiple chipselect support for Intel LGM SoCs, currently QSPI-NOR and QSPI-NAND supported. Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/spi/spi-cadence-quadspi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 6d6f7c440ece..c4440797db43 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -38,6 +38,7 @@ /* Capabilities */ #define CQSPI_SUPPORTS_OCTAL BIT(0) +#define CQSPI_SUPPORTS_MULTI_CHIPSELECT BIT(1) struct cqspi_st; @@ -75,6 +76,7 @@ struct cqspi_st { bool is_decoded_cs; u32 fifo_depth; u32 fifo_width; + u32 num_chipselect; bool rclk_en; u32 trigger_address; u32 wr_delay; @@ -1049,6 +1051,7 @@ static int cqspi_of_get_flash_pdata(struct platform_device *pdev, static int cqspi_of_get_pdata(struct cqspi_st *cqspi) { + const struct cqspi_driver_platdata *ddata; struct device *dev = &cqspi->pdev->dev; struct device_node *np = dev->of_node; @@ -1070,6 +1073,15 @@ static int cqspi_of_get_pdata(struct cqspi_st *cqspi) return -ENXIO; } + ddata = of_device_get_match_data(dev); + if (ddata->hwcaps_mask & CQSPI_SUPPORTS_MULTI_CHIPSELECT) { + if (of_property_read_u32(np, "num-chipselect", + &cqspi->num_chipselect)) { + dev_err(dev, "couldn't determine number of cs\n"); + return -ENXIO; + } + } + cqspi->rclk_en = of_property_read_bool(np, "cdns,rclk-en"); return 0; @@ -1307,6 +1319,9 @@ static int cqspi_probe(struct platform_device *pdev) cqspi->current_cs = -1; cqspi->sclk = 0; + if (ddata->hwcaps_mask & CQSPI_SUPPORTS_MULTI_CHIPSELECT) + master->num_chipselect = cqspi->num_chipselect; + ret = cqspi_setup_flash(cqspi); if (ret) { dev_err(dev, "failed to setup flash parameters %d\n", ret); @@ -1396,6 +1411,7 @@ static const struct cqspi_driver_platdata am654_ospi = { }; static const struct cqspi_driver_platdata intel_lgm_qspi = { + .hwcaps_mask = CQSPI_SUPPORTS_MULTI_CHIPSELECT, .quirks = CQSPI_DISABLE_DAC_MODE, }; -- 2.11.0