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