Interface for flash drivers.
More...
|
| #define | PBL_FLASH_STATE_DEFINE(sym) |
| | Define the class state of flash sym, for the PBL_FLASH_*_DEFINE() macro of a driver.
|
| |
| #define | PBL_FLASH_INIT(sym, _name, _parent, _ops, _geometry, _otp, _otp_layout) |
| | Initializer for the struct pbl_flash of flash sym.
|
| |
Interface for flash drivers.
A driver embeds a struct pbl_flash in its instance, sets it up with PBL_FLASH_STATE_DEFINE() and PBL_FLASH_INIT(), and implements the struct pbl_flash_ops the class calls.
◆ pbl_flash
◆ PBL_FLASH_INIT
| #define PBL_FLASH_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops, |
|
|
|
_geometry, |
|
|
|
_otp, |
|
|
|
_otp_layout |
|
) |
| |
Value: { \
.ops = (_ops), \
.state = &sym##_flash_state, \
.geometry = (_geometry), \
.otp = (_otp), \
.otp_layout = (_otp_layout), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initializer for the struct pbl_flash of flash sym.
- Parameters
-
| sym | Symbol of the flash instance, with its state defined by PBL_FLASH_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, e.g. the memory controller, or NULL. |
| _ops | Driver operations. |
| _geometry | Geometry. |
| _otp | OTP organization, or NULL. |
| _otp_layout | OTP cells, or NULL. |
◆ PBL_FLASH_STATE_DEFINE
| #define PBL_FLASH_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
static struct pbl_flash_state sym##_flash_state
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Define the class state of flash sym, for the PBL_FLASH_*_DEFINE() macro of a driver.
- Parameters
-
| sym | Symbol of the flash instance. |
◆ pbl_flash_in_coredump()
| static bool pbl_flash_in_coredump |
( |
const struct pbl_flash * |
flash | ) |
|
|
inlinestatic |
◆ pbl_flash_set_map()
| void pbl_flash_set_map |
( |
const struct pbl_flash * |
flash, |
|
|
const void * |
ptr, |
|
|
uint32_t |
len |
|
) |
| |
Declare where the CPU reads the flash directly, for drivers.
Reads inside the window then copy from memory instead of going through the driver. The driver keeps the window coherent after it writes or erases.
- Parameters
-
| flash | Flash. |
| ptr | CPU address of the first byte, or NULL to remove the window. |
| len | Size of the window in bytes. |