summaryrefslogtreecommitdiffstats
path: root/sys/alpha/tc/tcasic.c
blob: 8a600f147574c0aef82bb69f756e261919862621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* $FreeBSD$ */
/* from $NetBSD: tcasic.c,v 1.23 1998/05/14 00:01:31 thorpej Exp $ */

/*
 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
 * All rights reserved.
 *
 * Author: Chris G. Demetriou
 * 
 * Permission to use, copy, modify and distribute this software and
 * its documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 *
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 *
 * any improvements or extensions that they make and grant Carnegie the
 * rights to redistribute these changes.
 */

#include "opt_cpu.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>

#include <machine/rpb.h>

/*#include <alpha/tc/dwlpxreg.h>*/

#define KV(pa)			ALPHA_PHYS_TO_K0SEG(pa)

static devclass_t	tcasic_devclass;
static device_t		tcasic0;		/* XXX only one for now */

struct tcasic_softc {
	vm_offset_t	dmem_base;	/* dense memory */
	vm_offset_t	smem_base;	/* sparse memory */
	vm_offset_t	io_base;	/* sparse i/o */
	vm_offset_t	cfg_base;	/* sparse pci config */
};

#define TCASIC_SOFTC(dev)	(struct tcasic_softc*) device_get_softc(dev)

static int tcasic_probe(device_t dev);
static int tcasic_attach(device_t dev);

static device_method_t tcasic_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		tcasic_probe),
	DEVMETHOD(device_attach,	tcasic_attach),
	DEVMETHOD(bus_print_child,      bus_generic_print_child),
	{ 0, 0 }
};

static driver_t tcasic_driver = {
	"tcasic",
	tcasic_methods,
	sizeof(struct tcasic_softc),
};

extern device_t tc0;
static int
tcasic_probe(device_t dev)
{
	if (tcasic0)
		return ENXIO;
	if((hwrpb->rpb_type != ST_DEC_3000_300) &&
	   (hwrpb->rpb_type != ST_DEC_3000_500))
		return ENXIO;
	tcasic0 = dev;
	device_set_desc(dev, "Turbochannel Host Bus Adapter");
	tc0 = device_add_child(dev, "tc", 0);
	return 0;
}

static int
tcasic_attach(device_t dev)
{
	tcasic0 = dev;

/*	chipset = tcasic_chipset;*/
	device_probe_and_attach(tc0);
	return 0;
}

DRIVER_MODULE(tcasic, root, tcasic_driver, tcasic_devclass, 0, 0);

OpenPOWER on IntegriCloud