2
0

flash.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* NOR flash devices */
  2. #include "memory.h"
  3. typedef struct pflash_t pflash_t;
  4. /* pflash_cfi01.c */
  5. pflash_t *pflash_cfi01_register(target_phys_addr_t base,
  6. DeviceState *qdev, const char *name,
  7. target_phys_addr_t size,
  8. BlockDriverState *bs,
  9. uint32_t sector_len, int nb_blocs, int width,
  10. uint16_t id0, uint16_t id1,
  11. uint16_t id2, uint16_t id3, int be);
  12. /* pflash_cfi02.c */
  13. pflash_t *pflash_cfi02_register(target_phys_addr_t base,
  14. DeviceState *qdev, const char *name,
  15. target_phys_addr_t size,
  16. BlockDriverState *bs, uint32_t sector_len,
  17. int nb_blocs, int nb_mappings, int width,
  18. uint16_t id0, uint16_t id1,
  19. uint16_t id2, uint16_t id3,
  20. uint16_t unlock_addr0, uint16_t unlock_addr1,
  21. int be);
  22. MemoryRegion *pflash_cfi01_get_memory(pflash_t *fl);
  23. /* nand.c */
  24. DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id);
  25. void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,
  26. uint8_t ce, uint8_t wp, uint8_t gnd);
  27. void nand_getpins(DeviceState *dev, int *rb);
  28. void nand_setio(DeviceState *dev, uint32_t value);
  29. uint32_t nand_getio(DeviceState *dev);
  30. uint32_t nand_getbuswidth(DeviceState *dev);
  31. #define NAND_MFR_TOSHIBA 0x98
  32. #define NAND_MFR_SAMSUNG 0xec
  33. #define NAND_MFR_FUJITSU 0x04
  34. #define NAND_MFR_NATIONAL 0x8f
  35. #define NAND_MFR_RENESAS 0x07
  36. #define NAND_MFR_STMICRO 0x20
  37. #define NAND_MFR_HYNIX 0xad
  38. #define NAND_MFR_MICRON 0x2c
  39. /* onenand.c */
  40. void *onenand_raw_otp(DeviceState *onenand_device);
  41. /* ecc.c */
  42. typedef struct {
  43. uint8_t cp; /* Column parity */
  44. uint16_t lp[2]; /* Line parity */
  45. uint16_t count;
  46. } ECCState;
  47. uint8_t ecc_digest(ECCState *s, uint8_t sample);
  48. void ecc_reset(ECCState *s);
  49. extern VMStateDescription vmstate_ecc_state;