]> sigrok.org Git - libsigrokdecode.git/blob - decoders/spiflash/lists.py
license: remove FSF postal address from boiler plate license text
[libsigrokdecode.git] / decoders / spiflash / lists.py
1 ##
2 ## This file is part of the libsigrokdecode project.
3 ##
4 ## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de>
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
18 ##
19
20 from collections import OrderedDict
21
22 # OrderedDict which maps command IDs to their names and descriptions.
23 # Please keep this sorted by command ID.
24 # Don't forget to update 'Ann' in pd.py if you add/remove items here.
25 cmds = OrderedDict([
26     (0x01, ('WRSR', 'Write status register')),
27     (0x02, ('PP', 'Page program')),
28     (0x03, ('READ', 'Read data')),
29     (0x04, ('WRDI', 'Write disable')),
30     (0x05, ('RDSR', 'Read status register')),
31     (0x06, ('WREN', 'Write enable')),
32     (0x0b, ('FAST/READ', 'Fast read data')),
33     (0x20, ('SE', 'Sector erase')),
34     (0x2b, ('RDSCUR', 'Read security register')),
35     (0x2f, ('WRSCUR', 'Write security register')),
36     (0x35, ('RDSR2', 'Read status register 2')),
37     (0x60, ('CE', 'Chip erase')),
38     (0x70, ('ESRY', 'Enable SO to output RY/BY#')),
39     (0x80, ('DSRY', 'Disable SO to output RY/BY#')),
40     (0x90, ('REMS', 'Read electronic manufacturer & device ID')),
41     (0x9f, ('RDID', 'Read identification')),
42     (0xab, ('RDP/RES', 'Release from deep powerdown / Read electronic ID')),
43     (0xad, ('CP', 'Continuously program mode')),
44     (0xb1, ('ENSO', 'Enter secured OTP')),
45     (0xb9, ('DP', 'Deep power down')),
46     (0xbb, ('2READ', '2x I/O read')), # a.k.a. "Fast read dual I/O".
47     (0xc1, ('EXSO', 'Exit secured OTP')),
48     (0xc7, ('CE2', 'Chip erase')), # Alternative command ID
49     (0xd8, ('BE', 'Block erase')),
50     (0xef, ('REMS2', 'Read ID for 2x I/O mode')),
51 ])
52
53 device_name = {
54     'fidelix': {
55         0x15: 'FM25Q32',
56     },
57     'macronix': {
58         0x14: 'MX25L1605D',
59         0x15: 'MX25L3205D',
60         0x16: 'MX25L6405D',
61     },
62 }
63
64 chips = {
65     # FIDELIX
66     'fidelix_fm25q32': {
67         'vendor': 'FIDELIX',
68         'model': 'FM25Q32',
69         'res_id': 0x15,
70         'rems_id': 0xa115,
71         'rems2_id': 0xa115,
72         'rdid_id': 0xa14016,
73         'page_size': 256,
74         'sector_size': 4 * 1024,
75         'block_size': 64 * 1024,
76     },
77     # Macronix
78     'macronix_mx25l1605d': {
79         'vendor': 'Macronix',
80         'model': 'MX25L1605D',
81         'res_id': 0x14,
82         'rems_id': 0xc214,
83         'rems2_id': 0xc214,
84         'rdid_id': 0xc22015,
85         'page_size': 256,
86         'sector_size': 4 * 1024,
87         'block_size': 64 * 1024,
88     },
89     'macronix_mx25l3205d': {
90         'vendor': 'Macronix',
91         'model': 'MX25L3205D',
92         'res_id': 0x15,
93         'rems_id': 0xc215,
94         'rems2_id': 0xc215,
95         'rdid_id': 0xc22016,
96         'page_size': 256,
97         'sector_size': 4 * 1024,
98         'block_size': 64 * 1024,
99     },
100     'macronix_mx25l6405d': {
101         'vendor': 'Macronix',
102         'model': 'MX25L6405D',
103         'res_id': 0x16,
104         'rems_id': 0xc216,
105         'rems2_id': 0xc216,
106         'rdid_id': 0xc22017,
107         'page_size': 256,
108         'sector_size': 4 * 1024,
109         'block_size': 64 * 1024,
110     },
111 }