summaryrefslogtreecommitdiff
path: root/cleopatre/tools/openocd-r668/src/flash/spc300.h
blob: 23039d8c0c24e03cafa271e9419ff11580d9a705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef SPC300_H
#define SPC300_H

//SPI Chip Select
#define SPI_CS          0

//SPI Mode
#define	SPI_CPHA        0x01    // clock phase
#define	SPI_CPOL        0x02    // clock polarity
#define	SPI_CS_HIGH     0x04    // chipselect active high
#define	SPI_LSB_FIRST   0x08    // per-word bits-on-wire
#define	SPI_3WIRE       0x10    // SI/SO signals shared

typedef struct spi_flash_archi_s {
    char *name;

    // JEDEC id zero means "no ID" (most older chips); otherwise it has
    // a high byte of zero plus three data bytes: the manufacturer id,
    // then a two byte device id.
    u32 jedec_id;

    // The size listed here is what works with OPCODE_SE, which isn't
    // necessarily called a "sector" by the vendor.
    unsigned sector_size;
    u16 n_sectors;
} spi_flash_archi_t;

static spi_flash_archi_t allowed_flashs[] = {

    // Atmel --
    { "at25fs010",  0x1f6601, 32 * 1024, 4, },
    { "at25fs040",  0x1f6604, 64 * 1024, 8, },

    { "at25df041a", 0x1f4401, 64 * 1024, 8, },

    { "at26f004",   0x1f0400, 64 * 1024, 8, },
    { "at26df081a", 0x1f4501, 64 * 1024, 16, },
    { "at26df161a", 0x1f4601, 64 * 1024, 32, },
    { "at26df321",  0x1f4700, 64 * 1024, 64, },

    // Eon --
    { "en25q64",  0x1c3017,  64 * 1024, 128, },

    // Macronix --
    { "mx25l3205d", 0xc22016, 64 * 1024, 64, },

    // Spansion --
    { "s25sl004a", 0x010212, 64 * 1024, 8, },
    { "s25sl008a", 0x010213, 64 * 1024, 16, },
    { "s25sl016a", 0x010214, 64 * 1024, 32, },
    { "s25sl032a", 0x010215, 64 * 1024, 64, },
    { "s25sl064a", 0x010216, 64 * 1024, 128, },

    // SST --
    { "sst25vf040b", 0xbf258d, 64 * 1024, 8, },
    { "sst25vf080b", 0xbf258e, 64 * 1024, 16, },
    { "sst25vf016b", 0xbf2541, 64 * 1024, 32, },
    { "sst25vf032b", 0xbf254a, 64 * 1024, 64, },

    // ST Microelectronics --
    { "m25p05",  0x202010,  32 * 1024, 2, },
    { "m25p10",  0x202011,  32 * 1024, 4, },
    { "m25p20",  0x202012,  64 * 1024, 4, },
    { "m25p40",  0x202013,  64 * 1024, 8, },
    { "m25p80",         0,  64 * 1024, 16, },
    { "m25p16",  0x202015,  64 * 1024, 32, },
    { "m25p32",  0x202016,  64 * 1024, 64, },
    { "m25p64",  0x202017,  64 * 1024, 128, },
    { "m25p128", 0x202018, 256 * 1024, 64, },

    { "m45pe80", 0x204014,  64 * 1024, 16, },
    { "m45pe16", 0x204015,  64 * 1024, 32, },

    { "m25pe80", 0x208014,  64 * 1024, 16, },
    { "m25pe16", 0x208015,  64 * 1024, 32, },

    // Winbond --
    { "w25x10", 0xef3011, 64 * 1024, 2, },
    { "w25x20", 0xef3012, 64 * 1024, 4, },
    { "w25x40", 0xef3013, 64 * 1024, 8, },
    { "w25x80", 0xef3014, 64 * 1024, 16, },
    { "w25x16", 0xef3015, 64 * 1024, 32, },
    { "w25x32", 0xef3016, 64 * 1024, 64, },
    { "w25x64", 0xef3017, 64 * 1024, 128, },
};

#endif /* SPC300_H */