2000-05-29 19:43:32 +04:00
|
|
|
/* $NetBSD: gt.c,v 1.4 2000/05/29 15:43:32 soren Exp $ */
|
2000-03-20 02:07:43 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/select.h>
|
|
|
|
#include <sys/tty.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/user.h>
|
|
|
|
#include <sys/conf.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/syslog.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
|
|
|
|
#include <machine/intr.h>
|
|
|
|
#include <machine/bus.h>
|
|
|
|
|
|
|
|
#include <dev/pci/pcivar.h>
|
|
|
|
#include "pci.h"
|
|
|
|
|
|
|
|
struct gt_softc {
|
|
|
|
struct device sc_dev;
|
|
|
|
};
|
|
|
|
|
|
|
|
static int gt_match(struct device *, struct cfdata *, void *);
|
|
|
|
static void gt_attach(struct device *, struct device *, void *);
|
|
|
|
static int gt_print(void *aux, const char *pnp);
|
|
|
|
|
|
|
|
struct cfattach gt_ca = {
|
|
|
|
sizeof(struct gt_softc), gt_match, gt_attach
|
|
|
|
};
|
|
|
|
|
2000-05-29 19:43:32 +04:00
|
|
|
static int
|
2000-03-20 02:07:43 +03:00
|
|
|
gt_match(parent, match, aux)
|
|
|
|
struct device *parent;
|
|
|
|
struct cfdata *match;
|
|
|
|
void *aux;
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2000-05-29 19:43:32 +04:00
|
|
|
static void
|
2000-03-20 02:07:43 +03:00
|
|
|
gt_attach(parent, self, aux)
|
|
|
|
struct device *parent;
|
|
|
|
struct device *self;
|
|
|
|
void *aux;
|
|
|
|
{
|
|
|
|
struct pcibus_attach_args pba;
|
|
|
|
|
|
|
|
printf("\n");
|
|
|
|
|
2000-03-31 18:51:49 +04:00
|
|
|
/* XXX */
|
|
|
|
*((volatile u_int32_t *)0xb4000c00) =
|
|
|
|
(*((volatile u_int32_t *)0xb4000c00) & ~0x6) | 0x2;
|
|
|
|
|
2000-03-20 02:07:43 +03:00
|
|
|
#if NPCI > 0
|
|
|
|
pba.pba_busname = "pci";
|
|
|
|
pba.pba_dmat = &pci_bus_dma_tag;
|
2000-04-09 04:11:51 +04:00
|
|
|
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
|
2000-03-20 02:07:43 +03:00
|
|
|
pba.pba_bus = 0;
|
2000-03-31 18:51:49 +04:00
|
|
|
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
|
2000-04-09 04:11:51 +04:00
|
|
|
PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
|
2000-03-20 02:07:43 +03:00
|
|
|
config_found(self, &pba, gt_print);
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-05-29 19:43:32 +04:00
|
|
|
static int
|
2000-03-20 02:07:43 +03:00
|
|
|
gt_print(aux, pnp)
|
|
|
|
void *aux;
|
|
|
|
const char *pnp;
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
return 0;
|
|
|
|
}
|