Lines Matching full:nor
7 #include <linux/mtd/spi-nor.h>
13 static int sst26vf_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_lock() argument
18 static int sst26vf_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_unlock() argument
23 if (ofs != 0 || len != nor->params->size) in sst26vf_unlock()
26 ret = spi_nor_read_cr(nor, nor->bouncebuf); in sst26vf_unlock()
30 if (!(nor->bouncebuf[0] & SST26VF_CR_BPNV)) { in sst26vf_unlock()
31 dev_dbg(nor->dev, "Any block has been permanently locked\n"); in sst26vf_unlock()
35 return spi_nor_global_block_unlock(nor); in sst26vf_unlock()
38 static int sst26vf_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_is_locked() argument
49 static void sst26vf_default_init(struct spi_nor *nor) in sst26vf_default_init() argument
51 nor->params->locking_ops = &sst26vf_locking_ops; in sst26vf_default_init()
97 struct spi_nor *nor = mtd_to_spi_nor(mtd); in sst_write() local
101 dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len); in sst_write()
103 ret = spi_nor_lock_and_prep(nor); in sst_write()
107 ret = spi_nor_write_enable(nor); in sst_write()
111 nor->sst_write_second = false; in sst_write()
115 nor->program_opcode = SPINOR_OP_BP; in sst_write()
118 ret = spi_nor_write_data(nor, to, 1, buf); in sst_write()
122 ret = spi_nor_wait_till_ready(nor); in sst_write()
132 nor->program_opcode = SPINOR_OP_AAI_WP; in sst_write()
135 ret = spi_nor_write_data(nor, to, 2, buf + actual); in sst_write()
139 ret = spi_nor_wait_till_ready(nor); in sst_write()
143 nor->sst_write_second = true; in sst_write()
145 nor->sst_write_second = false; in sst_write()
147 ret = spi_nor_write_disable(nor); in sst_write()
151 ret = spi_nor_wait_till_ready(nor); in sst_write()
157 ret = spi_nor_write_enable(nor); in sst_write()
161 nor->program_opcode = SPINOR_OP_BP; in sst_write()
162 ret = spi_nor_write_data(nor, to, 1, buf + actual); in sst_write()
166 ret = spi_nor_wait_till_ready(nor); in sst_write()
172 ret = spi_nor_write_disable(nor); in sst_write()
176 spi_nor_unlock_and_unprep(nor); in sst_write()
180 static void sst_post_sfdp_fixups(struct spi_nor *nor) in sst_post_sfdp_fixups() argument
182 if (nor->info->flags & SST_WRITE) in sst_post_sfdp_fixups()
183 nor->mtd._write = sst_write; in sst_post_sfdp_fixups()