Home | History | Annotate | Line # | Download | only in nubus
nubus.h revision 1.64.58.1
      1  1.64.58.1       jym /*	$NetBSD: nubus.h,v 1.64.58.1 2009/05/13 17:18:00 jym Exp $	*/
      2        1.3       cgd 
      3        1.5    briggs /*
      4        1.5    briggs  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
      5        1.1    briggs  *
      6        1.1    briggs  * Redistribution and use in source and binary forms, with or without
      7        1.1    briggs  * modification, are permitted provided that the following conditions
      8        1.1    briggs  * are met:
      9        1.1    briggs  * 1. Redistributions of source code must retain the above copyright
     10        1.1    briggs  *    notice, this list of conditions and the following disclaimer.
     11        1.1    briggs  * 2. Redistributions in binary form must reproduce the above copyright
     12        1.1    briggs  *    notice, this list of conditions and the following disclaimer in the
     13        1.1    briggs  *    documentation and/or other materials provided with the distribution.
     14        1.1    briggs  * 3. All advertising materials mentioning features or use of this software
     15        1.1    briggs  *    must display the following acknowledgement:
     16        1.5    briggs  *	This product includes software developed by Allen Briggs.
     17        1.5    briggs  * 4. The name of the author may not be used to endorse or promote products
     18        1.5    briggs  *    derived from this software without specific prior written permission.
     19        1.1    briggs  *
     20        1.5    briggs  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21        1.1    briggs  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22        1.1    briggs  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23        1.5    briggs  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24        1.1    briggs  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25        1.1    briggs  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26        1.1    briggs  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27        1.1    briggs  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28        1.5    briggs  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29        1.5    briggs  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30        1.1    briggs  */
     31        1.1    briggs 
     32        1.5    briggs /*
     33        1.5    briggs  * Nubus cards in Macintoshes are identified by 4 16-bit numbers:
     34        1.5    briggs  * Category:	What is the main purpose of this card?
     35        1.5    briggs  * Type:	Within this overall category, what kind of card?
     36        1.5    briggs  * DrSW:	What software interface does it use?
     37        1.5    briggs  * DrHW:	What specific hardware is it?
     38        1.5    briggs  *
     39        1.5    briggs  * For example, the "Toby Frame Buffer" display card is
     40        1.5    briggs  *     Category 3 (display)
     41        1.5    briggs  *     Type     1 (video)
     42        1.5    briggs  *     DrSW     1 (Apple)
     43        1.5    briggs  * and DrHW     1 (TFB).
     44        1.5    briggs  */
     45        1.5    briggs 
     46        1.7    briggs #include <machine/cpu.h>
     47        1.7    briggs 
     48        1.5    briggs #define NUBUS_CATEGORY_BOARD	0x0001
     49       1.57    briggs #define  NUBUS_TYPE_BOARD	0x0000	/* We want these for minimal board */
     50       1.57    briggs #define   NUBUS_DRSW_BOARD	0x0000	/* ROMs that come with nothing but */
     51       1.57    briggs #define    NUBUS_DRHW_BOARD	0x0000	/* a board resource (old NI_GPIB) */
     52        1.5    briggs 
     53        1.5    briggs #define NUBUS_CATEGORY_DISPLAY	0x0003
     54        1.5    briggs #define  NUBUS_TYPE_VIDEO	0x0001
     55        1.5    briggs #define  NUBUS_TYPE_LCD		0x0002
     56        1.5    briggs #define   NUBUS_DRSW_APPLE	0x0001
     57       1.21    briggs #define    NUBUS_DRHW_TFB	0x0001	/* Apple Toby Frame Buffer */
     58       1.62     hauke #define    NUBUS_DRHW_BAER	0x0002  /* Formac ProNitron 80.IVb */
     59       1.21    briggs #define    NUBUS_DRHW_WVC	0x0006	/* Apple Workstation Video Card */
     60       1.29    scottr #define	   NUBUS_DRHW_COLORMAX	0x0007	/* Sigma Designs ColorMax */
     61       1.29    scottr #define    NUBUS_DRHW_SE30	0x0009	/* Apple SE/30 pseudo-slot video */
     62       1.21    briggs #define    NUBUS_DRHW_M2HRVC	0x0013	/* Apple Mac II High-Res Video Card */
     63       1.62     hauke #define    NUBUS_DRHW_MVC	0x0014	/* Apple Mac II Monochrome Video Card */
     64       1.27    scottr #define    NUBUS_DRHW_PVC	0x0017	/* Apple Mac II Portrait Video Card */
     65       1.28    scottr #define    NUBUS_DRHW_MDC	0x0019	/* Apple Macintosh Display Card */
     66       1.57    briggs #define    NUBUS_DRHW_VSC	0x0020	/* Apple Macintosh Duo MiniDock */
     67       1.57    briggs #define    NUBUS_DRHW_JET	0x0029	/* Apple Macintosh DuoDock II */
     68       1.52    briggs #define    NUBUS_DRHW_BOOGIE	0x002b	/* Apple Macintosh 24AC Video Card */
     69       1.62     hauke #define    NUBUS_DRHW_VILTRO340	0x0102	/* VillageTronic Mac Picasso 340 */
     70       1.30    briggs #define    NUBUS_DRHW_SUPRGFX	0x0105	/* SuperMac GFX */
     71       1.62     hauke #define    NUBUS_DRHW_RELAX200	0x0131  /* Relax 19" Model 200 */
     72       1.36    briggs #define    NUBUS_DRHW_FORMAC	0x013A	/* Formac color card II */
     73       1.21    briggs #define    NUBUS_DRHW_CB264	0x013B	/* RasterOps ColorBoard 264 */
     74       1.47    briggs #define    NUBUS_DRHW_MICRON	0x0146	/* Micron Exceed color */
     75       1.48    briggs #define    NUBUS_DRHW_RADGSC	0x0153	/* Radius GS/C */
     76       1.35    briggs #define    NUBUS_DRHW_SPECTRM8	0x017b	/* SuperMac Spectrum/8  Series III */
     77       1.31    briggs #define    NUBUS_DRHW_SPECTRUM	0x017c	/* SuperMac Spectrum/24 Series III */
     78       1.38    briggs #define    NUBUS_DRHW_VIMAGE	0x026E	/* Interware Co., Ltd. Vimage */
     79       1.23    briggs #define    NUBUS_DRHW_CB364	0x026F	/* RasterOps ColorBoard 364 */
     80       1.50    briggs #define    NUBUS_DRHW_LVIEW	0x0278	/* Sigma Designs L-View */
     81       1.54    briggs #define    NUBUS_DRHW_RDCGX	0x027C	/* Radius DirectColor/GX */
     82       1.32    briggs #define	   NUBUS_DRHW_RPC8	0x0291	/* Radius PrecisionColor 8 */
     83       1.34    briggs #define	   NUBUS_DRHW_LAPIS	0x0292	/* SE/30 Lapis ProColorServer 8 PDS */
     84       1.37    briggs #define	   NUBUS_DRHW_ROPS24LXI	0x02A0	/* RasterOps 8/24 XLi */
     85       1.55    briggs #define	   NUBUS_DRHW_ROPSPPGT	0x02A5	/* RasterOps PaintBoard Prism GT 1.0 */
     86       1.33    briggs #define    NUBUS_DRHW_FUTURASX	0x02AE	/* E-Machines Futura-SX */
     87       1.49    scottr #define    NUBUS_DRHW_ROPS24XLTV 0x02B7	/* RasterOps 24XlTV */
     88       1.21    briggs #define    NUBUS_DRHW_THUNDER24	0x02CB	/* SuperMac Thunder/24 */
     89       1.49    scottr #define    NUBUS_DRHW_ROPS24MXTV 0x03DF	/* RasterOps 24MxTV */
     90       1.42    briggs #define    NUBUS_DRHW_GVIMAGE	0x03FB	/* Interware Co., Ltd. Grand Vimage */
     91       1.36    briggs #define	   NUBUS_DRHW_RPC24XP	0x0406	/* Radius PrecisionColor 24Xp */
     92       1.39    briggs #define	   NUBUS_DRHW_RPC24X	0x040A	/* Radius PrecisionColor 24X */
     93       1.25    briggs #define	   NUBUS_DRHW_RPC8XJ	0x040B	/* Radius PrecisionColor 8xj */
     94       1.23    briggs #define	   NUBUS_DRHW_FIILX	0x0417	/* Futura II LX */
     95       1.23    briggs #define	   NUBUS_DRHW_FIISXDSP	0x042F	/* Futura II SX/DSP */
     96       1.43    scottr #define	   NUBUS_DRHW_MC2124NB	0x0462	/* MicroConversions 2124NB II */
     97        1.5    briggs 
     98       1.18    briggs /* False DrHW values for video cards masquerading as other cards */
     99       1.18    briggs #define    NUBUS_DRHW_SAM768	0x10000	/* Cornerstone/Samsung 768x1006 */
    100       1.18    briggs 
    101        1.5    briggs #define NUBUS_CATEGORY_NETWORK	0x0004
    102        1.5    briggs #define  NUBUS_TYPE_ETHERNET	0x0001
    103        1.5    briggs #define   NUBUS_DRSW_3COM	0x0000
    104       1.41    scottr #define   NUBUS_DRSW_CABLETRON	0x0001
    105        1.6    briggs #define   NUBUS_DRSW_GATOR	0x0103
    106        1.5    briggs #define   NUBUS_DRSW_ASANTE	0x0104
    107       1.11    briggs #define   NUBUS_DRSW_TECHWORKS	0x0109
    108       1.18    briggs #define	  NUBUS_DRSW_DAYNA	0x010B
    109        1.7    briggs #define   NUBUS_DRSW_FARALLON	0x010C
    110       1.31    briggs #define   NUBUS_DRSW_DAYNA2	0x0115
    111       1.12    briggs #define   NUBUS_DRSW_FOCUS	0x011A
    112       1.50    briggs #define   NUBUS_DRSW_ASANTEF	0x011D
    113       1.44    scottr #define   NUBUS_DRSW_TFLLAN	0x011E
    114       1.13    briggs #define    NUBUS_DRHW_INTERLAN	0x0100
    115       1.50    briggs #define    NUBUS_DRHW_ASANTEF	0x0101
    116       1.13    briggs #define    NUBUS_DRHW_KINETICS	0x0106
    117       1.20    briggs #define    NUBUS_DRHW_CABLETRON	0x0109
    118       1.46    briggs #define    NUBUS_DRHW_NUVOLINK	0x010B
    119       1.39    briggs #define    NUBUS_DRHW_ASANTE_LC	0x010F
    120       1.13    briggs #define    NUBUS_DRHW_SONIC	0x0110
    121       1.40    briggs #define    NUBUS_DRHW_TECHWORKS	0x0112
    122       1.24    briggs #define    NUBUS_DRHW_APPLE_SNT	0x0118
    123       1.20    briggs #define    NUBUS_DRHW_APPLE_SN	0x0119
    124       1.10    briggs 
    125       1.10    briggs #define NUBUS_CATEGORY_COMMUNICATIONS	0x0006
    126       1.10    briggs #define  NUBUS_TYPE_RS232	0x0002
    127       1.57    briggs #define  NUBUS_TYPE_IEEE488	0x0004
    128       1.62     hauke #define  NUBUS_TYPE_CENTRONICS	0x000B
    129       1.62     hauke #define  NUBUS_TYPE_BECTDIC	0x002E
    130       1.62     hauke #define   NUBUS_DRSW_BECTDIC	0x0100
    131       1.62     hauke #define   NUBUS_DRSW_CPI	0x0100
    132       1.10    briggs #define   NUBUS_DRSW_HDS	0x0102
    133       1.57    briggs #define   NUBUS_DRSW_NI488	0x0104
    134       1.62     hauke #define    NUBUS_DRHW_BECTDIC	0x0100	/* Becton Dickinson Acquisition Card */
    135       1.62     hauke #define    NUBUS_DRHW_CPI	0x0100	/* Creative Solutions parallel */
    136       1.62     hauke #define    NUBUS_DRHW_HDS	0x0102	/* Creative Solutions 2x serial */
    137       1.62     hauke #define    NUBUS_DRHW_NBGPIBTNT	0x0102	/* National Instruments NB-GPIB/TNT */
    138        1.5    briggs 
    139       1.51    briggs #define NUBUS_CATEGORY_MEMORY	0x0009	/* Also KanjiTalk Font Card? */
    140       1.51    briggs #define  NUBUS_TYPE_RAMCACHE	0x010C	/* From Apple PDS card */
    141       1.51    briggs #define   NUBUS_DRSW_AWGSPDS	0x0100
    142       1.51    briggs #define    NUBUS_DRHW_AWGSPDS	0x0100
    143        1.5    briggs 
    144        1.5    briggs #define NUBUS_CATEGORY_CPU	0x000A
    145        1.5    briggs #define  NUBUS_TYPE_68000	0x0002
    146        1.5    briggs #define  NUBUS_TYPE_68020	0x0003
    147        1.5    briggs #define  NUBUS_TYPE_68030	0x0004
    148        1.5    briggs #define  NUBUS_TYPE_68040	0x0005
    149       1.58       rjs #define  NUBUS_TYPE_MX		0x0009	/* TI microExplorer */
    150       1.38    briggs 
    151       1.53    briggs #define NUBUS_CATEGORY_INTBUS		0x000C
    152       1.53    briggs #define  NUBUS_TYPE_SCSI		0x0008
    153       1.53    briggs #define   NUBUS_DRSW_AWGSPDS_SCSI	0x0006
    154       1.53    briggs #define    NUBUS_DRHW_AWGSPDS_SCSI	0x0100
    155       1.53    briggs #define   NUBUS_DRSW_PLI		0x0108
    156       1.53    briggs #define    NUBUS_DRHW_PLI		0x0100
    157       1.57    briggs #define  NUBUS_TYPE_SCSIW	0x000B  /* FWB JackHammer Fast/Wide */
    158  1.64.58.1       jym #define   NUBUS_DRSW_FWB	0x0001
    159  1.64.58.1       jym #define    NUBUS_DRHW_FWB	0x0100
    160  1.64.58.1       jym #define  NUBUS_TYPE_SCSIAW	0x0106  /* Atto SiliconExpress IV f/w */
    161  1.64.58.1       jym #define   NUBUS_DRSW_ATTOSE	0x0101
    162  1.64.58.1       jym #define    NUBUS_DRHW_ATTOSE	0x0100
    163        1.5    briggs 
    164       1.57    briggs #define NUBUS_CATEGORY_DOCK	0x0020
    165       1.57    briggs #define  NUBUS_TYPE_STATION	0x0001
    166       1.57    briggs #define  NUBUS_TYPE_DESK	0x0002
    167       1.57    briggs #define  NUBUS_TYPE_TRAVEL	0x0003
    168       1.57    briggs /* #define   NUBUS_DRSW_APPLE	0x0001 */
    169       1.57    briggs #define   NUBUS_DRSW_NEWERTECH	0x0101
    170       1.57    briggs 
    171       1.57    briggs /* Station */
    172       1.57    briggs #define    NUBUS_DRHW_DUODOCK	0x0001	/* Apple DuoDock */
    173       1.57    briggs #define    NUBUS_DRHW_DUODOCKII	0x0002	/* Apple DuoDock II */
    174       1.57    briggs 
    175       1.57    briggs /* Desk */
    176       1.57    briggs #define    NUBUS_DRHW_DUOMINIDOCK 0x0001 /* Apple Duo MiniDock */
    177       1.57    briggs 
    178       1.57    briggs /* Travel */
    179       1.57    briggs #define	   NUBUS_DRHW_MICROSCSI 0x0100	/* Newer Technology  SCSI MicroDock */
    180       1.57    briggs 
    181       1.57    briggs 
    182        1.5    briggs /*
    183        1.5    briggs  * This is the same as Apple's Format Block for a card, with the
    184        1.5    briggs  * addition of a pointer to the base of the NuBUS slot.
    185        1.5    briggs  *
    186        1.5    briggs  * This basically describes a nubus card--this structure is held in the last
    187        1.5    briggs  * N bytes of each valid card's declaration ROM.
    188        1.5    briggs  */
    189        1.5    briggs typedef struct _nubus_slot {
    190        1.5    briggs 	u_long		top;
    191        1.5    briggs 	u_int8_t	slot;
    192        1.5    briggs 	u_int8_t	bytelanes;
    193        1.5    briggs 	u_int8_t	step;
    194        1.5    briggs 	u_int32_t	test_pattern;
    195        1.5    briggs 	u_int8_t	format;
    196        1.5    briggs 	u_int8_t	revision_level;
    197        1.5    briggs 	u_int32_t	crc;
    198        1.5    briggs 	u_int32_t	length;
    199        1.5    briggs 	u_int32_t	directory_offset;
    200        1.5    briggs } nubus_slot;
    201        1.5    briggs 
    202        1.5    briggs /*
    203        1.5    briggs  * Just a structure to ease comparison of type for drivers, etc.
    204        1.5    briggs  */
    205        1.5    briggs typedef struct _nubus_type {
    206        1.5    briggs 	u_int16_t	category;
    207        1.5    briggs 	u_int16_t	type;
    208        1.5    briggs 	u_int16_t	drsw;
    209        1.5    briggs 	u_int16_t	drhw;
    210        1.5    briggs } nubus_type;
    211        1.5    briggs 
    212        1.5    briggs /*
    213        1.5    briggs  * nubus_dir is a structure that describes a nubus directory.
    214        1.5    briggs  * The nubus*dir() functions should be used to traverse this.
    215        1.5    briggs  */
    216        1.5    briggs typedef struct _nubus_dir {
    217        1.5    briggs 	u_int32_t	dirbase;
    218        1.5    briggs 	u_int32_t	curr_ent;
    219        1.5    briggs } nubus_dir;
    220        1.5    briggs 
    221        1.5    briggs /*
    222        1.5    briggs  * This is the equivalent of an Apple sResource directory entry
    223        1.5    briggs  * with the addition of a pointer to itself (essentially) for easy
    224        1.5    briggs  * calculation of jump to indirect data.
    225        1.5    briggs  */
    226        1.5    briggs typedef struct _nubus_dirent {
    227        1.5    briggs 	u_int32_t	myloc;
    228        1.5    briggs 	u_int8_t	rsrc_id;
    229        1.5    briggs 	u_int32_t	offset;
    230        1.5    briggs } nubus_dirent;
    231        1.5    briggs 
    232        1.5    briggs /*
    233        1.5    briggs  * This is the equivalent of an Apple sResource with the addition of
    234        1.5    briggs  * a pointer back to the sResource directory from whence we came.
    235        1.5    briggs  *
    236        1.5    briggs  * According to the Apple documentation, each sResource is of one of the
    237        1.5    briggs  * following forms:
    238        1.5    briggs  *	all:	bits 31-24	Identification number
    239        1.5    briggs  *
    240        1.5    briggs  *	offset:	bits 23-0	Offset to long data, cString, sBlock, etc.
    241        1.5    briggs  *	word:	bits 23-16	0x00
    242        1.5    briggs  *		bits 15-0	word data
    243        1.5    briggs  *	byte:	bits 23-8	0x0000
    244        1.5    briggs  *		bits 7-0	byte data
    245        1.5    briggs  *
    246        1.5    briggs  * The last resource has id = 0xff and data = 0x000000.
    247        1.5    briggs  */
    248        1.5    briggs typedef struct _nubus_rsrc {
    249        1.5    briggs 	u_int32_t	myloc;
    250        1.5    briggs 	u_int8_t	id;
    251        1.5    briggs 	u_int32_t	data;
    252        1.5    briggs } nubus_rsrc;
    253        1.5    briggs 
    254       1.57    briggs /*
    255       1.57    briggs  * On a NuBus master, an sMemory resource (this is a second-level
    256       1.57    briggs  * resource list) holds a list of address ranges for onboard
    257       1.57    briggs  * RAM, ROM and IO resources.
    258       1.57    briggs  */
    259       1.57    briggs typedef struct _nubus_smem_range {
    260       1.57    briggs 	u_int32_t	length;
    261       1.57    briggs 	u_int32_t	offset;
    262       1.57    briggs } nubus_smem_range;
    263       1.57    briggs 
    264       1.57    briggs /*
    265       1.57    briggs  * XXX This is mapped on the range list we get back out of the sMemory
    266       1.57    briggs  * resources. I would have liked the range[] array to be of undefined
    267       1.57    briggs  * size but the compiler does not let me.
    268       1.57    briggs  * Maybe it's just too much grief, and we should work with an array
    269       1.57    briggs  * of u_int32_t.
    270       1.57    briggs  */
    271       1.57    briggs typedef struct _nubus_smem_rangelist {
    272       1.57    briggs 	u_int32_t		length;
    273       1.57    briggs 	nubus_smem_range	range[1];
    274       1.57    briggs } nubus_smem_rangelist;
    275       1.57    briggs 
    276       1.57    briggs 
    277        1.5    briggs /* Resource IDs for NUBUS_CATEGORY_* (All) */
    278        1.5    briggs #define NUBUS_RSRC_TYPE		0x01	/* Type (required)		*/
    279        1.5    briggs #define NUBUS_RSRC_NAME		0x02	/* Name (required)		*/
    280        1.5    briggs #define NUBUS_RSRC_ICON		0x03	/* Icon				*/
    281        1.5    briggs #define NUBUS_RSRC_DRVRDIR	0x04	/* Driver directory		*/
    282        1.5    briggs #define NUBUS_RSRC_LOADREC	0x05	/* Load record for resource	*/
    283        1.5    briggs #define NUBUS_RSRC_BOOTREC	0x06	/* Boot record			*/
    284        1.5    briggs #define NUBUS_RSRC_FLAGS	0x07	/* sResource Flags		*/
    285        1.5    briggs #define NUBUS_RSRC_HWDEVID	0x08	/* Hardware device ID		*/
    286        1.5    briggs #define NUBUS_RSRC_MINOR_BASEOS	0x0A	/* Offset to hw in std space	*/
    287        1.5    briggs #define NUBUS_RSRC_MINOR_LENGTH	0x0B	/* Length of std space		*/
    288        1.5    briggs #define NUBUS_RSRC_MAJOR_BASEOS	0x0C	/* Offset to hw in super space	*/
    289        1.5    briggs #define NUBUS_RSRC_MAJOR_LENGTH	0x0D	/* Length of super space	*/
    290        1.5    briggs #define NUBUS_RSRC_CICN		0x0F	/* Color icon			*/
    291        1.5    briggs #define NUBUS_RSRC_ICL8		0x10	/* 8-bit icon data		*/
    292        1.5    briggs #define NUBUS_RSRC_ICL4		0x11	/* 4-bit icon data		*/
    293       1.57    briggs #define NUBUS_RSRC_SMEMORY	0x6C	/* Resource list for master	*/
    294        1.5    briggs 
    295        1.5    briggs /* Resource IDs for NUBUS_CATEGORY_DISPLAY */
    296        1.5    briggs #define NUBUS_RSRC_GAMMADIR	0x40	/* ID for gamma directory	*/
    297        1.5    briggs #define NUBUS_RSRC_VIDNAMES	0x41	/* ID for video name directory	*/
    298        1.5    briggs #define NUBUS_RSRC_FIRSTMODE	0x80	/* ID for first mode (1-bit)	*/
    299        1.5    briggs #define NUBUS_RSRC_SECONDMODE	0x81	/* ID for 2nd mode (2-bit)	*/
    300        1.5    briggs #define NUBUS_RSRC_THIRDMODE	0x82	/* ID for 3rd mode (4-bit)	*/
    301        1.5    briggs #define NUBUS_RSRC_FOURTHMODE	0x83	/* ID for 4th mode (8-bit)	*/
    302        1.5    briggs #define NUBUS_RSRC_FIFTHMODE	0x84	/* ID for 5th mode (16-bit)	*/
    303        1.5    briggs #define NUBUS_RSRC_SIXTHMODE	0x85	/* ID for 6th mode (32-bit)	*/
    304        1.5    briggs 
    305        1.5    briggs /* Resource IDs for NUBUS_CATEGORY_BOARD */
    306        1.5    briggs #define NUBUS_RSRC_BOARDID	0x20	/* Board ID			*/
    307        1.5    briggs #define NUBUS_RSRC_PRAMINITDATA	0x21	/* Private board data for PRAM	*/
    308        1.5    briggs #define NUBUS_RSRC_PRIMARYINIT	0x22	/* Primary init record		*/
    309        1.5    briggs #define NUBUS_RSRC_TIMEOUTCONST	0x23	/* Timeout constant		*/
    310        1.5    briggs #define NUBUS_RSRC_VENDORINFO	0x24	/* Vendor info list		*/
    311        1.5    briggs #define NUBUS_RSRC_BOARDFLAGS	0x25	/* Board flags			*/
    312        1.5    briggs #define NUBUS_RSRC_SECONDINIT	0x26	/* Secondary init record	*/
    313        1.5    briggs 
    314        1.5    briggs #define NUBUS_RSRC_VEND_ID	0x01	/* Card vendor's design ID	*/
    315        1.5    briggs #define NUBUS_RSRC_VEND_SERIAL	0x02	/* Card's serial number		*/
    316        1.5    briggs #define NUBUS_RSRC_VEND_REV	0x03	/* Card design's revision level	*/
    317        1.5    briggs #define NUBUS_RSRC_VEND_PART	0x04	/* Card part number		*/
    318        1.5    briggs #define NUBUS_RSRC_VEND_DATE	0x05	/* Card revision date		*/
    319        1.5    briggs 
    320       1.57    briggs /* Resource IDs for NUBUS_RSRC_SMEMORY master sMemory resource list */
    321       1.57    briggs #define NUBUS_RSRC_SMEM_MINOR_RAMADDR	0x80	/* Minor RAM address ranges */
    322       1.57    briggs #define NUBUS_RSRC_SMEM_MAJOR_RAMADDR	0x81	/* Major RAM address ranges */
    323       1.57    briggs #define NUBUS_RSRC_SMEM_MINOR_ROMADDR	0x82	/* Minor ROM address ranges */
    324       1.57    briggs #define NUBUS_RSRC_SMEM_MAJOR_ROMADDR	0x83	/* Major ROM address ranges */
    325       1.57    briggs #define NUBUS_RSRC_SMEM_MINOR_DEVADDR	0x84	/* Minor device address ranges */
    326       1.57    briggs #define NUBUS_RSRC_SMEM_MAJOR_DEVADDR	0x85	/* Major device address ranges */
    327       1.57    briggs 
    328       1.57    briggs 
    329        1.5    briggs typedef struct _NUBUS_DRIVER {
    330        1.5    briggs 	u_int8_t	drvr_id;
    331        1.5    briggs 	u_int32_t	offset;
    332        1.5    briggs } NUBUS_DRIVER;
    333        1.5    briggs 
    334        1.5    briggs typedef struct _NUBUS_BLOCK {
    335        1.5    briggs 	u_int32_t	size;		/* Size of block of data	*/
    336       1.63  christos 	void *		data;		/* Pointer to data		*/
    337        1.5    briggs } NUBUS_BLOCK;
    338        1.5    briggs 
    339        1.5    briggs typedef struct _NUBUS_EXEC_BLOCK {
    340        1.5    briggs 	u_int32_t	size;		/* Size of total block - 4 	*/
    341        1.5    briggs 	u_int8_t	revision;	/* Always 0x2			*/
    342        1.5    briggs 	u_int8_t	cpu;		/* Which processor?		*/
    343        1.5    briggs 	u_int32_t	code_offset;	/* Offset base to start of code	*/
    344       1.63  christos 	void *		code;		/* pointer to base of code.	*/
    345        1.5    briggs } NUBUS_EXEC_BLOCK;
    346        1.5    briggs 
    347        1.5    briggs #define NUBUS_EXEC_CPU_68000	1
    348        1.5    briggs #define NUBUS_EXEC_CPU_68020	2
    349        1.5    briggs #define NUBUS_EXEC_CPU_68030	3
    350        1.5    briggs #define NUBUS_EXEC_CPU_68040	4
    351        1.5    briggs 
    352        1.5    briggs #define NUBUS_MIN_SLOT		0x9
    353        1.5    briggs #define NUBUS_MAX_SLOT		0xE
    354        1.5    briggs #define NUBUS_ROM_TEST_PATTERN	0x5A932BC7
    355        1.1    briggs 
    356       1.17    scottr #define NUBUS_SLOT2PA(x)	(0xf9000000 + \
    357       1.17    scottr 				 ((((x) - NUBUS_MIN_SLOT) & 0xf) << 24))
    358        1.1    briggs 
    359       1.15    scottr struct nubus_attach_args {
    360       1.16    scottr 	bus_space_tag_t	na_tag;
    361       1.56    briggs 	bus_dma_tag_t	na_dmat;
    362       1.15    scottr 	int		slot;
    363       1.15    scottr 	int		rsrcid;
    364       1.15    scottr 	u_int16_t	category;
    365       1.15    scottr 	u_int16_t	type;
    366       1.15    scottr 	u_int16_t	drsw;
    367       1.15    scottr 	u_int16_t	drhw;
    368       1.15    scottr 	nubus_slot	*fmt;
    369       1.15    scottr };
    370       1.15    scottr 
    371        1.5    briggs struct nubus_softc {
    372        1.5    briggs 	struct	device	sc_dev;
    373        1.1    briggs };
    374        1.1    briggs 
    375       1.57    briggs 
    376       1.59       chs void	nubus_get_main_dir(nubus_slot *, nubus_dir *);
    377       1.59       chs void	nubus_get_dir_from_rsrc(nubus_slot *, nubus_dirent *, nubus_dir *);
    378       1.59       chs 
    379       1.59       chs int	nubus_find_rsrc(bus_space_tag_t, bus_space_handle_t, nubus_slot *,
    380       1.59       chs 	    nubus_dir *, u_int8_t, nubus_dirent *);
    381       1.59       chs int	nubus_get_ind_data(bus_space_tag_t, bus_space_handle_t, nubus_slot *,
    382       1.64   tsutsui 	    nubus_dirent *, char *, int);
    383       1.59       chs int	nubus_get_c_string(bus_space_tag_t, bus_space_handle_t, nubus_slot *,
    384       1.64   tsutsui 	    nubus_dirent *, char *, int);
    385       1.59       chs int	nubus_get_smem_addr_rangelist(bus_space_tag_t, bus_space_handle_t,
    386       1.63  christos     	    nubus_slot *, nubus_dirent *, void *);
    387       1.59       chs 
    388       1.60       rjs const char	*nubus_get_vendor(bus_space_tag_t, bus_space_handle_t, nubus_slot *,
    389       1.59       chs 	    int);
    390       1.60       rjs const char	*nubus_get_card_name(bus_space_tag_t, bus_space_handle_t, nubus_slot *);
    391       1.46    briggs #ifdef DEBUG
    392       1.59       chs void	nubus_scan_slot(bus_space_tag_t, int);
    393       1.46    briggs #endif
    394