Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp885865imm; Fri, 8 Jun 2018 06:49:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3Ij1KX8hM+EGdNFY+ogGjiw1/jzCul0Q6kFA0kDn8a9iGB+At9AhH0XEZvsQ32/6KzqOv X-Received: by 2002:a62:e097:: with SMTP id d23-v6mr6134522pfm.81.1528465779348; Fri, 08 Jun 2018 06:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528465779; cv=none; d=google.com; s=arc-20160816; b=QNSzcByLdcjVKe3KIAZZvcWPnmDTowcOhF2cEAJp6L69o1fD8L1xA24a5DcEx/dWMh RtU2tPzzb6C3y15spx4BnuihaBBOY7rCfwT+sec5JYkoIcJfXKXrI/zrkPJ63p7LzH9T SE6EjNgungXk7SC1JaxfmPFX9ZCKmr/6u5/XD7XOsofJIRIssBOjjchkIWRpOUcPm4mC jPKl+d7LlRfSdlRzXSExbvH77ox68K6MGgkg7qAR4Nx9R1EJ7qfbsbCnc9xVYKBsztzd xpf2qOCsxR/LxzCyRn9K6L1D80R1QkenfGIqiLtIxgGBSDwV7H504jbOaTNyJ3RYrSQd uHKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=9cTSTIo4cgoyvgclhdz+Yfsbraay1/hy+BP8Y2C6y2E=; b=wExWY+TNsgjXXearzcG4zYYly/joQjCU+A2WYBB0+ZWf64f6T+oFLvKqDVZMtTAPpm zGQZC/Ms6XmdOS1z2a0wcBIKUFU+JFe1sPmfCfwxxM32demC68xNCxtLHxllM/RvDUsz WIBF6YtovT9hBFBITFiRiJpkq6NkRgtBXWdPKhhCUd8yoPGaImEtTF4SaO1/01XlUsuU ZRf0l7zrpN+eulxE0MW7RUDkEmcawqGh9Xeqnbal8IbHoqlz4iNBV1tE4qHWrIFeJgLF VdblLzVfGqkB0JCr+CI56NT6fIBCuOeAG/L6aJWgFndWVcQqE2Fw9/GszSKzu0/XeWGP TC3w== 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 v26-v6si27328192pgc.416.2018.06.08.06.49.25; Fri, 08 Jun 2018 06:49:39 -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 S1752753AbeFHNs2 (ORCPT + 99 others); Fri, 8 Jun 2018 09:48:28 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:24138 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbeFHNs1 (ORCPT ); Fri, 8 Jun 2018 09:48:27 -0400 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="12312498" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Jun 2018 06:48:27 -0700 Received: from localhost.localdomain.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Fri, 8 Jun 2018 06:48:26 -0700 From: Tudor Ambarus To: , , , , , CC: , , , , Tudor Ambarus Subject: [PATCH] add support to non-uniform SFDP SPI NOR flash memories Date: Fri, 8 Jun 2018 16:48:17 +0300 Message-ID: <20180608134818.21387-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit message became wall-of-text, my feeling is that I heavily reworked the code so I changed the author. If someone thinks differently, please say and I'll change back to the initial authorship. What I've done: - minimize the amount of erase() calls by using the best sequence of erase type commands depending on alignment. - build the list of best fitted erase commands to be executed once we validate that the erase can be performed. - add improvements on how the erase map is handled. The regions are consecutive in the address space, walk through the regions incrementally. - speed up finding the best erase type command. Order erase types by size, iterate them from the biggest to the smallest and stop when best fitted command is found. - determine at init if there are erase types that can erase the entire memory - fix the erase size in overlaid regions. S25FS512S states that 'if a sector erase command is applied to a 256KB range that is overlaid by 4KB secors, the overlaid 4kB sectors are not affected by the erase' Backward compatibility test done on MX25L25673G. Changes since RFC PATCH: - build a list of erase commands to be executed once we validate that the erase can be performed - fix walking through the address space in overlaid regions - drop wall-of-text description commit message, change author Tudor Ambarus (1): mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories drivers/mtd/spi-nor/spi-nor.c | 357 ++++++++++++++++++++++++++++++++++++++++-- include/linux/mtd/spi-nor.h | 108 +++++++++++++ 2 files changed, 451 insertions(+), 14 deletions(-) -- 2.9.4