gt.c revision 1.5.2.2 1 1.5.2.2 thorpej /* $NetBSD: gt.c,v 1.5.2.2 2002/05/16 01:01:36 thorpej Exp $ */
2 1.5.2.2 thorpej
3 1.5.2.2 thorpej /*
4 1.5.2.2 thorpej * Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
5 1.5.2.2 thorpej *
6 1.5.2.2 thorpej * Redistribution and use in source and binary forms, with or without
7 1.5.2.2 thorpej * modification, are permitted provided that the following conditions
8 1.5.2.2 thorpej * are met:
9 1.5.2.2 thorpej * 1. Redistributions of source code must retain the above copyright
10 1.5.2.2 thorpej * notice, this list of conditions, and the following disclaimer.
11 1.5.2.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
12 1.5.2.2 thorpej * notice, this list of conditions and the following disclaimer in the
13 1.5.2.2 thorpej * documentation and/or other materials provided with the distribution.
14 1.5.2.2 thorpej *
15 1.5.2.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.5.2.2 thorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.5.2.2 thorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.5.2.2 thorpej * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.5.2.2 thorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.5.2.2 thorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.5.2.2 thorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.5.2.2 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.5.2.2 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.5.2.2 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.5.2.2 thorpej * SUCH DAMAGE.
26 1.5.2.2 thorpej */
27 1.5.2.2 thorpej
28 1.5.2.2 thorpej #include <sys/param.h>
29 1.5.2.2 thorpej #include <sys/systm.h>
30 1.5.2.2 thorpej #include <sys/ioctl.h>
31 1.5.2.2 thorpej #include <sys/select.h>
32 1.5.2.2 thorpej #include <sys/tty.h>
33 1.5.2.2 thorpej #include <sys/proc.h>
34 1.5.2.2 thorpej #include <sys/user.h>
35 1.5.2.2 thorpej #include <sys/conf.h>
36 1.5.2.2 thorpej #include <sys/file.h>
37 1.5.2.2 thorpej #include <sys/uio.h>
38 1.5.2.2 thorpej #include <sys/kernel.h>
39 1.5.2.2 thorpej #include <sys/syslog.h>
40 1.5.2.2 thorpej #include <sys/types.h>
41 1.5.2.2 thorpej #include <sys/device.h>
42 1.5.2.2 thorpej
43 1.5.2.2 thorpej #include <machine/intr.h>
44 1.5.2.2 thorpej #include <machine/bus.h>
45 1.5.2.2 thorpej
46 1.5.2.2 thorpej #include <dev/pci/pcivar.h>
47 1.5.2.2 thorpej #include "pci.h"
48 1.5.2.2 thorpej
49 1.5.2.2 thorpej struct gt_softc {
50 1.5.2.2 thorpej struct device sc_dev;
51 1.5.2.2 thorpej };
52 1.5.2.2 thorpej
53 1.5.2.2 thorpej static int gt_match(struct device *, struct cfdata *, void *);
54 1.5.2.2 thorpej static void gt_attach(struct device *, struct device *, void *);
55 1.5.2.2 thorpej static int gt_print(void *aux, const char *pnp);
56 1.5.2.2 thorpej
57 1.5.2.2 thorpej struct cfattach gt_ca = {
58 1.5.2.2 thorpej sizeof(struct gt_softc), gt_match, gt_attach
59 1.5.2.2 thorpej };
60 1.5.2.2 thorpej
61 1.5.2.2 thorpej static int
62 1.5.2.2 thorpej gt_match(parent, match, aux)
63 1.5.2.2 thorpej struct device *parent;
64 1.5.2.2 thorpej struct cfdata *match;
65 1.5.2.2 thorpej void *aux;
66 1.5.2.2 thorpej {
67 1.5.2.2 thorpej return 1;
68 1.5.2.2 thorpej }
69 1.5.2.2 thorpej
70 1.5.2.2 thorpej static void
71 1.5.2.2 thorpej gt_attach(parent, self, aux)
72 1.5.2.2 thorpej struct device *parent;
73 1.5.2.2 thorpej struct device *self;
74 1.5.2.2 thorpej void *aux;
75 1.5.2.2 thorpej {
76 1.5.2.2 thorpej struct pcibus_attach_args pba;
77 1.5.2.2 thorpej
78 1.5.2.2 thorpej printf("\n");
79 1.5.2.2 thorpej
80 1.5.2.2 thorpej /* XXX */
81 1.5.2.2 thorpej *((volatile u_int32_t *)0xb4000c00) =
82 1.5.2.2 thorpej (*((volatile u_int32_t *)0xb4000c00) & ~0x6) | 0x2;
83 1.5.2.2 thorpej
84 1.5.2.2 thorpej #if NPCI > 0
85 1.5.2.2 thorpej pba.pba_busname = "pci";
86 1.5.2.2 thorpej pba.pba_dmat = &pci_bus_dma_tag;
87 1.5.2.2 thorpej pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
88 1.5.2.2 thorpej pba.pba_bus = 0;
89 1.5.2.2 thorpej pba.pba_bridgetag = NULL;
90 1.5.2.2 thorpej pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
91 1.5.2.2 thorpej PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
92 1.5.2.2 thorpej config_found(self, &pba, gt_print);
93 1.5.2.2 thorpej #endif
94 1.5.2.2 thorpej return;
95 1.5.2.2 thorpej }
96 1.5.2.2 thorpej
97 1.5.2.2 thorpej static int
98 1.5.2.2 thorpej gt_print(aux, pnp)
99 1.5.2.2 thorpej void *aux;
100 1.5.2.2 thorpej const char *pnp;
101 1.5.2.2 thorpej {
102 1.5.2.2 thorpej /* XXX */
103 1.5.2.2 thorpej return 0;
104 1.5.2.2 thorpej }
105