Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1028904imw; Tue, 5 Jul 2022 02:28:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcTwn3PRqAh5GupAo3kzVOpZaFzR+kj2rzsu+hjH0bxWTZlwiV2GVHQpBukDysI11bKpnb X-Received: by 2002:a17:902:c2c7:b0:16b:a6b3:7bd8 with SMTP id c7-20020a170902c2c700b0016ba6b37bd8mr29952321pla.174.1657013318149; Tue, 05 Jul 2022 02:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657013318; cv=none; d=google.com; s=arc-20160816; b=O476DKNqo9NMCBHaipfrUgr9lKQYYjqTeSxmgTORvhjImX2Vp1rKiZAvYE5c/DwrWj s97AaMx+S7RmKrwseYpfNwp5ShZtZ4xug/YcAnNr1SpX0mHI/Cytm/dWxBSErgFz6bUm oPUiA+vXA8WR/G/gLWIrafn82nUbmwRYwV2vKMAJV/mjbXCRioQ1d8JHJGQ1yiOmPWUM qJD2aT8nz+dC0xBYiHQn99OxDR98tGPweTxTrDpYRacDBZv5jDKkdPRDfyYMzWKO2cRI g3f9aY1LSWWBOxvizy3iuZbh04UQ6hn+hLFofeB8ymVQ/2aUM0Qa8p9gXQyO+cQlfElH drSA== 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; bh=z2l81Jc3abYbUe7sTbiWXFfkyW7KArDTSWYkkWBZI9Y=; b=0QlGzw6nBY2+0LdbRD5QxlxPdLltWwTQYTSdyz/SiqxaoJacN4UB0E681o2NbTELMN vS2ZVC5aZJIDmk5xOsZpQ6410mz2HPKkqbUfDXWOQcCfPOlx0M78LPKIQC02Ek3HUaJ7 47/WhUTtLg4r5feAogxvkab8BuhoTVLA3uMQ5mF8jv0idLLywAym89rEcCulPaQBdqMT pBaY2VAKlW3LJD5e6TUW5edyj0dYDZ4kh1wG5Gm+SVOCvV84OTI0Ag2Vgz+nw0VRpXu1 fYBpf2E0ROAGbYmsTbeYUuvP6SVbrngkflcO/lXtkzi93ndsE/hzIvEk86l6KgA1nQ1U hzqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a621811000000b005289ba801e8si553678pfy.62.2022.07.05.02.28.25; Tue, 05 Jul 2022 02:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbiGEJ1L (ORCPT + 99 others); Tue, 5 Jul 2022 05:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbiGEJ06 (ORCPT ); Tue, 5 Jul 2022 05:26:58 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B0DDF2F; Tue, 5 Jul 2022 02:26:55 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8DBA51A08BC; Tue, 5 Jul 2022 11:26:54 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 54F8C1A0AE4; Tue, 5 Jul 2022 11:26:54 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id E7BB11802204; Tue, 5 Jul 2022 17:26:51 +0800 (+08) From: haibo.chen@nxp.com To: ashish.kumar@nxp.com, yogeshgaur.83@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, han.xu@nxp.com, singh.kuldeep87k@gmail.com, tudor.ambarus@microchip.com, p.yadav@ti.com, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, haibo.chen@nxp.com, zhengxunli@mxic.com.tw Subject: [PATCH 05/11] spi: spi-nxp-fspi: Add quirk to disable DTR support Date: Tue, 5 Jul 2022 17:11:37 +0800 Message-Id: <1657012303-6464-5-git-send-email-haibo.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1657012303-6464-1-git-send-email-haibo.chen@nxp.com> References: <1657012303-6464-1-git-send-email-haibo.chen@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haibo Chen Not all platform currently supports octal DTR mode. lx2160a do not implement DQS, this causes flash probe failure and therefore, provide an option of quirk FSPI_QUIRK_DISABLE_DTR for platforms not support DTR mode. Signed-off-by: Haibo Chen --- drivers/spi/spi-nxp-fspi.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 34679dc0e1ad..61cf1b82c0d7 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -325,6 +325,9 @@ /* Access flash memory using IP bus only */ #define FSPI_QUIRK_USE_IP_ONLY BIT(0) +/* Disable DTR */ +#define FSPI_QUIRK_DISABLE_DTR BIT(1) + struct nxp_fspi_devtype_data { unsigned int rxfifo; unsigned int txfifo; @@ -337,7 +340,7 @@ static struct nxp_fspi_devtype_data lx2160a_data = { .rxfifo = SZ_512, /* (64 * 64 bits) */ .txfifo = SZ_1K, /* (128 * 64 bits) */ .ahb_buf_size = SZ_2K, /* (256 * 64 bits) */ - .quirks = 0, + .quirks = FSPI_QUIRK_DISABLE_DTR, .little_endian = true, /* little-endian */ }; @@ -1149,10 +1152,14 @@ static const struct spi_controller_mem_ops nxp_fspi_mem_ops = { .get_name = nxp_fspi_get_name, }; -static struct spi_controller_mem_caps nxp_fspi_mem_caps = { +static const struct spi_controller_mem_caps nxp_fspi_mem_caps = { .dtr = true, }; +static const struct spi_controller_mem_caps nxp_fspi_mem_caps_quirks = { + .dtr = false, +}; + static int nxp_fspi_probe(struct platform_device *pdev) { struct spi_controller *ctlr; @@ -1257,7 +1264,10 @@ static int nxp_fspi_probe(struct platform_device *pdev) ctlr->bus_num = -1; ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT; ctlr->mem_ops = &nxp_fspi_mem_ops; - ctlr->mem_caps = &nxp_fspi_mem_caps; + if (f->devtype_data->quirks & FSPI_QUIRK_DISABLE_DTR) + ctlr->mem_caps = &nxp_fspi_mem_caps_quirks; + else + ctlr->mem_caps = &nxp_fspi_mem_caps; nxp_fspi_default_setup(f); -- 2.25.1