Home | History | Annotate | Line # | Download | only in dev
      1 /*	$NetBSD: elroyvar.h,v 1.2 2014/03/31 20:51:20 christos Exp $	*/
      2 
      3 /*	$OpenBSD: elroyvar.h,v 1.3 2007/06/17 14:51:21 kettenis Exp $	*/
      4 
      5 /*
      6  * Copyright (c) 2005 Michael Shalayeff
      7  * All rights reserved.
      8  *
      9  * Permission to use, copy, modify, and distribute this software for any
     10  * purpose with or without fee is hereby granted, provided that the above
     11  * copyright notice and this permission notice appear in all copies.
     12  *
     13  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     17  * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
     18  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     19  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     20  */
     21 
     22 #include <machine/pdc.h>
     23 
     24 struct elroy_softc {
     25 	device_t sc_dv;
     26 
     27 	int sc_ver;
     28 	hppa_hpa_t sc_hpa;
     29 	bus_space_tag_t sc_bt;
     30 	bus_space_handle_t sc_bh;
     31 	bus_dma_tag_t sc_dmat;
     32 	volatile struct elroy_regs *sc_regs;
     33 	bus_addr_t sc_iobase;
     34 
     35 	uint32_t sc_imr;
     36 	int sc_nints;
     37 	int *sc_irq;
     38 
     39 	struct pdc_pat_pci_rt *sc_int_tbl;
     40 	int sc_int_tbl_sz;
     41 
     42 	struct hppa_pci_chipset_tag sc_pc;
     43 	struct hppa_bus_space_tag sc_iot;
     44 	struct hppa_bus_space_tag sc_memt;
     45 	char sc_memexname[20];
     46 	struct extent *sc_memex;
     47 	struct hppa_bus_dma_tag sc_dmatag;
     48 };
     49 
     50 void apic_attach(struct elroy_softc *);
     51 int apic_intr(void *);
     52 int apic_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
     53 const char *apic_intr_string(void *, pci_intr_handle_t, char *, size_t);
     54 void *apic_intr_establish(void *, pci_intr_handle_t, int,
     55     int (*)(void *), void *);
     56 void apic_intr_disestablish(void *, void *);
     57 
     58 void elroy_write32(volatile uint32_t *, uint32_t);
     59 uint32_t elroy_read32(volatile uint32_t *);
     60