Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2019140imm; Sat, 29 Sep 2018 08:44:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dqbn2BxbqtIcstSxpep5QgO5ZVld8LFCTRhDu0+9MVAri65e0Taf2zUuoHVIMrO7JOh26 X-Received: by 2002:a17:902:246a:: with SMTP id m39-v6mr3667478plg.57.1538235844044; Sat, 29 Sep 2018 08:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538235844; cv=none; d=google.com; s=arc-20160816; b=BW+tA61HDZbCX1h9feUZd3E2NeSJPQhv3osrDdAHH4+vojmOh18/yuJVXLoyCUk57X eD+7in6NdsT/293U2J2wswRHeT0IPZeNKkMSoLqZwPha2ellCUzwUF7g+DFDH6m5IRf0 /5OD/OiMPFKsrbKE7DxPX5D+w+G2jzqH1LyZ/cFLEIasyL1DwLuKvndlknvA3fomdEQJ sJvzrZ5hnmSJfv2y7r6sJtJuFSsXSmD4HC/9TNiUWaIKOLXh2pea8Iae5A6u4FGyP//K DQT8foNfXxvuo7xuSnRhpfUCoD86cx83CcvarCQW0uD6nK4f79OWL3VqBAJpW9XsV6a+ K7eA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Xi2YUdt+dFjDQv2A/xKfGQSweug6bId4Qcn+SuhCucQ=; b=YMcO7k/qmg/TqoAUwbCDvuVPcNbeprMbANbUMFJmPYBvf5Stvgafn3MnWjEQfDBJxX KaM7BwkV5GZcu+gs388fVHWHMhOoymThiMofDZI4LurrTnBuC6nEuDBMdDfP5iZD1M/G eZINm9mMwL8Is2WcgyhLsU+mJ1ZPgVkQBvDwlO6EDBHAAe5HJRG25IhVGhuWxuEOUfJ/ Bv3g45VT5XHAzBRcXNU2e3iRwEY8am1JV/zqE9fmczijLgQOpNYFo9x7Xkm4o/lwyCtN TlCVNWfeyADi789Ch60pw+3hthDO7b9118zEq4RiKgWYkyRNIEzrQDrUfTiOdEq4FfgD 0nLg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si7489523pfn.97.2018.09.29.08.43.49; Sat, 29 Sep 2018 08:44:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbeI2WMg (ORCPT + 99 others); Sat, 29 Sep 2018 18:12:36 -0400 Received: from mail.bootlin.com ([62.4.15.54]:56110 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbeI2WMg (ORCPT ); Sat, 29 Sep 2018 18:12:36 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id EA90520734; Sat, 29 Sep 2018 17:43:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id B5A3820711; Sat, 29 Sep 2018 17:43:40 +0200 (CEST) Date: Sat, 29 Sep 2018 17:43:40 +0200 From: Boris Brezillon To: Esben Haabendal Cc: Chuanhua Han , broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] spi: spi-fsl-dspi: Fix support for XSPI transport mode Message-ID: <20180929174340.53290075@bbrezillon> In-Reply-To: <87y3bkcpym.fsf@gmail.com> References: <20180921070628.35153-1-chuanhua.han@nxp.com> <20180921070628.35153-2-chuanhua.han@nxp.com> <87y3bkcpym.fsf@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Esben, On Sat, 29 Sep 2018 16:56:17 +0200 Esben Haabendal wrote: > Chuanhua Han writes: > > > This patch fixes the problem that the XSPI mode of the dspi controller > > cannot transfer data properly. > > In XSPI mode, cmd_fifo is written before tx_fifo, which transforms the > > byte order of sending and receiving data. > > Did you find documentation on proper ordering of writes to related > TX FIFO and CMD FIFO entries? > > I have failed to find such information, and thus opted for what I > believed would be the safe approach, writing to TX FIFO first, so that > when CMD FIFO is written, it will already have data in place. And it > seems to work. > > But, I now see that SPIx_SR[TFIWF] hints that it should be done the > other way around. > > Tranmit FIFO Invalid Write Flag - Indicates Data Write on TX FIFO > while CMD FIFO is empty. Without a Command, the Data entries present > in TXFIFO are invalid. > > But I fail to see how that should be related to byte ordering. > > So I believe this patch is doing two things. > > 1. Changing write ordering of TX FIFO and CMD FIFO. > 2. Handling byte ordering based on SPIx_CTARn[LSBFE] flag. > > It would be nice if we could get clarification from NXP on > what is the right way to do the TX FIFO and CMD FIFO write ordering. > > But as for the byte ordering changes, I don't think it looks write. The > meaning of SPIx_CTARn[LSBFE] is according to the documentaiton the bit > ordering on the wire, and should not be related to register byte > ordering. > > You should probably split this patch in two, so they can be reviewed and > merged independently. Yes, I forgot to mention that, but this patch should definitely be split in at least 2 patches. Regards, Boris