mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <boris.brezillon@collabora.com>
Cc: <marek.vasut@gmail.com>, <vigneshr@ti.com>,
	<miquel.raynal@bootlin.com>, <richard@nod.at>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/5] mtd: spi-nor: move manuf out of the core - batch 0
Date: Sun, 25 Aug 2019 13:02:38 +0000	[thread overview]
Message-ID: <6098471f-ab8a-4887-7065-2d2266492ee8@microchip.com> (raw)
In-Reply-To: <20190825133853.32532641@collabora.com>



On 08/25/2019 02:38 PM, Boris Brezillon wrote:
> External E-Mail
> 
> 
> On Fri, 23 Aug 2019 15:53:33 +0000
> <Tudor.Ambarus@microchip.com> wrote:
> 
>> From: Tudor Ambarus <tudor.ambarus@microchip.com>
>>
>> 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;
> ...
> };

Yep, this is a good idea. I'll make a patch and add your Suggested-by tag.

Thanks!

> 
>>
>> 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(-)
>>
> 
> 
> 

      reply	other threads:[~2019-08-25 13:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 15:53 Tudor.Ambarus
2019-08-23 15:53 ` [PATCH 1/5] mtd: spi-nor: Regroup flash parameter and settings Tudor.Ambarus
2019-08-25 11:32   ` Boris Brezillon
2019-08-23 15:53 ` [PATCH 2/5] mtd: spi-nor: Use nor->params Tudor.Ambarus
2019-08-25 11:31   ` Boris Brezillon
2019-08-23 15:53 ` [PATCH 3/5] mtd: spi-nor: Drop quad_enable() from 'struct spi-nor' Tudor.Ambarus
2019-08-25 11:32   ` Boris Brezillon
2019-08-23 15:53 ` [PATCH 4/5] mtd: spi-nor: Move clear_sr_bp() to 'struct spi_nor_flash_parameter' Tudor.Ambarus
2019-08-24  3:53   ` Tudor.Ambarus
2019-08-25 11:33   ` Boris Brezillon
2019-08-25 13:09   ` Boris Brezillon
2019-08-25 13:19     ` Tudor.Ambarus
2019-08-25 13:28       ` Boris Brezillon
2019-08-23 15:53 ` [PATCH 5/5] mtd: spi-nor: Move erase_map " Tudor.Ambarus
2019-08-25 11:34   ` Boris Brezillon
2019-08-25 11:38 ` [PATCH 0/5] mtd: spi-nor: move manuf out of the core - batch 0 Boris Brezillon
2019-08-25 13:02   ` Tudor.Ambarus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6098471f-ab8a-4887-7065-2d2266492ee8@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=boris.brezillon@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome