1 /*	$OpenBSD: scfio.h,v 1.2 2003/06/02 18:40:59 jason Exp $	*/
2 
3 /*
4  * Copyright (c) 1999 Jason L. Wright (jason@thought.net)
5  * All rights reserved.
6  *
7  * This software was developed by Jason L. Wright under contract with
8  * RTMX Incorporated (http://www.rtmx.com).
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 AUTHOR ``AS IS'' AND ANY EXPRESS OR
20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
23  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 /*
33  * ioctls and flags for sysconfig registers on Force CPU-5V boards.
34  */
35 
36 /* led1/led2 */
37 #define	SCF_LED_COLOR_MASK	0x03	/* color bits */
38 #define	SCF_LED_COLOR_OFF	0x00	/* led off */
39 #define	SCF_LED_COLOR_GREEN	0x01	/* green led */
40 #define	SCF_LED_COLOR_RED	0x02	/* red led */
41 #define	SCF_LED_COLOR_YELLOW	0x03	/* yellow led */
42 #define	SCF_LED_BLINK_MASK	0x0c	/* blink bits */
43 #define	SCF_LED_BLINK_NONE	0x00	/* steady led */
44 #define	SCF_LED_BLINK_HALF	0x04	/* blink 1/2 hz */
45 #define	SCF_LED_BLINK_ONE	0x08	/* blink 1 hz */
46 #define	SCF_LED_BLINK_TWO	0x0c	/* blink 2 hz */
47 
48 /* 7 segment led */
49 #define	SCF_7LED_A		0x01	/* Layout:	*/
50 #define	SCF_7LED_B		0x02	/*	AAA	*/
51 #define	SCF_7LED_C		0x04	/*     FF BB	*/
52 #define	SCF_7LED_D		0x08	/*	GGG	*/
53 #define	SCF_7LED_E		0x10	/*     EE CC	*/
54 #define	SCF_7LED_F		0x20	/*      DDD  P	*/
55 #define	SCF_7LED_G		0x40
56 #define	SCF_7LED_P		0x80
57 
58 /* flash memory control */
59 #define	SCF_FMCTRL_SELROM	0x01	/* select boot/user flash */
60 #define	SCF_FMCTRL_SELBOOT	0x02	/* select 1st/2nd flash */
61 #define	SCF_FMCTRL_WRITEV	0x04	/* turn on write voltage */
62 #define	SCF_FMCTRL_SELADDR	0x38	/* address 21:19 bits */
63 
64 #define	SCFIOCSLED1	_IOW('S', 0x01, u_int8_t)	/* set led1 */
65 #define	SCFIOCGLED1	_IOR('S', 0x02, u_int8_t)	/* get led1 */
66 #define	SCFIOCSLED2	_IOW('S', 0x03, u_int8_t)	/* set led2 */
67 #define	SCFIOCGLED2	_IOR('S', 0x04, u_int8_t)	/* get led2 */
68 #define	SCFIOCSLED7	_IOW('S', 0x05, u_int8_t)	/* set 7-segment led */
69 #define	SCFIOCGLED7	_IOW('S', 0x06, u_int8_t)	/* get 7-segment led */
70 #define	SCFIOCGROT	_IOR('S', 0x07, u_int8_t)	/* get rotary sw */
71 #define	SCFIOCSFMCTRL	_IOW('S', 0x08, u_int8_t)	/* set flash ctrl */
72 #define	SCFIOCGFMCTRL	_IOR('S', 0x09, u_int8_t)	/* get flash ctrl */
73