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 devices swiss army knife
40 utility can be used to perform various operations on
42 devices (read, write, erase,
43 read and write OOB area and to get info about NAND flash chip).
45 The following commands are available:
46 .Bl -tag -width ".Cm of Ns = Ns Ar file"
48 Read pages from NAND device.
50 Write pages to NAND device.
53 Requires offset aligned to block granularity.
55 Get information about NAND chip (page size, block size, OOB area size, chip size
58 Read OOB area from specified page.
60 Write OOB area bound to specified page.
65 The following operands are available for
69 .Bl -tag -width ".Cm of Ns = Ns Ar file"
70 .It Cm dev Ns = Ns Ar <path>
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
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
85 .It Cm count Ns = Ns Ar <n>
86 Count of objects (pages, blocks, bytes).
89 The following operands are available for
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.
102 The following operands are available for
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>
120 The following operands are available for
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>
133 The following operands are available for
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).
151 WARNING: The only required parameter for the \fBerase\fP command is
153 When no other arguments are provided the whole device is erased!
155 There is only one operand available for
159 .Bl -tag -width ".Cm of Ns = Ns Ar file"
160 .It Cm dev Ns = Ns Ar <path>
161 Path to NAND device node.
164 There is only one operand available for
168 .Bl -tag -width ".Cm of Ns = Ns Ar file"
169 .It Cm topic Ns = Ns Ar <name>
174 If the supplied argument
176 points to a device node other than gnand<num> or gnand.raw<num> both