49 const int bus = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS;
101 if (
CONFIG(BOOTMEDIA_SPI_LOCK_REBOOT))
103 else if (
CONFIG(BOOTMEDIA_SPI_LOCK_PIN))
105 else if (
CONFIG(BOOTMEDIA_SPI_LOCK_PERMANENT))
static const struct region_device_ops spi_ops
static ssize_t spi_readat(const struct region_device *rd, void *b, size_t offset, size_t size)
const struct region_device * boot_device_rw(void)
static void boot_device_rw_init(void)
const struct spi_flash * boot_device_spi_flash(void)
static bool sfg_init_done
int boot_device_wp_region(const struct region_device *rd, const enum bootdev_prot_type type)
static struct spi_flash sfg
static const struct region_device spi_rw
static ssize_t spi_writeat(const struct region_device *rd, const void *b, size_t offset, size_t size)
static ssize_t spi_eraseat(const struct region_device *rd, size_t offset, size_t size)
void boot_device_init(void)
#define REGION_DEV_INIT(ops_, offset_, size_)
static const struct region * region_device_region(const struct region_device *rdev)
static void lock(void *unused)
void __weak spi_init(void)
int spi_flash_ctrlr_protect_region(const struct spi_flash *flash, const struct region *region, const enum ctrlr_prot_type type)
int spi_flash_set_write_protected(const struct spi_flash *flash, const struct region *region, const enum spi_flash_status_reg_lockdown mode)
int spi_flash_probe(unsigned int bus, unsigned int cs, struct spi_flash *flash)
int spi_flash_read(const struct spi_flash *flash, u32 offset, size_t len, void *buf)
int spi_flash_is_write_protected(const struct spi_flash *flash, const struct region *region)
int spi_flash_write(const struct spi_flash *flash, u32 offset, size_t len, const void *buf)
int spi_flash_erase(const struct spi_flash *flash, u32 offset, size_t len)
spi_flash_status_reg_lockdown
@ SPI_WRITE_PROTECTION_PERMANENT
@ SPI_WRITE_PROTECTION_PIN
@ SPI_WRITE_PROTECTION_REBOOT
ssize_t(* readat)(const struct region_device *, void *, size_t, size_t)