weaselreg.h revision 1.1 1 1.1 hpeyerl /* $NetBSD: weaselreg.h,v 1.1 2002/01/01 16:48:34 hpeyerl Exp $ */
2 1.1 hpeyerl
3 1.1 hpeyerl /*-
4 1.1 hpeyerl * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.1 hpeyerl * All rights reserved.
6 1.1 hpeyerl *
7 1.1 hpeyerl * This code is derived from software contributed to The NetBSD Foundation
8 1.1 hpeyerl * by Herb Peyerl and Jason Thorpe.
9 1.1 hpeyerl *
10 1.1 hpeyerl * Redistribution and use in source and binary forms, with or without
11 1.1 hpeyerl * modification, are permitted provided that the following conditions
12 1.1 hpeyerl * are met:
13 1.1 hpeyerl * 1. Redistributions of source code must retain the above copyright
14 1.1 hpeyerl * notice, this list of conditions and the following disclaimer.
15 1.1 hpeyerl * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 hpeyerl * notice, this list of conditions and the following disclaimer in the
17 1.1 hpeyerl * documentation and/or other materials provided with the distribution.
18 1.1 hpeyerl * 3. All advertising materials mentioning features or use of this software
19 1.1 hpeyerl * must display the following acknowledgement:
20 1.1 hpeyerl * This product includes software developed by the NetBSD
21 1.1 hpeyerl * Foundation, Inc. and its contributors.
22 1.1 hpeyerl * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 hpeyerl * contributors may be used to endorse or promote products derived
24 1.1 hpeyerl * from this software without specific prior written permission.
25 1.1 hpeyerl *
26 1.1 hpeyerl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 hpeyerl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 hpeyerl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 hpeyerl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 hpeyerl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 hpeyerl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 hpeyerl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 hpeyerl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 hpeyerl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 hpeyerl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 hpeyerl * POSSIBILITY OF SUCH DAMAGE.
37 1.1 hpeyerl */
38 1.1 hpeyerl
39 1.1 hpeyerl
40 1.1 hpeyerl #ifndef _DEV_PCI_WEASELREG_H_
41 1.1 hpeyerl #define _DEV_PCI_WEASELREG_H_
42 1.1 hpeyerl
43 1.1 hpeyerl /*
44 1.1 hpeyerl * PCI-Weasel configuration block.
45 1.1 hpeyerl */
46 1.1 hpeyerl #define CFG_VERSION_2 0x02
47 1.1 hpeyerl struct weasel_config_block {
48 1.1 hpeyerl uint8_t cfg_version; /* version of config */
49 1.1 hpeyerl uint8_t weasel_attn; /* attention character */
50 1.1 hpeyerl uint8_t debug; /* debug level */
51 1.1 hpeyerl uint8_t reset_pc_on_boot; /* reset PC Weasel on boot */
52 1.1 hpeyerl uint8_t duart_baud; /* UART baud rate */
53 1.1 hpeyerl uint8_t duart_parity; /* 0=none, 1=even, 2=odd */
54 1.1 hpeyerl uint8_t duart_bits; /* 7 or 8 */
55 1.1 hpeyerl uint8_t enable_duart_switching; /* UART switching mode */
56 1.1 hpeyerl uint8_t wdt_allow; /* WDOG is allowed */
57 1.1 hpeyerl uint16_t wdt_msec; /* WDOG period in msec. */
58 1.1 hpeyerl uint8_t duart_flow; /* RTS/CTS enabled */
59 1.1 hpeyerl uint8_t break_passthru; /* BRK passed through to 16550 */
60 1.1 hpeyerl uint8_t serial_number[10]; /* board serial number */
61 1.1 hpeyerl uint8_t default_partition; /* default Weasel boot image */
62 1.1 hpeyerl uint8_t color; /* use color */
63 1.1 hpeyerl uint8_t future_use[229]; /* reserved for future use */
64 1.1 hpeyerl uint8_t cksum; /* always last element. */
65 1.1 hpeyerl };
66 1.1 hpeyerl
67 1.1 hpeyerl #define WEASEL_DATA_RD 0x00
68 1.1 hpeyerl #define OS_RET_WDT_ACTIVE 0x01
69 1.1 hpeyerl #define OS_RET_WDT_INACTIVE 0x02
70 1.1 hpeyerl #define OS_RET_PONG 0x03
71 1.1 hpeyerl
72 1.1 hpeyerl #define WEASEL_DATA_WR 0x01
73 1.1 hpeyerl #define OS_CMD_WDT_ENABLE 0x01
74 1.1 hpeyerl #define OS_CMD_WDT_DISABLE 0x02
75 1.1 hpeyerl #define OS_CMD_WDT_QUERY 0x03
76 1.1 hpeyerl #define OS_CMD_SHOW_CONFIG 0x04
77 1.1 hpeyerl #define OS_CMD_QUERY_SW_VER 0x05
78 1.1 hpeyerl #define OS_CMD_QUERY_HW_VER 0x06
79 1.1 hpeyerl #define OS_CMD_QUERY_L_VER 0x07
80 1.1 hpeyerl #define OS_CMD_PING 0x08
81 1.1 hpeyerl #define OS_CMD_QUERY_VB_VER 0x09
82 1.1 hpeyerl #define OS_CMD_QUERT_BR_VER 0x0a
83 1.1 hpeyerl #define OS_CMD_RESET_SM 0xff
84 1.1 hpeyerl
85 1.1 hpeyerl #define WEASEL_STATUS 0x02
86 1.1 hpeyerl #define OS_WS_HOST_WRITE 0x00
87 1.1 hpeyerl #define OS_WS_HOST_READ 0x01
88 1.1 hpeyerl #define OS_WS_WDT_RDY 0x02
89 1.1 hpeyerl #define OS_WS_BUSY 0xff
90 1.1 hpeyerl
91 1.1 hpeyerl #define WEASEL_HOST_STATUS 0x03
92 1.1 hpeyerl #define OS_HS_WEASEL_WRITE 0x00
93 1.1 hpeyerl #define OS_HS_WEASEL_READ 0x01
94 1.1 hpeyerl #define OS_HS_WDT_RDY 0x02
95 1.1 hpeyerl
96 1.1 hpeyerl #define WEASEL_CHALLENGE 0x04
97 1.1 hpeyerl
98 1.1 hpeyerl #define WEASEL_RESPONSE 0x05
99 1.1 hpeyerl
100 1.1 hpeyerl #endif /* _DEV_PCI_WEASELREG_H_ */
101