Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp507048imm; Fri, 12 Oct 2018 01:53:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV63QlXpmRhj+bDWbsOfhgeQqindyf4AWeSszsdroMVr65SQ4h/ZBij507jJRoR9WQatroB2f X-Received: by 2002:a63:fb09:: with SMTP id o9-v6mr4693399pgh.333.1539334410366; Fri, 12 Oct 2018 01:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539334410; cv=none; d=google.com; s=arc-20160816; b=y1KsZZzDpS9tGGtlUr+guGPA/y0hE7M1UNjfOKcrZTeeuv38Cfru06zBfsZPOc4Ic7 e++05li/zav8NXWDdbde373fg56wXcy8YKCEJcMXtRlHQu3ha23H/wXTfwoYLpDIJot/ Zd2FA27SDxSNP4JSXgfT8stOoyI0WgbQw+I3bcWr/ZKxJCJnbhDX266KfmpV3wc6PnBU GmjuY7HZzndSFVTGqYIsWowzZr+geEdwhue4GnijmVUi0Ce4ASSkQIq1vdtmfASWafup KW6t5RUOzJp5YtzOG+A5DqagkI2t19WDESeAqWgc/JCF/FxyfRPVlBK2viAYPnoKWUAG x/AQ== 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=QY+rfb6B82N3gS4KQYUa/65uX1XnxUzEEqLysHcJ1E4=; b=0xgcmi+15wUNdR5ZMBrbTDzbXJ6qW6kPhF7P7QpChUUt333IJ1jOSofSl/Hs7noqxW UEQrZdfn9b243+WoiTxSiAUz6Xhy2UzgerFuR/J5CeAEPC23AhHP1QWP4oJphQodVz4l 8iYHmA/P/FFM3jCj5HGHXDQIZnb+0CeMpXbZK0Fo7eKPunYQLET2lXYLfuoA09hk/uPq wFdQvBgwV7Al6LtrU0bJ/PmROl3gDNQcmCsYa23IRyuM1L/23Ucfyvi8NG7iwk5Uu/XV RhfSsml9+iPwxEE110NhikrQeA3cwu890EAu/LEuw+J9mZzm5baLSr/Ub5DVhuGsnf/T dmXA== 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 n10-v6si635231pgr.291.2018.10.12.01.53.15; Fri, 12 Oct 2018 01:53:30 -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 S1727989AbeJLQYT (ORCPT + 99 others); Fri, 12 Oct 2018 12:24:19 -0400 Received: from mail.bootlin.com ([62.4.15.54]:43464 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbeJLQYT (ORCPT ); Fri, 12 Oct 2018 12:24:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 934FD20703; Fri, 12 Oct 2018 10:52:52 +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 shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-7-245.w90-88.abo.wanadoo.fr [90.88.129.245]) by mail.bootlin.com (Postfix) with ESMTPSA id 3931E20898; Fri, 12 Oct 2018 10:52:42 +0200 (CEST) Date: Fri, 12 Oct 2018 10:52:42 +0200 From: Boris Brezillon To: Vignesh R Cc: Marek Vasut , Rob Herring , "devicetree@vger.kernel.org" , Yogesh Gaur , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , Brian Norris , Linux ARM Mailing List , Tudor Ambarus Subject: Re: [PATCH 0/3] spi-nor: Add Octal SPI support Message-ID: <20181012105242.519a70b9@bbrezillon> In-Reply-To: References: <20181003165603.2579-1-vigneshr@ti.com> <20181003212017.653e739f@bbrezillon> <1074d503-71ef-2998-7096-de6135bb965d@ti.com> <20181004131732.4c9e2ae9@bbrezillon> 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 Vignesh, On Mon, 8 Oct 2018 21:06:02 +0530 Vignesh R wrote: > Hi Boris, > > Sorry I missed this mail. > > On Thursday 04 October 2018 04:47 PM, Boris Brezillon wrote: > > On Thu, 4 Oct 2018 16:05:36 +0530 > > Vignesh R wrote: > > > >>>> > >>>> .../devicetree/bindings/mtd/cadence-quadspi.txt | 1 + > >>>> drivers/mtd/spi-nor/cadence-quadspi.c | 9 +++++++++ > >>> > >>> On a slightly different topic, do you plan to convert the Cadence > >>> driver to spi-mem? And if you don't, is it because you don't have time > >>> or because some features are missing in spi-mem (I remember you > >>> mentioned a few things back when you were reviewing the spi-mem series)? > >>> > >> > >> I do not have plans to convert cadence QSPI driver to spi-mem yet, > >> mainly due to lack of time. Also, not sure if original author Marek and > >> other altera people are okay with that. > >> > >> I see couple of issues in the way of conversion: > >> 1. I would wait to know what direction would direct mapping APIs[1] go > >> before starting spi-mem conversion for Cadence QSPI driver. Else, we > >> have may to re write again if direct mapping APIs are merged. > > > > I'd suggest reviewing the proposal I posted so that you can influence > > the design of this new API ;-). > > > > I did take a look and proposal seems fine. Will try to prototype and > test cadence QSPI driver with these. Thanks for the patches! That's great news! Let me know how it goes, and don't hesitate to ask if you have any questions. > > > >> 2. New Cadence OSPI IP has an integrated PHY to support high throughput > >> OSPI flashes operating up 200MHz in Octal DDR mode. In order to work > >> with such flashes, PHY DLLs need to be calibrated. Highly simplified > >> calibration sequence is as below(See [2] for actual sequence): > >> -Read flash ID at low speed and store it. > >> -Enable PHY and set DLLs to a defined initial value > >> -Increment RX DLL value > >> -Read flash ID and check for correctness of data read > >> -repeat above two steps until a band of passing values is obtained for > >> RX DLL where flash ID is correctly read. > >> -DLL needs to set to middle of the passing band. > > > > Is the Read ID operation hardcoded or do you just use it as a way to > > trigger predictable transfers on the IO bus? > > > > Just a way to trigger predictable data reads. Good. > > >> > >> I am trying to figure out how to fit this into the spi-mem framework as > >> controller would to need to store READ ID opcode and expected JEDEC ID > >> before starting calibration sequence. > > > > I think this should be split in 2: > > > > - the SPI NOR framework passing the operation to use to do the > > calibration (here a READ ID) > > - the SPI controller framework replaying the same operation with > > different DLL configs until it finds the best match > > > > So, it would basically be added as a new hook: > > > > int (*calibrate)(struct spi_mem *mem, > > const struct spi_mem_op *tmpl); > > > > and a new function provided by the spi-mem API > > > > int spi_mem_calibrate(struct spi_mem *mem, > > const struct spi_mem_op *tmpl); > > > > and calibration outcome would be somehow attached to the spi_mem > > object. > > > > This way we stay memory agnostic but still provide the necessary blocks > > at the spi-mem level to do such callibrations. > > > > Would that work? > > > > That would work and hopefully is not intrusive to spi-mem framework. > Okay. Don't hesitate to post a proposal along those lines and I'll try to review it. Thanks, Boris