2011-08-04 12:55:30 +00:00
|
|
|
#include "memory.h"
|
|
|
|
|
2007-11-17 17:14:51 +00:00
|
|
|
/* NOR flash devices */
|
2009-10-01 21:12:16 +00:00
|
|
|
typedef struct pflash_t pflash_t;
|
2007-11-17 17:14:51 +00:00
|
|
|
|
2007-12-10 00:28:27 +00:00
|
|
|
/* pflash_cfi01.c */
|
2011-08-04 12:55:30 +00:00
|
|
|
extern const MemoryRegionOps pflash_cfi01_ops_be;
|
|
|
|
extern const MemoryRegionOps pflash_cfi01_ops_le;
|
|
|
|
extern const MemoryRegionOps pflash_cfi02_ops_be;
|
|
|
|
extern const MemoryRegionOps pflash_cfi02_ops_le;
|
|
|
|
|
|
|
|
pflash_t *pflash_cfi01_register(target_phys_addr_t base, MemoryRegion *mem,
|
2007-12-10 00:28:27 +00:00
|
|
|
BlockDriverState *bs,
|
|
|
|
uint32_t sector_len, int nb_blocs, int width,
|
|
|
|
uint16_t id0, uint16_t id1,
|
2011-08-04 12:55:30 +00:00
|
|
|
uint16_t id2, uint16_t id3);
|
2007-12-10 00:28:27 +00:00
|
|
|
|
|
|
|
/* pflash_cfi02.c */
|
2011-08-04 12:55:30 +00:00
|
|
|
pflash_t *pflash_cfi02_register(target_phys_addr_t base, MemoryRegion *mem,
|
2007-12-10 01:07:47 +00:00
|
|
|
BlockDriverState *bs, uint32_t sector_len,
|
2008-04-16 23:45:36 +00:00
|
|
|
int nb_blocs, int nb_mappings, int width,
|
2007-12-10 00:28:27 +00:00
|
|
|
uint16_t id0, uint16_t id1,
|
2008-04-16 23:37:15 +00:00
|
|
|
uint16_t id2, uint16_t id3,
|
2011-08-04 12:55:30 +00:00
|
|
|
uint16_t unlock_addr0, uint16_t unlock_addr1);
|
2007-11-17 17:14:51 +00:00
|
|
|
|
|
|
|
/* nand.c */
|
2011-07-29 15:35:24 +00:00
|
|
|
DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id);
|
|
|
|
void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,
|
2010-12-03 00:39:22 +00:00
|
|
|
uint8_t ce, uint8_t wp, uint8_t gnd);
|
2011-07-29 15:35:24 +00:00
|
|
|
void nand_getpins(DeviceState *dev, int *rb);
|
|
|
|
void nand_setio(DeviceState *dev, uint32_t value);
|
|
|
|
uint32_t nand_getio(DeviceState *dev);
|
|
|
|
uint32_t nand_getbuswidth(DeviceState *dev);
|
2007-11-17 17:14:51 +00: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-14 21:57:44 +00:00
|
|
|
/* onenand.c */
|
2009-10-01 21:12:16 +00:00
|
|
|
void onenand_base_update(void *opaque, target_phys_addr_t new);
|
2008-04-14 21:57:44 +00:00
|
|
|
void onenand_base_unmap(void *opaque);
|
2011-07-29 15:35:26 +00:00
|
|
|
void *onenand_init(BlockDriverState *bdrv,
|
|
|
|
uint16_t man_id, uint16_t dev_id, uint16_t ver_id,
|
2011-07-29 15:35:25 +00:00
|
|
|
int regshift, qemu_irq irq);
|
2008-07-29 14:19:16 +00:00
|
|
|
void *onenand_raw_otp(void *opaque);
|
2008-04-14 21:57:44 +00:00
|
|
|
|
2007-11-17 17:14:51 +00:00
|
|
|
/* ecc.c */
|
2009-05-10 00:44:56 +00:00
|
|
|
typedef struct {
|
2007-11-17 17:14:51 +00:00
|
|
|
uint8_t cp; /* Column parity */
|
|
|
|
uint16_t lp[2]; /* Line parity */
|
|
|
|
uint16_t count;
|
2009-05-10 00:44:56 +00:00
|
|
|
} ECCState;
|
2007-11-17 17:14:51 +00:00
|
|
|
|
2009-05-10 00:44:56 +00:00
|
|
|
uint8_t ecc_digest(ECCState *s, uint8_t sample);
|
|
|
|
void ecc_reset(ECCState *s);
|
2011-01-21 10:12:11 +00:00
|
|
|
extern VMStateDescription vmstate_ecc_state;
|