Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1925470ybg; Fri, 5 Jun 2020 00:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy58woaTsB42j6VDKaQEQTEZfCgCKApq0BA7fV4CaCsiL1v+Lpon9ixeKbYGkf+79yVR3PS X-Received: by 2002:aa7:c81a:: with SMTP id a26mr8289980edt.353.1591343378925; Fri, 05 Jun 2020 00:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591343378; cv=none; d=google.com; s=arc-20160816; b=Eadx4WrJAfFyc+hC45tpr+WUdgh3GXD0e+sAwWLKj7qEr9pub9l0lRZXER48ABWPfx 104mO89xXWXxAB/8pq0oLl5YZ+kn9BxBgO5+DbKW+KCwTuqo6HsIIBhdZkyGOaG+0cwg f9tySZfYjK6lVyNqSicSAZrIYZTvneEKf3/81DGlHg46PsGZmW/Q0f92MsyhzA7s8qv6 tJ04gqzZmyKcqoHaGF47GtFuPF60lgt7uyZaPhoHesKOge+yzj025ZB+KQlpufsm0vBz n1QYwmDyT6ke5mJWNCQo+OHurutaiVdlzwSXDGxYqHQH9N0bCrDiwkWq2TqnYGJFBvSA OtIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=/QTOo3V/OvtmwXkMH0REV+fHC0n6K4DySni52n9Xxbg=; b=oksNle6y1oysvwsW60dfI8O0vP6+j5zBB/QOBlB21fkNj8QCEpG3gOoiBRAyvaNQxU mLRrryMVRrJ2J0lLkKocEoJoduHNn/zXn9xlTEMm68W96ssCKE7F8dng31L7/UBYg3cH Ul8LcIazTWA52EILp6BsP4CJFEekAINeflvFIncoIh1ExEL5ggYhjnrTpAueFNMMGEVE W3rky41FJsstO8mKhCHjHIO5FrnEpgOMJBcmBD+o7omJ1d1DPgRf7W0Pxbf6NeojuPH1 wgb4NY1xrRc1tTtdwv5igOO3gyyw1V2wxMkd99VQ28XbtCimMKBu9AB5IajovAiu5kl7 ET3w== 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 l15si3027553ejc.97.2020.06.05.00.49.16; Fri, 05 Jun 2020 00:49:38 -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 S1726144AbgFEHrY (ORCPT + 99 others); Fri, 5 Jun 2020 03:47:24 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:55601 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgFEHrX (ORCPT ); Fri, 5 Jun 2020 03:47:23 -0400 X-Originating-IP: 157.36.131.136 Received: from localhost (unknown [157.36.131.136]) (Authenticated sender: me@yadavpratyush.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 54D2E1C0002; Fri, 5 Jun 2020 07:47:15 +0000 (UTC) Date: Fri, 5 Jun 2020 13:17:11 +0530 From: Pratyush Yadav To: masonccyang@mxic.com.tw Cc: boris.brezillon@collabora.com, broonie@kernel.org, juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, matthias.bgg@gmail.com, miquel.raynal@bootlin.com, p.yadav@ti.com, richard@nod.at, tudor.ambarus@microchip.com, vigneshr@ti.com Subject: Re: [PATCH v4 7/7] mtd: spi-nor: macronix: Add Octal 8D-8D-8D supports for Macronix mx25uw51245g Message-ID: <20200605074711.zxxajsfgzopnjecw@yadavpratyush.com> References: <1590737775-4798-1-git-send-email-masonccyang@mxic.com.tw> <1590737775-4798-8-git-send-email-masonccyang@mxic.com.tw> <20200529094202.7vjs7clhykncivux@yadavpratyush.com> <20200603055359.y35dwznglc7tlewq@yadavpratyush.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/20 10:53AM, masonccyang@mxic.com.tw wrote: > > > > > > > > > > > +#define MXIC_CR2_DUMMY_SET_ADDR 0x300 > > > > > + > > > > > +/* Fixup the dummy cycles to device and setup octa_dtr_enable() > */ > > > > > +static void mx25uw51245g_post_sfdp_fixups(struct spi_nor *nor) > > > > > +{ > > > > > + struct spi_nor_flash_parameter *params = nor->params; > > > > > + int ret; > > > > > + u8 rdc, wdc; > > > > > + > > > > > + ret = spi_nor_read_cr2(nor, MXIC_CR2_DUMMY_SET_ADDR, &rdc); > > > > > + if (ret) > > > > > + return; > > > > > + > > > > > + /* Refer to dummy cycle and frequency table(MHz) */ > > > > > + switch (params->dummy_cycles) { > > > > > + case 10: /* 10 dummy cycles for 104 MHz */ > > > > > + wdc = 5; > > > > > + break; > > > > > + case 12: /* 12 dummy cycles for 133 MHz */ > > > > > + wdc = 4; > > > > > + break; > > > > > + case 16: /* 16 dummy cycles for 166 MHz */ > > > > > + wdc = 2; > > > > > + break; > > > > > + case 18: /* 18 dummy cycles for 173 MHz */ > > > > > + wdc = 1; > > > > > + break; > > > > > + case 20: /* 20 dummy cycles for 200 MHz */ > > > > > + default: > > > > > + wdc = 0; > > > > > + } > > > > > > > > I don't get the point of this. You already know the fastest the > > > > mx25uw51245g flash can run at. Why not just use the maximum dummy > > > > cycles? SPI NOR doesn't know the speed the controller is running at > so > > > > the best it can do is use the maximum dummy cycles possible so it > never > > > > falls short. Sure, it will be _slightly_ less performance, but we > will > > > > be sure to read the correct data, which is much much more important. > > > > > > In general, 200MHz needs 20 dummy cycles but some powerful device may > only > > > > > > needs 18 dummy cycles or less. > > > > Yes, but do different mx25uw51245g chips have different dummy cycle > > requirements? Shouldn't all the chips with the same ID have same > > performance? > > > > Same chip ID but different grade, > i.e., commercial or industrial grade. Ok. In that case it makes sense. -- Regards, Pratyush Yadav