summaryrefslogtreecommitdiff
path: root/sys/arch/vax/include/ka630.h
blob: 755376fc8c71335dd41ab13ab1143b0ac96d2a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*	$OpenBSD: ka630.h,v 1.3 1997/09/12 09:21:20 maja Exp $ */
/*	$NetBSD: ka630.h,v 1.2 1997/07/26 10:12:41 ragge Exp $ */
/*-
 * Copyright (c) 1986, 1988 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)uvaxII.h	7.4 (Berkeley) 5/9/91
 */

#if VAX630 || VAX410
#define UVAXIISID	((u_long *)0x20040004)
#define UVAXIICPU	((struct uvaxIIcpu *)0x20080000)

struct uvaxIIcpu {
	u_short uvaxII_bdr;
	u_short uvaxII_xxx;
	u_long  uvaxII_mser;
	u_long  uvaxII_cear;
	u_long  uvaxII_dear;
};

/* Memory system err reg. */
#define	UVAXIIMSER_CD	0x00000300
#define	UVAXIIMSER_NXM	0x00000080
#define	UVAXIIMSER_LPE	0x00000040
#define	UVAXIIMSER_QPE	0x00000020
#define	UVAXIIMSER_MERR	0x000000f0
#define	UVAXIIMSER_CPUE	0x00000060
#define	UVAXIIMSER_DQPE	0x00000010
#define	UVAXIIMSER_LEB	0x00000008
#define	UVAXIIMSER_WRWP	0x00000002
#define	UVAXIIMSER_PEN	0x00000001

/* Mem. error address regs. */
#define	UVAXIICEAR_PG	0x00007fff
#define	UVAXIIDEAR_PG	0x00007fff
#endif

/*
 * Definitions specific to the ka630 MicroVAXII Q22 bus cpu card. Includes the
 * tod clock chip and the cpu registers.
 */
#if VAX630
#define KA630CLK	((struct ka630clock *)0x200b8000)

/* Bdr register bits */
#define	KA630BDR_PWROK	0x8000
#define	KA630BDR_HLTENB	0x4000
#define	KA630BDR_CPU	0x0c00
#define	KA630BDR_BDG	0x0300
#define	KA630BDR_DSPL	0x000f

/* Clock registers and constants */
#define	MINSEC	60
#define	HRSEC	3600
#define DAYSEC	(HRSEC * 24)
#define YEARSEC	(DAYSEC * 365)

#define	KA630CLK_VRT	0200
#define	KA630CLK_UIP	0200
#define	KA630CLK_RATE	040
#define	KA630CLK_ENABLE	06
#define	KA630CLK_SET	0206
/* cpmbx bits */
#define	KA630CLK_HLTACT	03
/* halt action values */
#define	KA630CLK_RESTRT	01
#define	KA630CLK_REBOOT	02
#define	KA630CLK_HALT	03
#define	KA630CLK_DOTHIS	040
/* in progress flags */
#define	KA630CLK_BOOT	04
#define	KA630CLK_RSTRT	010
#define	KA630CLK_LANG	0360

#ifndef _LOCORE
struct ka630clock {
	u_short	sec;
	u_short	secalrm;
	u_short	min;
	u_short	minalrm;
	u_short	hr;
	u_short	hralrm;
	u_short	dayofwk;
	u_short	day;
	u_short	mon;
	u_short	yr;
	u_short	csr0;
	u_short	csr1;
	u_short	csr2;
	u_short	csr3;
	u_short	cpmbx;	/* CPMBX is used by the boot rom. see ka630-ug-3.3.3 */
};

#endif
static int ka630_clkread __P((time_t));
static void ka630_clkwrite __P((void));

#endif