Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp271645pxx; Thu, 29 Oct 2020 02:08:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr9Sq714/Oj318l7z7zrAmu3bwm3KFbg9JfiBdUS3mpvzj+Cih2T3ONnxBJaCG0L0QXrpB X-Received: by 2002:aa7:dad6:: with SMTP id x22mr3080069eds.136.1603962482230; Thu, 29 Oct 2020 02:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603962482; cv=none; d=google.com; s=arc-20160816; b=m8ZJhPoZ7h2WcoDcO1VcmoLZJjL0GvVxF7sXvnuk2KrZfTyjypeih+k0/Y70UEq0z/ wiNoXRAjbOY6TJvUFQIrVfQ6wSdrLNm8DzNGv64EDCssx2i1syhKv8NxNJpapCGlJYSu j+3r87Ad0XhwKzfQB4h0o1GMQX1LslC6jkoSr46NKSqK4i8peivoFlnjQ6Fj5rrmr5pR NzJEoQADMA7vn8A6i3wVfxiGrn+q4g+qat1INv5XXJfxngiRlHALq/HdLDBX4nnXLWAj PPdWZg3OgOsaMOkcszDJ14gtzZm105Nuwr8wRMF/JkRQklTOPezZwEntYqNWUPKajOmt jKnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=G+ySgoUoSliiqQjFcN2YvilovWvoDksVvI/v+ASeSXs=; b=VYYH2sSs47XN4qbjZ/pRBtLQPaE5IHqdjdoFVEYCSMI8hYsJgujIGzEEgE0J/0tr0h GGtuMY2fPfqpPN2/ft+UpjnaH4LwkdWoFSkph1DXF6GUVjeg9/2wyieTg3pZYjF3k04R ClBS/9jq4VIZRSaMYDr9G1Crbe4atTnqeLqNLuYuCVNMfRJEhpXn+UN4w3Q7wE83ZVMk uxdEr9XK1Sou/boTWhxxveJiq2j0EOy2aekw5EdZW7lAfLh14U7MU8H2sor4cE5mvrxK shgeLolgXIRPDWSxbto6yBTv1fvgNmm+KdGcdh4fa6mNl1JycAmKoRoW4tsS947lG5YY ookg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg15si1397316edb.596.2020.10.29.02.07.39; Thu, 29 Oct 2020 02:08:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727031AbgJ2IhS convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Oct 2020 04:37:18 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50603 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbgJ2IhS (ORCPT ); Thu, 29 Oct 2020 04:37:18 -0400 X-Greylist: delayed 2606 seconds by postgrey-1.27 at vger.kernel.org; Thu, 29 Oct 2020 04:37:16 EDT X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id E16B8E0014; Thu, 29 Oct 2020 08:37:12 +0000 (UTC) Date: Thu, 29 Oct 2020 09:37:11 +0100 From: Miquel Raynal To: mdalam@codeaurora.org Cc: agross@kernel.org, bjorn.andersson@linaro.org, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH 0/5] mtd: rawnand: qcom: Add support for QSPI nand Message-ID: <20201029093711.0c7c5903@xps13> In-Reply-To: <20201029085344.5b2a4b51@xps13> References: <1602307902-16761-1-git-send-email-mdalam@codeaurora.org> <20201028104835.3dc31745@xps13> <10db598eed716d7759bc0125b6977cf1@codeaurora.org> <20201029085344.5b2a4b51@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miquel Raynal wrote on Thu, 29 Oct 2020 08:53:44 +0100: > Hello, > > mdalam@codeaurora.org wrote on Wed, 28 Oct 2020 23:54:23 +0530: > > > On 2020-10-28 15:18, Miquel Raynal wrote: > > > Hello, > > > > > > Md Sadre Alam wrote on Sat, 10 Oct 2020 > > > 11:01:37 +0530: > > > > > >> QPIC 2.0 supports Serial NAND support in addition to all features and > > >> commands in QPIC 1.0 for parallel NAND. Parallel and Serial NAND >> cannot > > >> operate simultaneously. QSPI nand devices will connect to QPIC >> IO_MACRO > > >> block of QPIC controller. There is a separate IO_MACRO clock for >> IO_MACRO > > >> block. Default IO_MACRO block divide the input clock by 4. so if >> IO_MACRO > > >> input clock is 320MHz then on bus it will be 80MHz, so QSPI nand >> device > > >> should also support this frequency. > > >> >> QPIC provides 4 data pins to QSPI nand. In standard SPI mode (x1 mode) >> data > > >> transfer will occur on only 2 pins one pin for Serial data in and one >> for > > >> serial data out. In QUAD SPI mode (x4 mode) data transfer will occur >> at all > > >> the four data lines. QPIC controller supports command for x1 mode and >> x4 mode. > > >> >> Md Sadre Alam (5): > > >> dt-bindings: qcom_nandc: IPQ5018 QPIC NAND documentation > > >> mtd: rawnand: qcom: Add initial support for qspi nand > > >> mtd: rawnand: qcom: Read QPIC version > > >> mtd: rawnand: qcom: Enable support for erase,read & write for serial > > >> nand. > > >> mtd: rawnand: qcom: Add support for serial training. > > >> >> .../devicetree/bindings/mtd/qcom_nandc.txt | 3 + > > >> drivers/mtd/nand/raw/nand_ids.c | 13 + > > >> drivers/mtd/nand/raw/qcom_nandc.c | 502 >> ++++++++++++++++++++- > > >> 3 files changed, 494 insertions(+), 24 deletions(-) > > >> > > I'm sorry but this series clearly breaks the current layering. I cannot > > > authorize SPI-NAND code to fall into the raw NAND subsystem. > > > > > > > I am agree with you, we should not add SPI-NAND changes inside > > raw NAND subsystem. > > > > > As both typologies cannot be used at the same time, I guess you should > > > have another driver handling this feature under the spi/ subsystem + > > > a few declarations in the SPI-NAND devices list. > > > > > > > Initially I was started writing separate driver under SPI-NAND subsystem then I > > realized that more than 85% of raw/qcom_nand.c code getting duplicated. > > > > That's why I have added this SPI-NAND change in raw/qcom_nand.c since > > more than 85% of code will be reused. > > > > If I will add this change inside SPI-NAND subsystem then much of > > raw/qcom_nand.c code will get duplicated. Would it be ok ? > > What about moving the generic code to drivers/mtd/nand/common/ and > referring to it from drivers/mtd/nand/raw/qcom_nand.c and > drivers/spi/spi-qcom.c (or such)? Actually, perhaps drivers/memory/ is the right location for the generic bits. Thanks, Miquèl