nubus.h 8.2 KB

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