Lines Matching refs:nor
16 static int sst26vf_nor_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_nor_lock() argument
21 static int sst26vf_nor_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_nor_unlock() argument
26 if (ofs != 0 || len != nor->params->size) in sst26vf_nor_unlock()
29 ret = spi_nor_read_cr(nor, nor->bouncebuf); in sst26vf_nor_unlock()
33 if (!(nor->bouncebuf[0] & SST26VF_CR_BPNV)) { in sst26vf_nor_unlock()
34 dev_dbg(nor->dev, "Any block has been permanently locked\n"); in sst26vf_nor_unlock()
38 return spi_nor_global_block_unlock(nor); in sst26vf_nor_unlock()
41 static int sst26vf_nor_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_nor_is_locked() argument
52 static void sst26vf_nor_late_init(struct spi_nor *nor) in sst26vf_nor_late_init() argument
54 nor->params->locking_ops = &sst26vf_nor_locking_ops; in sst26vf_nor_late_init()
123 struct spi_nor *nor = mtd_to_spi_nor(mtd); in sst_nor_write() local
127 dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len); in sst_nor_write()
129 ret = spi_nor_lock_and_prep(nor); in sst_nor_write()
133 ret = spi_nor_write_enable(nor); in sst_nor_write()
137 nor->sst_write_second = false; in sst_nor_write()
141 nor->program_opcode = SPINOR_OP_BP; in sst_nor_write()
144 ret = spi_nor_write_data(nor, to, 1, buf); in sst_nor_write()
148 ret = spi_nor_wait_till_ready(nor); in sst_nor_write()
158 nor->program_opcode = SPINOR_OP_AAI_WP; in sst_nor_write()
161 ret = spi_nor_write_data(nor, to, 2, buf + actual); in sst_nor_write()
165 ret = spi_nor_wait_till_ready(nor); in sst_nor_write()
169 nor->sst_write_second = true; in sst_nor_write()
171 nor->sst_write_second = false; in sst_nor_write()
173 ret = spi_nor_write_disable(nor); in sst_nor_write()
177 ret = spi_nor_wait_till_ready(nor); in sst_nor_write()
183 ret = spi_nor_write_enable(nor); in sst_nor_write()
187 nor->program_opcode = SPINOR_OP_BP; in sst_nor_write()
188 ret = spi_nor_write_data(nor, to, 1, buf + actual); in sst_nor_write()
192 ret = spi_nor_wait_till_ready(nor); in sst_nor_write()
198 ret = spi_nor_write_disable(nor); in sst_nor_write()
202 spi_nor_unlock_and_unprep(nor); in sst_nor_write()
206 static void sst_nor_late_init(struct spi_nor *nor) in sst_nor_late_init() argument
208 if (nor->info->mfr_flags & SST_WRITE) in sst_nor_late_init()
209 nor->mtd._write = sst_nor_write; in sst_nor_late_init()