Home | History | Annotate | Line # | Download | only in ofisa
      1  1.8   thorpej /*	$NetBSD: ofisavar.h,v 1.8 2021/04/30 02:13:15 thorpej Exp $	*/
      2  1.1       cgd 
      3  1.1       cgd /*
      4  1.1       cgd  * Copyright 1998
      5  1.1       cgd  * Digital Equipment Corporation. All rights reserved.
      6  1.1       cgd  *
      7  1.1       cgd  * This software is furnished under license and may be used and
      8  1.1       cgd  * copied only in accordance with the following terms and conditions.
      9  1.1       cgd  * Subject to these conditions, you may download, copy, install,
     10  1.1       cgd  * use, modify and distribute this software in source and/or binary
     11  1.1       cgd  * form. No title or ownership is transferred hereby.
     12  1.1       cgd  *
     13  1.1       cgd  * 1) Any source code used, modified or distributed must reproduce
     14  1.1       cgd  *    and retain this copyright notice and list of conditions as
     15  1.1       cgd  *    they appear in the source file.
     16  1.1       cgd  *
     17  1.1       cgd  * 2) No right is granted to use any trade name, trademark, or logo of
     18  1.1       cgd  *    Digital Equipment Corporation. Neither the "Digital Equipment
     19  1.1       cgd  *    Corporation" name nor any trademark or logo of Digital Equipment
     20  1.1       cgd  *    Corporation may be used to endorse or promote products derived
     21  1.1       cgd  *    from this software without the prior written permission of
     22  1.1       cgd  *    Digital Equipment Corporation.
     23  1.1       cgd  *
     24  1.1       cgd  * 3) This software is provided "AS-IS" and any express or implied
     25  1.1       cgd  *    warranties, including but not limited to, any implied warranties
     26  1.1       cgd  *    of merchantability, fitness for a particular purpose, or
     27  1.1       cgd  *    non-infringement are disclaimed. In no event shall DIGITAL be
     28  1.1       cgd  *    liable for any damages whatsoever, and in particular, DIGITAL
     29  1.1       cgd  *    shall not be liable for special, indirect, consequential, or
     30  1.1       cgd  *    incidental damages or damages for lost profits, loss of
     31  1.1       cgd  *    revenue or loss of use, whether such damages arise in contract,
     32  1.1       cgd  *    negligence, tort, under statute, in equity, at law or otherwise,
     33  1.1       cgd  *    even if advised of the possibility of such damage.
     34  1.1       cgd  */
     35  1.1       cgd 
     36  1.1       cgd #ifndef _DEV_OFISA_OFISAVAR_H_
     37  1.1       cgd #define	_DEV_OFISA_OFISAVAR_H_
     38  1.1       cgd 
     39  1.8   thorpej #include <dev/ofw/openfirm.h>
     40  1.8   thorpej #include <dev/isa/isavar.h>
     41  1.8   thorpej 
     42  1.1       cgd struct ofisa_attach_args {
     43  1.2       cgd 	struct ofbus_attach_args oba;	/* common */
     44  1.1       cgd 
     45  1.1       cgd 	bus_space_tag_t	iot;		/* i/o space tag */
     46  1.1       cgd 	bus_space_tag_t	memt;		/* mem space tag */
     47  1.1       cgd 	bus_dma_tag_t	dmat;		/* DMA tag */
     48  1.1       cgd 	isa_chipset_tag_t ic;		/* chipset tag (for intr, etc.) */
     49  1.1       cgd };
     50  1.1       cgd 
     51  1.1       cgd struct ofisa_reg_desc {
     52  1.1       cgd 	int		type;		/* type.  XXX aliasing modifiers? */
     53  1.1       cgd 	bus_addr_t	addr;		/* base address. */
     54  1.1       cgd 	bus_size_t	len;		/* length. */
     55  1.1       cgd };
     56  1.1       cgd 
     57  1.1       cgd #define	OFISA_REG_TYPE_MEM	0	/* memory space */
     58  1.1       cgd #define	OFISA_REG_TYPE_IO	1	/* I/O space */
     59  1.1       cgd 
     60  1.1       cgd struct ofisa_intr_desc {
     61  1.1       cgd 	int		share;		/* sharing type: IST_*. */
     62  1.1       cgd 	int		irq;		/* IRQ. */
     63  1.1       cgd };
     64  1.1       cgd 
     65  1.3   thorpej struct ofisa_dma_desc {
     66  1.3   thorpej 	int		drq;		/* DMA request */
     67  1.3   thorpej 	int		mode;		/* DMA mode */
     68  1.3   thorpej 	int		width;		/* DMA width */
     69  1.3   thorpej 	int		countwidth;	/* DMA count width */
     70  1.3   thorpej 	int		busmaster;	/* boolean; is a busmaster */
     71  1.3   thorpej };
     72  1.3   thorpej 
     73  1.3   thorpej #define	OFISA_DMA_MODE_COMPAT	0	/* compatibility mode */
     74  1.3   thorpej #define	OFISA_DMA_MODE_A	1	/* DMA A mode */
     75  1.3   thorpej #define	OFISA_DMA_MODE_B	2	/* DMA B mode */
     76  1.3   thorpej #define	OFISA_DMA_MODE_F	3	/* DMA F mode */
     77  1.3   thorpej #define	OFISA_DMA_MODE_C	4	/* DMA C mode */
     78  1.3   thorpej 
     79  1.1       cgd /*
     80  1.1       cgd  * Machine-dependent function/macro definitions.
     81  1.1       cgd  *
     82  1.1       cgd  * Machine-dependent code must implement at least:
     83  1.1       cgd  *
     84  1.1       cgd  *	int	ofisa_get_isabus_data(int phandle,
     85  1.1       cgd  *		    struct isabus_attach_args *iba);
     86  1.1       cgd  *
     87  1.1       cgd  *	int	ofisa_ignore_child(int pphandle, int cphandle);
     88  1.1       cgd  *
     89  1.1       cgd  * Individual ofisa attachments may want addition functions or
     90  1.1       cgd  * macros from this (or other) headers.  See those attachments'
     91  1.1       cgd  * files for more details.
     92  1.1       cgd  */
     93  1.4       cgd #include <machine/ofisa_machdep.h>
     94  1.1       cgd 
     95  1.5     perry int	ofisa_reg_count(int);
     96  1.5     perry int	ofisa_reg_get(int, struct ofisa_reg_desc *, int);
     97  1.5     perry void	ofisa_reg_print(struct ofisa_reg_desc *, int);
     98  1.5     perry int	ofisa_intr_count(int);
     99  1.5     perry int	ofisa_intr_get(int, struct ofisa_intr_desc *, int);
    100  1.5     perry void	ofisa_intr_print(struct ofisa_intr_desc *, int);
    101  1.5     perry int	ofisa_dma_count(int);
    102  1.5     perry int	ofisa_dma_get(int, struct ofisa_dma_desc *, int);
    103  1.5     perry void	ofisa_dma_print(struct ofisa_dma_desc *, int);
    104  1.7  christos void	ofisa_print_model(device_t, int);
    105  1.8   thorpej int	ofisaprint(void *, const char *);
    106  1.1       cgd 
    107  1.1       cgd #endif /* _DEV_OFISA_OFISAVAR_H_ */
    108