Lines Matching refs:region

28  * 256). Thus one "security register" maps to one OTP region.
155 static int spi_nor_otp_lock_bit_cr(unsigned int region)
159 if (region >= ARRAY_SIZE(lock_bits))
162 return lock_bits[region];
166 * spi_nor_otp_lock_sr2() - lock the OTP region
168 * @region: OTP region
170 * Lock the OTP region by writing the status register-2. This method is used on
175 int spi_nor_otp_lock_sr2(struct spi_nor *nor, unsigned int region)
180 lock_bit = spi_nor_otp_lock_bit_cr(region);
188 /* no need to write the register if region is already locked */
198 * spi_nor_otp_is_locked_sr2() - get the OTP region lock status
200 * @region: OTP region
202 * Retrieve the OTP region lock bit by reading the status register-2. This
207 int spi_nor_otp_is_locked_sr2(struct spi_nor *nor, unsigned int region)
212 lock_bit = spi_nor_otp_lock_bit_cr(region);
223 static loff_t spi_nor_otp_region_start(const struct spi_nor *nor, unsigned int region)
227 return org->base + region * org->offset;
236 static loff_t spi_nor_otp_region_to_offset(struct spi_nor *nor, unsigned int region)
238 return region * spi_nor_otp_region_len(nor);
288 unsigned int region;
295 for (region = spi_nor_otp_offset_to_region(nor, ofs);
296 region <= spi_nor_otp_offset_to_region(nor, ofs + len - 1);
297 region++) {
298 locked = ops->is_locked(nor, region);
315 unsigned int region;
346 * file offsets to the address of an OTP region as used in the
349 region = spi_nor_otp_offset_to_region(nor, ofs);
350 rstart = spi_nor_otp_region_start(nor, region);
353 * The size of a OTP region is expected to be a power of two,
355 * a region.
359 /* don't access beyond one OTP region */
400 unsigned int region;
431 region = spi_nor_otp_offset_to_region(nor, from);
432 rstart = spi_nor_otp_region_start(nor, region);
453 unsigned int region;
468 region = spi_nor_otp_offset_to_region(nor, from);
469 ret = ops->lock(nor, region);