Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5248603ybh; Wed, 7 Aug 2019 03:10:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVuxhZ9e2LUJLlQUqtLi8L7ctvnorrtiyXWtX1WMXZehsPzzsOQVMVxhn2etFu8QK6eu5m X-Received: by 2002:a17:90a:bf92:: with SMTP id d18mr7836590pjs.128.1565172634214; Wed, 07 Aug 2019 03:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565172634; cv=none; d=google.com; s=arc-20160816; b=Mrcrvksb4uTR73r2ueUseo5B2Mp01Z0RhIl47NUqu6v7Kdl+CVMmVUypMgC6xjoKFa GQWAuQbkcvFAZ6uh0P/bu7SHiDrzMVCmPBxh7njpPqpr01f7yPy7isUEQKUOJ+fVrT8m 11WajXdS7JKt6Yr5F65PLqx5nKs/E2U1WKrZv2ON/GLwNEcTE1jehyiugw90t+jjUlaI Fcmc1YTY5vo+Wl9G7UEj9lqTXs1buUvF4lKw3q0sVHsGZRpsdV2p1t7PP6wB5gqgsT6f 5qBDjdTGIXGFGX40SYmn96aL9YUEqMbrGA8zLxfL6hDCCZSQZ+/UX86+QZFVjTLUK70L SmdQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=90mjIEha3o/nYYlpsx9X1jk9thY55FK5bzZTX/TqMpw=; b=a0r60IHPDfJCe/XKm+220UhH5q78LPpl+aMRbZ/Rjrcb7MBJt7pBE6UINqfqvx1U22 bg5PYFHjUnsUGmWvKut56MaxUfJcnvzISUu7GNlE/zlztRH/xcMf/iriJ1GTbYAUy9iv Mk6ZJCVAbzgqaqCqn7HKhT1Tnw5eN9zSJvRGNitmy+V0w/V12QFoXS7ApZzP2z6SY3EC jWgwPyiE+guJyLb8up2pGRpZ+5xFmAqJhXlNSmb5NGpCRgLCUL4Zk50GiawJCCBuzil9 pcm+znU/hlB2BEGp3wCzZqX9h8M59oyra341XaGB7ZwRwI07NDaZBqcs3zmgTWIwaHIe HaCw== 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 11si45431449pla.248.2019.08.07.03.10.18; Wed, 07 Aug 2019 03:10:34 -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 S1729551AbfHGKIa convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Aug 2019 06:08:30 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:54159 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729407AbfHGKIa (ORCPT ); Wed, 7 Aug 2019 06:08:30 -0400 X-Originating-IP: 86.250.200.211 Received: from xps13 (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 9E20A240002; Wed, 7 Aug 2019 10:08:27 +0000 (UTC) Date: Wed, 7 Aug 2019 12:08:26 +0200 From: Miquel Raynal To: shiva.linuxworks@gmail.com Cc: Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra , Boris Brezillon , Marcel Ziswiler , Frieder Schrempf , Shivamurthy Shastri , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Jeff Kletsky , Chuanhong Guo , liaoweixiong Subject: Re: [PATCH 8/8] mtd: spinand: micron: Enable micron flashes with multi-die Message-ID: <20190807120826.3b9e43d6@xps13> In-Reply-To: <20190722055621.23526-9-sshivamurthy@micron.com> References: <20190722055621.23526-1-sshivamurthy@micron.com> <20190722055621.23526-9-sshivamurthy@micron.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shiva, shiva.linuxworks@gmail.com wrote on Mon, 22 Jul 2019 07:56:21 +0200: "with multiple dies" in the title > From: Shivamurthy Shastri > > Some of the Micron flashes has multi-die, and need to select the die have multiple dies and > each time while accessing it. > > Signed-off-by: Shivamurthy Shastri > --- > drivers/mtd/nand/spi/micron.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c > index 1e28ea3d1362..fa2b43caf39d 100644 > --- a/drivers/mtd/nand/spi/micron.c > +++ b/drivers/mtd/nand/spi/micron.c > @@ -90,6 +90,19 @@ static int micron_ecc_get_status(struct spinand_device *spinand, > return -EINVAL; > } > Please explain in a comment what you do here, like in the commit title. > +static int micron_select_target(struct spinand_device *spinand, > + unsigned int target) > +{ > + struct spi_mem_op op = SPINAND_SET_FEATURE_OP(0xd0, > + spinand->scratchbuf); > + > + if (target == 1) > + target = 0x40; > + > + *spinand->scratchbuf = target; if (target == 1) *spinand->scratchbuf = 0x40 space > + return spi_mem_exec_op(spinand->spimem, &op); > +} > + > static int micron_spinand_detect(struct spinand_device *spinand) > { > const struct spi_mem_op *op; > @@ -105,6 +118,7 @@ static int micron_spinand_detect(struct spinand_device *spinand) > spinand->flags = 0; > spinand->eccinfo.get_status = micron_ecc_get_status; > spinand->eccinfo.ooblayout = µn_ooblayout_ops; > + spinand->select_target = micron_select_target; > > op = spinand_select_op_variant(spinand, > &read_cache_variants); Thanks, Miquèl