libflashrom
Enumerations | Functions
Flash chips

Enumerations

enum  flashrom_flag { FLASHROM_FLAG_FORCE, FLASHROM_FLAG_FORCE_BOARDMISMATCH, FLASHROM_FLAG_VERIFY_AFTER_WRITE, FLASHROM_FLAG_VERIFY_WHOLE_CHIP }
 

Functions

int flashrom_flash_probe (struct flashrom_flashctx **const flashctx, const struct flashrom_programmer *const flashprog, const char *const chip_name)
 Probe for a flash chip. More...
 
size_t flashrom_flash_getsize (const struct flashrom_flashctx *const flashctx)
 Returns the size of the specified flash chip in bytes. More...
 
void flashrom_flash_release (struct flashrom_flashctx *const flashctx)
 Free a flash context. More...
 
void flashrom_flag_set (struct flashrom_flashctx *const flashctx, const enum flashrom_flag flag, const bool value)
 Set a flag in the given flash context. More...
 
bool flashrom_flag_get (const struct flashrom_flashctx *const flashctx, const enum flashrom_flag flag)
 Return the current value of a flag in the given flash context. More...
 
int flashrom_flash_erase (struct flashctx *const flashctx)
 Erase the specified ROM chip. More...
 

Detailed Description

Enumeration Type Documentation

Function Documentation

bool flashrom_flag_get ( const struct flashrom_flashctx *const  flashctx,
const enum flashrom_flag  flag 
)

Return the current value of a flag in the given flash context.

Parameters
flashctxFlash context to read from.
flagFlag to be read.
Returns
Current value of the flag.
void flashrom_flag_set ( struct flashrom_flashctx *const  flashctx,
const enum flashrom_flag  flag,
const bool  value 
)

Set a flag in the given flash context.

Parameters
flashctxFlash context to alter.
flagFlag that is to be set / cleared.
valueValue to set.
int flashrom_flash_erase ( struct flashctx *const  flashctx)

Erase the specified ROM chip.

If a layout is set in the given flash context, only included regions will be erased.

Parameters
flashctxThe context of the flash chip to erase.
Returns
0 on success.
size_t flashrom_flash_getsize ( const struct flashrom_flashctx *const  flashctx)

Returns the size of the specified flash chip in bytes.

Parameters
flashctxThe queried flash context.
Returns
Size of flash chip in bytes.
int flashrom_flash_probe ( struct flashrom_flashctx **const  flashctx,
const struct flashrom_programmer *const  flashprog,
const char *const  chip_name 
)

Probe for a flash chip.

Probes for a flash chip and returns a flash context, that can be used later with flash chip and image operations, if exactly one matching chip is found.

Parameters
[out]flashctxPoints to a pointer of type struct flashrom_flashctx that will be set if exactly one chip is found. *flashctx has to be freed by the caller with flashrom_flash_release.
[in]flashprogThe flash programmer used to access the chip.
[in]chip_nameName of a chip to probe for, or NULL to probe for all known chips.
Returns
0 on success, 3 if multiple chips were found, 2 if no chip was found, or 1 on any other error.
void flashrom_flash_release ( struct flashrom_flashctx *const  flashctx)

Free a flash context.

Parameters
flashctxFlash context to free.