Lines Matching +full:otp +full:- +full:1
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016-2017 Micron Technology, Inc.
17 #include <linux/spi/spi-mem.h>
24 SPI_MEM_OP(SPI_MEM_OP_CMD(0xff, 1), \
30 SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \
36 SPI_MEM_OP(SPI_MEM_OP_CMD(0x9f, 1), \
37 SPI_MEM_OP_ADDR(naddr, 0, 1), \
38 SPI_MEM_OP_DUMMY(ndummy, 1), \
39 SPI_MEM_OP_DATA_IN(len, buf, 1))
42 SPI_MEM_OP(SPI_MEM_OP_CMD(0x1f, 1), \
43 SPI_MEM_OP_ADDR(1, reg, 1), \
45 SPI_MEM_OP_DATA_OUT(1, valptr, 1))
48 SPI_MEM_OP(SPI_MEM_OP_CMD(0x0f, 1), \
49 SPI_MEM_OP_ADDR(1, reg, 1), \
51 SPI_MEM_OP_DATA_IN(1, valptr, 1))
54 SPI_MEM_OP(SPI_MEM_OP_CMD(0xd8, 1), \
55 SPI_MEM_OP_ADDR(3, addr, 1), \
60 SPI_MEM_OP(SPI_MEM_OP_CMD(0x13, 1), \
61 SPI_MEM_OP_ADDR(3, addr, 1), \
66 SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
67 SPI_MEM_OP_ADDR(2, addr, 1), \
68 SPI_MEM_OP_DUMMY(ndummy, 1), \
69 SPI_MEM_OP_DATA_IN(len, buf, 1), \
73 SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
74 SPI_MEM_OP_ADDR(2, addr, 1), \
75 SPI_MEM_OP_DUMMY(ndummy, 1), \
76 SPI_MEM_OP_DATA_IN(len, buf, 1))
79 SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
80 SPI_MEM_OP_ADDR(3, addr, 1), \
81 SPI_MEM_OP_DUMMY(ndummy, 1), \
82 SPI_MEM_OP_DATA_IN(len, buf, 1))
85 SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
86 SPI_MEM_OP_ADDR(3, addr, 1), \
87 SPI_MEM_OP_DUMMY(ndummy, 1), \
88 SPI_MEM_OP_DATA_IN(len, buf, 1))
91 SPI_MEM_OP(SPI_MEM_OP_CMD(0x0d, 1), \
92 SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
93 SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
94 SPI_MEM_DTR_OP_DATA_IN(len, buf, 1), \
98 SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \
99 SPI_MEM_OP_ADDR(2, addr, 1), \
100 SPI_MEM_OP_DUMMY(ndummy, 1), \
104 SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \
105 SPI_MEM_OP_ADDR(3, addr, 1), \
106 SPI_MEM_OP_DUMMY(ndummy, 1), \
110 SPI_MEM_OP(SPI_MEM_OP_CMD(0x3d, 1), \
111 SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
112 SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
117 SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \
118 SPI_MEM_OP_ADDR(2, addr, 1), \
119 SPI_MEM_OP_DUMMY(ndummy, 1), \
123 SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \
124 SPI_MEM_OP_ADDR(3, addr, 1), \
125 SPI_MEM_OP_DUMMY(ndummy, 1), \
129 SPI_MEM_OP(SPI_MEM_OP_CMD(0x6d, 1), \
130 SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
131 SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
136 SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
142 SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
148 SPI_MEM_OP(SPI_MEM_OP_CMD(0xbd, 1), \
155 SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \
161 SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \
167 SPI_MEM_OP(SPI_MEM_OP_CMD(0xed, 1), \
174 SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1), \
175 SPI_MEM_OP_ADDR(3, addr, 1), \
180 SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x02 : 0x84, 1), \
181 SPI_MEM_OP_ADDR(2, addr, 1), \
183 SPI_MEM_OP_DATA_OUT(len, buf, 1))
186 SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x32 : 0x34, 1), \
187 SPI_MEM_OP_ADDR(2, addr, 1), \
214 #define STATUS_ECC_HAS_BITFLIPS (1 << 4)
223 * tBERS (erase) 1ms to 4ms
245 * struct spinand_id - SPI NAND id structure
262 * struct spinand_devid - SPI NAND device id structure
270 * read_id opcode + 1-byte address.
272 * read_id opcode + 1 dummy byte.
281 * struct manufacurer_ops - SPI NAND manufacturer specific operations
294 * struct spinand_manufacturer - SPI NAND manufacturer instance
325 * struct spinand_op_variants - SPI NAND operation variants
329 * Some operations like read-from-cache/write-to-cache have several variants
348 * spinand_ecc_info - description of the on-die ECC implemented by a SPI NAND
352 * -EBADMSG if there are uncorrectable errors. I can also return
355 * @ooblayout: the OOB layout used by the on-die ECC implementation
363 #define SPINAND_HAS_CR_FEAT_BIT BIT(1)
369 * struct spinand_ondie_ecc_conf - private SPI-NAND on-die ECC engine structure
371 * ->get_status() is not populated by the spinand device.
378 * struct spinand_otp_layout - structure to describe the SPI NAND OTP area
379 * @npages: number of pages in the OTP
380 * @start_page: start page of the user/factory OTP area.
388 * struct spinand_fact_otp_ops - SPI NAND OTP methods for factory area
389 * @info: get the OTP area information
390 * @read: read from the SPI NAND OTP area
400 * struct spinand_user_otp_ops - SPI NAND OTP methods for user area
401 * @info: get the OTP area information
402 * @lock: lock an OTP region
403 * @erase: erase an OTP region
404 * @read: read from the SPI NAND OTP area
405 * @write: write to the SPI NAND OTP area
419 * struct spinand_fact_otp - SPI NAND OTP grouping structure for factory area
420 * @layout: OTP region layout
421 * @ops: OTP access ops
429 * struct spinand_user_otp - SPI NAND OTP grouping structure for user area
430 * @layout: OTP region layout
431 * @ops: OTP access ops
439 * struct spinand_info - Structure used to describe SPI NAND chips
442 * @flags: OR-ing of the SPINAND_XXX flags
445 * @eccinfo: on-die ECC info
447 * @op_variants.read_cache: variants of the read-cache operation
448 * @op_variants.write_cache: variants of the write-cache operation
449 * @op_variants.update_cache: variants of the update-cache operation
451 * multi-die chips
453 * @fact_otp: SPI NAND factory OTP info.
454 * @user_otp: SPI NAND user OTP info.
552 * struct spinand_device - SPI NAND device instance
566 * @eccinfo: on-die ECC information
571 * because the spi-mem interface explicitly requests that buffers
572 * passed in spi_mem_op be DMA-able, so we can't based the bufs on
578 * A per-transfer check must of course be done to ensure it is
582 * @fact_otp: SPI NAND factory OTP info.
583 * @user_otp: SPI NAND user OTP info.
628 * mtd_to_spinand() - Get the SPI NAND device attached to an MTD instance
639 * spinand_to_mtd() - Get the MTD device embedded in a SPI NAND device
646 return nanddev_to_mtd(&spinand->base); in spinand_to_mtd()
650 * nand_to_spinand() - Get the SPI NAND device embedding an NAND object
661 * spinand_to_nand() - Get the NAND device embedded in a SPI NAND object
669 return &spinand->base; in spinand_to_nand()
673 * spinand_set_of_node - Attach a DT node to a SPI NAND device
682 nanddev_set_of_node(&spinand->base, np); in spinand_set_of_node()