]> git.proxmox.com Git - mirror_qemu.git/blame - hw/flash.h
Save/load PCI-device, PCI-bus and PIIX3 irq-related state (patches by Uri Lublin.
[mirror_qemu.git] / hw / flash.h
CommitLineData
87ecb68b
PB
1/* NOR flash devices */
2typedef struct pflash_t pflash_t;
3
4pflash_t *pflash_register (target_phys_addr_t base, ram_addr_t off,
5 BlockDriverState *bs,
6 uint32_t sector_len, int nb_blocs, int width,
7 uint16_t id0, uint16_t id1,
8 uint16_t id2, uint16_t id3);
9
10/* nand.c */
11struct nand_flash_s;
12struct nand_flash_s *nand_init(int manf_id, int chip_id);
13void nand_done(struct nand_flash_s *s);
14void nand_setpins(struct nand_flash_s *s,
15 int cle, int ale, int ce, int wp, int gnd);
16void nand_getpins(struct nand_flash_s *s, int *rb);
17void nand_setio(struct nand_flash_s *s, uint8_t value);
18uint8_t nand_getio(struct nand_flash_s *s);
19
20#define NAND_MFR_TOSHIBA 0x98
21#define NAND_MFR_SAMSUNG 0xec
22#define NAND_MFR_FUJITSU 0x04
23#define NAND_MFR_NATIONAL 0x8f
24#define NAND_MFR_RENESAS 0x07
25#define NAND_MFR_STMICRO 0x20
26#define NAND_MFR_HYNIX 0xad
27#define NAND_MFR_MICRON 0x2c
28
29/* ecc.c */
30struct ecc_state_s {
31 uint8_t cp; /* Column parity */
32 uint16_t lp[2]; /* Line parity */
33 uint16_t count;
34};
35
36uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);
37void ecc_reset(struct ecc_state_s *s);
38void ecc_put(QEMUFile *f, struct ecc_state_s *s);
39void ecc_get(QEMUFile *f, struct ecc_state_s *s);
40