Home | History | Annotate | Line # | Download | only in ep93xx
ep93xxvar.h revision 1.4
      1  1.4  dyoung /*	$NetBSD: ep93xxvar.h,v 1.4 2011/07/01 19:31:17 dyoung Exp $ */
      2  1.1    joff /*
      3  1.1    joff  * Copyright (c) 2004 Jesse Off
      4  1.1    joff  * All rights reserved.
      5  1.1    joff  *
      6  1.1    joff  * Redistribution and use in source and binary forms, with or without
      7  1.1    joff  * modification, are permitted provided that the following conditions
      8  1.1    joff  * are met:
      9  1.1    joff  * 1. Redistributions of source code must retain the above copyright
     10  1.1    joff  *    notice, this list of conditions and the following disclaimer.
     11  1.1    joff  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1    joff  *    notice, this list of conditions and the following disclaimer in the
     13  1.1    joff  *    documentation and/or other materials provided with the distribution.
     14  1.1    joff  *
     15  1.1    joff  * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
     16  1.1    joff  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17  1.1    joff  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18  1.1    joff  * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
     19  1.1    joff  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20  1.1    joff  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21  1.1    joff  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22  1.1    joff  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23  1.1    joff  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24  1.1    joff  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25  1.1    joff  * SUCH DAMAGE.
     26  1.1    joff  */
     27  1.1    joff 
     28  1.1    joff #ifndef _EP93XXVAR_H_
     29  1.1    joff #define _EP93XXVAR_H_
     30  1.1    joff 
     31  1.1    joff #include <sys/conf.h>
     32  1.1    joff #include <sys/device.h>
     33  1.1    joff #include <sys/queue.h>
     34  1.1    joff 
     35  1.4  dyoung #include <sys/bus.h>
     36  1.1    joff 
     37  1.1    joff struct ep93xx_softc {
     38  1.1    joff 	struct device sc_dev;
     39  1.1    joff 	bus_space_tag_t sc_iot;
     40  1.1    joff };
     41  1.1    joff 
     42  1.1    joff struct intrhand {
     43  1.1    joff 	TAILQ_ENTRY(intrhand) ih_list;	/* link on intrq list */
     44  1.1    joff 	int (*ih_func)(void *);		/* interrupt handler */
     45  1.1    joff 	void *ih_arg;			/* arg for handler */
     46  1.1    joff 	int ih_ipl;			/* IPL_* */
     47  1.1    joff 	int ih_irq;			/* IRQ number */
     48  1.1    joff };
     49  1.1    joff 
     50  1.1    joff #define	IRQNAMESIZE	sizeof("ep93xxintr irq xxx")
     51  1.1    joff 
     52  1.1    joff struct intrq {
     53  1.1    joff 	TAILQ_HEAD(, intrhand) iq_list;	/* handler list */
     54  1.1    joff 	struct evcnt iq_ev;		/* event counter */
     55  1.1    joff 	u_int32_t iq_vic1_mask;		/* VIC1 IRQs to mask while handling */
     56  1.1    joff 	u_int32_t iq_vic2_mask;		/* VIC2 IRQs to mask while handling */
     57  1.1    joff 	u_int32_t iq_levels;		/* IPL_*'s this IRQ has */
     58  1.1    joff 	char iq_name[IRQNAMESIZE];	/* interrupt name */
     59  1.1    joff 	int iq_ist;			/* share type */
     60  1.1    joff };
     61  1.1    joff 
     62  1.1    joff struct pmap_ent {
     63  1.1    joff 	const char*	msg;
     64  1.1    joff 	vaddr_t		va;
     65  1.1    joff 	paddr_t		pa;
     66  1.1    joff 	vsize_t		sz;
     67  1.1    joff 	int		prot;
     68  1.1    joff 	int		cache;
     69  1.1    joff };
     70  1.1    joff 
     71  1.1    joff extern struct bus_space	ep93xx_bs_tag;
     72  1.1    joff extern struct arm32_bus_dma_tag ep93xx_bus_dma;
     73  1.1    joff 
     74  1.1    joff void	ep93xx_attach(struct ep93xx_softc *);
     75  1.1    joff void	ep93xx_intr_init(void);
     76  1.1    joff void	*ep93xx_intr_establish(int irq, int ipl, int (*)(void *), void *);
     77  1.1    joff void	ep93xx_intr_disestablish(void *);
     78  1.1    joff /* Platform needs to provide this */
     79  1.1    joff bus_dma_tag_t ep93xx_bus_dma_init(struct arm32_bus_dma_tag *);
     80  1.1    joff void	ep93xx_reset(void);
     81  1.1    joff 
     82  1.1    joff #endif /* _EP93XXVAR_H_ */
     83