Home | History | Annotate | Line # | Download | only in tc
tcvar.h revision 1.12
      1  1.12  jonathan /*	$NetBSD: tcvar.h,v 1.12 1998/04/19 13:04:24 jonathan Exp $	*/
      2   1.1       cgd 
      3   1.1       cgd /*
      4   1.1       cgd  * Copyright (c) 1995 Carnegie-Mellon University.
      5   1.1       cgd  * All rights reserved.
      6   1.1       cgd  *
      7   1.1       cgd  * Author: Chris G. Demetriou
      8   1.1       cgd  *
      9   1.1       cgd  * Permission to use, copy, modify and distribute this software and
     10   1.1       cgd  * its documentation is hereby granted, provided that both the copyright
     11   1.1       cgd  * notice and this permission notice appear in all copies of the
     12   1.1       cgd  * software, derivative works or modified versions, and any portions
     13   1.1       cgd  * thereof, and that both notices appear in supporting documentation.
     14   1.1       cgd  *
     15   1.1       cgd  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16   1.1       cgd  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17   1.1       cgd  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18   1.1       cgd  *
     19   1.1       cgd  * Carnegie Mellon requests users of this software to return to
     20   1.1       cgd  *
     21   1.1       cgd  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22   1.1       cgd  *  School of Computer Science
     23   1.1       cgd  *  Carnegie Mellon University
     24   1.1       cgd  *  Pittsburgh PA 15213-3890
     25   1.1       cgd  *
     26   1.1       cgd  * any improvements or extensions that they make and grant Carnegie the
     27   1.1       cgd  * rights to redistribute these changes.
     28   1.1       cgd  */
     29   1.1       cgd 
     30   1.1       cgd #ifndef __DEV_TC_TCVAR_H__
     31   1.1       cgd #define __DEV_TC_TCVAR_H__
     32   1.1       cgd 
     33   1.1       cgd /*
     34   1.5       cgd  * Definitions for TurboChannel autoconfiguration.
     35   1.1       cgd  */
     36   1.1       cgd 
     37   1.5       cgd #include <machine/bus.h>
     38   1.1       cgd #include <dev/tc/tcreg.h>
     39   1.5       cgd 
     40   1.5       cgd /*
     41   1.5       cgd  * Machine-dependent definitions.
     42   1.5       cgd  */
     43   1.5       cgd #if (alpha + pmax != 1)
     44   1.5       cgd ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
     45   1.5       cgd #endif
     46   1.5       cgd #if alpha
     47   1.5       cgd #include <alpha/tc/tc_machdep.h>
     48   1.5       cgd #endif
     49   1.5       cgd #if pmax
     50   1.1       cgd #include <machine/tc_machdep.h>
     51   1.5       cgd #endif
     52   1.1       cgd 
     53   1.1       cgd /*
     54  1.12  jonathan  * In the long run, the following block will go completely away.
     55  1.12  jonathan  * For now, the MI TC code still uses the old TC_IPL_ names
     56  1.12  jonathan  * and not the new IPL_ names.
     57   1.5       cgd  */
     58  1.12  jonathan #if 1
     59   1.5       cgd /*
     60  1.12  jonathan  * Map the new definitions to the old.
     61   1.5       cgd  */
     62   1.5       cgd #include <machine/intr.h>
     63   1.5       cgd 
     64   1.5       cgd #define tc_intrlevel_t	int
     65   1.5       cgd 
     66   1.5       cgd #define	TC_IPL_NONE	IPL_NONE
     67   1.5       cgd #define	TC_IPL_BIO	IPL_BIO
     68   1.5       cgd #define	TC_IPL_NET	IPL_NET
     69   1.5       cgd #define	TC_IPL_TTY	IPL_TTY
     70   1.5       cgd #define	TC_IPL_CLOCK	IPL_CLOCK
     71  1.12  jonathan #endif /* 1 */
     72   1.5       cgd 
     73   1.1       cgd 
     74   1.1       cgd /*
     75   1.1       cgd  * Arguments used to attach TurboChannel busses.
     76   1.1       cgd  */
     77   1.2       cgd struct tcbus_attach_args {
     78   1.2       cgd 	char		*tba_busname;		/* XXX should be common */
     79   1.7       cgd 	bus_space_tag_t tba_memt;
     80   1.1       cgd 
     81   1.2       cgd 	/* Bus information */
     82   1.3       cgd 	u_int		tba_speed;		/* see TC_SPEED_* below */
     83   1.2       cgd 	u_int		tba_nslots;
     84   1.2       cgd 	struct tc_slotdesc *tba_slots;
     85   1.2       cgd 	u_int		tba_nbuiltins;
     86   1.2       cgd 	const struct tc_builtin *tba_builtins;
     87   1.2       cgd 
     88   1.1       cgd 
     89   1.2       cgd 	/* TC bus resource management; XXX will move elsewhere eventually. */
     90   1.2       cgd 	void	(*tba_intr_establish) __P((struct device *, void *,
     91   1.1       cgd 		    tc_intrlevel_t, int (*)(void *), void *));
     92   1.2       cgd 	void	(*tba_intr_disestablish) __P((struct device *, void *));
     93  1.11   thorpej #ifdef __alpha__
     94  1.11   thorpej 	bus_dma_tag_t (*tba_get_dma_tag) __P((int));
     95  1.11   thorpej #endif
     96   1.1       cgd };
     97   1.1       cgd 
     98   1.1       cgd /*
     99   1.1       cgd  * Arguments used to attach TurboChannel devices.
    100   1.1       cgd  */
    101   1.2       cgd struct tc_attach_args {
    102   1.7       cgd 	bus_space_tag_t ta_memt;
    103  1.11   thorpej #ifdef __alpha__
    104  1.11   thorpej 	bus_dma_tag_t	ta_dmat;
    105  1.11   thorpej #endif
    106   1.5       cgd 
    107   1.2       cgd 	char		ta_modname[TC_ROM_LLEN+1];
    108   1.2       cgd 	u_int		ta_slot;
    109   1.2       cgd 	tc_offset_t	ta_offset;
    110   1.2       cgd 	tc_addr_t	ta_addr;
    111   1.2       cgd 	void		*ta_cookie;
    112   1.3       cgd 	u_int		ta_busspeed;		/* see TC_SPEED_* below */
    113   1.1       cgd };
    114   1.1       cgd 
    115   1.1       cgd /*
    116   1.1       cgd  * Description of TurboChannel slots, provided by machine-dependent
    117   1.1       cgd  * code to the TurboChannel bus driver.
    118   1.1       cgd  */
    119   1.1       cgd struct tc_slotdesc {
    120   1.2       cgd 	tc_addr_t	tcs_addr;
    121   1.2       cgd 	void		*tcs_cookie;
    122   1.2       cgd 	int		tcs_used;
    123   1.1       cgd };
    124   1.1       cgd 
    125   1.1       cgd /*
    126   1.1       cgd  * Description of built-in TurboChannel devices, provided by
    127   1.1       cgd  * machine-dependent code to the TurboChannel bus driver.
    128   1.1       cgd  */
    129   1.1       cgd struct tc_builtin {
    130   1.2       cgd 	char		*tcb_modname;
    131   1.2       cgd 	u_int		tcb_slot;
    132   1.2       cgd 	tc_offset_t	tcb_offset;
    133   1.2       cgd 	void		*tcb_cookie;
    134   1.1       cgd };
    135   1.1       cgd 
    136   1.1       cgd /*
    137   1.1       cgd  * Interrupt establishment functions.
    138   1.1       cgd  */
    139   1.1       cgd void	tc_intr_establish __P((struct device *, void *, tc_intrlevel_t,
    140   1.1       cgd 	    int (*)(void *), void *));
    141   1.1       cgd void	tc_intr_disestablish __P((struct device *, void *));
    142   1.1       cgd 
    143   1.8       jtk #include "locators.h"
    144   1.1       cgd /*
    145   1.1       cgd  * Easy to remember names for TurboChannel device locators.
    146   1.1       cgd  */
    147   1.8       jtk #define	tccf_slot	cf_loc[TCCF_SLOT]		/* slot */
    148   1.8       jtk #define	tccf_offset	cf_loc[TCCF_OFFSET]		/* offset */
    149   1.1       cgd 
    150   1.8       jtk #define	TCCF_SLOT_UNKNOWN	TCCF_SLOT_DEFAULT
    151   1.8       jtk #define	TCCF_OFFSET_UNKNOWN	TCCF_OFFSET_DEFAULT
    152   1.3       cgd 
    153   1.3       cgd /*
    154   1.3       cgd  * Miscellaneous definitions.
    155   1.3       cgd  */
    156   1.3       cgd #define	TC_SPEED_12_5_MHZ	0		/* 12.5MHz TC bus */
    157   1.3       cgd #define	TC_SPEED_25_MHZ		1		/* 25MHz TC bus */
    158   1.1       cgd 
    159   1.1       cgd #endif /* __DEV_TC_TCVAR_H__ */
    160