tlsbmem.c revision 1.1 1 /* $NetBSD: tlsbmem.c,v 1.1 1997/03/12 19:20:18 cgd Exp $ */
2
3 /*
4 * Copyright (c) 1997
5 * Matthew Jacob
6 * NASA AMES Research Center.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice immediately at the beginning of the file, without modification,
14 * this list of conditions, and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34 /*
35 * Dummy Node for TLSB Memory Modules found on
36 * AlphaServer 8200 and 8400 systems.
37 */
38
39 #include <sys/param.h>
40 #include <sys/systm.h>
41 #include <sys/device.h>
42 #include <sys/malloc.h>
43
44 #include <machine/autoconf.h>
45 #include <machine/rpb.h>
46 #include <machine/pte.h>
47
48 #include <alpha/tlsb/tlsbreg.h>
49 #include <alpha/tlsb/tlsbvar.h>
50
51 struct tlsbmem_softc {
52 struct device sc_dv;
53 int sc_node; /* TLSB node */
54 u_int16_t sc_dtype; /* device type */
55 };
56
57 static int tlsbmemmatch __P((struct device *, struct cfdata *, void *));
58 static void tlsbmemattach __P((struct device *, struct device *, void *));
59 struct cfattach tlsbmem_ca = {
60 sizeof (struct tlsbmem_softc), tlsbmemmatch, tlsbmemattach
61 };
62
63 struct cfdriver tlsbmem_cd = {
64 NULL, "tlsbmem", DV_DULL,
65 };
66
67 static int
68 tlsbmemmatch(parent, cf, aux)
69 struct device *parent;
70 struct cfdata *cf;
71 void *aux;
72 {
73 struct tlsb_dev_attach_args *ta = aux;
74 if (TLDEV_ISMEM(ta->ta_dtype))
75 return (1);
76 return (0);
77 }
78
79 static void
80 tlsbmemattach(parent, self, aux)
81 struct device *parent;
82 struct device *self;
83 void *aux;
84 {
85 struct tlsb_dev_attach_args *ta = aux;
86 struct tlsbmem_softc *sc = (struct tlsbmem_softc *)self;
87
88 sc->sc_node = ta->ta_node;
89 sc->sc_dtype = ta->ta_dtype;
90
91 printf("\n");
92 }
93