1 /* $NetBSD: properties.c,v 1.3 2001/02/21 13:09:18 minoura Exp $ */
4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
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.
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 FOUNDATION OR CONTRIBUTORS
23 * BE 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.
33 #include <sys/types.h>
35 #include "memswitch.h"
40 * XXX: gcc extension is used.
42 struct property properties
[] = {
45 0, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:MAGIC1
},
48 fill_ulong
, flush_ulong
,
49 " Magic. Must be 0x82773638\n"
53 4, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:MAGIC2
},
56 fill_ulong
, flush_ulong
,
57 " Magic. Must be 0x30303057\n"
61 30, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0},
62 parse_ulong
, 0, 0xff0000,
64 fill_ulong
, flush_ulong
,
65 " What to do on RTC alarm boot.\n"
69 34, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0xffff0000},
70 parse_ulong
, 0, 0xffffffff,
72 fill_ulong
, flush_ulong
,
77 38, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
80 fill_uchar
, flush_uchar
,
81 " 0 to enable alarm, 7 to disable.\n"
84 "alarm", "timetodown",
85 20, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:-1},
86 parse_time
, -1, 0x7fffffff,
88 fill_ulong
, flush_ulong
,
89 " When boot on alarm, time to shutdown is stored in second.\n"
90 " Can be specified in minite with suffix minute.\n"
94 24, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] -1}},
97 fill_ushort
, flush_ushort
,
99 " STD for standard, HDn for the nth harddisk, FDn for the nth floppy drive,\n"
100 " ROM for the ROM firmware, RAM for the non-volatile SRAM,\n"
101 " INSCSIn for the SCSI device ID n which is attached to the built-in adaptor,\n"
102 " EXSCSIn for the SCSI device ID n which is attached to the external adaptor.\n"
106 16, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0xed0100},
107 parse_ulong
, 0xed0000, 0xed3fff,
109 fill_ulong
, flush_ulong
,
110 " If boot.device specifies to boot from RAM, the start address is stored.\n"
114 12, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0xbffffc},
115 parse_ulong
, 0xe80000, 0xffffff,
117 fill_ulong
, flush_ulong
,
118 " If boot.device specifies to boot from ROM, the start address is stored.\n"
121 "display", "contrast",
122 40, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 14}},
125 fill_uchar
, flush_uchar
,
126 " Display contrast (0-15).\n"
129 "display", "dentakufont",
130 44, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
133 fill_uchar
, flush_uchar
,
134 " In-line calculator font. 0 for LCD-like, 1 for normal.\n"
135 " Note on NetBSD in-line calculator is not supported.\n"
138 "display", "glyphmode",
139 89, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
142 fill_uchar
, flush_uchar
,
143 " Glyph mode for ASCII/JIS ROMAN characters (bitmap).\n"
144 " Bit 0 (LSB) is for codepoint 0x5c (\\), bit 1 for 0x7e (~),\n"
145 " bit 2 for 0x7c (|).\n"
146 " 0 for JIS ROMAN, 1 for ASCII.\n"
149 "display", "resolution",
150 29, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 16}},
153 fill_uchar
, flush_uchar
,
154 " Initial display resolution.\n"
157 "display", "tcolor0",
158 46, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0}},
159 parse_ushort
, 0, 0xffff,
161 fill_ushort
, flush_ushort
,
162 " Initial RGB value for color cell #0.\n"
163 " Note on NetBSD the value is ignored.\n"
166 "display", "tcolor1",
167 48, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0xf83e}},
168 parse_ushort
, 0, 0xffff,
170 fill_ushort
, flush_ushort
,
171 " Initial RGB value for color cell #1.\n"
172 " Note on NetBSD the value is ignored.\n"
175 "display", "tcolor2",
176 50, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0xffc0}},
177 parse_ushort
, 0, 0xffff,
179 fill_ushort
, flush_ushort
,
180 " Initial RGB value for color cell #2.\n"
181 " Note on NetBSD the value is ignored.\n"
184 "display", "tcolor3",
185 52, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0xfffe}},
186 parse_ushort
, 0, 0xffff,
188 fill_ushort
, flush_ushort
,
189 " Initial RGB value for color cell #3.\n"
190 " Note on NetBSD the value is ignored.\n"
193 "display", "tcolor47",
194 54, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0xde6c}},
195 parse_ushort
, 0, 0xffff,
197 fill_ushort
, flush_ushort
,
198 " Initial RGB value for color cell #4-7.\n"
199 " Note on NetBSD the value is ignored.\n"
202 "display", "tcolor8f",
203 56, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0}},
204 parse_ushort
, 0, 0xffff,
206 fill_ushort
, flush_ushort
,
207 " Initial RGB value for color cell #8-15.\n"
208 " Note on NetBSD the value is ignored.\n"
212 90, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
215 fill_uchar
, flush_uchar
,
216 " Number of old, SASI-compatible hard disks connected.\n"
217 " Note they are not supported on NetBSD.\n"
221 8, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:1024*1024},
222 parse_byte
, 1024*1024, 12*1024*1024,
224 fill_ulong
, flush_ulong
,
225 " Memory size in byte.\n"
226 " Can be specified by Kilobyte and Megabyte with suffix KB and MB respectively.\n"
230 26, 2, 0, {word
:{[0] 0}}, 0, {word
:{[0] 0}}, {word
:{[0] 0x4e07}},
233 fill_ushort
, flush_ushort
,
235 " Consist of comma-separated 5 specs. The first value means speed in bps,\n"
236 " second means the bit width (5-8), third means parity (n for non parity,\n"
237 " o for odd parity, e for even parity), fourth means stop bit (2, 1 or 1.5),\n"
238 " fifth for software flow control (`-' or `s').\n"
239 " Note that the value is ignored on NetBSD.\n"
243 45, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
244 parse_srammode
, 0, 1,
246 fill_uchar
, flush_uchar
,
247 " Usage of the user area of non-volatile static RAM.\n"
248 " 0 for unused, 1 for SRAMDISK, 2 for user program.\n"
252 84, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0},
253 parse_dummy
, 0, 0xffffffff,
255 fill_ulong
, flush_dummy
,
256 " Boot count since the SRAM is initialized.\n"
260 76, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0},
261 parse_dummy
, 0, 0xffffffff,
263 fill_ulong
, flush_dummy
,
264 " Total uptime since the SRAM is initialized.\n"
268 58, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 3}},
269 parse_uchar
, 0, 0xff,
271 fill_uchar
, flush_uchar
,
272 " Delay for start keyboard autorepeat. (200+100*n) ms.\n"
275 "keyboard", "kanalayout",
276 43, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
279 fill_uchar
, flush_uchar
,
280 " Layout of kana keys. 0 for JIS, 1 for AIUEO order.\n"
281 " Note on NetBSD kana input is not supported.\n"
284 "keyboard", "ledstat",
285 28, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
286 parse_uchar
, 0, 0x7f,
288 fill_uchar
, flush_uchar
,
289 " Initial keyboard LED status (bitmap).\n"
290 " Each bit means KANA, ROMAJI, CODE, CAPS, INS, HIRAGANA, ZENKAKU from LSB.\n"
294 39, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
297 fill_uchar
, flush_uchar
,
298 " 1 for normal, 0 for TV control.\n"
301 "keyboard", "repeat",
302 59, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 3}},
303 parse_uchar
, 0, 0xff,
305 fill_uchar
, flush_uchar
,
306 " Time elapsed between the keyboard autorepeat. (30+5*n^2 ms.\n"
309 "poweroff", "ejectfloppy",
310 41, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 0}},
313 fill_uchar
, flush_uchar
,
314 " 1 to eject floppy disks at shutdown.\n"
317 "poweroff", "tvctrl",
318 42, 1, 0, {byte
:{[0] 0}}, 0, {byte
:{[0] 0}}, {byte
:{[0] 13}},
319 parse_uchar
, 0, 0xff,
321 fill_uchar
, flush_uchar
,
322 " What to do at shutdown for display TV.\n"
325 "printer", "timeout",
326 60, 4, 0, {longword
:0}, 0, {longword
:0}, {longword
:0x80000},
327 parse_ulong
, 0, 0xffffffff,
329 fill_ulong
, flush_ulong
,
330 " Printer timeout in second.\n"
334 int number_of_props
= sizeof (properties
) / sizeof (struct property
);