pica.h revision 1.1 1 1.1 ur /* $NetBSD: pica.h,v 1.1 2000/12/24 09:25:29 ur Exp $ */
2 1.1 ur /* $OpenBSD: pica.h,v 1.4 1996/09/14 15:58:28 pefo Exp $ */
3 1.1 ur
4 1.1 ur /*
5 1.1 ur * Copyright (c) 1994, 1995, 1996 Per Fogelstrom
6 1.1 ur *
7 1.1 ur * Redistribution and use in source and binary forms, with or without
8 1.1 ur * modification, are permitted provided that the following conditions
9 1.1 ur * are met:
10 1.1 ur * 1. Redistributions of source code must retain the above copyright
11 1.1 ur * notice, this list of conditions and the following disclaimer.
12 1.1 ur * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 ur * notice, this list of conditions and the following disclaimer in the
14 1.1 ur * documentation and/or other materials provided with the distribution.
15 1.1 ur * 3. All advertising materials mentioning features or use of this software
16 1.1 ur * must display the following acknowledgement:
17 1.1 ur * This product includes software developed under OpenBSD by
18 1.1 ur * Per Fogelstrom.
19 1.1 ur * 4. The name of the author may not be used to endorse or promote products
20 1.1 ur * derived from this software without specific prior written permission.
21 1.1 ur *
22 1.1 ur * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
23 1.1 ur * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 1.1 ur * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 ur * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
26 1.1 ur * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1 ur * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1 ur * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1 ur * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1 ur * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1 ur * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 ur * SUCH DAMAGE.
33 1.1 ur *
34 1.1 ur */
35 1.1 ur #ifndef _PICA_H_
36 1.1 ur #define _PICA_H_ 1
37 1.1 ur
38 1.1 ur /*
39 1.1 ur * PICA's Physical address space
40 1.1 ur */
41 1.1 ur
42 1.1 ur #define PICA_PHYS_MIN 0x00000000 /* 256 Meg */
43 1.1 ur #define PICA_PHYS_MAX 0x0fffffff
44 1.1 ur
45 1.1 ur /*
46 1.1 ur * Memory map
47 1.1 ur */
48 1.1 ur
49 1.1 ur #define PICA_PHYS_MEMORY_START 0x00000000
50 1.1 ur #define PICA_PHYS_MEMORY_END 0x0fffffff /* 256 Meg in 8 slots */
51 1.1 ur
52 1.1 ur #define PICA_MEMORY_SIZE_REG 0xe00fffe0 /* Memory size register */
53 1.1 ur #define PICA_CONFIG_REG 0xe00ffff0 /* Hardware config reg */
54 1.1 ur
55 1.1 ur /*
56 1.1 ur * I/O map
57 1.1 ur */
58 1.1 ur
59 1.1 ur #define R4030_P_LOCAL_IO_BASE 0x80000000 /* I/O Base address */
60 1.1 ur #define R4030_V_LOCAL_IO_BASE 0xe0000000
61 1.1 ur #define R4030_S_LOCAL_IO_BASE 0x00040000 /* Size */
62 1.1 ur #define R4030 R4030_V_LOCAL_IO_BASE
63 1.1 ur
64 1.1 ur #define R4030_SYS_CONFIG (R4030+0x0000) /* Global config register */
65 1.1 ur #define R4030_SYS_TL_BASE (R4030+0x0018) /* DMA transl. table base */
66 1.1 ur #define R4030_SYS_TL_LIMIT (R4030+0x0020) /* DMA transl. table limit */
67 1.1 ur #define R4030_SYS_TL_IVALID (R4030+0x0028) /* DMA transl. cache inval */
68 1.1 ur #define R4030_SYS_DMA0_REGS (R4030+0x0100) /* DMA ch0 base address */
69 1.1 ur #define R4030_SYS_DMA1_REGS (R4030+0x0120) /* DMA ch0 base address */
70 1.1 ur #define R4030_SYS_DMA2_REGS (R4030+0x0140) /* DMA ch0 base address */
71 1.1 ur #define R4030_SYS_DMA3_REGS (R4030+0x0160) /* DMA ch0 base address */
72 1.1 ur #define R4030_SYS_DMA_INT_SRC (R4030+0x0200) /* DMA int source status reg */
73 1.1 ur #define R4030_SYS_NVRAM_PROT (R4030+0x0220) /* NV ram protect register */
74 1.1 ur #define R4030_SYS_IT_VALUE (R4030+0x0228) /* Interval timer reload */
75 1.1 ur #define R4030_SYS_IT_STAT (R4030+0x0230) /* Interval timer count */
76 1.1 ur #define R4030_SYS_ISA_VECTOR (R4030+0x0238) /* ISA Interrupt vector */
77 1.1 ur #define R4030_SYS_EXT_IMASK (R4030+0x00e8) /* External int enable mask */
78 1.1 ur
79 1.1 ur #define PVLB R4030_V_LOCAL_IO_BASE
80 1.1 ur #define PICA_SYS_SONIC (PVLB+0x1000) /* SONIC base address */
81 1.1 ur #define PICA_SYS_SCSI (PVLB+0x2000) /* SCSI base address */
82 1.1 ur #define PICA_SYS_FLOPPY (PVLB+0x3000) /* Floppy base address */
83 1.1 ur #define PICA_SYS_CLOCK (PVLB+0x4000) /* Clock base address */
84 1.1 ur #define PICA_SYS_KBD (PVLB+0x5000) /* Keybrd/mouse base address */
85 1.1 ur #define PICA_SYS_COM1 (PVLB+0x6000) /* Com port 1 */
86 1.1 ur #define PICA_SYS_COM2 (PVLB+0x7000) /* Com port 2 */
87 1.1 ur #define PICA_SYS_PAR1 (PVLB+0x8000) /* Parallel port 1 */
88 1.1 ur #define PICA_SYS_NVRAM (PVLB+0x9000) /* Unprotected NV-ram */
89 1.1 ur #define PICA_SYS_PNVRAM (PVLB+0xa000) /* Protected NV-ram */
90 1.1 ur #define PICA_SYS_NVPROM (PVLB+0xb000) /* Read only NV-ram */
91 1.1 ur #define PICA_SYS_SOUND (PVLB+0xc000) /* Sound port */
92 1.1 ur
93 1.1 ur #define PICA_SYS_ISA_AS (PICA_V_ISA_IO+0x70)
94 1.1 ur
95 1.1 ur #define PICA_P_DRAM_CONF 0x800e0000 /* Dram config registers */
96 1.1 ur #define PICA_V_DRAM_CONF 0xe00e0000
97 1.1 ur #define PICA_S_DRAM_CONF 0x00020000
98 1.1 ur
99 1.1 ur #define PICA_P_INT_SOURCE 0xf0000000 /* Interrupt src registers */
100 1.1 ur #define PICA_V_INT_SOURCE R4030_V_LOCAL_IO_BASE+R4030_S_LOCAL_IO_BASE
101 1.1 ur #define PICA_S_INT_SOURCE 0x00001000
102 1.1 ur #define PVIS PICA_V_INT_SOURCE
103 1.1 ur #define PICA_SYS_LB_IS (PVIS+0x0000) /* Local bus int source */
104 1.1 ur #define PICA_SYS_LB_IE (PVIS+0x0002) /* Local bus int enables */
105 1.1 ur #define PICA_SYS_LB_IE_PAR1 0x0001 /* Parallel port enable */
106 1.1 ur #define PICA_SYS_LB_IE_FLOPPY 0x0002 /* Floppy ctrl enable */
107 1.1 ur #define PICA_SYS_LB_IE_SOUND 0x0004 /* Sound port enable */
108 1.1 ur #define PICA_SYS_LB_IE_VIDEO 0x0008 /* Video int enable */
109 1.1 ur #define PICA_SYS_LB_IE_SONIC 0x0010 /* Ethernet ctrl enable */
110 1.1 ur #define PICA_SYS_LB_IE_SCSI 0x0020 /* Scsi crtl enable */
111 1.1 ur #define PICA_SYS_LB_IE_KBD 0x0040 /* Keyboard ctrl enable */
112 1.1 ur #define PICA_SYS_LB_IE_MOUSE 0x0080 /* Mouse ctrl enable */
113 1.1 ur #define PICA_SYS_LB_IE_COM1 0x0100 /* Serial port 1 enable */
114 1.1 ur #define PICA_SYS_LB_IE_COM2 0x0200 /* Serial port 2 enable */
115 1.1 ur
116 1.1 ur #define PICA_P_LOCAL_VIDEO_CTRL 0x60000000 /* Local video control */
117 1.1 ur #define PICA_V_LOCAL_VIDEO_CTRL 0xe0200000
118 1.1 ur #define PICA_S_LOCAL_VIDEO_CTRL 0x00200000
119 1.1 ur
120 1.1 ur #define PICA_P_EXTND_VIDEO_CTRL 0x60200000 /* Extended video control */
121 1.1 ur #define PICA_V_EXTND_VIDEO_CTRL 0xe0400000
122 1.1 ur #define PICA_S_EXTND_VIDEO_CTRL 0x00200000
123 1.1 ur
124 1.1 ur #define PICA_P_LOCAL_VIDEO 0x40000000 /* Local video memory */
125 1.1 ur #define PICA_V_LOCAL_VIDEO 0xe0800000
126 1.1 ur #define PICA_S_LOCAL_VIDEO 0x00800000
127 1.1 ur
128 1.1 ur #define PICA_P_ISA_IO 0x90000000 /* ISA I/O control */
129 1.1 ur #define PICA_V_ISA_IO 0xe2000000
130 1.1 ur #define PICA_S_ISA_IO 0x01000000
131 1.1 ur
132 1.1 ur #define PICA_P_ISA_MEM 0x91000000 /* ISA Memory control */
133 1.1 ur #define PICA_V_ISA_MEM 0xe3000000
134 1.1 ur #define PICA_S_ISA_MEM 0x01000000
135 1.1 ur
136 1.1 ur /*
137 1.1 ur * Addresses used by various display drivers.
138 1.1 ur */
139 1.1 ur #define PICA_MONO_BASE (PICA_V_LOCAL_VIDEO_CTRL + 0x3B4)
140 1.1 ur #define PICA_MONO_BUF (PICA_V_LOCAL_VIDEO + 0xB0000)
141 1.1 ur #define PICA_CGA_BASE (PICA_V_LOCAL_VIDEO_CTRL + 0x3D4)
142 1.1 ur #define PICA_CGA_BUF (PICA_V_LOCAL_VIDEO + 0xB8000)
143 1.1 ur
144 1.1 ur /*
145 1.1 ur * Interrupt vector descriptor for device on pica bus.
146 1.1 ur */
147 1.1 ur struct pica_int_desc {
148 1.1 ur int int_mask; /* Mask used in PICA_SYS_LB_IE */
149 1.1 ur intr_handler_t int_hand; /* Interrupt handler */
150 1.1 ur void *param; /* Parameter to send to handler */
151 1.1 ur int spl_mask; /* Spl mask for interrupt */
152 1.1 ur };
153 1.1 ur
154 1.1 ur int pica_intrnull __P((void *));
155 1.1 ur #endif /* _PICA_H_ */
156