Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp455503imn; Wed, 3 Aug 2022 10:57:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6hCVI+mH+MCRdcJDuRzjFExZOOnuBwZnJo9VXla/iABIwa25Vb/Wzpu6KpBymhwyx+cFty X-Received: by 2002:a63:e70f:0:b0:41c:ac9e:27aa with SMTP id b15-20020a63e70f000000b0041cac9e27aamr2034899pgi.489.1659549455549; Wed, 03 Aug 2022 10:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659549455; cv=none; d=google.com; s=arc-20160816; b=NM7jfm5XxyWN7xgCNGwqLxqok++c09DEFr/pln92Qs7/Q8fQAC1J9VCTj4f+4kg/fB ydnnPr2DlX6/WVJEdxqjiOe8EwmH11/OwgA538cQ/rz5uf9jNYMOzMT0xvBKx20rfBuB nrjbfUE3+zYdhSCOzZR3o+x2/fXUY0G6QL04pyJY06F6rfC+GU1IK3JKvLjsMXea5Azn hD0JzPVukDpMmCif00qYV+ro3/wzfIlBwaIGJagIwBttjN+ZUEROreeE/nmbKHqFI8AA gZv01B/ZS+YW1jtyYfKccVjG7Uo2SVVaXMNEFeiGJ9EeT7xEgbHagX3YTmc7g9BmEda8 /cRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=t7mzK+VsqxBbknsxZ5Y86hkmSLWbQ885cOUS2ErnhsQ=; b=pUiDHjSLh3qmmtNHUU2vcvcegBR6olpSKduiVbhrGMZEwL7RqOzIEOGGIJLthg2Gvq 4WBhrcXdpcb56AYCMFSeqAH7iC6s89wOZFV0Gl0gkPHl6nh2xhkb6g63xws2ahtD2/te 1y2pXlTr42nPqF2MaxBSOWFLhA1r4Vdl/ELcnNbKw2VKT8ykq0O41yKItvFtVzj15Kcn q0i/ndZeAnKJCx3/eyLEH+it5jPcF/VOY0KLzQN+4cSsAgESQcc1uvvxTHDJf7ltRWu+ CXjQt1dz06QSkcg2ADDtr4bIQbl6nzRVUEfgTSY0eHOW9uGgpd+YycgnqNokqIFNgll9 IxLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=jNNBA5NQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw1-20020a17090b180100b001f27725711dsi2829057pjb.58.2022.08.03.10.57.19; Wed, 03 Aug 2022 10:57:35 -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; dkim=pass header.i=@sifive.com header.s=google header.b=jNNBA5NQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238252AbiHCRfY (ORCPT + 99 others); Wed, 3 Aug 2022 13:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238072AbiHCRfT (ORCPT ); Wed, 3 Aug 2022 13:35:19 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9968ECCA for ; Wed, 3 Aug 2022 10:35:18 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id w3so6717983edc.2 for ; Wed, 03 Aug 2022 10:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t7mzK+VsqxBbknsxZ5Y86hkmSLWbQ885cOUS2ErnhsQ=; b=jNNBA5NQLHsI0JyVIXzvuhIkTOOmyLoWRAHk03bJUHB6YpbpNC0an7pMlGB6lZz/ee o89HDMIE3QpAs55xNUvZxZn1oPl3DF3vvQ+soHxaMVh1mRr4z4dl9iaSx23EpupA6TL7 pJkVZlLM9DMFjHlOyycAlG/aAP0fVcwFY3iQ80PSCCcnV+SZXRIhI9+oEvaBliFe2A91 MPomkiS5rMbCbgHRdkvp4vk4B8hw57pjKD3s6vomjU4Z/xyPMtwZFnB4Mm8TiCUwuIOl tjKGNuEy3b37Edcu42Epg6SU3TtkwZAL3Gdy5Un8TEC5s+ZHtxOVEdVZJSNacV/nYxMf PMXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t7mzK+VsqxBbknsxZ5Y86hkmSLWbQ885cOUS2ErnhsQ=; b=cW1XC3tgFL3QkJJD/KdRSjk4sQTc7uqV6LNN4kaWaSXgoOE5xeNz7y0wHNQIjEOTIi zYkT4JY+FkLZg5x/jX9qB64KLyLqzRfZG/iQv74+c4Y0Ld9eaKi1RxblfiS4Q4/djqX7 6pCwmgmYSqk/gqxm7sE0MEWLLjr9+0Cah3CqFdsJN8rnuwd1SpWmP4QuZRsEtaoNTbnl n6P0j5IzsmOY4XZiXtVcDoYm7sBexF6qBed/J4znORSKSjCI8Yjxt0sRFUHLdkjmgKtt iDfU5CX/13rEBq/wf4TUYkizORp0/MLX+qpbly5A4lhgT+h+zetiaV6E/pWAvHfd4MZ+ oSaA== X-Gm-Message-State: AJIora9umcZ0yVCnQiDsEFsAQbmZ1hhysV0cFfmINd1iEzHFaoFqETRK ZxAhHtM8jFdfhTQRQpaIi7GEdaHjBKtblfKTLP0hOg== X-Received: by 2002:a05:6402:430e:b0:43d:1cf6:61ec with SMTP id m14-20020a056402430e00b0043d1cf661ecmr25679481edc.194.1659548117129; Wed, 03 Aug 2022 10:35:17 -0700 (PDT) MIME-Version: 1.0 References: <20220802175755.6530-1-sudip.mukherjee@sifive.com> <20220802175755.6530-5-sudip.mukherjee@sifive.com> In-Reply-To: From: Sudip Mukherjee Date: Wed, 3 Aug 2022 18:35:06 +0100 Message-ID: Subject: Re: [PATCH 04/11] spi: dw: use TMOD_RO to read in enhanced spi modes To: Mark Brown Cc: Serge Semin , Rob Herring , Krzysztof Kozlowski , Greentime Hu , Jude Onyenegecha , William Salmon , Adnan Chowdhury , Ben Dooks , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jeegar Lakhani Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hi Mark, On Tue, Aug 2, 2022 at 8:13 PM Mark Brown wrote: > > On Tue, Aug 02, 2022 at 06:57:48PM +0100, Sudip Mukherjee wrote: > > When we are using the enhanced spi modes we can not use EEPROM Read. > > The Synopsys datasheet mentions EEPROM Read is not applicable in > > enhanced SPI modes. We will need to use Receive only mode. > > > > Signed-off-by: Sudip Mukherjee > > --- > > drivers/spi/spi-dw-core.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c > > index 8c84a2e991b5..8e624620864f 100644 > > --- a/drivers/spi/spi-dw-core.c > > +++ b/drivers/spi/spi-dw-core.c > > @@ -727,7 +727,10 @@ static int dw_spi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op) > > cfg.dfs = 8; > > cfg.freq = clamp(mem->spi->max_speed_hz, 0U, dws->max_mem_freq); > > if (op->data.dir == SPI_MEM_DATA_IN) { > > - cfg.tmode = DW_SPI_CTRLR0_TMOD_EPROMREAD; > > + if (enhanced_spi) > > + cfg.tmode = DW_SPI_CTRLR0_TMOD_RO; > > + else > > + cfg.tmode = DW_SPI_CTRLR0_TMOD_EPROMREAD; > > This is fixing the previous commit... This was not actually meant to be a fixup patch. I intentionally made it separate so that "enhanced_spi" is introduced in the previous patch, and then modified the tmode read protocol in this patch based on enhanced_spi. But I can merge it with the previous patch like you have suggested. -- Regards Sudip