blob: ac516064f0ee7882227520a201067e91c648c8e4 [file] [log] [blame]
Ben Cheng30692c62013-10-15 18:26:18 -07001/*
2 nubus.h: various definitions and prototypes for NuBus drivers to use.
3
4 Originally written by Alan Cox.
5
6 Hacked to death by C. Scott Ananian and David Huggins-Daines.
7
8 Some of the constants in here are from the corresponding
9 NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
10 rest of them on our own. */
11
12#ifndef _UAPILINUX_NUBUS_H
13#define _UAPILINUX_NUBUS_H
14
15#include <linux/types.h>
16
17enum nubus_category {
18 NUBUS_CAT_BOARD = 0x0001,
19 NUBUS_CAT_DISPLAY = 0x0003,
20 NUBUS_CAT_NETWORK = 0x0004,
21 NUBUS_CAT_COMMUNICATIONS = 0x0006,
22 NUBUS_CAT_FONT = 0x0009,
23 NUBUS_CAT_CPU = 0x000A,
24 /* For lack of a better name */
25 NUBUS_CAT_DUODOCK = 0x0020
26};
27
28enum nubus_type_network {
29 NUBUS_TYPE_ETHERNET = 0x0001,
30 NUBUS_TYPE_RS232 = 0x0002
31};
32
33enum nubus_type_display {
34 NUBUS_TYPE_VIDEO = 0x0001
35};
36
37enum nubus_type_cpu {
38 NUBUS_TYPE_68020 = 0x0003,
39 NUBUS_TYPE_68030 = 0x0004,
40 NUBUS_TYPE_68040 = 0x0005
41};
42
43/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
44 * 68030 motherboards: <10,4,0,24>
45 * 68040 motherboards: <10,5,0,24>
46 * DuoDock Plus: <32,1,1,2>
47 *
48 * Toby Frame Buffer card: <3,1,1,1>
49 * RBV built-in video (IIci): <3,1,1,24>
50 * Valkyrie built-in video (Q630): <3,1,1,46>
51 * Macintosh Display Card: <3,1,1,25>
52 * Sonora built-in video (P460): <3,1,1,34>
53 * Jet framebuffer (DuoDock Plus): <3,1,1,41>
54 *
55 * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
56 * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
57 * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
58 * Sonic Systems Ethernet A-Series Card: <4,1,268,256>
59 * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
60 * ROM on the above card: <2,1,0,0>
61 * Cabletron ethernet card: <4,1,1,265>
62 * Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
63 * Kinetics EtherPort IIN: <4,1,259,262>
64 * API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
65 *
66 * Add your devices to the list! You can obtain the "Slots" utility
67 * from Apple's FTP site at:
68 * ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
69 *
70 * Alternately, TattleTech can be found at any Info-Mac mirror site.
71 * or from its distribution site: ftp://ftp.decismkr.com/dms
72 */
73
74/* DrSW: Uniquely identifies the software interface to a board. This
75 is usually the one you want to look at when writing a driver. It's
76 not as useful as you think, though, because as we should know by
77 now (duh), "Apple Compatible" can mean a lot of things... */
78
79/* Add known DrSW values here */
80enum nubus_drsw {
81 /* NUBUS_CAT_DISPLAY */
82 NUBUS_DRSW_APPLE = 0x0001,
83 NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
84
85 /* NUBUS_CAT_NETWORK */
86 NUBUS_DRSW_3COM = 0x0000,
87 NUBUS_DRSW_CABLETRON = 0x0001,
88 NUBUS_DRSW_SONIC_LC = 0x0001,
89 NUBUS_DRSW_KINETICS = 0x0103,
90 NUBUS_DRSW_ASANTE = 0x0104,
91 NUBUS_DRSW_TECHWORKS = 0x0109,
92 NUBUS_DRSW_DAYNA = 0x010b,
93 NUBUS_DRSW_FARALLON = 0x010c,
94 NUBUS_DRSW_APPLE_SN = 0x010f,
95 NUBUS_DRSW_DAYNA2 = 0x0115,
96 NUBUS_DRSW_FOCUS = 0x011a,
97 NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
98 NUBUS_DRSW_DAYNA_LC = 0x011e,
99
100 /* NUBUS_CAT_CPU */
101 NUBUS_DRSW_NONE = 0x0000,
102};
103
104/* DrHW: Uniquely identifies the hardware interface to a board (or at
105 least, it should... some video cards are known to incorrectly
106 identify themselves as Toby cards) */
107
108/* Add known DrHW values here */
109enum nubus_drhw {
110 /* NUBUS_CAT_DISPLAY */
111 NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
112 NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
113 NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
114 NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
115 NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
Christopher Ferris0543f742017-07-26 13:09:46 -0700116 NUBUS_DRHW_APPLE_MVC = 0x0014, /* Mac II Monochrome Video Card */
Ben Cheng30692c62013-10-15 18:26:18 -0700117 NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
118 NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
119 NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
Christopher Ferris0543f742017-07-26 13:09:46 -0700120 NUBUS_DRHW_APPLE_VSC = 0x0020, /* Duo MiniDock ViSC framebuffer */
Ben Cheng30692c62013-10-15 18:26:18 -0700121 NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
Christopher Ferris0543f742017-07-26 13:09:46 -0700122 NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
Ben Cheng30692c62013-10-15 18:26:18 -0700123 NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
124 NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
Ben Cheng30692c62013-10-15 18:26:18 -0700125 NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
126 NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
127 NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
128 NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
129 NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
130 NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
131 NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
132 NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
133 NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
134 NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
135 NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
136 NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
137 NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
138 NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
139 NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
140 NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
141 NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
142 NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
143 NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
144
145 /* NUBUS_CAT_NETWORK */
146 NUBUS_DRHW_INTERLAN = 0x0100,
147 NUBUS_DRHW_SMC9194 = 0x0101,
148 NUBUS_DRHW_KINETICS = 0x0106,
149 NUBUS_DRHW_CABLETRON = 0x0109,
150 NUBUS_DRHW_ASANTE_LC = 0x010f,
151 NUBUS_DRHW_SONIC = 0x0110,
152 NUBUS_DRHW_TECHWORKS = 0x0112,
153 NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
154 NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
155 NUBUS_DRHW_FOCUS = 0x011c,
156 NUBUS_DRHW_SONNET = 0x011d,
157};
158
159/* Resource IDs: These are the identifiers for the various weird and
160 wonderful tidbits of information that may or may not reside in the
161 NuBus ROM directory. */
162enum nubus_res_id {
163 NUBUS_RESID_TYPE = 0x0001,
164 NUBUS_RESID_NAME = 0x0002,
165 NUBUS_RESID_ICON = 0x0003,
166 NUBUS_RESID_DRVRDIR = 0x0004,
167 NUBUS_RESID_LOADREC = 0x0005,
168 NUBUS_RESID_BOOTREC = 0x0006,
169 NUBUS_RESID_FLAGS = 0x0007,
170 NUBUS_RESID_HWDEVID = 0x0008,
171 NUBUS_RESID_MINOR_BASEOS = 0x000a,
172 NUBUS_RESID_MINOR_LENGTH = 0x000b,
173 NUBUS_RESID_MAJOR_BASEOS = 0x000c,
174 NUBUS_RESID_MAJOR_LENGTH = 0x000d,
175 NUBUS_RESID_CICN = 0x000f,
176 NUBUS_RESID_ICL8 = 0x0010,
177 NUBUS_RESID_ICL4 = 0x0011,
178};
179
180/* Category-specific resources. */
181enum nubus_board_res_id {
182 NUBUS_RESID_BOARDID = 0x0020,
183 NUBUS_RESID_PRAMINITDATA = 0x0021,
184 NUBUS_RESID_PRIMARYINIT = 0x0022,
185 NUBUS_RESID_TIMEOUTCONST = 0x0023,
186 NUBUS_RESID_VENDORINFO = 0x0024,
187 NUBUS_RESID_BOARDFLAGS = 0x0025,
188 NUBUS_RESID_SECONDINIT = 0x0026,
189
190 /* Not sure why Apple put these next two in here */
191 NUBUS_RESID_VIDNAMES = 0x0041,
192 NUBUS_RESID_VIDMODES = 0x007e
193};
194
195/* Fields within the vendor info directory */
196enum nubus_vendor_res_id {
197 NUBUS_RESID_VEND_ID = 0x0001,
198 NUBUS_RESID_VEND_SERIAL = 0x0002,
199 NUBUS_RESID_VEND_REV = 0x0003,
200 NUBUS_RESID_VEND_PART = 0x0004,
201 NUBUS_RESID_VEND_DATE = 0x0005
202};
203
204enum nubus_net_res_id {
205 NUBUS_RESID_MAC_ADDRESS = 0x0080
206};
207
208enum nubus_cpu_res_id {
209 NUBUS_RESID_MEMINFO = 0x0081,
210 NUBUS_RESID_ROMINFO = 0x0082
211};
212
213enum nubus_display_res_id {
214 NUBUS_RESID_GAMMADIR = 0x0040,
215 NUBUS_RESID_FIRSTMODE = 0x0080,
216 NUBUS_RESID_SECONDMODE = 0x0081,
217 NUBUS_RESID_THIRDMODE = 0x0082,
218 NUBUS_RESID_FOURTHMODE = 0x0083,
219 NUBUS_RESID_FIFTHMODE = 0x0084,
220 NUBUS_RESID_SIXTHMODE = 0x0085
221};
222
223struct nubus_dir
224{
225 unsigned char *base;
226 unsigned char *ptr;
227 int done;
228 int mask;
229};
230
231struct nubus_dirent
232{
233 unsigned char *base;
234 unsigned char type;
235 __u32 data; /* Actually 24bits used */
236 int mask;
237};
238
239
240/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
241static inline void *nubus_slot_addr(int slot)
242{
243 return (void *)(0xF0000000|(slot<<24));
244}
245
246#endif /* _UAPILINUX_NUBUS_H */