1*b6584574Sdyoung /* $NetBSD: gdiumvar.h,v 1.2 2011/07/01 18:45:36 dyoung Exp $ */ 274c9ebf3Smatt 374c9ebf3Smatt /*- 474c9ebf3Smatt * Copyright (c) 2001 The NetBSD Foundation, Inc. 574c9ebf3Smatt * All rights reserved. 674c9ebf3Smatt * 774c9ebf3Smatt * This code is derived from software contributed to The NetBSD Foundation 874c9ebf3Smatt * by Jason R. Thorpe. 974c9ebf3Smatt * 1074c9ebf3Smatt * Redistribution and use in source and binary forms, with or without 1174c9ebf3Smatt * modification, are permitted provided that the following conditions 1274c9ebf3Smatt * are met: 1374c9ebf3Smatt * 1. Redistributions of source code must retain the above copyright 1474c9ebf3Smatt * notice, this list of conditions and the following disclaimer. 1574c9ebf3Smatt * 2. Redistributions in binary form must reproduce the above copyright 1674c9ebf3Smatt * notice, this list of conditions and the following disclaimer in the 1774c9ebf3Smatt * documentation and/or other materials provided with the distribution. 1874c9ebf3Smatt * 1974c9ebf3Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2074c9ebf3Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2174c9ebf3Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2274c9ebf3Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2374c9ebf3Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2474c9ebf3Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2574c9ebf3Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2674c9ebf3Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2774c9ebf3Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2874c9ebf3Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2974c9ebf3Smatt * POSSIBILITY OF SUCH DAMAGE. 3074c9ebf3Smatt */ 3174c9ebf3Smatt 32*b6584574Sdyoung #include <sys/bus.h> 3374c9ebf3Smatt #include <dev/pci/pcivar.h> 3474c9ebf3Smatt 3574c9ebf3Smatt #include <mips/bonito/bonitovar.h> 3674c9ebf3Smatt 3774c9ebf3Smatt struct gdium_config { 3874c9ebf3Smatt struct bonito_config gc_bonito; 3974c9ebf3Smatt 4074c9ebf3Smatt struct mips_bus_space gc_iot; 4174c9ebf3Smatt struct mips_bus_space gc_memt; 4274c9ebf3Smatt 4374c9ebf3Smatt struct mips_bus_dma_tag gc_pci_dmat; 4474c9ebf3Smatt 4574c9ebf3Smatt struct mips_pci_chipset gc_pc; 4674c9ebf3Smatt 4774c9ebf3Smatt struct extent *gc_io_ex; 4874c9ebf3Smatt struct extent *gc_mem_ex; 4974c9ebf3Smatt 5074c9ebf3Smatt int gc_mallocsafe; 5174c9ebf3Smatt }; 5274c9ebf3Smatt 5374c9ebf3Smatt struct mainbus_attach_args { 5474c9ebf3Smatt const char *maa_name; 5574c9ebf3Smatt }; 5674c9ebf3Smatt 5774c9ebf3Smatt #define GDIUM_IRQ_GPIO0 0 5874c9ebf3Smatt #define GDIUM_IRQ_GPIO1 1 5974c9ebf3Smatt #define GDIUM_IRQ_GPIO2 2 6074c9ebf3Smatt #define GDIUM_IRQ_GPIO3 3 6174c9ebf3Smatt #define GDIUM_IRQ_PCI_INTA 4 6274c9ebf3Smatt #define GDIUM_IRQ_PCI_INTB 5 6374c9ebf3Smatt #define GDIUM_IRQ_PCI_INTC 6 6474c9ebf3Smatt #define GDIUM_IRQ_PCI_INTD 7 6574c9ebf3Smatt #define GDIUM_IRQ_PCI_PERR 8 6674c9ebf3Smatt #define GDIUM_IRQ_PCI_SERR 9 6774c9ebf3Smatt #define GDIUM_IRQ_DENALI 10 6874c9ebf3Smatt #define GDIUM_IRQ_INT0 11 6974c9ebf3Smatt #define GDIUM_IRQ_INT1 12 7074c9ebf3Smatt #define GDIUM_IRQ_INT2 13 7174c9ebf3Smatt #define GDIUM_IRQ_INT3 14 7274c9ebf3Smatt #define GDIUM_IRQ_MAX 14 7374c9ebf3Smatt 7474c9ebf3Smatt #ifdef _KERNEL 7574c9ebf3Smatt extern struct gdium_config gdium_configuration; 7674c9ebf3Smatt 7774c9ebf3Smatt int gdium_cnattach(struct gdium_config *); 7874c9ebf3Smatt 7974c9ebf3Smatt void gdium_bus_io_init(bus_space_tag_t, void *); 8074c9ebf3Smatt void gdium_bus_mem_init(bus_space_tag_t, void *); 8174c9ebf3Smatt 8274c9ebf3Smatt void gdium_dma_init(struct gdium_config *); 8374c9ebf3Smatt 8474c9ebf3Smatt void gdium_intr_init(struct gdium_config *); 8574c9ebf3Smatt 8674c9ebf3Smatt //void gdium_iointr(uint32_t, uint32_t, register_t, uint32_t); 8774c9ebf3Smatt 8874c9ebf3Smatt void gdium_cal_timer(bus_space_tag_t, bus_space_handle_t); 8974c9ebf3Smatt #endif /* _KERNEL */ 90