All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] add support to non-uniform SFDP SPI NOR flash memories
@ 2018-09-11 15:40 ` Tudor Ambarus
  0 siblings, 0 replies; 158+ messages in thread
From: Tudor Ambarus @ 2018-09-11 15:40 UTC (permalink / raw)
  To: marek.vasut, dwmw2, computersforpeace, boris.brezillon, richard
  Cc: linux-mtd, linux-arm-kernel, linux-kernel, cyrille.pitchen,
	nicolas.ferre, Cristian.Birsan, Tudor Ambarus

Backward compatibility test done on mx25l3273fm2i-08g with
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS set and unset.
Non-uniform erase test done on sst26vf064b-104i/sn with
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS set and unset.

Note that in order to do the non-uniform test you'll have to force the
spi_nor_has_uniform_erase() to return false, because the erase map is
tuned to come back to the uniform case. Also, for the SST flashes, you'll
have to unlock the global protection (see
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1763887.html).

Changes in v3:
- drop "mtd: spi-nor: parse SFDP 4-byte Address Instruction Table":
  let's add just a feature per patch set to make it easily digestible.
  No worries, will resubmit it once the non-uniform erase supports gets
  approved.
- SNOR_ERASE_FLAGS_OFFSET was buggy and since it's used only once
  in the uniform erase case, remove it entirely and do the init by
  hand
- describe all introduced functions together with arguments and
  return value
- various minor updates: drop a cast, rename a function - cosmetics ...

Changes in v2:
- add JESD216B SFDP optional parsers: Sector Map Parameter Table parser and
  4-byte Address Instruction Table parser (patch 2/3 and patch 3/3).

- save the Erase Types from bfpt to determine the Erase Type sizes. Sort all
  the map's Erase Types in ascending order with the smallest erase size being
  the first member in the erase_type array. Sort in the same way the Erase Type
  mask in regions in order to have a 1-to-1 correspondence with the Erase
  Types defined in the map. We sort the Erase Type by size, at init, in order to
  speed up the process of finding the best erase command at run-time.

- remove setting of mtd->erasesize and nor->erase_opcode when parsing the Basic
  Flash Parameter Table. mtd->erasesize was set to the maximum supported Erase
  Type size, without verifying if that Erase Type can erase the entire flash.
  mtd->erasesize is now set just in spi_nor_select_erase(), after we find which
  Erase Types are supported in the uniform case.

- spi_nor_select_erase(): pass directly info->sector_size instead of the whole
  flash_info structure in order to simplify the code.

- fix condition on finding erase regions:
  while (addr < region_start || addr >= region_end) {
- fix the list command adding: list_add_tail() instead of list_add()
- write_enable(nor); before erasing the sectors
- As Boris suggested, remove likely() because it doesn't make any difference
  given the time it takes to actually erase the block.
- bool return value for spi_nor_has_uniform_erase().

Changes in v1 or what I've done on top of Cyrille's work (https://lkml.org/lkml//
2017/4/15/70):
- 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 support for overlaid regions.


Tudor Ambarus (2):
  mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories
  mtd: spi-nor: parse SFDP Sector Map Parameter Table

 drivers/mtd/spi-nor/spi-nor.c | 910 +++++++++++++++++++++++++++++++++++++++---
 include/linux/mtd/spi-nor.h   | 119 ++++++
 2 files changed, 971 insertions(+), 58 deletions(-)

-- 
2.9.4


^ permalink raw reply	[flat|nested] 158+ messages in thread

end of thread, other threads:[~2018-10-23  9:15 UTC | newest]

Thread overview: 158+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 15:40 [PATCH v3 0/2] add support to non-uniform SFDP SPI NOR flash memories Tudor Ambarus
2018-09-11 15:40 ` Tudor Ambarus
2018-09-11 15:40 ` [PATCH v3 1/2] mtd: spi-nor: " Tudor Ambarus
2018-09-11 15:40   ` Tudor Ambarus
2018-09-11 18:55   ` Marek Vasut
2018-09-11 18:55     ` Marek Vasut
2018-09-17 17:03   ` Tudor Ambarus
2018-09-17 17:03     ` Tudor Ambarus
2018-10-16  9:51   ` Yogesh Narayan Gaur
2018-10-16  9:51     ` Yogesh Narayan Gaur
2018-10-16  9:51     ` Yogesh Narayan Gaur
2018-10-16 12:04     ` Boris Brezillon
2018-10-16 12:04       ` Boris Brezillon
2018-10-16 12:04       ` Boris Brezillon
2018-10-16 12:17       ` Boris Brezillon
2018-10-16 12:17         ` Boris Brezillon
2018-10-16 12:17         ` Boris Brezillon
2018-10-17  1:54         ` Yogesh Narayan Gaur
2018-10-17  1:54           ` Yogesh Narayan Gaur
2018-10-17  1:54           ` Yogesh Narayan Gaur
2018-10-16 15:14     ` Tudor Ambarus
2018-10-16 15:14       ` Tudor Ambarus
2018-10-16 15:14       ` Tudor Ambarus
2018-10-16 16:34       ` Cyrille Pitchen
2018-10-16 16:34         ` Cyrille Pitchen
2018-10-16 16:34         ` Cyrille Pitchen
2018-10-17  2:07         ` Yogesh Narayan Gaur
2018-10-17  2:07           ` Yogesh Narayan Gaur
2018-10-17  2:07           ` Yogesh Narayan Gaur
2018-10-17  3:50           ` Yogesh Narayan Gaur
2018-10-17  3:50             ` Yogesh Narayan Gaur
2018-10-17  3:50             ` Yogesh Narayan Gaur
2018-10-17  7:07           ` Boris Brezillon
2018-10-17  7:07             ` Boris Brezillon
2018-10-17  7:07             ` Boris Brezillon
2018-10-17  7:10             ` Boris Brezillon
2018-10-17  7:10               ` Boris Brezillon
2018-10-17  7:10               ` Boris Brezillon
2018-10-17  7:17               ` Boris Brezillon
2018-10-17  7:17                 ` Boris Brezillon
2018-10-17  7:17                 ` Boris Brezillon
2018-10-17  7:29               ` Boris Brezillon
2018-10-17  7:29                 ` Boris Brezillon
2018-10-17  7:29                 ` Boris Brezillon
2018-10-17  7:46                 ` Yogesh Narayan Gaur
2018-10-17  7:46                   ` Yogesh Narayan Gaur
2018-10-17  7:46                   ` Yogesh Narayan Gaur
2018-10-17  8:00                   ` Tudor Ambarus
2018-10-17  8:00                     ` Tudor Ambarus
2018-10-17  8:00                     ` Tudor Ambarus
2018-10-17  8:20                     ` Yogesh Narayan Gaur
2018-10-17  8:20                       ` Yogesh Narayan Gaur
2018-10-17  8:20                       ` Yogesh Narayan Gaur
2018-10-17  8:48                       ` Boris Brezillon
2018-10-17  8:48                         ` Boris Brezillon
2018-10-17  8:48                         ` Boris Brezillon
2018-10-17  9:52                   ` Boris Brezillon
2018-10-17  9:52                     ` Boris Brezillon
2018-10-17  9:52                     ` Boris Brezillon
2018-10-22  6:04                     ` Yogesh Narayan Gaur
2018-10-22  6:04                       ` Yogesh Narayan Gaur
2018-10-22  6:04                       ` Yogesh Narayan Gaur
2018-10-22  7:34                       ` Boris Brezillon
2018-10-22  7:34                         ` Boris Brezillon
2018-10-22  7:34                         ` Boris Brezillon
2018-10-22  8:01                       ` Boris Brezillon
2018-10-22  8:01                         ` Boris Brezillon
2018-10-22  8:01                         ` Boris Brezillon
2018-10-22  8:32                         ` Yogesh Narayan Gaur
2018-10-22  8:32                           ` Yogesh Narayan Gaur
2018-10-22  8:32                           ` Yogesh Narayan Gaur
2018-10-22  9:09                           ` Boris Brezillon
2018-10-22  9:09                             ` Boris Brezillon
2018-10-22  9:09                             ` Boris Brezillon
2018-10-22  8:33                       ` Tudor Ambarus
2018-10-22  8:33                         ` Tudor Ambarus
2018-10-22  8:33                         ` Tudor Ambarus
2018-10-22  9:15                       ` Boris Brezillon
2018-10-22  9:15                         ` Boris Brezillon
2018-10-22  9:15                         ` Boris Brezillon
2018-10-22 10:03                         ` Yogesh Narayan Gaur
2018-10-22 10:03                           ` Yogesh Narayan Gaur
2018-10-22 10:03                           ` Yogesh Narayan Gaur
2018-10-22 10:10                           ` Boris Brezillon
2018-10-22 10:10                             ` Boris Brezillon
2018-10-22 10:10                             ` Boris Brezillon
2018-10-22 10:17                             ` Yogesh Narayan Gaur
2018-10-22 10:17                               ` Yogesh Narayan Gaur
2018-10-22 10:17                               ` Yogesh Narayan Gaur
2018-10-22 10:25                               ` Boris Brezillon
2018-10-22 10:25                                 ` Boris Brezillon
2018-10-22 10:25                                 ` Boris Brezillon
2018-10-22 10:20                           ` Boris Brezillon
2018-10-22 10:20                             ` Boris Brezillon
2018-10-22 10:20                             ` Boris Brezillon
2018-10-22 10:26                           ` Boris Brezillon
2018-10-22 10:26                             ` Boris Brezillon
2018-10-22 10:26                             ` Boris Brezillon
2018-10-22 10:39                             ` Yogesh Narayan Gaur
2018-10-22 10:39                               ` Yogesh Narayan Gaur
2018-10-22 10:39                               ` Yogesh Narayan Gaur
2018-10-22 10:46                               ` Boris Brezillon
2018-10-22 10:46                                 ` Boris Brezillon
2018-10-22 10:46                                 ` Boris Brezillon
2018-10-22 10:52                                 ` Boris Brezillon
2018-10-22 10:52                                   ` Boris Brezillon
2018-10-22 10:52                                   ` Boris Brezillon
2018-10-22 11:03                                   ` Yogesh Narayan Gaur
2018-10-22 11:03                                     ` Yogesh Narayan Gaur
2018-10-22 11:03                                     ` Yogesh Narayan Gaur
2018-10-22 11:43                                     ` Boris Brezillon
2018-10-22 11:43                                       ` Boris Brezillon
2018-10-22 11:43                                       ` Boris Brezillon
2018-10-22 11:46                                       ` Yogesh Narayan Gaur
2018-10-22 11:46                                         ` Yogesh Narayan Gaur
2018-10-22 11:46                                         ` Yogesh Narayan Gaur
2018-10-22 11:52                                         ` Boris Brezillon
2018-10-22 11:52                                           ` Boris Brezillon
2018-10-22 11:52                                           ` Boris Brezillon
2018-10-23  4:47                                           ` Yogesh Narayan Gaur
2018-10-23  4:47                                             ` Yogesh Narayan Gaur
2018-10-23  4:47                                             ` Yogesh Narayan Gaur
2018-10-23  5:39                                             ` Boris Brezillon
2018-10-23  5:39                                               ` Boris Brezillon
2018-10-23  5:39                                               ` Boris Brezillon
2018-10-23  8:18                                               ` Yogesh Narayan Gaur
2018-10-23  8:18                                                 ` Yogesh Narayan Gaur
2018-10-23  8:18                                                 ` Yogesh Narayan Gaur
2018-10-23  8:48                                                 ` Boris Brezillon
2018-10-23  8:48                                                   ` Boris Brezillon
2018-10-23  8:48                                                   ` Boris Brezillon
2018-10-23  8:59                                                   ` Yogesh Narayan Gaur
2018-10-23  8:59                                                     ` Yogesh Narayan Gaur
2018-10-23  8:59                                                     ` Yogesh Narayan Gaur
2018-10-23  9:09                                                     ` Boris Brezillon
2018-10-23  9:09                                                       ` Boris Brezillon
2018-10-23  9:09                                                       ` Boris Brezillon
2018-10-23  9:01                                                   ` Boris Brezillon
2018-10-23  9:01                                                     ` Boris Brezillon
2018-10-23  9:01                                                     ` Boris Brezillon
2018-10-23  9:05                                                     ` Yogesh Narayan Gaur
2018-10-23  9:05                                                       ` Yogesh Narayan Gaur
2018-10-23  9:05                                                       ` Yogesh Narayan Gaur
2018-10-23  9:10                                                       ` Boris Brezillon
2018-10-23  9:10                                                         ` Boris Brezillon
2018-10-23  9:10                                                         ` Boris Brezillon
2018-10-23  9:15                                                         ` Yogesh Narayan Gaur
2018-10-23  9:15                                                           ` Yogesh Narayan Gaur
2018-10-23  9:15                                                           ` Yogesh Narayan Gaur
2018-10-17  9:06           ` Cyrille Pitchen
2018-10-17  9:06             ` Cyrille Pitchen
2018-10-17  9:06             ` Cyrille Pitchen
2018-09-11 15:40 ` [PATCH v3 2/2] mtd: spi-nor: parse SFDP Sector Map Parameter Table Tudor Ambarus
2018-09-11 15:40   ` Tudor Ambarus
2018-09-11 18:56   ` Marek Vasut
2018-09-11 18:56     ` Marek Vasut
2018-09-18 13:09 ` [PATCH v3 0/2] add support to non-uniform SFDP SPI NOR flash memories Boris Brezillon
2018-09-18 13:09   ` Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.