summaryrefslogtreecommitdiff
path: root/chip_interface/flash.h
blob: ec622a086345eba076fb8b4b848b4425de4ed2b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* flash.h - flash interface
 *
 * (Chromium license) */

#ifndef __CHIP_INTERFACE_FLASH_H
#define __CHIP_INTERFACE_FLASH_H

/* returns the flash size and erase clock structure. */
EcError CrFlashQuery(*size, *erase_block) {

EcError CrFlashRead(addr_t offset, length, uint8_t *data);

EcError CrFlashWrite(addr_t offset, length, uint8_t *data);

EcError CrFlashErase(addr_t offset, length);

EcError CrFlashSetWriteProtectRange(addr_t offset, length);

/* TODO: change to Randall's new model */
/* Set lock bit (the SRP bit in SPI) */
EcError CrFlashEnableWriteProtect(void);

/* TODO: change to Randall's new model */
/* Always return FAILED because FMPPEn cannot be reset to 1
 * until a power-on reset or after committed (see p. 577).
 */
int CrFlashDisableWriteProtect(void);

#endif  /* __CHIP_INTERFACE_FLASH_H */