Lines Matching +full:spi +full:- +full:nor
26 #define SNOR_MFR_MICRON CFI_MFR_ST /* ST Micro <--> Micron */
37 * requires a 4-byte (32-bit) address.
48 #define SPINOR_OP_READ_1_1_2 0x3b /* Read data bytes (Dual Output SPI) */
49 #define SPINOR_OP_READ_1_2_2 0xbb /* Read data bytes (Dual I/O SPI) */
50 #define SPINOR_OP_READ_1_1_4 0x6b /* Read data bytes (Quad Output SPI) */
51 #define SPINOR_OP_READ_1_4_4 0xeb /* Read data bytes (Quad I/O SPI) */
68 /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
71 #define SPINOR_OP_READ_1_1_2_4B 0x3c /* Read data bytes (Dual Output SPI) */
72 #define SPINOR_OP_READ_1_2_2_4B 0xbc /* Read data bytes (Dual I/O SPI) */
73 #define SPINOR_OP_READ_1_1_4_4B 0x6c /* Read data bytes (Quad Output SPI) */
74 #define SPINOR_OP_READ_1_4_4_4B 0xec /* Read data bytes (Quad I/O SPI) */
82 /* Double Transfer Rate opcodes - defined in JEDEC JESD216B. */
106 #define SPINOR_OP_EN4B 0xb7 /* Enter 4-byte mode */
107 #define SPINOR_OP_EX4B 0xe9 /* Exit 4-byte mode */
147 /* Supported SPI protocols */
242 * struct flash_info - Forward declaration of a structure used internally by
248 * struct spi_nor - Structure for defining a the SPI NOR layer
251 * @dev: point to a spi device, or a spi nor controller device.
252 * @info: spi-nor part JDEC MFR id and other info
253 * @page_size: the page size of the SPI NOR
260 * @flags: flag options for the current SPI-NOR (SNOR_F_*)
261 * @read_proto: the SPI protocol for read operations
262 * @write_proto: the SPI protocol for write operations
263 * @reg_proto the SPI protocol for read_reg/write_reg/erase operations
269 * @read_reg: [DRIVER-SPECIFIC] read out the register
270 * @write_reg: [DRIVER-SPECIFIC] write data to the register
271 * @read: [DRIVER-SPECIFIC] read data from the SPI NOR
272 * @write: [DRIVER-SPECIFIC] write data to the SPI NOR
273 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
275 * spi-nor will send the erase opcode via write_reg()
276 * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR
277 * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR
278 * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is
279 * @quad_enable: [FLASH-SPECIFIC] enables SPI NOR quad mode
301 int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
302 void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
303 int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
304 int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
306 ssize_t (*read)(struct spi_nor *nor, loff_t from,
308 ssize_t (*write)(struct spi_nor *nor, loff_t to,
310 int (*erase)(struct spi_nor *nor, loff_t offs);
312 int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
313 int (*flash_unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
314 int (*flash_is_locked)(struct spi_nor *nor, loff_t ofs, uint64_t len);
315 int (*quad_enable)(struct spi_nor *nor);
320 static inline void spi_nor_set_flash_node(struct spi_nor *nor, in spi_nor_set_flash_node() argument
323 mtd_set_of_node(&nor->mtd, np); in spi_nor_set_flash_node()
326 static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor) in spi_nor_get_flash_node() argument
328 return mtd_get_of_node(&nor->mtd); in spi_nor_get_flash_node()
332 * struct spi_nor_hwcaps - Structure for describing the hardware capabilies
333 * supported by the SPI controller (bus master).
343 * As a matter of performances, it is relevant to use Octo SPI protocols first,
344 * then Quad SPI protocols before Dual SPI protocols, Fast Read and lastly
373 * Like (Fast) Read capabilities, Octo/Quad SPI protocols are preferred to the
374 * legacy SPI 1-1-1 protocol.
376 * JEDEC/SFDP standard to define them. Also at this moment no SPI flash memory
393 * spi_nor_scan() - scan the SPI NOR
394 * @nor: the spi_nor structure
398 * The drivers can use this fuction to scan the SPI NOR.
406 int spi_nor_scan(struct spi_nor *nor, const char *name,
410 * spi_nor_restore_addr_mode() - restore the status of SPI NOR
411 * @nor: the spi_nor structure
413 void spi_nor_restore(struct spi_nor *nor);