xref: /openbsd-src/sys/arch/alpha/mcbus/mcmem.c (revision 6aef9a4e4bcb6a36740e54f2ae0d9a714ecc29ec)
1 /* $OpenBSD: mcmem.c,v 1.3 2022/03/13 08:04:13 mpi Exp $ */
2 /* $NetBSD: mcmem.c,v 1.4 2002/10/02 04:06:38 thorpej Exp $ */
3 
4 /*
5  * Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
6  * Copyright (c) 1998 by Matthew Jacob
7  * NASA AMES Research Center.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice immediately at the beginning of the file, without modification,
15  *    this list of conditions, and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote products
20  *    derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
26  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  */
34 
35 /*
36  * 'dummy' (for now) node for the memory modules attached to
37  * the MCBUS main system bus found on AlphaServer 4100 systems.
38  */
39 
40 #include <sys/param.h>
41 #include <sys/systm.h>
42 #include <sys/device.h>
43 #include <sys/malloc.h>
44 
45 #include <machine/autoconf.h>
46 #include <machine/rpb.h>
47 #include <machine/pte.h>
48 
49 #include <alpha/mcbus/mcbusreg.h>
50 #include <alpha/mcbus/mcbusvar.h>
51 
52 int	mcmemmatch (struct device *, void *, void *);
53 void	mcmemattach (struct device *, struct device *, void *);
54 
55 const struct cfattach mcmem_ca = {
56         sizeof(struct device), mcmemmatch, mcmemattach
57 };
58 
59 struct cfdriver mcmem_cd = {
60         NULL, "mcmem", DV_DULL,
61 };
62 
63 int
mcmemmatch(parent,cf,aux)64 mcmemmatch(parent, cf, aux)
65 	struct device *parent;
66 	void *cf;
67 	void *aux;
68 {
69 	struct mcbus_dev_attach_args *ta = aux;
70 
71 	if (ta->ma_type == MCBUS_TYPE_MEM)
72 		return (1);
73 
74 	return (0);
75 }
76 
77 void
mcmemattach(parent,self,aux)78 mcmemattach(parent, self, aux)
79 	struct device *parent;
80 	struct device *self;
81 	void *aux;
82 {
83 	printf("\n");
84 }
85