1 .\" Copyright (c) 2011 Aleksandr Rybalko
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 "copy nvram-like data into kernel environment"
34 .Cd "device nvram2env"
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.
41 The NVRAM-like data is an array of zero terminated strings. Each string contains
42 the string name, "=" delimiter and the string value.
45 copies the environment values into kernel environment using the kernel setenv call.
51 defining the NVRAM base address, fallback base address, maxsize and flags.
54 is currently MIPS-specific.
56 base - physical address where data block is stored.
58 fallbackbase - physical address where data block is stored, but only
61 maxsize - maximum size of data block.
63 flags - control flags, used to select nvram type and enable/disable CRC check.
64 .Bl -tag -width indent
66 Avoid CRC checking. Currently CRC checking is not implemented, so to be future
67 compatible, please set it to "1".
69 Use format "Generic", skip uint32_t field, then zero terminating array of
72 Use Broadcom CFE format. uint32_t signature "FLSH", uint32_t size,
73 three unused fields uint32_t, then data.
75 Use U-Boot format, uint32_t crc, then zero terminating array of strings.
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
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
95 but seems for CFE nvram preferred to read both blocks:
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
103 Dynamic, editable form CFE, override values from first
104 .Bd -literal -offset indent
105 hint.nvram.1.flags=0x05 # Broadcom + nocheck
106 hint.nvram.1.base=0x1cff8000
118 .An Aleksandr Rybalko Aq ray@ddteam.net .