|
PebbleOS v4.44.0-46-gef116268a
|
Flash driver operations. More...
#include <flash.h>
Data Fields | |
| int(* | init )(const struct pbl_flash *flash) |
| Optional. | |
| int(* | read )(const struct pbl_flash *flash, uint32_t addr, void *buf, size_t len) |
Read len bytes. | |
| int(* | write )(const struct pbl_flash *flash, uint32_t addr, const void *buf, size_t len) |
Program len bytes, returning once they are programmed. | |
| int(* | erase )(const struct pbl_flash *flash, uint32_t addr, uint32_t size) |
Start erasing the sector or subsector of size bytes at addr. | |
| int(* | erase_status )(const struct pbl_flash *flash) |
| Optional. | |
| int(* | erase_suspend )(const struct pbl_flash *flash) |
Optional, with erase_status. | |
| int(* | erase_resume )(const struct pbl_flash *flash) |
With erase_suspend. | |
| void(* | power_down )(const struct pbl_flash *flash, pbl_flash_pm_fn_t fn, void *arg) |
| Optional. | |
| void(* | stop )(const struct pbl_flash *flash) |
| Optional. | |
| int(* | otp_read )(const struct pbl_flash *flash, uint8_t region, uint32_t offs, void *buf, size_t len) |
| With OTP. | |
| int(* | otp_write )(const struct pbl_flash *flash, uint8_t region, uint32_t offs, const void *buf, size_t len) |
| With OTP. | |
| int(* | otp_is_locked )(const struct pbl_flash *flash, uint8_t region, bool *locked) |
| With OTP. | |
| int(* | otp_lock )(const struct pbl_flash *flash, uint8_t region) |
| Optional. | |
| int(* | otp_erase )(const struct pbl_flash *flash, uint8_t region) |
| Optional. | |
Flash driver operations.
Called with the device lock held, or without any OS service in coredump mode, which drivers check with pbl_flash_in_coredump(): they must then poll instead of blocking.
| int(* pbl_flash_ops::erase) (const struct pbl_flash *flash, uint32_t addr, uint32_t size) |
Start erasing the sector or subsector of size bytes at addr.
Returns 0, 1 if the erase completed before returning, or a negative errno. Without erase_status, returns once the erase is done.
| int(* pbl_flash_ops::erase_resume) (const struct pbl_flash *flash) |
With erase_suspend.
Resume the suspended erase. Returns 0 or a negative errno.
| int(* pbl_flash_ops::erase_status) (const struct pbl_flash *flash) |
Optional.
Returns 0 once the erase is done, -EBUSY while it is in progress, -EAGAIN while it is suspended, or another negative errno if it failed.
| int(* pbl_flash_ops::erase_suspend) (const struct pbl_flash *flash) |
Optional, with erase_status.
Suspend the erase in progress. Returns 0, 1 if the erase had already completed, or a negative errno.
| int(* pbl_flash_ops::init) (const struct pbl_flash *flash) |
Optional.
Bring the hardware up. Also called by pbl_flash_coredump_init(), possibly after a previous initialization. Returns 0 or a negative errno.
| int(* pbl_flash_ops::otp_erase) (const struct pbl_flash *flash, uint8_t region) |
Optional.
Erase OTP region region.
| int(* pbl_flash_ops::otp_is_locked) (const struct pbl_flash *flash, uint8_t region, bool *locked) |
With OTP.
Check whether OTP region region is locked.
| int(* pbl_flash_ops::otp_lock) (const struct pbl_flash *flash, uint8_t region) |
Optional.
Lock OTP region region forever.
| int(* pbl_flash_ops::otp_read) (const struct pbl_flash *flash, uint8_t region, uint32_t offs, void *buf, size_t len) |
With OTP.
Read len bytes at offs of OTP region region.
| int(* pbl_flash_ops::otp_write) (const struct pbl_flash *flash, uint8_t region, uint32_t offs, const void *buf, size_t len) |
With OTP.
Program len bytes at offs of OTP region region.
| void(* pbl_flash_ops::power_down) (const struct pbl_flash *flash, pbl_flash_pm_fn_t fn, void *arg) |
Optional.
Power down while fn runs, with interrupts disabled.
| int(* pbl_flash_ops::read) (const struct pbl_flash *flash, uint32_t addr, void *buf, size_t len) |
Read len bytes.
Returns 0 or a negative errno.
| void(* pbl_flash_ops::stop) (const struct pbl_flash *flash) |
Optional.
Return the hardware to the state the boot code expects, before a reset.
| int(* pbl_flash_ops::write) (const struct pbl_flash *flash, uint32_t addr, const void *buf, size_t len) |
Program len bytes, returning once they are programmed.
Returns 0 or a negative errno.