Statistics
| Branch: | Revision:

root / hw / flash.h @ 92f562ec

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 d4220389 Juha Riihimäki
DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id);
22 d4220389 Juha Riihimäki
void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,
23 51db57f7 Juan Quintela
                  uint8_t ce, uint8_t wp, uint8_t gnd);
24 d4220389 Juha Riihimäki
void nand_getpins(DeviceState *dev, int *rb);
25 d4220389 Juha Riihimäki
void nand_setio(DeviceState *dev, uint32_t value);
26 d4220389 Juha Riihimäki
uint32_t nand_getio(DeviceState *dev);
27 d4220389 Juha Riihimäki
uint32_t nand_getbuswidth(DeviceState *dev);
28 87ecb68b pbrook
29 87ecb68b pbrook
#define NAND_MFR_TOSHIBA        0x98
30 87ecb68b pbrook
#define NAND_MFR_SAMSUNG        0xec
31 87ecb68b pbrook
#define NAND_MFR_FUJITSU        0x04
32 87ecb68b pbrook
#define NAND_MFR_NATIONAL        0x8f
33 87ecb68b pbrook
#define NAND_MFR_RENESAS        0x07
34 87ecb68b pbrook
#define NAND_MFR_STMICRO        0x20
35 87ecb68b pbrook
#define NAND_MFR_HYNIX                0xad
36 87ecb68b pbrook
#define NAND_MFR_MICRON                0x2c
37 87ecb68b pbrook
38 7e7c5e4c balrog
/* onenand.c */
39 c227f099 Anthony Liguori
void onenand_base_update(void *opaque, target_phys_addr_t new);
40 7e7c5e4c balrog
void onenand_base_unmap(void *opaque);
41 5923ba42 Juha Riihimäki
void *onenand_init(BlockDriverState *bdrv,
42 5923ba42 Juha Riihimäki
                uint16_t man_id, uint16_t dev_id, uint16_t ver_id,
43 af5a75f4 Peter Maydell
                int regshift, qemu_irq irq);
44 c580d92b balrog
void *onenand_raw_otp(void *opaque);
45 7e7c5e4c balrog
46 87ecb68b pbrook
/* ecc.c */
47 bc24a225 Paul Brook
typedef struct {
48 87ecb68b pbrook
    uint8_t cp;                /* Column parity */
49 87ecb68b pbrook
    uint16_t lp[2];        /* Line parity */
50 87ecb68b pbrook
    uint16_t count;
51 bc24a225 Paul Brook
} ECCState;
52 87ecb68b pbrook
53 bc24a225 Paul Brook
uint8_t ecc_digest(ECCState *s, uint8_t sample);
54 bc24a225 Paul Brook
void ecc_reset(ECCState *s);
55 34f9f0b5 Dmitry Eremin-Solenikov
extern VMStateDescription vmstate_ecc_state;