Annotation of sys/arch/hp300/dev/frodoreg.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: frodoreg.h,v 1.2 2007/01/06 20:17:43 miod Exp $ */
2: /* $NetBSD: frodoreg.h,v 1.1 1997/05/12 08:03:49 thorpej Exp $ */
3:
4: /*
5: * Copyright (c) 1997 Michael Smith. All rights reserved.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
15: *
16: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26: * SUCH DAMAGE.
27: */
28:
29: /* Base address of the Frodo part */
30: #define FRODO_BASE (INTIOBASE + 0x1c000)
31:
32: /*
33: * Where we find the 8250-like APCI ports, and how far apart they are.
34: */
35: #define FRODO_APCIBASE 0x0
36: #define FRODO_APCISPACE 0x20
37: #define FRODO_APCI_OFFSET(x) (FRODO_APCIBASE + ((x) * FRODO_APCISPACE))
38:
39: /*
40: * Other items in the Frodo part
41: */
42:
43: /* An mc146818-like calendar, but no battery... lame */
44: #define FRODO_CALENDAR 0x80
45:
46: #define FRODO_TIMER 0xa0 /* 8254-like timer */
47: #define FRODO_T1_CTR 0xa0 /* counter 1 */
48: #define FRODO_T2_CTR 0xa4 /* counter 2 */
49: #define FRODO_T3_CTR 0xa8 /* counter 3 */
50: #define FRODO_T_CTRL 0xac /* control register */
51: #define FRODO_T_PSCALE 0xb0 /* prescaler */
52: #define FRODO_T_PCOUNT 0xb4 /* precounter ? */
53: #define FRODO_T_OVCOUNT 0xb8 /* overflow counter (0, 1, 2) */
54:
55: #define FRODO_PIO 0xc0 /* programmable i/o registers start
56: here */
57: #define FRODO_IISR 0xc0 /* ISA Interrupt Status Register
58: (also PIR) */
59: #define FRODO_IISR_SERVICE (1<<0) /* service switch "on" if 0 */
60: #define FRODO_IISR_ILOW (1<<1) /* IRQ 3,4,5 or 6 on ISA if 0 */
61: #define FRODO_IISR_IMID (1<<2) /* IRQ 7,9,10 or 11 on ISA if 0 */
62: #define FRODO_IISR_IHI (1<<3) /* IRQ 12,13,14 or 15 on ISA if 0 */
63: /* bits 4 and 5 are DN2500 SCSI interrupts */
64: /* bit 6 is unused */
65: #define FRODO_IISR_IOCHK (1<<7) /* ISA board asserted IOCHK if low */
66:
67: #define FRODO_PIO_IPR 0xc4 /* input polarity register
68: (ints 7->0) */
69:
70: #define FRODO_PIO_IELR 0xc8 /* input edge/level register */
71: #define FRODO_PIO_ISA_CONTROL 0xcc /* ISA interrupts masking */
72:
73: /* This is probably not used on the 4xx */
74: #define FRODO_DIAGCTL 0xd0 /* Diagnostic Control Register */
75:
76: #define FRODO_PIC_MU 0xe0 /* upper Interrupt Mask register */
77: #define FRODO_PIC_ML 0xe4 /* lower Interrupt Mask register */
78: #define FRODO_PIC_PU 0xe8 /* upper Interrupt Pending register */
79: #define FRODO_PIC_PL 0xec /* lower Interrupt Pending register */
80: #define FRODO_PIC_IVR 0xf8 /* Interrupt Vector register */
81: #define FRODO_PIC_ACK 0xf8 /* Interrupt Acknowledge */
82:
83: /* Shorthand for register access. */
84: #define FRODO_READ(sc, reg) ((sc)->sc_regs[(reg)])
85: #define FRODO_WRITE(sc, reg, val) (sc)->sc_regs[(reg)] = (val)
86:
87: /* manipulate interrupt registers */
88: #define FRODO_GETMASK(sc) \
89: ((FRODO_READ((sc), FRODO_PIC_MU) << 8) | \
90: FRODO_READ((sc), FRODO_PIC_ML))
91: #define FRODO_SETMASK(sc, val) do { \
92: FRODO_WRITE((sc), FRODO_PIC_MU, ((val) >> 8) & 0xff); \
93: FRODO_WRITE((sc), FRODO_PIC_ML, (val) & 0xff); } while (0)
94:
95: #define FRODO_GETPEND(sc) \
96: ((FRODO_READ((sc), FRODO_PIC_PU) << 8) | \
97: FRODO_READ((sc), FRODO_PIC_PL))
98:
99: /*
100: * Interrupt lines. Use FRODO_INTR_BIT() below to get a bit
101: * suitable for one of the interrupt mask registers. Yes, line
102: * 0 is unused.
103: */
104: #define FRODO_INTR_ILOW 1
105: #define FRODO_INTR_IMID 2
106: #define FRODO_INTR_IHI 3
107: #define FRODO_INTR_SCSIDMA 4 /* DN2500 only */
108: #define FRODO_INTR_SCSI 5 /* DN2500 only */
109: #define FRODO_INTR_HORIZ 6
110: #define FRODO_INTR_IOCHK 7
111: #define FRODO_INTR_CALENDAR 8
112: #define FRODO_INTR_TIMER0 9
113: #define FRODO_INTR_TIMER1 10
114: #define FRODO_INTR_TIMER2 11
115: #define FRODO_INTR_APCI0 12
116: #define FRODO_INTR_APCI1 13
117: #define FRODO_INTR_APCI2 14
118: #define FRODO_INTR_APCI3 15
119:
120: #define FRODO_NINTR 16
121:
122: #define FRODO_INTR_ISA(l) ((l) != 0 && (l) <= FRODO_INTR_IHI)
123: #define FRODO_INTR_BIT(line) (1 << (line))
CVSweb