KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
flash.h
Go to the documentation of this file.
1 /* KallistiOS ##version##
2 
3  navi/flash.h
4  Copyright (C) 2002 Dan Potter
5 
6 */
7 
8 /** \file navi/flash.h
9  \brief BIOS replacement flashrom support.
10 
11  This file is involved with accessing an flashrom chip soldered in place to
12  replace the BIOS ROM. Specifically, this driver is for accessing a STMicro
13  M29W800B, but should also work with other chips like the M29W160B or
14  equivalent AMD chips.
15 
16  \author Dan Potter
17 */
18 
19 #ifndef __NAVI_FLASH_H
20 #define __NAVI_FLASH_H
21 
22 #include <arch/types.h>
23 
24 /** \brief Try to detect a compatible flashrom.
25  \return 0 if a compatible flashrom is detected, <0 if the
26  normal Dreamcast BIOS is detected.
27 */
28 int nvflash_detect();
29 
30 /** \brief Erase a single block of flashrom.
31  \param addr The block of the flashrom to erase.
32  \return 0 on success, <0 on error.
33 */
34 int nvflash_erase_block(uint32 addr);
35 
36 /** \brief Write data to the flashrom.
37  \param addr The block of the flashrom to write to.
38  \param data The data to write.
39  \param len The length of the data, in bytes.
40  \return 0 on success, <0 on error.
41 */
42 int nvflash_write_block(uint32 addr, void * data, uint32 len);
43 
44 /* Erase the whole flash chip */
45 /** \brief Erase the whole flashrom.
46  \return 0 on success, <0 on error.
47 */
48 int nvflash_erase_all();
49 
50 #endif /* __NAVI_FLASH_H */
Common integer types.
int nvflash_erase_all()
Erase the whole flashrom.
int nvflash_detect()
Try to detect a compatible flashrom.
int nvflash_write_block(uint32 addr, void *data, uint32 len)
Write data to the flashrom.
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
int nvflash_erase_block(uint32 addr)
Erase a single block of flashrom.