Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2897934ybl; Sun, 25 Aug 2019 04:40:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgWWMo31PMtpzJppyskpES2Y3uQPjBiDYKCIAhYFx9g47Bqqx62C/YP+nfUWkV7ZIs3uAN X-Received: by 2002:a65:64ce:: with SMTP id t14mr11688901pgv.137.1566733201242; Sun, 25 Aug 2019 04:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566733201; cv=none; d=google.com; s=arc-20160816; b=zrYfcGwlzTA3ZtquZQLThfgvu4HkOgzS0ozBfj4l0FPx/26YgCWAkXA0ZeawzUYXOq DxWdmSqxG9bs1ChgNOr1oNQHx6I+LAHAAD0mEHSfVfLNVRQeGLu6PXrDDvh6HR+FrZVm EifzuclQYtFBJP07zsUSM1uJLo5HYawuNlLIdC0ojSbKLehWFREo6saFF9z0afI9gOdF hKhaj9Kng8L1YC3X+qvl6++2nMk2t/KaqB8NnBSOXZWTcNewOqdhMigVVZFWBbgAMVoZ Ejqa6FybujqTeX2/e+SasOODYWjV36stWriKFt6J7GkQXJE4GnWtuwd/mo+wPdSRQF5z sBOQ== 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=x0ydvm2H1TdOm0bNfFatrClkH3zTmC09Uwa/u8U+zzc=; b=iaK2SC7xE1fiCddWgLVPS7S02sk+tlu/tgY4g+zNH4MsOfQ0Mn2FeC4FFrURx+xXyA I6Rg105dWPEt7Gro/NLcY+OnJiGghJMOVewSFmaM5s38aTSsOF9vNV9puoOPpYjqMzTg tiyzpsC0mGKjdXM5cXUIVJtooRJxN/ulzrJc5s9RfGf+NQR+pSMw1BkdSeIXfVNy3hEX +w2Z0y7pSt2XmO/5EAj9f5qpS3OGQ6q84gNrAnVi/Pagtzu+CPqDtqk/7i5TuTUx+cBM mxGf+Jg0Kv9A9ORXiLC1SE15gSfbKBeAzzOAPhprFNqCOYq3A/fFE1vPWJ0rQDfQgmaU xu9A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si6872227pjr.38.2019.08.25.04.39.45; Sun, 25 Aug 2019 04:40:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbfHYLi5 (ORCPT + 99 others); Sun, 25 Aug 2019 07:38:57 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37864 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726612AbfHYLi5 (ORCPT ); Sun, 25 Aug 2019 07:38:57 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1D42426DF12; Sun, 25 Aug 2019 12:38:56 +0100 (BST) Date: Sun, 25 Aug 2019 13:38:53 +0200 From: Boris Brezillon To: Cc: , , , , , Subject: Re: [PATCH 0/5] mtd: spi-nor: move manuf out of the core - batch 0 Message-ID: <20190825133853.32532641@collabora.com> In-Reply-To: <20190823155325.13459-1-tudor.ambarus@microchip.com> References: <20190823155325.13459-1-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Aug 2019 15:53:33 +0000 wrote: > From: Tudor Ambarus > > This series is a prerequisite for the effort of moving the > manufacturer specific code out of the SPI NOR core. > > The scope is to move all [FLASH-SPECIFIC] parameters and settings > from 'struct spi_nor' to 'struct spi_nor_flash_parameter'. We will > have a clear separation between the SPI NOR layer and the flash > parameters and settings. > > 'struct spi_nor_flash_parameter' describes the hardware capabilities > and associated settings of the SPI NOR flash memory. It includes > legacy flash parameters and settings that can be overwritten by the > spi_nor_fixups hooks, or dynamically when parsing the JESD216 > Serial Flash Discoverable Parameters (SFDP) tables. All SFDP params > and settings will fit inside 'struct spi_nor_flash_parameter'. While we're at moving things around, I think it'd make sense to move all '[DRIVER SPECIFIC]' fields (which are actually SPI NOR controller driver specific fields) to a separate struct: struct spi_nor_controller_ops { int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops); void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops); int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); ssize_t (*read)(struct spi_nor *nor, loff_t from, size_t len, u_char *read_buf); ssize_t (*write)(struct spi_nor *nor, loff_t to, size_t len, const u_char *write_buf); int (*erase)(struct spi_nor *nor, loff_t offs); }; struct spi_nor { ... const struct spi_nor_controller_ops *controller_ops; ... }; > > Tested uniform and non-uniform erase on sst26vf064b flash using the > atmel-quadspi driver. > > In order to test this, you'll have to merge v5.3-rc5 in spi-nor/next. > This patch depends on > 'commit 834de5c1aa76 ("mtd: spi-nor: Fix the disabling of write protection at init") > > Tudor Ambarus (5): > mtd: spi-nor: Regroup flash parameter and settings > mtd: spi-nor: Use nor->params > mtd: spi-nor: Drop quad_enable() from 'struct spi-nor' > mtd: spi-nor: Move clear_sr_bp() to 'struct spi_nor_flash_parameter' > mtd: spi-nor: Move erase_map to 'struct spi_nor_flash_parameter' > > drivers/mtd/spi-nor/spi-nor.c | 236 ++++++++++++++++----------------------- > include/linux/mtd/spi-nor.h | 254 ++++++++++++++++++++++++++++-------------- > 2 files changed, 269 insertions(+), 221 deletions(-) >