7#define SFCX_CONFIG 0x00
8#define SFCX_STATUS 0x04
9#define SFCX_COMMAND 0x08
10#define SFCX_ADDRESS 0x0C
12#define SFCX_LOGICAL 0x14
13#define SFCX_PHYSICAL 0x18
14#define SFCX_DPHYSADDR 0x1C
15#define SFCX_MPHYSADDR 0x20
16#define SFCX_PHISON 0xFC
19#define PAGE_BUF_TO_REG 0x00
20#define REG_TO_PAGE_BUF 0x01
21#define LOG_PAGE_TO_BUF 0x02
22#define PHY_PAGE_TO_BUF 0x03
23#define WRITE_PAGE_TO_PHY 0x04
24#define BLOCK_ERASE 0x05
25#define DMA_LOG_TO_RAM 0x06
26#define DMA_PHY_TO_RAM 0x07
27#define DMA_RAM_TO_PHY 0x08
28#define UNLOCK_CMD_0 0x55
29#define UNLOCK_CMD_1 0xAA
32#define CONFIG_DBG_MUX_SEL 0x7C000000u
33#define CONFIG_DIS_EXT_ER 0x2000000u
34#define CONFIG_CSR_DLY 0x1FE0000u
35#define CONFIG_ULT_DLY 0x1F800u
36#define CONFIG_BYPASS 0x400u
37#define CONFIG_DMA_LEN 0x3C0u
38#define CONFIG_FLSH_SIZE 0x30u
39#define CONFIG_WP_EN 0x8u
40#define CONFIG_INT_EN 0x4u
41#define CONFIG_ECC_DIS 0x2u
42#define CONFIG_SW_RST 0x1u
45#define STATUS_ILL_LOG 0x800u
46#define STATUS_PIN_WP_N 0x400u
47#define STATUS_PIN_BY_N 0x200u
48#define STATUS_INT_CP 0x100u
49#define STATUS_ADDR_ER 0x80u
50#define STATUS_BB_ER 0x40u
51#define STATUS_RNP_ER 0x20u
52#define STATUS_ECC_ER 0x1Cu
53#define STATUS_WR_ER 0x2u
54#define STATUS_BUSY 0x1u
55#define STATUS_ERROR (STATUS_ILL_LOG|STATUS_ADDR_ER|STATUS_BB_ER|STATUS_RNP_ER|STATUS_ECC_ER|STATUS_WR_ER)
58#define PAGE_VALID 0x4000000u
59#define PAGE_PID 0x3FFFE00u
63#define MAX_PAGE_SZ 0x210
64#define MAX_BLOCK_SZ 0x42000
66#define META_TYPE_0 0x00
67#define META_TYPE_1 0x01
68#define META_TYPE_2 0x02
70#define CONFIG_BLOCKS 0x04
76#define RAW_NAND_64 0x4200000
78#define SFCX_INITIALIZED 1
83#define SFCX_SUCCESS(status) ((status&STATUS_ERROR)==0)
unsigned long sfcx_readreg(int addr)
int sfcx_is_pageerased(unsigned char *data)
int sfcx_read_page(unsigned char *data, int address, int raw)
void sfcx_set_pagevalid(unsigned char *data)
int sfcx_write_page(unsigned char *data, int address)
void sfcx_set_pageinvalid(unsigned char *data)
int sfcx_rawaddress_to_block(int address)
int sfcx_block_to_rawaddress(int block)
int sfcx_get_blocknumber(unsigned char *data)
int sfcx_address_to_block(int address)
int sfcx_get_blockversion(unsigned char *data)
void sfcx_set_blockversion(unsigned char *data, int ver)
int sfcx_read_block(unsigned char *data, int address, int raw)
int rawflash_writeImage(int len, int f)
int sfcx_is_pagezeroed(unsigned char *data)
void sfcx_calcecc(unsigned int *data)
int sfcx_read_metadata_type(void)
int try_rawflash_internal(char *filename, bool ignoreMetadataCheck)
void sfcx_writereg(int addr, unsigned long data)
int sfcx_is_pagevalid(unsigned char *data)
int try_rawflash(char *filename)
unsigned int sfcx_init(void)
int sfcx_erase_block(int address)
int sfcx_block_to_address(int block)
int sfcx_write_block(unsigned char *data, int address)
void sfcx_set_blocknumber(unsigned char *data, int num)