]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.sbin/nandtool/nandtool.8
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.sbin / nandtool / nandtool.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 April 10, 2012
28 .Dt NANDTOOL 8
29 .Os
30 .Sh NAME
31 .Nm nandtool
32 .Nd NAND devices swiss army knife
33 .Sh SYNOPSIS
34 .Nm
35 .Ar command
36 .Op Ar operands ...
37 .Sh DESCRIPTION
38 The
39 .Nm
40 utility can be used to perform various operations on
41 .Xr gnand 4
42 devices (read, write, erase,
43 read and write OOB area and to get info about NAND flash chip).
44 .Pp
45 The following commands are available:
46 .Bl -tag -width ".Cm of Ns = Ns Ar file"
47 .It Cm read Ns
48 Read pages from NAND device.
49 .It Cm write Ns
50 Write pages to NAND device.
51 .It Cm erase Ns
52 Erase blocks.
53 Requires offset aligned to block granularity.
54 .It Cm info Ns
55 Get information about NAND chip (page size, block size, OOB area size, chip size
56 and media size)
57 .It Cm readoob Ns
58 Read OOB area from specified page.
59 .It Cm writeoob Ns
60 Write OOB area bound to specified page.
61 .It Cm help Ns
62 Get usage info.
63 .El
64 .Sh COMMAND read
65 The following operands are available for
66 .Nm
67 .Cm read
68 command:
69 .Bl -tag -width ".Cm of Ns = Ns Ar file"
70 .It Cm dev Ns = Ns Ar <path>
71 Path to a
72 .Xr gnand 4
73 device node, required for all operations.
74 .It Cm out Ns = Ns Ar <file>
75 Output file path. If not specified, page contents
76 will be dumped to stdout in format similar to
77 .Xr hexdump 1
78 .It Cm page Ns = Ns Ar <n>
79 Offset on device, expressed as page number.
80 .It Cm block Ns = Ns Ar <n>
81 Offset on device, expressed as block number.
82 .It Cm pos Ns = Ns Ar <n>
83 Offset on device, expressed in bytes (however, must be aligned
84 to page granularity).
85 .It Cm count Ns = Ns Ar <n>
86 Count of objects (pages, blocks, bytes).
87 .El
88 .Sh COMMAND readoob
89 The following operands are available for
90 .Nm
91 .Cm readoob
92 command:
93 .Bl -tag -width ".Cm of Ns = Ns Ar file"
94 .It Cm dev Ns = Ns Ar <path>
95 Path to NAND device node.
96 .It Cm page Ns = Ns Ar <n>
97 Offset on device, expressed as page number.
98 .It Cm out Ns = Ns Ar <file>
99 Output file path, optional.
100 .El
101 .Sh COMMAND write
102 The following operands are available for
103 .Nm
104 .Cm write
105 command:
106 .Bl -tag -width ".Cm of Ns = Ns Ar file"
107 .It Cm dev Ns = Ns Ar <path>
108 Path to NAND device node.
109 .It Cm page Ns = Ns Ar <n>
110 Offset on device, expressed as page number.
111 .It Cm block Ns = Ns Ar <n>
112 Offset on device, expressed as block number.
113 .It Cm pos Ns = Ns Ar <n>
114 Offset on device, expressed in bytes (however, must be aligned
115 to page granularity).
116 .It Cm in Ns = Ns Ar <file>
117 Input file path.
118 .El
119 .Sh COMMAND writeoob
120 The following operands are available for
121 .Nm
122 .Cm writeoob
123 command:
124 .Bl -tag -width ".Cm of Ns = Ns Ar file"
125 .It Cm dev Ns = Ns Ar <path>
126 Path to NAND device node.
127 .It Cm page Ns = Ns Ar <n>
128 Offset on device, expressed as page number.
129 .It Cm in Ns = Ns Ar <file>
130 Input file path.
131 .El
132 .Sh COMMAND erase
133 The following operands are available for
134 .Nm
135 .Cm erase
136 command:
137 .Bl -tag -width ".Cm of Ns = Ns Ar file"
138 .It Cm dev Ns = Ns Ar <path>
139 Path to NAND device node.
140 .It Cm page Ns = Ns Ar <n>
141 Offset on device, expressed as page number.
142 .It Cm block Ns = Ns Ar <n>
143 Offset on device, expressed as block number.
144 .It Cm pos Ns = Ns Ar <n>
145 Offset on device, epressed in bytes (however, must be aligned
146 to block granularity).
147 .It Cm count Ns = Ns Ar <n>
148 Count of objects (pages, blocks, bytes).
149 .El
150 .Pp
151 WARNING: The only required parameter for the \fBerase\fP command is
152 .Ar dev .
153 When no other arguments are provided the whole device is erased!
154 .Sh COMMAND info
155 There is only one operand available for
156 .Nm
157 .Cm info
158 command:
159 .Bl -tag -width ".Cm of Ns = Ns Ar file"
160 .It Cm dev Ns = Ns Ar <path>
161 Path to NAND device node.
162 .El
163 .Sh COMMAND help
164 There is only one operand available for
165 .Nm
166 .Cm help
167 command:
168 .Bl -tag -width ".Cm of Ns = Ns Ar file"
169 .It Cm topic Ns = Ns Ar <name>
170 Help topic.
171 .El
172 .Sh EXIT STATUS
173 .Ex -std
174 If the supplied argument
175 .Ar dev
176 points to a device node other than gnand<num> or gnand.raw<num> both
177 .Nm
178 .Cm readoob
179 and
180 .Nm
181 .Cm writeoob
182 return error.
183 .Sh SEE ALSO
184 .Xr gnand 4