Statistics
| Branch: | Revision:

root / hw / flash.h @ a5fce077

History | View | Annotate | Download (2 kB)

1 87ecb68b pbrook
/* NOR flash devices */
2 c227f099 Anthony Liguori
typedef struct pflash_t pflash_t;
3 87ecb68b pbrook
4 88eeee0a balrog
/* pflash_cfi01.c */
5 c227f099 Anthony Liguori
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 3d08ff69 Blue Swirl
                                uint16_t id2, uint16_t id3, int be);
10 88eeee0a balrog
11 88eeee0a balrog
/* pflash_cfi02.c */
12 c227f099 Anthony Liguori
pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
13 cf6d9118 balrog
                                BlockDriverState *bs, uint32_t sector_len,
14 4fbd24ba balrog
                                int nb_blocs, int nb_mappings, int width,
15 88eeee0a balrog
                                uint16_t id0, uint16_t id1,
16 6725070d balrog
                                uint16_t id2, uint16_t id3,
17 5f9fc5ad Blue Swirl
                                uint16_t unlock_addr0, uint16_t unlock_addr1,
18 5f9fc5ad Blue Swirl
                                int be);
19 87ecb68b pbrook
20 87ecb68b pbrook
/* nand.c */
21 bc24a225 Paul Brook
typedef struct NANDFlashState NANDFlashState;
22 bc24a225 Paul Brook
NANDFlashState *nand_init(int manf_id, int chip_id);
23 bc24a225 Paul Brook
void nand_done(NANDFlashState *s);
24 bc24a225 Paul Brook
void nand_setpins(NANDFlashState *s,
25 87ecb68b pbrook
                int cle, int ale, int ce, int wp, int gnd);
26 bc24a225 Paul Brook
void nand_getpins(NANDFlashState *s, int *rb);
27 bc24a225 Paul Brook
void nand_setio(NANDFlashState *s, uint8_t value);
28 bc24a225 Paul Brook
uint8_t nand_getio(NANDFlashState *s);
29 87ecb68b pbrook
30 87ecb68b pbrook
#define NAND_MFR_TOSHIBA        0x98
31 87ecb68b pbrook
#define NAND_MFR_SAMSUNG        0xec
32 87ecb68b pbrook
#define NAND_MFR_FUJITSU        0x04
33 87ecb68b pbrook
#define NAND_MFR_NATIONAL        0x8f
34 87ecb68b pbrook
#define NAND_MFR_RENESAS        0x07
35 87ecb68b pbrook
#define NAND_MFR_STMICRO        0x20
36 87ecb68b pbrook
#define NAND_MFR_HYNIX                0xad
37 87ecb68b pbrook
#define NAND_MFR_MICRON                0x2c
38 87ecb68b pbrook
39 7e7c5e4c balrog
/* onenand.c */
40 c227f099 Anthony Liguori
void onenand_base_update(void *opaque, target_phys_addr_t new);
41 7e7c5e4c balrog
void onenand_base_unmap(void *opaque);
42 7e7c5e4c balrog
void *onenand_init(uint32_t id, int regshift, qemu_irq irq);
43 c580d92b balrog
void *onenand_raw_otp(void *opaque);
44 7e7c5e4c balrog
45 87ecb68b pbrook
/* ecc.c */
46 bc24a225 Paul Brook
typedef struct {
47 87ecb68b pbrook
    uint8_t cp;                /* Column parity */
48 87ecb68b pbrook
    uint16_t lp[2];        /* Line parity */
49 87ecb68b pbrook
    uint16_t count;
50 bc24a225 Paul Brook
} ECCState;
51 87ecb68b pbrook
52 bc24a225 Paul Brook
uint8_t ecc_digest(ECCState *s, uint8_t sample);
53 bc24a225 Paul Brook
void ecc_reset(ECCState *s);
54 bc24a225 Paul Brook
void ecc_put(QEMUFile *f, ECCState *s);
55 bc24a225 Paul Brook
void ecc_get(QEMUFile *f, ECCState *s);