]> sigrok.org Git - libsigrokdecode.git/blame - decoders/spiflash/lists.py
spiflash: Major refactoring and annotation improvements.
[libsigrokdecode.git] / decoders / spiflash / lists.py
CommitLineData
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
17## along with this program; if not, write to the Free Software
18## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19##
20
1be94d3d
UH
21from collections import OrderedDict
22
23# OrderedDict which maps command IDs to their names and descriptions.
24# Please keep this sorted by command ID.
25# Don't forget to update 'Ann' in pd.py if you add/remove items here.
26cmds = OrderedDict([
27 (0x01, ('WRSR', 'Write status register')),
28 (0x02, ('PP', 'Page program')),
29 (0x03, ('READ', 'Read data')),
30 (0x04, ('WRDI', 'Write disable')),
31 (0x05, ('RDSR', 'Read status register')),
32 (0x06, ('WREN', 'Write enable')),
33 (0x0b, ('FAST/READ', 'Fast read data')),
34 (0x20, ('SE', 'Sector erase')),
35 (0x2b, ('RDSCUR', 'Read security register')),
36 (0x2f, ('WRSCUR', 'Write security register')),
37 (0x35, ('RDSR2', 'Read status register 2')),
38 (0x60, ('CE', 'Chip erase')),
39 (0x70, ('ESRY', 'Enable SO to output RY/BY#')),
40 (0x80, ('DSRY', 'Disable SO to output RY/BY#')),
41 (0x90, ('REMS', 'Read electronic manufacturer & device ID')),
42 (0x9f, ('RDID', 'Read identification')),
43 (0xab, ('RDP/RES', 'Release from deep powerdown / Read electronic ID')),
44 (0xad, ('CP', 'Continuously program mode')),
45 (0xb1, ('ENSO', 'Enter secured OTP')),
46 (0xb9, ('DP', 'Deep power down')),
de22de7f 47 (0xbb, ('2READ', '2x I/O read')), # a.k.a. "Fast read dual I/O".
1be94d3d
UH
48 (0xc1, ('EXSO', 'Exit secured OTP')),
49 (0xc7, ('CE2', 'Chip erase')), # Alternative command ID
50 (0xd8, ('BE', 'Block erase')),
51 (0xef, ('REMS2', 'Read ID for 2x I/O mode')),
52])
c2446117
UH
53
54device_name = {
03ec43f0
UH
55 'fidelix': {
56 0x15: 'FM25Q32',
57 },
db188228
UH
58 'macronix': {
59 0x14: 'MX25L1605D',
60 0x15: 'MX25L3205D',
61 0x16: 'MX25L6405D',
62 },
c2446117
UH
63}
64
65chips = {
03ec43f0
UH
66 # FIDELIX
67 'fidelix_fm25q32': {
68 'vendor': 'FIDELIX',
69 'model': 'FM25Q32',
70 'res_id': 0x15,
71 'rems_id': 0xa115,
72 'rems2_id': 0xa115,
73 'rdid_id': 0xa14016,
74 'page_size': 256,
75 'sector_size': 4 * 1024,
76 'block_size': 64 * 1024,
77 },
c2446117
UH
78 # Macronix
79 'macronix_mx25l1605d': {
80 'vendor': 'Macronix',
81 'model': 'MX25L1605D',
82 'res_id': 0x14,
83 'rems_id': 0xc214,
84 'rems2_id': 0xc214,
85 'rdid_id': 0xc22015,
86 'page_size': 256,
87 'sector_size': 4 * 1024,
88 'block_size': 64 * 1024,
89 },
90 'macronix_mx25l3205d': {
91 'vendor': 'Macronix',
92 'model': 'MX25L3205D',
93 'res_id': 0x15,
94 'rems_id': 0xc215,
95 'rems2_id': 0xc215,
96 'rdid_id': 0xc22016,
97 'page_size': 256,
98 'sector_size': 4 * 1024,
99 'block_size': 64 * 1024,
100 },
101 'macronix_mx25l6405d': {
102 'vendor': 'Macronix',
103 'model': 'MX25L6405D',
104 'res_id': 0x16,
105 'rems_id': 0xc216,
106 'rems2_id': 0xc216,
107 'rdid_id': 0xc22017,
108 'page_size': 256,
109 'sector_size': 4 * 1024,
110 'block_size': 64 * 1024,
111 },
112}