Gives a human-readable name of this flash driver, This field is used to select and initialize the driver.
Gives a human-readable description of arguments.
An array of driver-specific commands to register. When called during the "flash bank" command, the driver can register addition commands to support new flash chip functions.
Finish the "flash bank" command for @a bank. The @a bank parameter will have been filled in by the core flash layer when this routine is called, and the driver can store additional information in its struct flash_bank::driver_priv field. The CMD_ARGV are: @par @code CMD_ARGV[0] = bank CMD_ARGV[1] = drivername {name above} CMD_ARGV[2] = baseaddress CMD_ARGV[3] = lengthbytes CMD_ARGV[4] = chip_width_in bytes CMD_ARGV[5] = bus_width_in_bytes CMD_ARGV[6] = driver-specific parameters @endcode For example, CMD_ARGV[4] = 2 (for 16 bit flash), CMD_ARGV[5] = 4 (for 32 bit bus). If extra arguments are provided (@a CMD_ARGC > 6), they will start in @a CMD_ARGV[6]. These can be used to implement driver-specific extensions.
int (*)(struct flash_bank *bank, unsigned int first,
unsigned int last)
Bank/sector erase routine (target-specific). When called, the flash driver should erase the specified sectors using whatever means are at its disposal.
int (*)(struct flash_bank *bank, int set, unsigned int first,
unsigned int last)
Bank/sector protection routine (target-specific). If protection is not implemented, set method to NULL When called, the driver should enable/disable protection for MINIMUM the range covered by first..last sectors inclusive. Some chips have alignment requirements will cause the actual range to be protected / unprotected to be larger than the first..last range.
int (*)(struct flash_bank *bank,
const uint8_t *buffer, uint32_t offset, uint32_t count)
Program data into the flash. Note CPU address will be "bank->base + offset", while the physical address is dependent upon current target MMU mappings.
int (*)(struct flash_bank *bank,
uint8_t *buffer, uint32_t offset, uint32_t count)
Read data from the flash. Note CPU address will be "bank->base + offset", while the physical address is dependent upon current target MMU mappings.
int (*)(struct flash_bank *bank,
const uint8_t *buffer, uint32_t offset, uint32_t count)
Verify data in flash. Note CPU address will be "bank->base + offset", while the physical address is dependent upon current target MMU mappings.
Probe to determine what kind of flash is present. This is invoked by the "probe" script command.
Check the erasure status of a flash bank. When called, the driver routine must perform the required checks and then set the @c flash_sector::is_erased field for each of the flash banks's sectors.
Determine if the specific bank is "protected" or not. When called, the driver routine must must perform the required protection check(s) and then set the @c flash_sector::is_protected field for each of the flash bank's sectors. If protection is not implemented, set method to NULL.
Display human-readable information about the flash bank.
A more gentle flavor of flash_driver::probe, performing setup with less noise. Generally, driver routines should test to see if the bank has already been probed; if it has, the driver probably should not perform its probe a second time. This callback is often called from the inside of other routines (e.g. GDB flash downloads) to autoprobe the flash as it is programming the flash.
Deallocates private driver structures. Use default_flash_free_driver_priv() to simply free(bank->driver_priv).