]>
Commit | Line | Data |
---|---|---|
c2446117 UH |
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 | |
4539e9ca | 17 | ## along with this program; if not, see <http://www.gnu.org/licenses/>. |
c2446117 UH |
18 | ## |
19 | ||
1be94d3d UH |
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#')), | |
8a73c6c7 AA |
40 | (0x82, ('WRITE1', 'Main memory page program through buffer 1 with built-in erase')), |
41 | (0x85, ('WRITE2', 'Main memory page program through buffer 2 with built-in erase')), | |
1be94d3d UH |
42 | (0x90, ('REMS', 'Read electronic manufacturer & device ID')), |
43 | (0x9f, ('RDID', 'Read identification')), | |
44 | (0xab, ('RDP/RES', 'Release from deep powerdown / Read electronic ID')), | |
45 | (0xad, ('CP', 'Continuously program mode')), | |
46 | (0xb1, ('ENSO', 'Enter secured OTP')), | |
47 | (0xb9, ('DP', 'Deep power down')), | |
de22de7f | 48 | (0xbb, ('2READ', '2x I/O read')), # a.k.a. "Fast read dual I/O". |
1be94d3d UH |
49 | (0xc1, ('EXSO', 'Exit secured OTP')), |
50 | (0xc7, ('CE2', 'Chip erase')), # Alternative command ID | |
8a73c6c7 | 51 | (0xd7, ('STATUS', 'Status register read')), |
1be94d3d UH |
52 | (0xd8, ('BE', 'Block erase')), |
53 | (0xef, ('REMS2', 'Read ID for 2x I/O mode')), | |
54 | ]) | |
c2446117 UH |
55 | |
56 | device_name = { | |
d62d7452 UH |
57 | 'adesto': { |
58 | 0x00: 'AT45Dxxx family, standard series', | |
59 | }, | |
03ec43f0 UH |
60 | 'fidelix': { |
61 | 0x15: 'FM25Q32', | |
62 | }, | |
db188228 UH |
63 | 'macronix': { |
64 | 0x14: 'MX25L1605D', | |
65 | 0x15: 'MX25L3205D', | |
66 | 0x16: 'MX25L6405D', | |
67 | }, | |
c2446117 UH |
68 | } |
69 | ||
70 | chips = { | |
d62d7452 UH |
71 | # Adesto |
72 | 'adesto_at45db161e': { | |
73 | 'vendor': 'Adesto', | |
74 | 'model': 'AT45DB161E', | |
75 | 'res_id': 0xff, # The chip doesn't emit an ID here. | |
76 | 'rems_id': 0xffff, # Not supported by the chip. | |
77 | 'rems2_id': 0xffff, # Not supported by the chip. | |
78 | 'rdid_id': 0x1f26000100, # RDID and 2 extra "EDI" bytes. | |
79 | 'page_size': 528, # Configurable, could also be 512 bytes. | |
80 | 'sector_size': 128 * 1024, | |
81 | 'block_size': 4 * 1024, | |
82 | }, | |
03ec43f0 UH |
83 | # FIDELIX |
84 | 'fidelix_fm25q32': { | |
85 | 'vendor': 'FIDELIX', | |
86 | 'model': 'FM25Q32', | |
87 | 'res_id': 0x15, | |
88 | 'rems_id': 0xa115, | |
89 | 'rems2_id': 0xa115, | |
90 | 'rdid_id': 0xa14016, | |
91 | 'page_size': 256, | |
92 | 'sector_size': 4 * 1024, | |
93 | 'block_size': 64 * 1024, | |
94 | }, | |
c2446117 UH |
95 | # Macronix |
96 | 'macronix_mx25l1605d': { | |
97 | 'vendor': 'Macronix', | |
98 | 'model': 'MX25L1605D', | |
99 | 'res_id': 0x14, | |
100 | 'rems_id': 0xc214, | |
101 | 'rems2_id': 0xc214, | |
102 | 'rdid_id': 0xc22015, | |
103 | 'page_size': 256, | |
104 | 'sector_size': 4 * 1024, | |
105 | 'block_size': 64 * 1024, | |
106 | }, | |
107 | 'macronix_mx25l3205d': { | |
108 | 'vendor': 'Macronix', | |
109 | 'model': 'MX25L3205D', | |
110 | 'res_id': 0x15, | |
111 | 'rems_id': 0xc215, | |
112 | 'rems2_id': 0xc215, | |
113 | 'rdid_id': 0xc22016, | |
114 | 'page_size': 256, | |
115 | 'sector_size': 4 * 1024, | |
116 | 'block_size': 64 * 1024, | |
117 | }, | |
118 | 'macronix_mx25l6405d': { | |
119 | 'vendor': 'Macronix', | |
120 | 'model': 'MX25L6405D', | |
121 | 'res_id': 0x16, | |
122 | 'rems_id': 0xc216, | |
123 | 'rems2_id': 0xc216, | |
124 | 'rdid_id': 0xc22017, | |
125 | 'page_size': 256, | |
126 | 'sector_size': 4 * 1024, | |
127 | 'block_size': 64 * 1024, | |
128 | }, | |
129 | } |