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