Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1597906pxu; Fri, 27 Nov 2020 10:36:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJylkehtF5TUXJlvfoo2N2xSHp88VWcn7AAIp/5PZPwxKeE2TkXnKX/v81FixwGmbN+B2NHU X-Received: by 2002:a05:6402:143a:: with SMTP id c26mr8783288edx.131.1606502182510; Fri, 27 Nov 2020 10:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606502182; cv=none; d=google.com; s=arc-20160816; b=nuMkYw9LN9+S8nNheIYX4t9tVWfpgOT/BY8XcQhzF78xV20Sk/PMFaAi0KAnCc2Jpg bCE2SDtSeAnX+x66wnJZQtmWZnkxjXqFdj5fwoQQQ/rkYI5ONIPtfLCHEMY0zIEmC2q2 2Lg1Qfgb/xlKJMpsNpZ5caqN8z5iNlC/HDDFWzwNaV20B7kqMgSAoMZKmHlbPmq4Kn/o 9iTiGU4pwHNOC0ir26lhLPLhMs7EAo7D9NP6UXU5hcohD9H52aNnlX6SO7r9hBHBryoe Qs795uTRI+WHSlHW2TxayfuJgFMoP9TL/pFeCkwJ78Z4cz1lAsqrJcdonriKYHpD4tqV J22A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:subject:cc:to:from:date :content-transfer-encoding:mime-version:sender:dkim-signature; bh=HUJXvp284SgEwZROfQs9oj7GiVOC/2yMIUq8pK3JA5U=; b=AdXNT7pzaeHQrAw/RsF19pRimd90MQ8VA8GRAnMNuyHSRcqsYXFfgs9Y1K2Qn33QYo tVtrvegfKTM4r8Tg/itHGA4uKolw9QGy8JOHm9/IVZaaaGsa4L/Cw3QU7k6PZHYe9tZO 5lN67/D8LzdOW2j3yEPJbiu0J6Z4LpD7JvzpF8uWsm+OgjSBGOXb7idsE+CHCS3RtEVw LbAziNd4JST8eR4bRYmINysGHBauzYXlLvC04z5GUQkcWeA7XF6ScrtneWeMdJyhmAla y6bisIm9pdNVnHDG/U1R6omBKeH26a6vu8oIXcmE/kxXpRJtzUn5gI4Al8zomLtE71Xe pZ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=EekN9MMh; 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 n11si6051725ejg.660.2020.11.27.10.35.59; Fri, 27 Nov 2020 10:36:22 -0800 (PST) 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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=EekN9MMh; 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 S1731052AbgK0Oro (ORCPT + 99 others); Fri, 27 Nov 2020 09:47:44 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:42800 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730908AbgK0Orn (ORCPT ); Fri, 27 Nov 2020 09:47:43 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606488463; h=Message-ID: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=HUJXvp284SgEwZROfQs9oj7GiVOC/2yMIUq8pK3JA5U=; b=EekN9MMhe1XylyED16a7HTPA2g+9KcsgfyVflkmfHxH3+QhFxreUmllaxMBPEHgibHY0Uw3V Mtb9ggGun4MTuzCP8M5ydG+M6JAQNAnf/dI0Z5gQAN+cCXRDW3b+rror6w0bthzm8t1NyXCB cW2/OI2Qqru8Rj7xpzBnlMMj4BY= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5fc1118c7f0cfa6a16f331c2 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 27 Nov 2020 14:47:40 GMT Sender: mdalam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C3C3BC43464; Fri, 27 Nov 2020 14:47:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mdalam) by smtp.codeaurora.org (Postfix) with ESMTPSA id CEDF3C433C6; Fri, 27 Nov 2020 14:47:38 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 27 Nov 2020 20:17:38 +0530 From: mdalam@codeaurora.org To: Boris Brezillon Cc: Md Sadre Alam , agross@kernel.org, bjorn.andersson@linaro.org, miquel.raynal@bootlin.com, 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 2/5] mtd: rawnand: qcom: Add initial support for qspi nand Message-ID: <885854a4765c302d86b0d482c2c45abc@codeaurora.org> X-Sender: mdalam@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-29 14:37, Boris Brezillon wrote: > Hello, > > On Sat, 10 Oct 2020 11:01:39 +0530 > Md Sadre Alam wrote: > >> This change will add initial support for qspi (serial nand). >> >> QPIC Version v.2.0 onwards supports serial nand as well so this >> change will initialize all required register to enable qspi (serial >> nand). >> >> This change is supporting very basic functionality of qspi nand flash. >> >> 1. Reset device (Reset QSPI NAND device). >> >> 2. Device detection (Read id QSPI NAND device). > > Unfortunately, that's not going to work in the long term. You're > basically hacking the raw NAND framework to make SPI NANDs fit. I do > understand the rationale behind this decision (re-using the code for > ECC and probably other things), but that's not going to work. So I'd > recommend doing the following instead: > > 1/ implement a SPI-mem controller driver > 2/ implement an ECC engine driver so the ECC logic can be shared > between the SPI controller and raw NAND controller drivers > 3/ convert the raw NAND driver to the exec_op() interface (none of > this hack would have been possible if the driver was using the new > API) Sorry for late reply. I think I mixup the serial nand support and QPIC_V2.0 support. Only patches [2/5] mtd: rawnand: qcom: Add initial support for qspi nand and [5/5] mtd: rawnand: qcom: Add support for serial training. are for serial nand. Other patches [3/5] mtd: rawnand: qcom: Read QPIC version & [4/5] mtd: rawnand: qcom: Enable support for erase,read & write for serial nand. are to support QPIC_V2.0. In QPIC_V2.0 onwards some additional registers and features got added. QPIC_NAND_READ_LOCATION_LAST_CW_n register got added to read last code word. Page scope read & multi page read feature got added to read single and multiple pages. QPIC_NAND_AUTO_STATUS_EN register got added to read status in page scope read & multi page read etc. I will take out QPIC_V2.0 support patches and will push it separately. For serial nand support few lines of codes are there around 50 lines to initalize QPIC serial block and serial training code. So can I put this this as a separate file inside drivers/mtd/nand/raw/qpic_serial_nand.c. Would it be ok ? Because there is no dedicated spi controller for serial nand. QPIC controller having one serial interface block to deal with serial nand device. > > Regards, > > Boris