root / hw / flash.h @ c3203fa5
History | View | Annotate | Download (2.1 kB)
1 | cb9c377f | Paolo Bonzini | #ifndef HW_FLASH_H
|
---|---|---|---|
2 | cb9c377f | Paolo Bonzini | #define HW_FLASH_H 1 |
3 | cb9c377f | Paolo Bonzini | |
4 | 87ecb68b | pbrook | /* NOR flash devices */
|
5 | cfe5f011 | Avi Kivity | |
6 | 022c62cb | Paolo Bonzini | #include "exec/memory.h" |
7 | cfe5f011 | Avi Kivity | |
8 | c227f099 | Anthony Liguori | typedef struct pflash_t pflash_t; |
9 | 87ecb68b | pbrook | |
10 | 88eeee0a | balrog | /* pflash_cfi01.c */
|
11 | a8170e5e | Avi Kivity | pflash_t *pflash_cfi01_register(hwaddr base, |
12 | cfe5f011 | Avi Kivity | DeviceState *qdev, const char *name, |
13 | a8170e5e | Avi Kivity | hwaddr size, |
14 | 88eeee0a | balrog | BlockDriverState *bs, |
15 | 88eeee0a | balrog | uint32_t sector_len, int nb_blocs, int width, |
16 | 88eeee0a | balrog | uint16_t id0, uint16_t id1, |
17 | 01e0451a | Anthony Liguori | uint16_t id2, uint16_t id3, int be);
|
18 | 88eeee0a | balrog | |
19 | 88eeee0a | balrog | /* pflash_cfi02.c */
|
20 | a8170e5e | Avi Kivity | pflash_t *pflash_cfi02_register(hwaddr base, |
21 | cfe5f011 | Avi Kivity | DeviceState *qdev, const char *name, |
22 | a8170e5e | Avi Kivity | hwaddr size, |
23 | cf6d9118 | balrog | BlockDriverState *bs, uint32_t sector_len, |
24 | 4fbd24ba | balrog | int nb_blocs, int nb_mappings, int width, |
25 | 88eeee0a | balrog | uint16_t id0, uint16_t id1, |
26 | 6725070d | balrog | uint16_t id2, uint16_t id3, |
27 | 01e0451a | Anthony Liguori | uint16_t unlock_addr0, uint16_t unlock_addr1, |
28 | 01e0451a | Anthony Liguori | int be);
|
29 | 87ecb68b | pbrook | |
30 | cfe5f011 | Avi Kivity | MemoryRegion *pflash_cfi01_get_memory(pflash_t *fl); |
31 | cfe5f011 | Avi Kivity | |
32 | 87ecb68b | pbrook | /* nand.c */
|
33 | d4220389 | Juha Riihimäki | DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id); |
34 | d4220389 | Juha Riihimäki | void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,
|
35 | 51db57f7 | Juan Quintela | uint8_t ce, uint8_t wp, uint8_t gnd); |
36 | d4220389 | Juha Riihimäki | void nand_getpins(DeviceState *dev, int *rb); |
37 | d4220389 | Juha Riihimäki | void nand_setio(DeviceState *dev, uint32_t value);
|
38 | d4220389 | Juha Riihimäki | uint32_t nand_getio(DeviceState *dev); |
39 | d4220389 | Juha Riihimäki | uint32_t nand_getbuswidth(DeviceState *dev); |
40 | 87ecb68b | pbrook | |
41 | 87ecb68b | pbrook | #define NAND_MFR_TOSHIBA 0x98 |
42 | 87ecb68b | pbrook | #define NAND_MFR_SAMSUNG 0xec |
43 | 87ecb68b | pbrook | #define NAND_MFR_FUJITSU 0x04 |
44 | 87ecb68b | pbrook | #define NAND_MFR_NATIONAL 0x8f |
45 | 87ecb68b | pbrook | #define NAND_MFR_RENESAS 0x07 |
46 | 87ecb68b | pbrook | #define NAND_MFR_STMICRO 0x20 |
47 | 87ecb68b | pbrook | #define NAND_MFR_HYNIX 0xad |
48 | 87ecb68b | pbrook | #define NAND_MFR_MICRON 0x2c |
49 | 87ecb68b | pbrook | |
50 | 7e7c5e4c | balrog | /* onenand.c */
|
51 | 500954e3 | Juha Riihimäki | void *onenand_raw_otp(DeviceState *onenand_device);
|
52 | 7e7c5e4c | balrog | |
53 | 87ecb68b | pbrook | /* ecc.c */
|
54 | bc24a225 | Paul Brook | typedef struct { |
55 | 87ecb68b | pbrook | uint8_t cp; /* Column parity */
|
56 | 87ecb68b | pbrook | uint16_t lp[2]; /* Line parity */ |
57 | 87ecb68b | pbrook | uint16_t count; |
58 | bc24a225 | Paul Brook | } ECCState; |
59 | 87ecb68b | pbrook | |
60 | bc24a225 | Paul Brook | uint8_t ecc_digest(ECCState *s, uint8_t sample); |
61 | bc24a225 | Paul Brook | void ecc_reset(ECCState *s);
|
62 | 34f9f0b5 | Dmitry Eremin-Solenikov | extern VMStateDescription vmstate_ecc_state;
|
63 | cb9c377f | Paolo Bonzini | |
64 | cb9c377f | Paolo Bonzini | #endif |