weaselreg.h revision 1.2 1 1.2 martin /* $NetBSD: weaselreg.h,v 1.2 2008/04/28 20:23:55 martin 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 *
19 1.1 hpeyerl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 hpeyerl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 hpeyerl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 hpeyerl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 hpeyerl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 hpeyerl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 hpeyerl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 hpeyerl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 hpeyerl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 hpeyerl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 hpeyerl * POSSIBILITY OF SUCH DAMAGE.
30 1.1 hpeyerl */
31 1.1 hpeyerl
32 1.1 hpeyerl
33 1.1 hpeyerl #ifndef _DEV_PCI_WEASELREG_H_
34 1.1 hpeyerl #define _DEV_PCI_WEASELREG_H_
35 1.1 hpeyerl
36 1.1 hpeyerl /*
37 1.1 hpeyerl * PCI-Weasel configuration block.
38 1.1 hpeyerl */
39 1.1 hpeyerl #define CFG_VERSION_2 0x02
40 1.1 hpeyerl struct weasel_config_block {
41 1.1 hpeyerl uint8_t cfg_version; /* version of config */
42 1.1 hpeyerl uint8_t weasel_attn; /* attention character */
43 1.1 hpeyerl uint8_t debug; /* debug level */
44 1.1 hpeyerl uint8_t reset_pc_on_boot; /* reset PC Weasel on boot */
45 1.1 hpeyerl uint8_t duart_baud; /* UART baud rate */
46 1.1 hpeyerl uint8_t duart_parity; /* 0=none, 1=even, 2=odd */
47 1.1 hpeyerl uint8_t duart_bits; /* 7 or 8 */
48 1.1 hpeyerl uint8_t enable_duart_switching; /* UART switching mode */
49 1.1 hpeyerl uint8_t wdt_allow; /* WDOG is allowed */
50 1.1 hpeyerl uint16_t wdt_msec; /* WDOG period in msec. */
51 1.1 hpeyerl uint8_t duart_flow; /* RTS/CTS enabled */
52 1.1 hpeyerl uint8_t break_passthru; /* BRK passed through to 16550 */
53 1.1 hpeyerl uint8_t serial_number[10]; /* board serial number */
54 1.1 hpeyerl uint8_t default_partition; /* default Weasel boot image */
55 1.1 hpeyerl uint8_t color; /* use color */
56 1.1 hpeyerl uint8_t future_use[229]; /* reserved for future use */
57 1.1 hpeyerl uint8_t cksum; /* always last element. */
58 1.1 hpeyerl };
59 1.1 hpeyerl
60 1.1 hpeyerl #define WEASEL_DATA_RD 0x00
61 1.1 hpeyerl #define OS_RET_WDT_ACTIVE 0x01
62 1.1 hpeyerl #define OS_RET_WDT_INACTIVE 0x02
63 1.1 hpeyerl #define OS_RET_PONG 0x03
64 1.1 hpeyerl
65 1.1 hpeyerl #define WEASEL_DATA_WR 0x01
66 1.1 hpeyerl #define OS_CMD_WDT_ENABLE 0x01
67 1.1 hpeyerl #define OS_CMD_WDT_DISABLE 0x02
68 1.1 hpeyerl #define OS_CMD_WDT_QUERY 0x03
69 1.1 hpeyerl #define OS_CMD_SHOW_CONFIG 0x04
70 1.1 hpeyerl #define OS_CMD_QUERY_SW_VER 0x05
71 1.1 hpeyerl #define OS_CMD_QUERY_HW_VER 0x06
72 1.1 hpeyerl #define OS_CMD_QUERY_L_VER 0x07
73 1.1 hpeyerl #define OS_CMD_PING 0x08
74 1.1 hpeyerl #define OS_CMD_QUERY_VB_VER 0x09
75 1.1 hpeyerl #define OS_CMD_QUERT_BR_VER 0x0a
76 1.1 hpeyerl #define OS_CMD_RESET_SM 0xff
77 1.1 hpeyerl
78 1.1 hpeyerl #define WEASEL_STATUS 0x02
79 1.1 hpeyerl #define OS_WS_HOST_WRITE 0x00
80 1.1 hpeyerl #define OS_WS_HOST_READ 0x01
81 1.1 hpeyerl #define OS_WS_WDT_RDY 0x02
82 1.1 hpeyerl #define OS_WS_BUSY 0xff
83 1.1 hpeyerl
84 1.1 hpeyerl #define WEASEL_HOST_STATUS 0x03
85 1.1 hpeyerl #define OS_HS_WEASEL_WRITE 0x00
86 1.1 hpeyerl #define OS_HS_WEASEL_READ 0x01
87 1.1 hpeyerl #define OS_HS_WDT_RDY 0x02
88 1.1 hpeyerl
89 1.1 hpeyerl #define WEASEL_CHALLENGE 0x04
90 1.1 hpeyerl
91 1.1 hpeyerl #define WEASEL_RESPONSE 0x05
92 1.1 hpeyerl
93 1.1 hpeyerl #endif /* _DEV_PCI_WEASELREG_H_ */
94