1.\" $OpenBSD: eeprom.8,v 1.21 2016/09/01 13:39:50 jmc Exp $ 2.\" $NetBSD: eeprom.8,v 1.2 1996/02/28 01:13:24 thorpej Exp $ 3.\" 4.\" Copyright (c) 1996 The NetBSD Foundation, Inc. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to The NetBSD Foundation 8.\" by Jason R. Thorpe. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE 23.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd $Mdocdate: September 1 2016 $ 32.Dt EEPROM 8 33.Os 34.Sh NAME 35.Nm eeprom 36.Nd display or modify contents of the EEPROM or OpenPROM 37.Sh SYNOPSIS 38.Nm eeprom 39.Op Fl cipv 40.Op Fl f Ar device 41.Op Fl N Ar system 42.Oo 43.Ar field Ns Op = Ns Ar value 44.Ar ... 45.Oc 46.Sh DESCRIPTION 47.Nm eeprom 48provides an interface for displaying and changing the contents of the 49EEPROM or OpenPROM. 50Without any arguments, 51.Nm eeprom 52will list all of the known fields and their corresponding values. 53When given the name of a specific field, 54.Nm eeprom 55will display that value or set it if the field name is followed by 56.Sq = 57and a value. 58Only the superuser may modify the contents of the EEPROM or OpenPROM. 59.Pp 60The options are as follows: 61.Bl -tag -width Ds 62.It Fl 63Commands are taken from stdin and displayed on stdout. 64.It Fl c 65.Nm eeprom 66will fix incorrect checksum values and exit. 67This flag is quietly ignored on systems with an OpenPROM. 68.It Fl f Ar device 69On systems with an EEPROM, use 70.Ar device 71instead of the default 72.Pa /dev/eeprom . 73On systems with an OpenPROM, use 74.Ar device 75instead of the default 76.Pa /dev/openprom . 77.It Fl i 78If checksum values are incorrect, 79.Nm eeprom 80will ignore them and continue after displaying a warning. 81This flag is quietly ignored on systems with an OpenPROM. 82.It Fl N Ar system 83Use the system image 84.Ar system 85instead of the default 86.Pa /bsd . 87.It Fl p 88On systems with an OpenPROM, display the tree derived from it and exit. 89This flag is quietly ignored on systems with an EEPROM. 90.It Fl v 91On systems with an OpenPROM, be verbose when setting a value. 92Systems with an EEPROM are always verbose. 93.El 94.Sh FIELDS AND VALUES 95The following fields and values are for systems with an EEPROM: 96.Bl -tag -width "watchdog_reboot " 97.It Ar hwupdate 98A valid date, such as 99.Dq 7/12/95 . 100The strings 101.Dq today 102and 103.Dq now 104are also acceptable. 105.It Ar memsize 106How much memory, in megabytes, is installed in the system. 107.It Ar memtest 108How much memory, in megabytes, is to be tested upon power-up. 109.It Ar scrsize 110The size of the screen. 111Acceptable values are 112.Dq 1024x1024 , 113.Dq 1152x900 , 114.Dq 1600x1280 , 115and 116.Dq 1440x1440 . 117.It Ar watchdog_reboot 118If true, the system will reboot upon reset. 119Otherwise, the system will fall into the monitor. 120.It Ar default_boot 121If true, the system will use the boot device stored in 122.Ar bootdev . 123.It Ar bootdev 124Specifies the default boot device in the form cc(x,x,x), where 125.Dq cc 126is a combination of two letters such as 127.Dq sd 128or 129.Dq le 130and each 131.Dq x 132is a hexadecimal number between 0 and ff, less the prepending 133.Dq 0x . 134.It Ar kbdtype 135This value is 136.Dq 0 137for all Sun keyboards. 138.It Ar console 139Specifies the console type. 140Valid values are 141.Dq b&w , 142.Dq ttya , 143.Dq ttyb , 144.Dq color , 145and 146.Dq p4opt . 147.It Ar keyclick 148If true, the keys click annoyingly. 149.It Ar diagdev 150This is a string very similar to that used by 151.Ar bootdev . 152It specifies the default boot device when the diagnostic switch is 153turned on. 154.It Ar diagpath 155A 40-character, NULL-terminated string specifying the kernel or stand-alone 156program to load when the diagnostic switch is turned on. 157.It Ar columns 158An 8-bit integer specifying the number of columns on the console. 159.It Ar rows 160An 8-bit integer specifying the number of rows on the console. 161.It Ar ttya_use_baud 162Use the baud rate stored in 163.Ar ttya_baud 164instead of the default 9600. 165.It Ar ttya_baud 166A 16-bit integer specifying the baud rate to use on ttya. 167.It Ar ttya_no_rtsdtr 168If true, disables RTS/DTR. 169.It Ar ttyb_use_baud 170Similar to 171.Ar ttya_use_baud , 172but for ttyb. 173.It Ar ttyb_baud 174Similar to 175.Ar ttya_baud , 176but for ttyb. 177.It Ar ttyb_no_rtsdtr 178Similar to 179.Ar ttya_no_rtsdtr , 180but for ttyb. 181.It Ar banner 182An 80-character, NULL-terminated string to use at power-up instead 183of the default Sun banner. 184.El 185.Pp 186Note that the 187.Ar secure , 188.Ar bad_login , 189and 190.Ar password 191fields are not currently supported. 192.Pp 193Since the OpenPROM is designed such that the field names are arbitrary, 194explaining them here is dubious. 195Below are field names and values that 196one is likely to see on a system with an OpenPROM. 197NOTE: this list 198may be incomplete or incorrect due to differences between revisions 199of the OpenPROM. 200.Bl -tag -width "last-hardware-update " 201.It Ar sunmon-compat? 202If true, the old EEPROM-style interface will be used while in the monitor, 203rather than the OpenPROM-style interface. 204.It Ar selftest-#megs 205A 32-bit integer specifying the number of megabytes of memory to 206test upon power-up. 207.It Ar oem-logo 208A 64bitx64bit bitmap in Sun Iconedit format. 209To set the bitmap, give the pathname of the file containing the image. 210NOTE: this property is not yet supported. 211.It Ar oem-logo? 212If true, enables the use of the bitmap stored in 213.Ar oem-logo 214rather than the default Sun logo. 215.It Ar oem-banner 216A string to use at power-up, rather than the default Sun banner. 217.It Ar oem-banner? 218If true, enables the use of the banner stored in 219.Ar oem-banner 220rather than the default Sun banner. 221.It Ar ttya-mode 222A string of five comma separated fields in the format 223.Dq 9600,8,n,1,- . 224The first field is the baud rate. 225The second field is the number of data bits. 226The third field is the parity; acceptable values for parity are 227.Dq n 228(none), 229.Dq e 230(even), 231.Dq o 232(odd), 233.Dq m 234(mark), and 235.Dq s 236(space). 237The fourth field is the number of stop bits. 238The fifth field is the 239.Dq handshake 240field; acceptable values are 241.Dq - 242(none), 243.Dq h 244(RTS/CTS), and 245.Dq s 246(XON/XOFF). 247.It Ar ttya-rts-dtr-off 248If true, the system will ignore RTS/DTR. 249.It Ar ttya-ignore-cd 250If true, the system will ignore carrier detect. 251.It Ar ttyb-mode 252Similar to 253.Ar ttya-mode , 254but for ttyb. 255.It Ar ttyb-rts-dtr-off 256Similar to 257.Ar ttya-rts-dtr-off , 258but for ttyb. 259.It Ar ttyb-ignore-cd 260Similar to 261.Ar ttya-ignore-cd , 262but for ttyb. 263.It Ar sbus-probe-list 264Four digits in the format 265.Dq 0123 266specifying which order to probe the SBus at power-up. 267It is unlikely that this value should ever be changed. 268.It Ar screen-#columns 269An 8-bit integer specifying the number of columns on the console. 270.It Ar screen-#rows 271An 8-bit integer specifying the number of rows on the console. 272.It Ar auto-boot? 273If true, the system will boot automatically at power-up. 274.It Ar watchdog-reboot? 275If true, the system will reboot upon reset. 276Otherwise, the system will fall into the monitor. 277.It Ar input-device 278One of the strings 279.Dq keyboard , 280.Dq ttya , 281or 282.Dq ttyb 283specifying the default console input device. 284.It Ar output-device 285One of the strings 286.Dq screen , 287.Dq ttya , 288or 289.Dq ttyb 290specifying the default console output device. 291.It Ar keyboard-click? 292If true, the keys click annoyingly. 293.It Ar sd-targets 294A string in the format 295.Dq 31204567 296describing the translation of physical to logical target. 297.It Ar st-targets 298Similar to 299.Ar sd-targets , 300but for tapes. 301The default translation is 302.Dq 45670123 . 303.It Ar scsi-initiator-id 304The SCSI ID of the on-board SCSI controller. 305.It Ar hardware-revision 306A 7-character string describing a date, such as 307.Dq 25May95 . 308.It Ar last-hardware-update 309Similar to 310.Ar hardware-revision , 311describing when the CPU was last updated. 312.It Ar diag-switch? 313If true, the system will boot and run in diagnostic mode. 314.It Ar local-mac-address? 315When set to 316.Em false , 317all Ethernet devices will use the same system default MAC address. 318When 319.Em true , 320Ethernet devices which have a unique MAC address will use it 321rather than the system default MAC address. 322This option only really affects FCode-based Ethernet devices. 323On Sparc64, all on-board devices, 324as well as plug-in 325.Xr hme 4 326boards, will respect this setting; 327other hardware will not. 328.El 329.Sh FILES 330.Bl -tag -width "/dev/openprom" -compact 331.It /dev/eeprom 332the EEPROM device on systems with an EEPROM 333.It /dev/openprom 334the OpenPROM device on systems with an OpenPROM 335.El 336.Sh SEE ALSO 337.Xr openprom 4 338.Sh CAVEATS 339The fields and their values are not necessarily well defined on 340systems with an OpenPROM. 341Your mileage may vary. 342.Pp 343There are a few fields known to exist in some revisions of the EEPROM 344and/or OpenPROM that are not yet supported. 345Most notable are those 346relating to password protection of the EEPROM or OpenPROM. 347.Pp 348Avoid gratuitously changing the contents of the EEPROM. 349It has a limited number of write cycles. 350.Pp 351The date parser isn't very intelligent. 352