Statistics
| Branch: | Revision:

root / hw / flash.h @ 968c74da

History | View | Annotate | Download (1.7 kB)

1 87ecb68b pbrook
/* NOR flash devices */
2 87ecb68b pbrook
typedef struct pflash_t pflash_t;
3 87ecb68b pbrook
4 88eeee0a balrog
/* pflash_cfi01.c */
5 88eeee0a balrog
pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
6 88eeee0a balrog
                                BlockDriverState *bs,
7 88eeee0a balrog
                                uint32_t sector_len, int nb_blocs, int width,
8 88eeee0a balrog
                                uint16_t id0, uint16_t id1,
9 88eeee0a balrog
                                uint16_t id2, uint16_t id3);
10 88eeee0a balrog
11 88eeee0a balrog
/* pflash_cfi02.c */
12 88eeee0a balrog
pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
13 cf6d9118 balrog
                                BlockDriverState *bs, uint32_t sector_len,
14 2e8c1917 balrog
                                int nb_blocs, int width,
15 88eeee0a balrog
                                uint16_t id0, uint16_t id1,
16 88eeee0a balrog
                                uint16_t id2, uint16_t id3);
17 87ecb68b pbrook
18 87ecb68b pbrook
/* nand.c */
19 87ecb68b pbrook
struct nand_flash_s;
20 87ecb68b pbrook
struct nand_flash_s *nand_init(int manf_id, int chip_id);
21 87ecb68b pbrook
void nand_done(struct nand_flash_s *s);
22 87ecb68b pbrook
void nand_setpins(struct nand_flash_s *s,
23 87ecb68b pbrook
                int cle, int ale, int ce, int wp, int gnd);
24 87ecb68b pbrook
void nand_getpins(struct nand_flash_s *s, int *rb);
25 87ecb68b pbrook
void nand_setio(struct nand_flash_s *s, uint8_t value);
26 87ecb68b pbrook
uint8_t nand_getio(struct nand_flash_s *s);
27 87ecb68b pbrook
28 87ecb68b pbrook
#define NAND_MFR_TOSHIBA        0x98
29 87ecb68b pbrook
#define NAND_MFR_SAMSUNG        0xec
30 87ecb68b pbrook
#define NAND_MFR_FUJITSU        0x04
31 87ecb68b pbrook
#define NAND_MFR_NATIONAL        0x8f
32 87ecb68b pbrook
#define NAND_MFR_RENESAS        0x07
33 87ecb68b pbrook
#define NAND_MFR_STMICRO        0x20
34 87ecb68b pbrook
#define NAND_MFR_HYNIX                0xad
35 87ecb68b pbrook
#define NAND_MFR_MICRON                0x2c
36 87ecb68b pbrook
37 87ecb68b pbrook
/* ecc.c */
38 87ecb68b pbrook
struct ecc_state_s {
39 87ecb68b pbrook
    uint8_t cp;                /* Column parity */
40 87ecb68b pbrook
    uint16_t lp[2];        /* Line parity */
41 87ecb68b pbrook
    uint16_t count;
42 87ecb68b pbrook
};
43 87ecb68b pbrook
44 87ecb68b pbrook
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);
45 87ecb68b pbrook
void ecc_reset(struct ecc_state_s *s);
46 87ecb68b pbrook
void ecc_put(QEMUFile *f, struct ecc_state_s *s);
47 87ecb68b pbrook
void ecc_get(QEMUFile *f, struct ecc_state_s *s);