From owner-svn-src-head@FreeBSD.ORG Mon Apr 4 22:30:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00FE4106564A; Mon, 4 Apr 2011 22:30:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E274A8FC16; Mon, 4 Apr 2011 22:30:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p34MUC8A097493; Mon, 4 Apr 2011 22:30:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34MUCeG097490; Mon, 4 Apr 2011 22:30:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104042230.p34MUCeG097490@svn.freebsd.org> From: Adrian Chadd Date: Mon, 4 Apr 2011 22:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220346 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2011 22:30:13 -0000 Author: adrian Date: Mon Apr 4 22:30:12 2011 New Revision: 220346 URL: http://svn.freebsd.org/changeset/base/220346 Log: Add a manpage for the nvram2env driver. Added: head/share/man/man4/nvram2env.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 4 20:45:39 2011 (r220345) +++ head/share/man/man4/Makefile Mon Apr 4 22:30:12 2011 (r220346) @@ -317,6 +317,7 @@ MAN= aac.4 \ null.4 \ ${_nve.4} \ ${_nvram.4} \ + ${_nvram2env.4} \ ${_nxge.4} \ ohci.4 \ orm.4 \ @@ -710,6 +711,9 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "powerpc" _atp.4= atp.4 .endif +.if ${MACHINE_CPUARCH} == "mips" +_nvram2env.4= nvram2env.4 +.endif .if exists(${.CURDIR}/man4.${MACHINE_CPUARCH}) SUBDIR= man4.${MACHINE_CPUARCH} Added: head/share/man/man4/nvram2env.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/nvram2env.4 Mon Apr 4 22:30:12 2011 (r220346) @@ -0,0 +1,119 @@ +.\" Copyright (c) 2011 Aleksandr Rybalko +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 3, 2011 +.Dt nvram2env 4 +.Os +.Sh NAME +.Nm nvram2env +.Nd "copy nvram-like data into kernel environment" +.Sh SYNOPSIS +.Cd "device nvram2env" +.Sh DESCRIPTION +.Nm +implements a simple method of reading the NVRAM-like data and information +stored in flash and storing it in the kernel environment. It can then be +used by various device drivers at boot-time. +.Pp +The NVRAM-like data is an array of zero terminated strings. Each string contains +the string name, "=" delimiter and the string value. +.Pp +.Nm +copies the environment values into kernel environment using the kernel setenv call. +.Pp +Configuration of +.Nm +is done in +.Xr device.hints 5 +defining the NVRAM base address, fallback base address, maxsize and flags. +.Pp +.Nm +is currently MIPS-specific. +.Ss base +base - physical address where data block is stored. +.Ss fallbackbase +fallbackbase - physical address where data block is stored, but only +if not found at base. +.Ss maxsize +maxsize - maximum size of data block. +.Ss flags +flags - control flags, used to select nvram type and enable/disable CRC check. +.Bl -tag -width indent +.It Fa 0x0001 +Avoid CRC checking. Currently CRC checking is not implemented, so to be future +compatible, please set it to "1". +.It Fa 0x0002 +Use format "Generic", skip uint32_t field, then zero terminating array of +strings. +.It Fa 0x0004 +Use Broadcom CFE format. uint32_t signature "FLSH", uint32_t size, +three unused fields uint32_t, then data. +.It Fa 0x0008 +Use U-Boot format, uint32_t crc, then zero terminating array of strings. +.El +.Sh EXAMPLES +Usage in U-Boot case: +.Bd -literal -offset indent +hint.nvram.0.base=0x1f030000 +hint.nvram.0.maxsize=0x2000 +hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +hint.nvram.1.base=0x1f032000 +hint.nvram.1.maxsize=0x4000 +hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic +.Ed +.Pp +CFE nvram with fallback: +.Bd -literal -offset indent +hint.nvram.0.base=0x1fff8000 +hint.nvram.0.fallbackbase=0x1fc00400 +hint.nvram.0.flags=4 # 4 = Format Broadcom +.Ed +.Pp +but seems for CFE nvram preferred to read both blocks: +.Pp +NVRAM partition: Static, CFE internal +.Bd -literal -offset indent +hint.nvram.0.flags=0x05 # Broadcom + nocheck +hint.nvram.0.base=0x1fc00400 +.Ed +.Pp +Dynamic, editable form CFE, override values from first +.Pp +.Bd -literal -offset indent +hint.nvram.1.flags=0x05 # Broadcom + nocheck +hint.nvram.1.base=0x1cff8000 +.Ed +.Sh SEE ALSO +.Xr kenv 1 , +.Xr kenv 2 . +.Sh HISTORY +.Nm +first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +.Nm +.An Aleksandr Rybalko Aq ray@ddteam.net .