apbus.h revision 1.1 1 1.1 tsubai /* $NetBSD: apbus.h,v 1.1 1999/12/22 05:53:21 tsubai Exp $ */
2 1.1 tsubai
3 1.1 tsubai /*-
4 1.1 tsubai * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved.
5 1.1 tsubai *
6 1.1 tsubai * Redistribution and use in source and binary forms, with or without
7 1.1 tsubai * modification, are permitted provided that the following conditions
8 1.1 tsubai * are met:
9 1.1 tsubai * 1. Redistributions of source code must retain the above copyright
10 1.1 tsubai * notice, this list of conditions and the following disclaimer.
11 1.1 tsubai * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 tsubai * notice, this list of conditions and the following disclaimer in the
13 1.1 tsubai * documentation and/or other materials provided with the distribution.
14 1.1 tsubai * 3. The name of the author may not be used to endorse or promote products
15 1.1 tsubai * derived from this software without specific prior written permission.
16 1.1 tsubai *
17 1.1 tsubai * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 1.1 tsubai * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 1.1 tsubai * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 1.1 tsubai * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 1.1 tsubai * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 1.1 tsubai * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 1.1 tsubai * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 1.1 tsubai * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 1.1 tsubai * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 1.1 tsubai * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 1.1 tsubai */
28 1.1 tsubai
29 1.1 tsubai #ifndef __MACHINE_APBUS__
30 1.1 tsubai #define __MACHINE_APBUS__
31 1.1 tsubai
32 1.1 tsubai struct apbus_ctl {
33 1.1 tsubai int apbc_ctlno;
34 1.1 tsubai int apbc_mu;
35 1.1 tsubai int apbc_unknown2;
36 1.1 tsubai void *apbc_sladdr;
37 1.1 tsubai
38 1.1 tsubai int apbc_unknown4;
39 1.1 tsubai int apbc_hwbase;
40 1.1 tsubai char *apbc_softc;
41 1.1 tsubai void *apbc_ent7;
42 1.1 tsubai
43 1.1 tsubai int apbc_unknown8;
44 1.1 tsubai int apbc_sl;
45 1.1 tsubai
46 1.1 tsubai struct apbus_ctl *apbc_slave0;
47 1.1 tsubai int apbc_slave0no;
48 1.1 tsubai int apbc_unknown12;
49 1.1 tsubai int apbc_unknown13;
50 1.1 tsubai
51 1.1 tsubai struct apbus_ctl *apbc_slave1;
52 1.1 tsubai int apbc_slave1no;
53 1.1 tsubai int apbc_unknown16;
54 1.1 tsubai int apbc_unknown17;
55 1.1 tsubai
56 1.1 tsubai struct apbus_ctl *apbc_slave2;
57 1.1 tsubai int apbc_slave2no;
58 1.1 tsubai int apbc_unknown20;
59 1.1 tsubai int apbc_unknown21;
60 1.1 tsubai
61 1.1 tsubai struct apbus_ctl *apbc_parent;
62 1.1 tsubai int apbc_parentno;
63 1.1 tsubai int apbc_unknown24;
64 1.1 tsubai int apbc_unknown25;
65 1.1 tsubai
66 1.1 tsubai struct apbus_ctl *apbc_link;
67 1.1 tsubai int apbc_unknown27;
68 1.1 tsubai int apbc_unknown28;
69 1.1 tsubai int apbc_unknown29;
70 1.1 tsubai int apbc_unknown30;
71 1.1 tsubai int apbc_unknown31;
72 1.1 tsubai };
73 1.1 tsubai
74 1.1 tsubai struct apbus_device {
75 1.1 tsubai char *apbd_name;
76 1.1 tsubai char *apbd_vendor;
77 1.1 tsubai unsigned int apbd_atr;
78 1.1 tsubai #define APBD_CHAR 0x00000001
79 1.1 tsubai #define APBD_STDIN 0x00000002
80 1.1 tsubai #define APBD_STDOUT 0x00000004
81 1.1 tsubai unsigned int apbd_rev;
82 1.1 tsubai void* apbd_driver;
83 1.1 tsubai struct {
84 1.1 tsubai int (*func0)();
85 1.1 tsubai int (*func1)();
86 1.1 tsubai int (*func2)();
87 1.1 tsubai int (*func3)();
88 1.1 tsubai int (*func4)();
89 1.1 tsubai int (*func5)();
90 1.1 tsubai int (*func6)();
91 1.1 tsubai int (*func7)();
92 1.1 tsubai int (*func8)();
93 1.1 tsubai int (*func9)();
94 1.1 tsubai int (*func10)();
95 1.1 tsubai int (*func11)();
96 1.1 tsubai int (*func12)();
97 1.1 tsubai int (*func13)();
98 1.1 tsubai int (*func14)();
99 1.1 tsubai int (*func15)();
100 1.1 tsubai } apbd_call;
101 1.1 tsubai struct apbus_ctl *apbd_ctl;
102 1.1 tsubai struct apbus_device *apbd_link;
103 1.1 tsubai unsigned int apbd_unknwon;
104 1.1 tsubai };
105 1.1 tsubai
106 1.1 tsubai struct apbus_bus {
107 1.1 tsubai unsigned int apbb_no;
108 1.1 tsubai void *apbb_unknown1;
109 1.1 tsubai void *apbb_unknown2;
110 1.1 tsubai void *apbb_unknown3;
111 1.1 tsubai struct apbus_bus *apbb_link;
112 1.1 tsubai unsigned int apbb_unknown5;
113 1.1 tsubai unsigned int apbb_unknown6;
114 1.1 tsubai unsigned int apbb_unknown7;
115 1.1 tsubai unsigned int apbb_unknown8;
116 1.1 tsubai };
117 1.1 tsubai
118 1.1 tsubai struct apbus_vector {
119 1.1 tsubai unsigned short state;
120 1.1 tsubai unsigned short mask;
121 1.1 tsubai unsigned int (*handler)();
122 1.1 tsubai };
123 1.1 tsubai
124 1.1 tsubai struct apbus_sysinfo {
125 1.1 tsubai int apbsi_revision;
126 1.1 tsubai int (*apbsi_call)();
127 1.1 tsubai unsigned int apbsi_error1;
128 1.1 tsubai void * apbsi_progstart;
129 1.1 tsubai
130 1.1 tsubai void * apbsi_progend;
131 1.1 tsubai struct apbus_device *apbsi_dev;
132 1.1 tsubai struct apbus_bus *apbsi_bus;
133 1.1 tsubai unsigned int apbsi_error2;
134 1.1 tsubai
135 1.1 tsubai unsigned int apbsi_basel;
136 1.1 tsubai unsigned int apbsi_baseh;
137 1.1 tsubai unsigned int apbsi_memsize;
138 1.1 tsubai unsigned int apbsi_tmpsize;
139 1.1 tsubai
140 1.1 tsubai unsigned int apbsi_freesize;
141 1.1 tsubai unsigned char *apbsi_sram;
142 1.1 tsubai void *apbsi_io;
143 1.1 tsubai void *apbsi_alloc;
144 1.1 tsubai
145 1.1 tsubai void *apbsi_cmdtable;
146 1.1 tsubai unsigned int apbsi_none0;
147 1.1 tsubai struct apbus_vector apbsi_vector[8];
148 1.1 tsubai void (*apbsi_trap)();
149 1.1 tsubai unsigned int apbsi_romversion;
150 1.1 tsubai unsigned char apbsi_none1[112];
151 1.1 tsubai };
152 1.1 tsubai
153 1.1 tsubai /*
154 1.1 tsubai * FYI: result of 'ss -m' command on NEWS5000 rom monitor on my machine...
155 1.1 tsubai *
156 1.1 tsubai * > ss -m
157 1.1 tsubai * Memory use:
158 1.1 tsubai * diag info: bf881800
159 1.1 tsubai * environ: bf881000
160 1.1 tsubai * apinfo: bf880000
161 1.1 tsubai * sysinfo: 9ff03270 -> struct apbus_sysinfo
162 1.1 tsubai * alloc list: ffffbff8
163 1.1 tsubai * max mem: 04000000
164 1.1 tsubai * free mem: 03ff1678
165 1.1 tsubai * mem base: 100000000
166 1.1 tsubai *
167 1.1 tsubai */
168 1.1 tsubai
169 1.1 tsubai extern struct apbus_sysinfo *_sip;
170 1.1 tsubai void apbus_wbflush __P((void));
171 1.1 tsubai
172 1.1 tsubai #endif /* !__MACHINE_APBUS__ */
173