Lines Matching full:nor
21 /* Standard SPI NOR flash operations. */
202 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type
241 * struct spi_nor_erase_region - Structure to describe a SPI NOR erase region
260 * struct spi_nor_erase_map - Structure to describe the SPI NOR erase map
264 * @uniform_region: a pre-allocated erase region for SPI NOR with a uniform
280 * struct spi_nor_locking_ops - SPI NOR locking methods
281 * @lock: lock a region of the SPI NOR.
282 * @unlock: unlock a region of the SPI NOR.
283 * @is_locked: check if a region of the SPI NOR is completely locked
286 int (*lock)(struct spi_nor *nor, loff_t ofs, u64 len);
287 int (*unlock)(struct spi_nor *nor, loff_t ofs, u64 len);
288 int (*is_locked)(struct spi_nor *nor, loff_t ofs, u64 len);
292 * struct spi_nor_otp_organization - Structure to describe the SPI NOR OTP regions
307 * struct spi_nor_otp_ops - SPI NOR OTP methods
308 * @read: read from the SPI NOR OTP area.
309 * @write: write to the SPI NOR OTP area.
312 * @is_locked: check if an OTP region of the SPI NOR is locked.
315 int (*read)(struct spi_nor *nor, loff_t addr, size_t len, u8 *buf);
316 int (*write)(struct spi_nor *nor, loff_t addr, size_t len,
318 int (*lock)(struct spi_nor *nor, unsigned int region);
319 int (*erase)(struct spi_nor *nor, loff_t addr);
320 int (*is_locked)(struct spi_nor *nor, unsigned int region);
324 * struct spi_nor_otp - SPI NOR OTP grouping structure
334 * struct spi_nor_flash_parameter - SPI NOR flash parameters and settings.
343 * @page_size: the page size of the SPI NOR flash memory.
365 * @otp: SPI NOR OTP info.
366 * @set_octal_dtr: enables or disables SPI NOR octal DTR mode.
367 * @quad_enable: enables SPI NOR quad mode.
368 * @set_4byte_addr_mode: puts the SPI NOR in 4 byte addressing mode.
372 * @locking_ops: SPI NOR locking methods.
396 int (*set_octal_dtr)(struct spi_nor *nor, bool enable);
397 int (*quad_enable)(struct spi_nor *nor);
398 int (*set_4byte_addr_mode)(struct spi_nor *nor, bool enable);
399 int (*ready)(struct spi_nor *nor);
406 * struct spi_nor_fixups - SPI NOR fixup hooks
420 * Those hooks can be used to tweak the SPI NOR configuration when the SFDP
424 void (*default_init)(struct spi_nor *nor);
425 int (*post_bfpt)(struct spi_nor *nor,
428 int (*post_sfdp)(struct spi_nor *nor);
429 int (*late_init)(struct spi_nor *nor);
433 * struct spi_nor_id - SPI NOR flash ID.
446 * struct flash_info - SPI NOR flash_info entry.
558 * struct spi_nor_manufacturer - SPI NOR manufacturer object
599 void spi_nor_spimem_setup_op(const struct spi_nor *nor,
602 int spi_nor_write_enable(struct spi_nor *nor);
603 int spi_nor_write_disable(struct spi_nor *nor);
604 int spi_nor_set_4byte_addr_mode_en4b_ex4b(struct spi_nor *nor, bool enable);
605 int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor,
607 int spi_nor_set_4byte_addr_mode_brwr(struct spi_nor *nor, bool enable);
608 int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable);
609 int spi_nor_wait_till_ready(struct spi_nor *nor);
610 int spi_nor_global_block_unlock(struct spi_nor *nor);
611 int spi_nor_prep_and_lock(struct spi_nor *nor);
612 void spi_nor_unlock_and_unprep(struct spi_nor *nor);
613 int spi_nor_sr1_bit6_quad_enable(struct spi_nor *nor);
614 int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor);
615 int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor);
616 int spi_nor_read_id(struct spi_nor *nor, u8 naddr, u8 ndummy, u8 *id,
618 int spi_nor_read_sr(struct spi_nor *nor, u8 *sr);
619 int spi_nor_sr_ready(struct spi_nor *nor);
620 int spi_nor_read_cr(struct spi_nor *nor, u8 *cr);
621 int spi_nor_write_sr(struct spi_nor *nor, const u8 *sr, size_t len);
622 int spi_nor_write_sr_and_check(struct spi_nor *nor, u8 sr1);
623 int spi_nor_write_16bit_cr_and_check(struct spi_nor *nor, u8 cr);
625 ssize_t spi_nor_read_data(struct spi_nor *nor, loff_t from, size_t len,
627 ssize_t spi_nor_write_data(struct spi_nor *nor, loff_t to, size_t len,
629 int spi_nor_read_any_reg(struct spi_nor *nor, struct spi_mem_op *op,
631 int spi_nor_write_any_volatile_reg(struct spi_nor *nor, struct spi_mem_op *op,
633 int spi_nor_erase_sector(struct spi_nor *nor, u32 addr);
635 int spi_nor_otp_read_secr(struct spi_nor *nor, loff_t addr, size_t len, u8 *buf);
636 int spi_nor_otp_write_secr(struct spi_nor *nor, loff_t addr, size_t len,
638 int spi_nor_otp_erase_secr(struct spi_nor *nor, loff_t addr);
639 int spi_nor_otp_lock_sr2(struct spi_nor *nor, unsigned int region);
640 int spi_nor_otp_is_locked_sr2(struct spi_nor *nor, unsigned int region);
659 int spi_nor_post_bfpt_fixups(struct spi_nor *nor,
663 void spi_nor_init_default_locking_ops(struct spi_nor *nor);
664 void spi_nor_try_unlock_all(struct spi_nor *nor);
665 void spi_nor_set_mtd_locking_ops(struct spi_nor *nor);
666 void spi_nor_set_mtd_otp_ops(struct spi_nor *nor);
668 int spi_nor_controller_ops_read_reg(struct spi_nor *nor, u8 opcode,
670 int spi_nor_controller_ops_write_reg(struct spi_nor *nor, u8 opcode,
673 int spi_nor_check_sfdp_signature(struct spi_nor *nor);
674 int spi_nor_parse_sfdp(struct spi_nor *nor);
686 static inline bool spi_nor_needs_sfdp(const struct spi_nor *nor) in spi_nor_needs_sfdp() argument
694 return !nor->info->size; in spi_nor_needs_sfdp()
698 void spi_nor_debugfs_register(struct spi_nor *nor);
701 static inline void spi_nor_debugfs_register(struct spi_nor *nor) {} in spi_nor_debugfs_register() argument