]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.sbin/nandsim/nandsim.8
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / usr.sbin / nandsim / nandsim.8
1 .\" Copyright (c) 2010 Semihalf
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd August 10, 2010
28 .Dt NANDSIM 8
29 .Os
30 .Sh NAME
31 .Nm nandsim
32 .Nd NAND simulator control program
33 .Sh SYNOPSIS
34 .Nm
35 .Ic status
36 .Aq ctrl_no | Fl -all  | Fl a
37 .Op Fl v
38 .Nm
39 .Ic conf
40 .Aq filename
41 .Nm
42 .Ic start
43 .Aq ctrl_no
44 .Nm
45 .Ic mod
46 .Aq ctrl_no:cs_no | Fl l Aq loglevel
47 .Op Fl p Aq prog_time
48 .Op Fl e Aq erase_time
49 .Op Fl r Aq read_time
50 .Op Fl E Aq error_ratio
51 .Op Fl h
52 .Nm
53 .Ic stop
54 .Aq ctrl_no
55 .Nm
56 .Ic error
57 .Aq ctrl_no:cs_no
58 .Aq page_num
59 .Aq column
60 .Aq length
61 .Aq pattern
62 .Nm
63 .Ic bb
64 .Aq ctrl_no:cs_no
65 .Op blk_num,blk_num2,...
66 .Op Fl U
67 .Op Fl L
68 .Nm
69 .Ic freeze
70 .Op ctrl_no
71 .Nm
72 .Ic log
73 .Aq ctrl_no | Fl -all  | Fl a
74 .Nm
75 .Ic stats
76 .Aq ctrl_no:cs_no
77 .Aq page_num
78 .Nm
79 .Ic dump
80 .Aq ctrl_no:cs_no
81 .Aq filename
82 .Nm
83 .Ic restore
84 .Aq ctrl_no:chip_no
85 .Aq filename
86 .Nm
87 .Ic destroy
88 .Aq ctrl_no[:cs_no] | Fl -all | Fl a
89 .Nm
90 .Ic help
91 .Op Fl v
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.
96 .Pp
97 Controllers are specified as
98 .Aq ctrl_no ;
99 chip selects are specified as
100 .Aq cs_no .
101 .Bl -tag -width periphlist
102 .It Ic status
103 Gets controller(s) status. If
104 .Fl a
105 or
106 .Fl -all
107 flag is specified - command will print status of every controller
108 currently available.
109 Optional flag
110 .Fl v
111 causes printing complete information about the controller, and all
112 chips attached to it.
113 .It Ic conf
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.:
118 .Bl -column
119 .It nandsim stop ...
120 .It nandsim destroy ...
121 .Pp
122 .It << edit config file >>
123 .Pp
124 .It nandsim conf ...
125 .It nandsim start ...
126 .El
127 .It Ic mod
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:
134 .Pp
135 General simulator related:
136 .Bl -tag -width flag
137 .It Fl l Aq log_level
138 change logging level to
139 .Aq log_level
140 .El
141 .Pp
142 Chip related:
143 .Bl -tag -width flag
144 .It Fl p Aq prog_time
145 change prog time for specified chip to
146 .Aq prog_time
147 .It Fl e Aq erase_time
148 change erase time for specified chip to
149 .Aq erase_time
150 .It Fl r Aq read_time
151 change read time for specified chip to
152 .Aq read_time
153 .It Fl E Aq error_ratio
154 change error ratio for specified chip to
155 .Aq error_ratio .
156 Error ratio is a number of errors per million read/write bytes.
157 .El
158 .Pp
159 Additionally, flag
160 .Fl h
161 will list parameters which can be altered.
162 .El
163 .Bl -tag -width periphlist
164 .It Ic bb
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
168 block number.
169 It is possible to specify multiple blocks, by separating blocks numbers
170 with a comma.
171 The following options can be used for the 'bb' command:
172 .Bl -tag -width flag
173 .It Fl U
174 unmark the bad previously marked block as bad.
175 .It Fl L
176 list all blocks marked as bad on a given chip.
177 .El
178 .It Ic log
179 Prints activity log of the specified controller to stdout; if
180 controller number is not specifed, logs for all available
181 controllers are printed.
182 .It Ic stats
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).
186 .It Ic dump
187 Dumps a snaphot of a single chip (including data and bad blocks
188 information, wearout level) into the file.
189 .It Ic restore
190 Restores chip state from a dump-file snapshot (produced previously
191 with the 'dump' command).
192 .It Ic start
193 Starts a controller i.e. the simulation.
194 .It Ic stop
195 Stops an already started controller; if the controller number is not
196 supplied, attempts to stop all currently working controllers.
197 .It Ic destroy
198 Removes existing active chip/controller and its configuration from
199 memory and releases the resources.
200 Specifying flag
201 .Fl a
202 or
203 .Fl -all
204 causes removal of every chip and controller.
205 Controller must be stopped in order to be destroyed.
206 .It Ic error
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).
210 .It Ic help
211 Prints synopsis,
212 .Fl v
213 gives more verbose output.
214 .It Ic freeze
215 Stops simulation of given controller (simulates power-loss).
216 All commands issues to any chip on this controller are ignored.
217 .El
218 .Sh SEE ALSO
219 .Xr nand 4 ,
220 .Xr nandsim 4
221 .Xr nandsim.conf 5
222 .Sh HISTORY
223 The
224 .Nm
225 utility first appeared in
226 .Fx 10.0 .
227 .Sh AUTHOR
228 This utility was written by
229 .An Lukasz Wojcik .