Skip to content

Commit 95c6e3d

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: introduce (temporary) INFO0()
The id will be converted to an own structure. To differentiate between flashes with and without IDs, introduce a temporary macro INFO0() and convert all flashes with no ID to use it. The difference between INFO0() and INFOx() is that the former, doesn't have a pointer to the id structure. Something which isn't possible to do within the INFOx() macro. After the flash_info conversion, that macro will be removed along with all the other INFOx() macros. Signed-off-by: Michael Walle <mwalle@kernel.org> Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-12-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent 3ea3f0a commit 95c6e3d

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

drivers/mtd/spi-nor/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ struct flash_info {
571571
SPI_NOR_ID((_jedec_id), (_ext_id)), \
572572
SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
573573

574+
#define INFO0(_sector_size, _n_sectors) \
575+
SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
576+
574577
#define INFOB(_jedec_id, _ext_id, _sector_size, _n_sectors, _n_banks) \
575578
SPI_NOR_ID((_jedec_id), (_ext_id)), \
576579
SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), (_n_banks)),

drivers/mtd/spi-nor/issi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ static const struct flash_info issi_nor_parts[] = {
7777
.fixups = &is25lp256_fixups },
7878

7979
/* PMC */
80-
{ "pm25lv512", INFO(0, 0, 32 * 1024, 2)
80+
{ "pm25lv512", INFO0(32 * 1024, 2)
8181
NO_SFDP_FLAGS(SECT_4K)
8282
.fixups = &pm25lv_nor_fixups
8383
},
84-
{ "pm25lv010", INFO(0, 0, 32 * 1024, 4)
84+
{ "pm25lv010", INFO0(32 * 1024, 4)
8585
NO_SFDP_FLAGS(SECT_4K)
8686
.fixups = &pm25lv_nor_fixups
8787
},

drivers/mtd/spi-nor/micron-st.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ static const struct flash_info st_nor_parts[] = {
272272
{ "m25p64", INFO(0x202017, 0, 64 * 1024, 128) },
273273
{ "m25p128", INFO(0x202018, 0, 256 * 1024, 64) },
274274

275-
{ "m25p05-nonjedec", INFO(0, 0, 32 * 1024, 2) },
276-
{ "m25p10-nonjedec", INFO(0, 0, 32 * 1024, 4) },
277-
{ "m25p20-nonjedec", INFO(0, 0, 64 * 1024, 4) },
278-
{ "m25p40-nonjedec", INFO(0, 0, 64 * 1024, 8) },
279-
{ "m25p80-nonjedec", INFO(0, 0, 64 * 1024, 16) },
280-
{ "m25p16-nonjedec", INFO(0, 0, 64 * 1024, 32) },
281-
{ "m25p32-nonjedec", INFO(0, 0, 64 * 1024, 64) },
282-
{ "m25p64-nonjedec", INFO(0, 0, 64 * 1024, 128) },
283-
{ "m25p128-nonjedec", INFO(0, 0, 256 * 1024, 64) },
275+
{ "m25p05-nonjedec", INFO0( 32 * 1024, 2) },
276+
{ "m25p10-nonjedec", INFO0( 32 * 1024, 4) },
277+
{ "m25p20-nonjedec", INFO0( 64 * 1024, 4) },
278+
{ "m25p40-nonjedec", INFO0( 64 * 1024, 8) },
279+
{ "m25p80-nonjedec", INFO0( 64 * 1024, 16) },
280+
{ "m25p16-nonjedec", INFO0( 64 * 1024, 32) },
281+
{ "m25p32-nonjedec", INFO0( 64 * 1024, 64) },
282+
{ "m25p64-nonjedec", INFO0( 64 * 1024, 128) },
283+
{ "m25p128-nonjedec", INFO0(256 * 1024, 64) },
284284

285285
{ "m45pe10", INFO(0x204011, 0, 64 * 1024, 2) },
286286
{ "m45pe80", INFO(0x204014, 0, 64 * 1024, 16) },

0 commit comments

Comments
 (0)