NetBSD/sys/arch/cobalt/dev/gt.c

105 lines
2.9 KiB
C

/* $NetBSD: gt.c,v 1.5 2002/05/16 01:01:35 thorpej Exp $ */
/*
* 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
};
static int
gt_match(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
{
return 1;
}
static void
gt_attach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
{
struct pcibus_attach_args pba;
printf("\n");
/* XXX */
*((volatile u_int32_t *)0xb4000c00) =
(*((volatile u_int32_t *)0xb4000c00) & ~0x6) | 0x2;
#if NPCI > 0
pba.pba_busname = "pci";
pba.pba_dmat = &pci_bus_dma_tag;
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
pba.pba_bus = 0;
pba.pba_bridgetag = NULL;
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
config_found(self, &pba, gt_print);
#endif
return;
}
static int
gt_print(aux, pnp)
void *aux;
const char *pnp;
{
/* XXX */
return 0;
}