1 .\" Copyright (c) 2010 Semihalf
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd NAND simulator control program
36 .Aq ctrl_no | Fl -all | Fl a
46 .Aq ctrl_no:cs_no | Fl l Aq loglevel
48 .Op Fl e Aq erase_time
50 .Op Fl E Aq error_ratio
65 .Op blk_num,blk_num2,...
73 .Aq ctrl_no | Fl -all | Fl a
88 .Aq ctrl_no[:cs_no] | Fl -all | Fl a
92 .Sh COMMAND DESCRIPTION
93 Controllers and chips are arranged into a simple hierarchy.
94 There can be up to 4 controllers configured, each with 4 chip select (CS) lines.
95 A given chip is connected to one of the chip selects.
97 Controllers are specified as
99 chip selects are specified as
101 .Bl -tag -width periphlist
103 Gets controller(s) status. If
107 flag is specified - command will print status of every controller
111 causes printing complete information about the controller, and all
112 chips attached to it.
114 Reads simulator configuration from a specified file (this includes
115 the simulation "layout" i.e. controllers-chips assignments).
116 Configuration changes for an already started simulation require a
117 full stop-start cycle in order to take effect i.e.:
120 .It nandsim destroy ...
122 .It << edit config file >>
125 .It nandsim start ...
128 Alters simulator parameters on-the-fly.
129 If controller number and CS pair is not specified, the general
130 simulator parameters (not specific to a controller or a chip) will be modified.
131 Changing chip's parameters requires specifying both controller number and CS
132 to which the given chip is connected.
133 Parameters which can be altered:
135 General simulator related:
137 .It Fl l Aq log_level
138 change logging level to
144 .It Fl p Aq prog_time
145 change prog time for specified chip to
147 .It Fl e Aq erase_time
148 change erase time for specified chip to
150 .It Fl r Aq read_time
151 change read time for specified chip to
153 .It Fl E Aq error_ratio
154 change error ratio for specified chip to
156 Error ratio is a number of errors per million read/write bytes.
161 will list parameters which can be altered.
163 .Bl -tag -width periphlist
165 Marks/unmarks a specified block as bad.
166 To mark/unmark the bad condition an a block, the following parameters
167 have to be supplied: controller number, CS number, and at least one
169 It is possible to specify multiple blocks, by separating blocks numbers
171 The following options can be used for the 'bb' command:
174 unmark the bad previously marked block as bad.
176 list all blocks marked as bad on a given chip.
179 Prints activity log of the specified controller to stdout; if
180 controller number is not specified, logs for all available
181 controllers are printed.
183 Print statistics of the selected controller, chip and page.
184 Statistics includes read count, write count, raw read count, raw
185 write count, ECC stats (succeeded corrections, failed correction).
187 Dumps a snaphot of a single chip (including data and bad blocks
188 information, wearout level) into the file.
190 Restores chip state from a dump-file snapshot (produced previously
191 with the 'dump' command).
193 Starts a controller i.e. the simulation.
195 Stops an already started controller; if the controller number is not
196 supplied, attempts to stop all currently working controllers.
198 Removes existing active chip/controller and its configuration from
199 memory and releases the resources.
204 causes removal of every chip and controller.
205 Controller must be stopped in order to be destroyed.
207 Directly overwrites a certain number of bytes in the specified page
208 at a given offset with a supplied pattern (which mimics the
209 corruption of flash contents).
213 gives more verbose output.
215 Stops simulation of given controller (simulates power-loss).
216 All commands issues to any chip on this controller are ignored.
225 utility first appeared in
228 This utility was written by