]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man4/nvram2env.4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man4 / nvram2env.4
1 .\" Copyright (c) 2011 Aleksandr Rybalko
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 3, 2011
28 .Dt NVRAM2ENV 4
29 .Os
30 .Sh NAME
31 .Nm nvram2env
32 .Nd "copy nvram-like data into kernel environment"
33 .Sh SYNOPSIS
34 .Cd "device     nvram2env"
35 .Sh DESCRIPTION
36 .Nm
37 implements a simple method of reading the NVRAM-like data and information
38 stored in flash and storing it in the kernel environment.  It can then be
39 used by various device drivers at boot-time.
40 .Pp
41 The NVRAM-like data is an array of zero terminated strings.  Each string contains
42 the string name, "=" delimiter and the string value.
43 .Pp
44 .Nm
45 copies the environment values into kernel environment using the kernel setenv call.
46 .Pp
47 Configuration of
48 .Nm
49 is done in
50 .Xr device.hints 5
51 defining the NVRAM base address, fallback base address, maxsize and flags.
52 .Pp
53 .Nm
54 is currently MIPS-specific.
55 .Ss base
56 base - physical address where data block is stored.
57 .Ss fallbackbase
58 fallbackbase - physical address where data block is stored, but only
59 if not found at base.
60 .Ss maxsize
61 maxsize - maximum size of data block.
62 .Ss flags
63 flags - control flags, used to select nvram type and enable/disable CRC check.
64 .Bl -tag -width indent
65 .It Fa 0x0001
66 Avoid CRC checking. Currently CRC checking is not implemented, so to be future
67 compatible, please set it to "1".
68 .It Fa 0x0002
69 Use format "Generic", skip uint32_t field, then zero terminating array of
70 strings.
71 .It Fa 0x0004
72 Use Broadcom CFE format. uint32_t signature "FLSH", uint32_t size,
73 three unused fields uint32_t, then data.
74 .It Fa 0x0008
75 Use U-Boot format, uint32_t crc, then zero terminating array of strings.
76 .El
77 .Sh EXAMPLES
78 Usage in U-Boot case:
79 .Bd -literal -offset indent
80 hint.nvram.0.base=0x1f030000
81 hint.nvram.0.maxsize=0x2000
82 hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic
83 hint.nvram.1.base=0x1f032000
84 hint.nvram.1.maxsize=0x4000
85 hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic
86 .Ed
87 .Pp
88 CFE nvram with fallback:
89 .Bd -literal -offset indent
90 hint.nvram.0.base=0x1fff8000
91 hint.nvram.0.fallbackbase=0x1fc00400
92 hint.nvram.0.flags=4 # 4 = Format Broadcom
93 .Ed
94 .Pp
95 but seems for CFE nvram preferred to read both blocks:
96 .Pp
97 NVRAM partition: Static, CFE internal
98 .Bd -literal -offset indent
99 hint.nvram.0.flags=0x05 # Broadcom + nocheck
100 hint.nvram.0.base=0x1fc00400
101 .Ed
102 .Pp
103 Dynamic, editable form CFE, override values from first
104 .Pp
105 .Bd -literal -offset indent
106 hint.nvram.1.flags=0x05 # Broadcom + nocheck
107 hint.nvram.1.base=0x1cff8000
108 .Ed
109 .Sh SEE ALSO
110 .Xr kenv 1 ,
111 .Xr kenv 2 .
112 .Sh HISTORY
113 .Nm
114 first appeared in
115 .Fx 9.0 .
116 .Sh AUTHORS
117 .An -nosplit
118 .Nm
119 .An Aleksandr Rybalko Aq ray@ddteam.net .