Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4446577imm; Tue, 11 Sep 2018 12:02:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZjrVS761gMNYTZI2m8r63aEpyS8IvMqhNWLSpjgH+WJUPw0MxOjxb4AM4PnvU2mNebuf5n X-Received: by 2002:a63:4c02:: with SMTP id z2-v6mr30646328pga.312.1536692532682; Tue, 11 Sep 2018 12:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536692532; cv=none; d=google.com; s=arc-20160816; b=C4IIf2aRPMFgIKIkaBR7y1rwkQXsbjSA2A0UnLv0GjPesMa2Ej2WxWcmKTi41fwy42 BoU/6iX5VVXTUxkeBtRKRkm0wRIM/PpwFDAA8YfpY5ug+UfiU0OFGoMx/45y4x4jBkVY M3n5bAwqyBM0oIsLyaVWzzirAeoyOknuiy4CqsCbNcPcS8luCvXiOV/oIIFiIYBEV4qD DyiIvYuvWZKlf8/Ymmn06TcewuJgdNYqkC17tsEcHAGzODVnYGnyBkVguvWc6o/C1jYl s/vcnb74ilh75BoNjamYhhg2j2/zYhMQsJr/oaBiC7M7V9rWC9L0LSjoQ4ZwaT/enmiZ zyvQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RcJNaqxwZea9uwDYmwE+bUzlZgXKGvWd45HN57loAjw=; b=wiR2CzvBxt1I1MyEjMqovjRjcRVZdYo5uxy8rIfowL0mWfUrZNfSX9uxDInxKkvyKI 8AO4xczfzBm0pHuh+MZA7XUYj6PuV2OlHL1TmPfUXBxAUJ19356ZQvIpz2z1/82VkYsH W8dBb6AU85ixAgwzQbebXdBbUJ+zl6QYfZxi5fmDTvR0LzZHPxV4tUzUBda3rxuRuy0A dFuAr7DRBqtwwPlvC3hkC5CWpsskMlu6KmEVk0YM2OCi1cPAq+mLTWM3GX5hBYFwYrk5 pBsdbh94Zo9+zN1DMqgM7COozJQ/Jk8mxd6c98vK7P3Jt4+4sWvgCJKM5RZxGPXMkiyr bJAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GHyTRUWP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w68-v6si21008329pfw.308.2018.09.11.12.01.44; Tue, 11 Sep 2018 12:02:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GHyTRUWP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeILACT (ORCPT + 99 others); Tue, 11 Sep 2018 20:02:19 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37701 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbeILACT (ORCPT ); Tue, 11 Sep 2018 20:02:19 -0400 Received: by mail-wm0-f68.google.com with SMTP id n11-v6so2098862wmc.2 for ; Tue, 11 Sep 2018 12:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RcJNaqxwZea9uwDYmwE+bUzlZgXKGvWd45HN57loAjw=; b=GHyTRUWPbOCK6Qu6IeXXl+QSb1n0ymooAvuXNK3z9EP2RwvrMDTXCs1J7iCE4v/HLo otbBReIIVrTfXFDo9V9wCRKUdgtIPw6VQuOBZd7LUb2Dg/ZfaC/Zkm4Cjjj6gamKGP0x nSA0AAzWP4eHqoqQmbuL9pm0Jva4FszXj5c/ayE8N2RqyTmoemT5NqxezzwICk0MVrnS Yyju452qy6eUnuoUnw+Osgi7YZ+K5Zvan4pI9Uitl2N/oVeSvOa6RCV79pUWayQ2/4+T Q4b01b19/T5MYQg/yWJNiZwM1LkbN2QNjsD6L7xAIl2VBlvNIiNasi+Stg7Ai9d0gDpc z1mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RcJNaqxwZea9uwDYmwE+bUzlZgXKGvWd45HN57loAjw=; b=T8KPETMlJsyZJsPidLFWAqmDey20TslzeasTwFbRxZdobdhC11gWwKs0S8s7pnJEGi jt4IFrKokkS94MdOPzhbHk83GXvek2itoFsxbpUqSfuDMTXMOIyx9GNUxjNLy0xtjizP hCTmuzMIpJj1IKtr2FfDZi9lxolhgzbwybjEa7PkI/o52cS/NWipyDWcxOQY8AepHVGv ni+9ucmvB6efNwNV8epgWhXd2KMJ5iL80AQr3O/XrqzL4NxIid6unti2jd+oJKLr0BjC liCssKK+7Ht8asyDSBCTy+T5AtNo7UBKx4WeJ46/B5kjf5gMesSzCD/zSj0mtNHeX7V8 1d1Q== X-Gm-Message-State: APzg51DMsE4pwzSRAARjRu/Ed1bS5/ZbQn0wNgLW4OCUd33cISDtXSmK iUOxaKwjioDEbUSS1ca4+fY= X-Received: by 2002:a1c:3a92:: with SMTP id h140-v6mr2373554wma.41.1536692498242; Tue, 11 Sep 2018 12:01:38 -0700 (PDT) Received: from [192.168.1.4] (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id j133-v6sm2965078wmd.12.2018.09.11.12.01.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 12:01:37 -0700 (PDT) Subject: Re: [PATCH v3 1/2] mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories To: Tudor Ambarus , dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.com, richard@nod.at Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, cyrille.pitchen@microchip.com, nicolas.ferre@microchip.com, Cristian.Birsan@microchip.com References: <20180911154007.17195-1-tudor.ambarus@microchip.com> <20180911154007.17195-2-tudor.ambarus@microchip.com> From: Marek Vasut Message-ID: Date: Tue, 11 Sep 2018 20:55:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180911154007.17195-2-tudor.ambarus@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/11/2018 05:40 PM, Tudor Ambarus wrote: > Based on Cyrille Pitchen's patch https://lkml.org/lkml/2017/3/22/935. > > This patch is a transitional patch in introducing the support of > SFDP SPI memories with non-uniform erase sizes like Spansion s25fs512s. > Non-uniform erase maps will be used later when initialized based on the > SFDP data. > > Introduce the memory erase map which splits the memory array into one > or many erase regions. Each erase region supports up to 4 erase types, > as defined by the JEDEC JESD216B (SFDP) specification. > > To be backward compatible, the erase map of uniform SPI NOR flash memories > is initialized so it contains only one erase region and this erase region > supports only one erase command. Hence a single size is used to erase any > sector/block of the memory. > > Besides, since the algorithm used to erase sectors on non-uniform SPI NOR > flash memories is quite expensive, when possible, the erase map is tuned > to come back to the uniform case. > > The 'erase with the best command, move forward and repeat' approach was > suggested by Cristian Birsan in a brainstorm session, so: > > Suggested-by: Cristian Birsan > Signed-off-by: Tudor Ambarus Reviewed-by: Marek Vasut -- Best regards, Marek Vasut