Lines Matching +full:read +full:- +full:to +full:- +full:read
1 /* SPDX-License-Identifier: GPL-2.0+ */
11 #include <linux/spi/spi-mem.h>
17 * FUNCTION has an optional suffix of '4', to represent an opcode which
18 * requires a 4-byte (32-bit) address.
24 #define SPINOR_OP_RDSR 0x05 /* Read status register */
26 #define SPINOR_OP_RDSR2 0x3f /* Read status register 2 */
28 #define SPINOR_OP_READ 0x03 /* Read data bytes (low frequency) */
29 #define SPINOR_OP_READ_FAST 0x0b /* Read data bytes (high frequency) */
30 #define SPINOR_OP_READ_1_1_2 0x3b /* Read data bytes (Dual Output SPI) */
31 #define SPINOR_OP_READ_1_2_2 0xbb /* Read data bytes (Dual I/O SPI) */
32 #define SPINOR_OP_READ_1_1_4 0x6b /* Read data bytes (Quad Output SPI) */
33 #define SPINOR_OP_READ_1_4_4 0xeb /* Read data bytes (Quad I/O SPI) */
34 #define SPINOR_OP_READ_1_1_8 0x8b /* Read data bytes (Octal Output SPI) */
35 #define SPINOR_OP_READ_1_8_8 0xcb /* Read data bytes (Octal I/O SPI) */
36 #define SPINOR_OP_PP 0x02 /* Page program (up to 256 bytes) */
46 #define SPINOR_OP_RDID 0x9f /* Read JEDEC ID */
47 #define SPINOR_OP_RDSFDP 0x5a /* Read SFDP */
48 #define SPINOR_OP_RDCR 0x35 /* Read configuration register */
53 /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
54 #define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */
55 #define SPINOR_OP_READ_FAST_4B 0x0c /* Read data bytes (high frequency) */
56 #define SPINOR_OP_READ_1_1_2_4B 0x3c /* Read data bytes (Dual Output SPI) */
57 #define SPINOR_OP_READ_1_2_2_4B 0xbc /* Read data bytes (Dual I/O SPI) */
58 #define SPINOR_OP_READ_1_1_4_4B 0x6c /* Read data bytes (Quad Output SPI) */
59 #define SPINOR_OP_READ_1_4_4_4B 0xec /* Read data bytes (Quad I/O SPI) */
60 #define SPINOR_OP_READ_1_1_8_4B 0x7c /* Read data bytes (Octal Output SPI) */
61 #define SPINOR_OP_READ_1_8_8_4B 0xcc /* Read data bytes (Octal I/O SPI) */
62 #define SPINOR_OP_PP_4B 0x12 /* Page program (up to 256 bytes) */
71 /* Double Transfer Rate opcodes - defined in JEDEC JESD216B. */
85 #define SPINOR_OP_EN4B 0xb7 /* Enter 4-byte mode */
86 #define SPINOR_OP_EX4B 0xe9 /* Exit 4-byte mode */
92 #define SPINOR_OP_RD_EVCR 0x65 /* Read EVCR register */
98 #define SPINOR_OP_RSECR 0x48 /* Read Security registers */
207 * struct spi_nor_hwcaps - Structure for describing the hardware capabilies
216 *(Fast) Read capabilities.
218 * As a matter of performances, it is relevant to use Octal SPI protocols first,
219 * then Quad SPI protocols before Dual SPI protocols, Fast Read and lastly
220 * (Slow) Read.
249 * Like (Fast) Read capabilities, Octal/Quad SPI protocols are preferred to the
250 * legacy SPI 1-1-1 protocol.
252 * JEDEC/SFDP standard to define them. Also at this moment no SPI flash memory
291 * struct spi_nor_controller_ops - SPI NOR controller driver specific
294 * read/write/erase/lock/unlock operations.
296 * read/write/erase/lock/unlock operations.
297 * @read_reg: read out the register.
298 * @write_reg: write data to the register.
299 * @read: read data from the SPI NOR.
300 * @write: write data to the SPI NOR.
312 ssize_t (*read)(struct spi_nor *nor, loff_t from, size_t len, u8 *buf); member
313 ssize_t (*write)(struct spi_nor *nor, loff_t to, size_t len,
319 * enum spi_nor_cmd_ext - describes the command opcode extension in DTR mode
325 * combine to form a 16-bit opcode.
343 * struct spi_nor - Structure for defining the SPI NOR layer
345 * @lock: the lock for the read/write/erase/lock/unlock operations
346 * @rww: Read-While-Write (RWW) sync lock
349 * @rww.ongoing_rd: a read is ongoing on the chip
352 * @dev: pointer to an SPI device or an SPI NOR controller device
353 * @spimem: pointer to the SPI memory device
355 * layer is not DMA-able
363 * @read_opcode: the read opcode
364 * @read_dummy: the dummy needed by the read operation
369 * @read_proto: the SPI protocol for read operations
373 * @debugfs_root: pointer to the debugfs directory
375 * @params: [FLASH-SPECIFIC] SPI NOR flash parameters and settings.
379 * @dirmap: pointers to struct spi_mem_dirmap_desc for reads/writes.
380 * @priv: pointer to the private data
428 mtd_set_of_node(&nor->mtd, np); in spi_nor_set_flash_node()
433 return mtd_get_of_node(&nor->mtd); in spi_nor_get_flash_node()
437 * spi_nor_scan() - scan the SPI NOR
442 * The drivers can use this function to scan the SPI NOR.
443 * In the scanning, it will try to get all the necessary information to