xref: /NextBSD/usr.sbin/nandtool/usage.h (revision eb1a5f8de9f7ea602c373a710f531abbf81141c4)
1 /*-
2  * Copyright (c) 2010-2012 Semihalf.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28 
29 #ifndef	__USAGE_H
30 #define	__USAGE_H
31 
32 static const char nand_help_usage[] =
33 	"Usage: %s help topic=<cmd>\n"
34 	"\n"
35 	"Arguments:\n"
36 	"\tcmd\t- [help|read|write|erase|readoob|writeoob|info]\n"
37 	"\n";
38 
39 static const char nand_read_usage[] =
40 	"Usage: %s read dev=<gnand_device> (block|page|pos)=n [count=n]\n"
41 	"\n"
42 	"Arguments:\n"
43 	"\tdev\t- path to gnand device node\n"
44 	"\tblock\t- starting block or\n"
45 	"\tpage\t- starting page or\n"
46 	"\tpos\t- starting position (in bytes, must be page-aligned)\n"
47 	"\tout\t- output file (hexdump to stdout if not supplied)\n"
48 	"\n"
49 	"Note that you can only specify only one of: 'block', 'page', 'pos'\n"
50 	"parameters at once. 'count' parameter is meaningful in terms of used\n"
51 	"unit (page, block or byte).\n";
52 
53 static const char nand_write_usage[] =
54 	"Usage: %s write dev=<gnand_device> in=<file> (block|page|pos)=n [count=n]\n"
55 	"\n"
56 	"Arguments:\n"
57 	"\tdev\t- path to gnand device node\n"
58 	"\tin\t- path to input file which be writed to gnand\n"
59 	"\tblock\t- starting block or\n"
60 	"\tpage\t- starting page or\n"
61 	"\tpos\t- starting position (in bytes, must be page-aligned)\n"
62 	"\tcount\t- byte/page/block count\n"
63 	"\n"
64 	"";
65 
66 static const char nand_erase_usage[] =
67 	"Usage: %s erase dev=<gnand_device> (block|page|pos)=n [count=n]\n"
68 	"\n"
69 	"Arguments:\n"
70 	"\tdev\t- path to gnand device node\n"
71 	"\tblock\t- starting block or\n"
72 	"\tpage\t- starting page or\n"
73 	"\tpos\t- starting position (in bytes, muse be block-aligned)\n"
74 	"\tcount\t- byte/page/block count\n"
75 	"\n"
76 	"NOTE: position and count for erase operation MUST be block-aligned\n";
77 
78 static const char nand_read_oob_usage[] =
79 	"Usage: %s readoob dev=<gnand_device> page=n [out=file] [count=n]\n"
80 	"\n"
81 	"Arguments:\n"
82 	"\tdev\t- path to gnand device node\n"
83 	"\tpage\t- page (page) number\n"
84 	"\tout\t- outut file (hexdump to stdout if not supplied)\n"
85 	"\tcount\t- page count (default is 1)\n"
86 	"\n"
87 	"If you supply count parameter with value other than 1, data will be\n"
88 	"read from subsequent page's OOB areas\n";
89 
90 static const char nand_write_oob_usage[] =
91 	"Usage: %s writeoob dev=<gnand_device> in=<file> page=n [count=n]\n"
92 	"\n"
93 	"\tdev\t- path to gnand device node\n"
94 	"\tin\t- path to file containing data which will be written\n"
95 	"\tpage\t- page (page) number\n"
96 	"\n"
97 	"If you supply count parameter with value other than 1, data will be\n"
98 	"written to subsequent page's OOB areas\n";
99 
100 static const char nand_info_usage[] =
101 	"Usage: %s info dev=<gnand_device>\n"
102 	"\n"
103 	"Arguments:\n"
104 	"\tdev\t- path to gnand device node\n";
105 
106 static const char nand_stats_usage[] =
107 	"Usage: %s stats dev=<gnand_device> (page|block)=<n>\n"
108 	"\n"
109 	"Arguments:\n"
110 	"\tdev\t- path to gnand device node\n";
111 
112 #endif	/* __USAGE_H */
113