Home | History | Annotate | Line # | Download | only in dev
      1  1.12     palle /*	$NetBSD: ebusvar.h,v 1.12 2014/08/24 19:06:14 palle Exp $	*/
      2   1.1       mrg 
      3   1.1       mrg /*
      4   1.6       mrg  * Copyright (c) 1999, 2000, 2001 Matthew R. Green
      5   1.1       mrg  * All rights reserved.
      6   1.1       mrg  *
      7   1.1       mrg  * Redistribution and use in source and binary forms, with or without
      8   1.1       mrg  * modification, are permitted provided that the following conditions
      9   1.1       mrg  * are met:
     10   1.1       mrg  * 1. Redistributions of source code must retain the above copyright
     11   1.1       mrg  *    notice, this list of conditions and the following disclaimer.
     12   1.1       mrg  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1       mrg  *    notice, this list of conditions and the following disclaimer in the
     14   1.1       mrg  *    documentation and/or other materials provided with the distribution.
     15   1.1       mrg  *
     16   1.1       mrg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17   1.1       mrg  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18   1.1       mrg  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19   1.1       mrg  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20   1.1       mrg  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21   1.1       mrg  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     22   1.1       mrg  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23   1.1       mrg  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24   1.1       mrg  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25   1.1       mrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26   1.1       mrg  * SUCH DAMAGE.
     27   1.1       mrg  */
     28   1.1       mrg 
     29   1.1       mrg #ifndef _SPARC64_DEV_EBUSVAR_H_
     30   1.1       mrg #define _SPARC64_DEV_EBUSVAR_H_
     31   1.1       mrg 
     32   1.9       mrg #include <sys/param.h>
     33   1.9       mrg #include <sys/conf.h>
     34   1.9       mrg #include <sys/device.h>
     35   1.9       mrg #include <sys/systm.h>
     36   1.9       mrg #include <sys/time.h>
     37   1.9       mrg 
     38   1.9       mrg #define _SPARC_BUS_DMA_PRIVATE
     39  1.11    dyoung #include <sys/bus.h>
     40   1.9       mrg 
     41   1.9       mrg #include <dev/pci/pcivar.h>
     42   1.9       mrg #include <dev/pci/pcireg.h>
     43   1.9       mrg #include <dev/pci/pcidevs.h>
     44   1.9       mrg 
     45   1.9       mrg #include <dev/ebus/ebusreg.h>
     46   1.9       mrg #include <dev/ebus/ebusvar.h>
     47   1.9       mrg 
     48   1.9       mrg struct ebus_softc {
     49  1.10  christos 	device_t			sc_dev;
     50   1.9       mrg 
     51   1.9       mrg 	int				sc_node;
     52   1.9       mrg 
     53   1.9       mrg 	bus_space_tag_t			sc_memtag;	/* from pci */
     54   1.9       mrg 	bus_space_tag_t			sc_iotag;	/* from pci */
     55   1.9       mrg 	bus_space_tag_t			sc_childbustag;	/* pass to children */
     56   1.9       mrg 	bus_dma_tag_t			sc_dmatag;
     57   1.9       mrg 
     58   1.9       mrg 	struct ebus_ranges		*sc_range;
     59   1.9       mrg 	struct ebus_interrupt_map	*sc_intmap;
     60   1.9       mrg 	struct ebus_interrupt_map_mask	sc_intmapmask;
     61   1.9       mrg 
     62   1.9       mrg 	int				sc_nrange;	/* counters */
     63   1.9       mrg 	int				sc_nintmap;
     64   1.1       mrg };
     65   1.1       mrg 
     66   1.9       mrg int	ebus_setup_attach_args(struct ebus_softc *, int,
     67   1.9       mrg 	    struct ebus_attach_args *);
     68   1.9       mrg void	ebus_destroy_attach_args(struct ebus_attach_args *);
     69   1.9       mrg int	ebus_print(void *, const char *);
     70   1.9       mrg void	ebus_find_ino(struct ebus_softc *, struct ebus_attach_args *);
     71   1.9       mrg 
     72   1.9       mrg paddr_t ebus_bus_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int);
     73   1.9       mrg 
     74   1.9       mrg bus_space_tag_t ebus_alloc_bus_tag(struct ebus_softc *, int);
     75   1.9       mrg 
     76   1.9       mrg #endif
     77