Skip to contentSkip to conversation

linux: drivers: mtd: spi-nor: gigadevice.c

PATCH In review Victor Lim 4 participants 8 messages Jul 20, 2023 – Jul 21, 2023 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Victor Lim

author
#0 lore raw

PATCH 1/1 linux: drivers: mtd: spi-nor: gigadevice.c

Adding gigedevice new part numbers

---
 drivers/mtd/spi-nor/gigadevice.c | 79 ++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +79 -0
index d57ddaf1525b..285fa42f2d97 100644
@@ -67,6 +67,85 @@ static const struct flash_info gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+/* adding these parts */
+	{ "gd25lx256e",  INFO(0xc86819, 0, 64 * 1024, 512,
+			      SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ |
+			      SPI_NOR_4B_OPCODES | SPI_NOR_OCTAL_DTR_READ |
+			      SPI_NOR_OCTAL_DTR_PP |
+			      SPI_NOR_IO_MODE_EN_VOLATILE)
+		.fixups = &gd25lx256e_fixups },
+	{"gd25b512", INFO(0xc8471A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55b01g", INFO(0xc8471B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55b02g", INFO(0xc8471C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25f64", INFO(0xc84317, 0, 64 * 1024, 128,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25f128", INFO(0xc84318, 0, 64 * 1024, 256,	SECT_4K	|
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25f256", INFO(0xc84319, 0, 64 * 1024, 512,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55f512", INFO(0xc8431A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25t512", INFO(0xc8461A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55t01g", INFO(0xc8461B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55t02ge", INFO(0xc8461C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25x512", INFO(0xc8481A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
+	{"gd55x01g", INFO(0xc8481B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
+	{"gd55x02g", INFO(0xc8481C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
+	{"gd25lb16", INFO(0xc86015, 0, 64 * 1024, 32,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25lb32", INFO(0xc86016, 0, 64 * 1024, 64,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
+	{"gd25lb64", INFO(0xc86017, 0, 64 * 1024, 128,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
+	{"gd25lb128", INFO(0xc86018, 0, 64 * 1024, 256,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25lb256", INFO(0xc86019, 0, 64 * 1024, 512,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lb256", INFO(0xc86719, 0, 64 * 1024, 512,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lb512", INFO(0xc8671A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55lb01g", INFO(0xc8671B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55lb02g", INFO(0xc8671C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lf80", INFO(0xc86314, 0, 64 * 1024, 16,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25lf16", INFO(0xc86315, 0, 64 * 1024, 32,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
+	{"gd25lf32", INFO(0xc86316, 0, 64 * 1024, 64,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
+	{"gd25lf64", INFO(0xc86317, 0, 64 * 1024, 128,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
+	{"gd25lf128", INFO(0xc86318, 0, 64 * 1024, 256,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
+	{"gd25lf255", INFO(0xc86319, 0, 64 * 1024, 512,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lf511", INFO(0xc8631A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lt256e", INFO(0xc86619, 0, 64 * 1024, 512,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lt512", INFO(0xc8661A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55lt01g", INFO(0xc8661B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd55lt02g", INFO(0xc8661C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
+	{"gd25lx512", INFO(0xc8681A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
+	{"gd55lx01g", INFO(0xc8681B, 0, 64 * 1024, 2048,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
+	{"gd55lx02g", INFO(0xc8681C, 0, 64 * 1024, 4096,	SECT_4K |
+	SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
 };
 
 const struct spi_nor_manufacturer spi_nor_gigadevice = {
Signature · 1 line
2.34.1
#1 lore raw
kernel test robot noticed the following build errors:

Hi Victor,

kernel test robot noticed the following build errors:

[auto build test ERROR on mtd/spi-nor/next]
[also build test ERROR on linus/master v6.5-rc2 next-20230720] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Victor-Lim/linux-drivers-mtd-spi-nor-gigadevice-c/20230720-123114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next
patch link:    https://lore.kernel.org/r/20230720042834.12296-1-vlim%40gigadevice.com
patch subject: [PATCH V1 1/1] linux: drivers: mtd: spi-nor: gigadevice.c
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20230720/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230720/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/mtd/spi-nor/gigadevice.c:75:58: error: macro "INFO" passed 5 arguments, but takes just 4
      75 |                               SPI_NOR_IO_MODE_EN_VOLATILE)
         |                                                          ^
   In file included from drivers/mtd/spi-nor/gigadevice.c:9:
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
>> drivers/mtd/spi-nor/gigadevice.c:71:26: error: 'INFO' undeclared here (not in a function)
      71 |         { "gd25lx256e",  INFO(0xc86819, 0, 64 * 1024, 512,
         |                          ^~~~
>> drivers/mtd/spi-nor/gigadevice.c:76:28: error: 'gd25lx256e_fixups' undeclared here (not in a function); did you mean 'gd25q256_fixups'?
      76 |                 .fixups = &gd25lx256e_fixups },
         |                            ^~~~~~~~~~~~~~~~~
         |                            gd25q256_fixups
   drivers/mtd/spi-nor/gigadevice.c:78:66: error: macro "INFO" passed 5 arguments, but takes just 4
      78 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:80:66: error: macro "INFO" passed 5 arguments, but takes just 4
      80 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:82:66: error: macro "INFO" passed 5 arguments, but takes just 4
      82 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:84:65: error: macro "INFO" passed 5 arguments, but takes just 4
      84 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
         |                                                                 ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:86:65: error: macro "INFO" passed 5 arguments, but takes just 4
      86 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
         |                                                                 ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:88:86: error: macro "INFO" passed 5 arguments, but takes just 4
      88 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                                      ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:90:86: error: macro "INFO" passed 5 arguments, but takes just 4
      90 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                                      ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:92:66: error: macro "INFO" passed 5 arguments, but takes just 4
      92 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:94:66: error: macro "INFO" passed 5 arguments, but takes just 4
      94 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:96:66: error: macro "INFO" passed 5 arguments, but takes just 4
      96 |         SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
         |                                                                  ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:98:48: error: macro "INFO" passed 5 arguments, but takes just 4
      98 |         SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
         |                                                ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:100:48: error: macro "INFO" passed 5 arguments, but takes just 4
     100 |         SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
         |                                                ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:102:48: error: macro "INFO" passed 5 arguments, but takes just 4
     102 |         SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
         |                                                ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:104:65: error: macro "INFO" passed 5 arguments, but takes just 4
     104 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
         |                                                                 ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:106:65: error: macro "INFO" passed 5 arguments, but takes just 4
     106 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)       },
         |                                                                 ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 
   drivers/mtd/spi-nor/gigadevice.c:108:65: error: macro "INFO" passed 5 arguments, but takes just 4
     108 |         SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)       },
         |                                                                 ^
   drivers/mtd/spi-nor/core.h:563: note: macro "INFO" defined here
     563 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)              \
         | 

drivers/mtd/spi-nor/gigadevice.c:110:65: error: macro "INFO" passed 5 arguments, but takes just 4

vim +/INFO +75 drivers/mtd/spi-nor/gigadevice.c

     8	
   > 9	#include "core.h"
    10	
    11	static int
    12	gd25q256_post_bfpt(struct spi_nor *nor,
    13			   const struct sfdp_parameter_header *bfpt_header,
    14			   const struct sfdp_bfpt *bfpt)
    15	{
    16		/*
    17		 * GD25Q256C supports the first version of JESD216 which does not define
    18		 * the Quad Enable methods. Overwrite the default Quad Enable method.
    19		 *
    20		 * GD25Q256 GENERATION | SFDP MAJOR VERSION | SFDP MINOR VERSION
    21		 *      GD25Q256C      | SFDP_JESD216_MAJOR | SFDP_JESD216_MINOR
    22		 *      GD25Q256D      | SFDP_JESD216_MAJOR | SFDP_JESD216B_MINOR
    23		 *      GD25Q256E      | SFDP_JESD216_MAJOR | SFDP_JESD216B_MINOR
    24		 */
    25		if (bfpt_header->major == SFDP_JESD216_MAJOR &&
    26		    bfpt_header->minor == SFDP_JESD216_MINOR)
    27			nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable;
    28	
    29		return 0;
    30	}
    31	
    32	static const struct spi_nor_fixups gd25q256_fixups = {
    33		.post_bfpt = gd25q256_post_bfpt,
    34	};
    35	
    36	static const struct flash_info gigadevice_nor_parts[] = {
    37		{ "gd25q16", INFO(0xc84015, 0, 64 * 1024,  32)
    38			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    39			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    40				      SPI_NOR_QUAD_READ) },
    41		{ "gd25q32", INFO(0xc84016, 0, 64 * 1024,  64)
    42			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    43			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    44				      SPI_NOR_QUAD_READ) },
    45		{ "gd25lq32", INFO(0xc86016, 0, 64 * 1024, 64)
    46			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    47			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    48				      SPI_NOR_QUAD_READ) },
    49		{ "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128)
    50			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    51			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    52				      SPI_NOR_QUAD_READ) },
    53		{ "gd25lq64c", INFO(0xc86017, 0, 64 * 1024, 128)
    54			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    55			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    56				      SPI_NOR_QUAD_READ) },
    57		{ "gd25lq128d", INFO(0xc86018, 0, 64 * 1024, 256)
    58			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    59			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    60				      SPI_NOR_QUAD_READ) },
    61		{ "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256)
    62			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
    63			NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
    64				      SPI_NOR_QUAD_READ) },
    65		{ "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512)
    66			PARSE_SFDP
    67			FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
    68			FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
    69			.fixups = &gd25q256_fixups },
    70	/* adding these parts */
  > 71		{ "gd25lx256e",  INFO(0xc86819, 0, 64 * 1024, 512,
    72				      SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ |
    73				      SPI_NOR_4B_OPCODES | SPI_NOR_OCTAL_DTR_READ |
    74				      SPI_NOR_OCTAL_DTR_PP |
  > 75				      SPI_NOR_IO_MODE_EN_VOLATILE)
  > 76			.fixups = &gd25lx256e_fixups },
    77		{"gd25b512", INFO(0xc8471A, 0, 64 * 1024, 1024,	SECT_4K |
    78		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    79		{"gd55b01g", INFO(0xc8471B, 0, 64 * 1024, 2048,	SECT_4K |
    80		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    81		{"gd55b02g", INFO(0xc8471C, 0, 64 * 1024, 4096,	SECT_4K |
    82		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    83		{"gd25f64", INFO(0xc84317, 0, 64 * 1024, 128,	SECT_4K |
    84		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
    85		{"gd25f128", INFO(0xc84318, 0, 64 * 1024, 256,	SECT_4K	|
    86		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
    87		{"gd25f256", INFO(0xc84319, 0, 64 * 1024, 512,	SECT_4K |
    88		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    89		{"gd55f512", INFO(0xc8431A, 0, 64 * 1024, 1024,	SECT_4K |
    90		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    91		{"gd25t512", INFO(0xc8461A, 0, 64 * 1024, 1024,	SECT_4K |
    92		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    93		{"gd55t01g", INFO(0xc8461B, 0, 64 * 1024, 2048,	SECT_4K |
    94		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    95		{"gd55t02ge", INFO(0xc8461C, 0, 64 * 1024, 4096,	SECT_4K |
    96		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
    97		{"gd25x512", INFO(0xc8481A, 0, 64 * 1024, 1024,	SECT_4K |
    98		SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
    99		{"gd55x01g", INFO(0xc8481B, 0, 64 * 1024, 2048,	SECT_4K |
   100		SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
   101		{"gd55x02g", INFO(0xc8481C, 0, 64 * 1024, 4096,	SECT_4K |
   102		SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
   103		{"gd25lb16", INFO(0xc86015, 0, 64 * 1024, 32,	SECT_4K |
   104		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
   105		{"gd25lb32", INFO(0xc86016, 0, 64 * 1024, 64,	SECT_4K |
   106		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
   107		{"gd25lb64", INFO(0xc86017, 0, 64 * 1024, 128,	SECT_4K |
   108		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
   109		{"gd25lb128", INFO(0xc86018, 0, 64 * 1024, 256,	SECT_4K |
   110		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
   111		{"gd25lb256", INFO(0xc86019, 0, 64 * 1024, 512,	SECT_4K |
   112		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   113		{"gd25lb256", INFO(0xc86719, 0, 64 * 1024, 512,	SECT_4K |
   114		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   115		{"gd25lb512", INFO(0xc8671A, 0, 64 * 1024, 1024,	SECT_4K |
   116		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   117		{"gd55lb01g", INFO(0xc8671B, 0, 64 * 1024, 2048,	SECT_4K |
   118		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   119		{"gd55lb02g", INFO(0xc8671C, 0, 64 * 1024, 4096,	SECT_4K |
   120		SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   121		{"gd25lf80", INFO(0xc86314, 0, 64 * 1024, 16,	SECT_4K |
   122		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
   123		{"gd25lf16", INFO(0xc86315, 0, 64 * 1024, 32,	SECT_4K |
   124		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)},
   125		{"gd25lf32", INFO(0xc86316, 0, 64 * 1024, 64,	SECT_4K |
   126		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
   127		{"gd25lf64", INFO(0xc86317, 0, 64 * 1024, 128,	SECT_4K |
   128		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
   129		{"gd25lf128", INFO(0xc86318, 0, 64 * 1024, 256,	SECT_4K |
   130		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK)	},
   131		{"gd25lf255", INFO(0xc86319, 0, 64 * 1024, 512,	SECT_4K |
   132		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   133		{"gd25lf511", INFO(0xc8631A, 0, 64 * 1024, 1024,	SECT_4K |
   134		SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
   135		{"gd25lt256e", INFO(0xc86619, 0, 64 * 1024, 512,	SECT_4K |

136 SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
137 {"gd25lt512", INFO(0xc8661A, 0, 64 * 1024, 1024, SECT_4K |
138 SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
139 {"gd55lt01g", INFO(0xc8661B, 0, 64 * 1024, 2048, SECT_4K |
140 SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
141 {"gd55lt02g", INFO(0xc8661C, 0, 64 * 1024, 4096, SECT_4K |
142 SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},
143 {"gd25lx512", INFO(0xc8681A, 0, 64 * 1024, 1024, SECT_4K |
144 SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
145 {"gd55lx01g", INFO(0xc8681B, 0, 64 * 1024, 2048, SECT_4K |
146 SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
147 {"gd55lx02g", INFO(0xc8681C, 0, 64 * 1024, 4096, SECT_4K |
148 SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
149 };
150

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#3 lore raw
In reply to Victor Lim

Am 2023-07-20 06:28, schrieb Victor Lim:

Quoted 3 lines

Adding gigedevice new part numbers

This is already v3 of this series. Please track and keep a change log.

Your previous ones were here:
https://lore.kernel.org/linux-mtd/[email protected]/
https://lore.kernel.org/linux-mtd/[email protected]/

Quoted 9 lines
---
 drivers/mtd/spi-nor/gigadevice.c | 79 ++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index d57ddaf1525b..285fa42f2d97 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info · line 71

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -67,6 +67,85 @@ static const struct flash_info 
 gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+/* adding these parts */

Why this comment?

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] = { · line 78

Quoted 8 lines
drivers/mtd/spi-nor/gigadevice.c +8 -0
+	{ "gd25lx256e",  INFO(0xc86819, 0, 64 * 1024, 512,
+			      SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ |
+			      SPI_NOR_4B_OPCODES | SPI_NOR_OCTAL_DTR_READ |
+			      SPI_NOR_OCTAL_DTR_PP |
+			      SPI_NOR_IO_MODE_EN_VOLATILE)
+		.fixups = &gd25lx256e_fixups },
+	{"gd25b512", INFO(0xc8471A, 0, 64 * 1024, 1024,	SECT_4K |
+	SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES)},

Did you even compile this? INFO() doesn't take 5 arguments. I'll stop here.

If you decide to post another version. Please read through all the feedback you've got and esp. Documentation/process/submitting-patches.rst

Make it one patch per added part, don't include legacy flags if not needed, include a test report and the dump of the SFDP tables.

Thanks,
-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

A message that is not in the archive (sent off-list or not yet received): TY0PR06MB56580D3FEE55389F41E33398BB3EA@TY0PR06MB5658.apcprd06.prod.outlook.com

#5 lore raw
Quoted 4 lines · Vlim

Hi, Michael,

Our parts do support SFDP.
Can you provide the guideline for the part definition?

There's none at the moment, you have to read the code.

Quoted 2 lines

I do see these samples in the gigadevice.c file; but, not sure of the purpose of each parameter.

The flags are defined in drivers/mtd/spi-nor/core.h. Start from there.

Quoted 1 line

All the flashes that you proposed, but one probably (gd25lx256e) can be probed using the generic spi-nor driver, thus you won't need to add dedicated flash entries. See:
773bbe104497 mtd: spi-nor: add generic flash driver

Cheers,
ta

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

A message that is not in the archive (sent off-list or not yet received): TY0PR06MB56581B9A28DCD7A7270CFC0ABB3FA@TY0PR06MB5658.apcprd06.prod.outlook.com

#7 lore raw
Quoted 2 lines · Vlim

Thanks, Tudor,

you're welcome

Quoted 1 line

Is PARSE_SFDP the command to read the SFDP parameters?

it's a flag, not a command, that when set at probe time the SFDP will be read.

Quoted 2 lines

It looks to me that the examples below are both using SFDP. But I do not see the flag that saying SFDP is used.

not quite

Quoted 3 lines

{ "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256) FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

The locking support is not part of the JEDEC SFDP standard, but vendors can define their own SFDP tables where they describe the locking support. So for now, if you want to enable locking you have to specify the locking flags, whatever they are. There are different flavors of block protection locking, with 3 or 4 block protection bits, their order, etc. You'll have to check the datasheet.

Quoted 2 lines

            NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

If the flash supports SFDP then the flags from above should be replaced with PARSE_SFDP.

We have some requirements when one updates or adds new flash entries. They have to dump the sysfs data, including the SFDP tables, and do some sanity check with mtd_utils. Check the following cover letter to find out how to do it:
https://lore.kernel.org/linux-mtd/[email protected]/

Quoted 5 lines

      { "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512) PARSE_SFDP
            FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6) FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
            .fixups = &gd25q256_fixups },

these are all different types of flags. Use git blame to find the reason why some were set.

Cheers,
ta

#8 lore raw
Quoted 10 lines
Quoted 3 lines

{ "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256) FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

The locking support is not part of the JEDEC SFDP standard, but vendors can define their own SFDP tables where they describe the locking support. So for now, if you want to enable locking you have to specify the locking flags, whatever they are. There are different flavors of block protection locking, with 3 or 4 block protection bits, their order, etc. You'll have to check the datasheet.

I've seen that gigadevice has their own proprietary SFDP table which also indicates locking. I'd prefer to have a parser for these, esp. because the patch is coming from the vendor itself :)

-michael

#9 lore raw
Quoted 11 lines · Michael Walle
Quoted 10 lines
Quoted 3 lines

{ "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256) FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

The locking support is not part of the JEDEC SFDP standard, but vendors can define their own SFDP tables where they describe the locking support. So for now, if you want to enable locking you have to specify the locking flags, whatever they are. There are different flavors of block protection locking, with 3 or 4 block protection bits, their order, etc. You'll have to check the datasheet.

Quoted 4 lines

I've seen that gigadevice has their own proprietary SFDP table which also indicates locking. I'd prefer to have a parser for these, esp. because the patch is coming from the vendor itself :)

Yes, I agree.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/