2007-11-17 20:14:51 +03:00
|
|
|
/* NOR flash devices */
|
2009-10-02 01:12:16 +04:00
|
|
|
typedef struct pflash_t pflash_t;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2007-12-10 03:28:27 +03:00
|
|
|
/* pflash_cfi01.c */
|
2009-10-02 01:12:16 +04:00
|
|
|
pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
|
2007-12-10 03:28:27 +03:00
|
|
|
BlockDriverState *bs,
|
|
|
|
uint32_t sector_len, int nb_blocs, int width,
|
|
|
|
uint16_t id0, uint16_t id1,
|
2010-03-29 23:23:56 +04:00
|
|
|
uint16_t id2, uint16_t id3, int be);
|
2007-12-10 03:28:27 +03:00
|
|
|
|
|
|
|
/* pflash_cfi02.c */
|
2009-10-02 01:12:16 +04:00
|
|
|
pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
|
2007-12-10 04:07:47 +03:00
|
|
|
BlockDriverState *bs, uint32_t sector_len,
|
2008-04-17 03:45:36 +04:00
|
|
|
int nb_blocs, int nb_mappings, int width,
|
2007-12-10 03:28:27 +03:00
|
|
|
uint16_t id0, uint16_t id1,
|
2008-04-17 03:37:15 +04:00
|
|
|
uint16_t id2, uint16_t id3,
|
2010-03-29 23:23:55 +04:00
|
|
|
uint16_t unlock_addr0, uint16_t unlock_addr1,
|
|
|
|
int be);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* nand.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct NANDFlashState NANDFlashState;
|
|
|
|
NANDFlashState *nand_init(int manf_id, int chip_id);
|
|
|
|
void nand_done(NANDFlashState *s);
|
|
|
|
void nand_setpins(NANDFlashState *s,
|
2007-11-17 20:14:51 +03:00
|
|
|
int cle, int ale, int ce, int wp, int gnd);
|
2009-05-10 04:44:56 +04:00
|
|
|
void nand_getpins(NANDFlashState *s, int *rb);
|
|
|
|
void nand_setio(NANDFlashState *s, uint8_t value);
|
|
|
|
uint8_t nand_getio(NANDFlashState *s);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
#define NAND_MFR_TOSHIBA 0x98
|
|
|
|
#define NAND_MFR_SAMSUNG 0xec
|
|
|
|
#define NAND_MFR_FUJITSU 0x04
|
|
|
|
#define NAND_MFR_NATIONAL 0x8f
|
|
|
|
#define NAND_MFR_RENESAS 0x07
|
|
|
|
#define NAND_MFR_STMICRO 0x20
|
|
|
|
#define NAND_MFR_HYNIX 0xad
|
|
|
|
#define NAND_MFR_MICRON 0x2c
|
|
|
|
|
2008-04-15 01:57:44 +04:00
|
|
|
/* onenand.c */
|
2009-10-02 01:12:16 +04:00
|
|
|
void onenand_base_update(void *opaque, target_phys_addr_t new);
|
2008-04-15 01:57:44 +04:00
|
|
|
void onenand_base_unmap(void *opaque);
|
|
|
|
void *onenand_init(uint32_t id, int regshift, qemu_irq irq);
|
2008-07-29 18:19:16 +04:00
|
|
|
void *onenand_raw_otp(void *opaque);
|
2008-04-15 01:57:44 +04:00
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* ecc.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct {
|
2007-11-17 20:14:51 +03:00
|
|
|
uint8_t cp; /* Column parity */
|
|
|
|
uint16_t lp[2]; /* Line parity */
|
|
|
|
uint16_t count;
|
2009-05-10 04:44:56 +04:00
|
|
|
} ECCState;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2009-05-10 04:44:56 +04:00
|
|
|
uint8_t ecc_digest(ECCState *s, uint8_t sample);
|
|
|
|
void ecc_reset(ECCState *s);
|
|
|
|
void ecc_put(QEMUFile *f, ECCState *s);
|
|
|
|
void ecc_get(QEMUFile *f, ECCState *s);
|