Lines Matching refs:nor
19 static int at25fs_nor_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_lock() argument
24 static int at25fs_nor_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_unlock() argument
29 if (ofs || len != nor->params->size) in at25fs_nor_unlock()
33 ret = spi_nor_write_sr_and_check(nor, 0); in at25fs_nor_unlock()
35 dev_dbg(nor->dev, "unable to clear BP bits, WP# asserted?\n"); in at25fs_nor_unlock()
40 static int at25fs_nor_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_is_locked() argument
51 static void at25fs_nor_late_init(struct spi_nor *nor) in at25fs_nor_late_init() argument
53 nor->params->locking_ops = &at25fs_nor_locking_ops; in at25fs_nor_late_init()
69 static int atmel_nor_set_global_protection(struct spi_nor *nor, loff_t ofs, in atmel_nor_set_global_protection() argument
76 if (ofs || len != nor->params->size) in atmel_nor_set_global_protection()
79 ret = spi_nor_read_sr(nor, nor->bouncebuf); in atmel_nor_set_global_protection()
83 sr = nor->bouncebuf[0]; in atmel_nor_set_global_protection()
88 ret = spi_nor_write_sr_and_check(nor, sr); in atmel_nor_set_global_protection()
90 dev_dbg(nor->dev, "unable to clear SRWD bit, WP# asserted?\n"); in atmel_nor_set_global_protection()
109 nor->bouncebuf[0] = sr; in atmel_nor_set_global_protection()
116 return spi_nor_write_sr(nor, nor->bouncebuf, 1); in atmel_nor_set_global_protection()
119 static int atmel_nor_global_protect(struct spi_nor *nor, loff_t ofs, in atmel_nor_global_protect() argument
122 return atmel_nor_set_global_protection(nor, ofs, len, true); in atmel_nor_global_protect()
125 static int atmel_nor_global_unprotect(struct spi_nor *nor, loff_t ofs, in atmel_nor_global_unprotect() argument
128 return atmel_nor_set_global_protection(nor, ofs, len, false); in atmel_nor_global_unprotect()
131 static int atmel_nor_is_global_protected(struct spi_nor *nor, loff_t ofs, in atmel_nor_is_global_protected() argument
136 if (ofs >= nor->params->size || (ofs + len) > nor->params->size) in atmel_nor_is_global_protected()
139 ret = spi_nor_read_sr(nor, nor->bouncebuf); in atmel_nor_is_global_protected()
143 return ((nor->bouncebuf[0] & ATMEL_SR_GLOBAL_PROTECT_MASK) == ATMEL_SR_GLOBAL_PROTECT_MASK); in atmel_nor_is_global_protected()
152 static void atmel_nor_global_protection_late_init(struct spi_nor *nor) in atmel_nor_global_protection_late_init() argument
154 nor->params->locking_ops = &atmel_nor_global_protection_ops; in atmel_nor_global_protection_late_init()