KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
flash.h File Reference

BIOS replacement flashrom support. More...

#include <arch/types.h>

Go to the source code of this file.

Functions

int nvflash_detect (void)
 Try to detect a compatible flashrom.
 
int nvflash_erase_block (uint32 addr)
 Erase a single block of flashrom.
 
int nvflash_write_block (uint32 addr, void *data, uint32 len)
 Write data to the flashrom.
 
int nvflash_erase_all (void)
 Erase the whole flashrom.
 

Detailed Description

BIOS replacement flashrom support.

This file is involved with accessing an flashrom chip soldered in place to replace the BIOS ROM. Specifically, this driver is for accessing a STMicro M29W800B, but should also work with other chips like the M29W160B or equivalent AMD chips.

Author
Megan Potter

Function Documentation

◆ nvflash_detect()

int nvflash_detect ( void )

Try to detect a compatible flashrom.

Returns
0 if a compatible flashrom is detected, <0 if the normal Dreamcast BIOS is detected.

◆ nvflash_erase_all()

int nvflash_erase_all ( void )

Erase the whole flashrom.

Returns
0 on success, <0 on error.

◆ nvflash_erase_block()

int nvflash_erase_block ( uint32 addr)

Erase a single block of flashrom.

Parameters
addrThe block of the flashrom to erase.
Returns
0 on success, <0 on error.

◆ nvflash_write_block()

int nvflash_write_block ( uint32 addr,
void * data,
uint32 len )

Write data to the flashrom.

Parameters
addrThe block of the flashrom to write to.
dataThe data to write.
lenThe length of the data, in bytes.
Returns
0 on success, <0 on error.