ibm40x_machdep.c revision 1.2.4.5 1 1.2.4.5 skrll /* $NetBSD: ibm40x_machdep.c,v 1.2.4.5 2005/01/24 08:34:26 skrll Exp $ */
2 1.2.4.2 skrll
3 1.2.4.2 skrll /*
4 1.2.4.2 skrll * Copyright 2001, 2002 Wasabi Systems, Inc.
5 1.2.4.2 skrll * All rights reserved.
6 1.2.4.2 skrll *
7 1.2.4.2 skrll * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 1.2.4.2 skrll *
9 1.2.4.2 skrll * Redistribution and use in source and binary forms, with or without
10 1.2.4.2 skrll * modification, are permitted provided that the following conditions
11 1.2.4.2 skrll * are met:
12 1.2.4.2 skrll * 1. Redistributions of source code must retain the above copyright
13 1.2.4.2 skrll * notice, this list of conditions and the following disclaimer.
14 1.2.4.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
15 1.2.4.2 skrll * notice, this list of conditions and the following disclaimer in the
16 1.2.4.2 skrll * documentation and/or other materials provided with the distribution.
17 1.2.4.2 skrll * 3. All advertising materials mentioning features or use of this software
18 1.2.4.2 skrll * must display the following acknowledgement:
19 1.2.4.2 skrll * This product includes software developed for the NetBSD Project by
20 1.2.4.2 skrll * Wasabi Systems, Inc.
21 1.2.4.2 skrll * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.2.4.2 skrll * or promote products derived from this software without specific prior
23 1.2.4.2 skrll * written permission.
24 1.2.4.2 skrll *
25 1.2.4.2 skrll * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.2.4.2 skrll * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.2.4.2 skrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.2.4.2 skrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.2.4.2 skrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.2.4.2 skrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.2.4.2 skrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.2.4.2 skrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.2.4.2 skrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.2.4.2 skrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.2.4.2 skrll * POSSIBILITY OF SUCH DAMAGE.
36 1.2.4.2 skrll */
37 1.2.4.2 skrll
38 1.2.4.2 skrll /*
39 1.2.4.2 skrll * Copyright (C) 1995, 1996 Wolfgang Solfrank.
40 1.2.4.2 skrll * Copyright (C) 1995, 1996 TooLs GmbH.
41 1.2.4.2 skrll * All rights reserved.
42 1.2.4.2 skrll *
43 1.2.4.2 skrll * Redistribution and use in source and binary forms, with or without
44 1.2.4.2 skrll * modification, are permitted provided that the following conditions
45 1.2.4.2 skrll * are met:
46 1.2.4.2 skrll * 1. Redistributions of source code must retain the above copyright
47 1.2.4.2 skrll * notice, this list of conditions and the following disclaimer.
48 1.2.4.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
49 1.2.4.2 skrll * notice, this list of conditions and the following disclaimer in the
50 1.2.4.2 skrll * documentation and/or other materials provided with the distribution.
51 1.2.4.2 skrll * 3. All advertising materials mentioning features or use of this software
52 1.2.4.2 skrll * must display the following acknowledgement:
53 1.2.4.2 skrll * This product includes software developed by TooLs GmbH.
54 1.2.4.2 skrll * 4. The name of TooLs GmbH may not be used to endorse or promote products
55 1.2.4.2 skrll * derived from this software without specific prior written permission.
56 1.2.4.2 skrll *
57 1.2.4.2 skrll * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
58 1.2.4.2 skrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59 1.2.4.2 skrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60 1.2.4.2 skrll * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61 1.2.4.2 skrll * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
62 1.2.4.2 skrll * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
63 1.2.4.2 skrll * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
64 1.2.4.2 skrll * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
65 1.2.4.2 skrll * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
66 1.2.4.2 skrll * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 1.2.4.2 skrll */
68 1.2.4.2 skrll
69 1.2.4.2 skrll #include <sys/cdefs.h>
70 1.2.4.5 skrll __KERNEL_RCSID(0, "$NetBSD: ibm40x_machdep.c,v 1.2.4.5 2005/01/24 08:34:26 skrll Exp $");
71 1.2.4.2 skrll
72 1.2.4.2 skrll #include <sys/param.h>
73 1.2.4.2 skrll #include <sys/exec.h>
74 1.2.4.2 skrll #include <sys/systm.h>
75 1.2.4.2 skrll
76 1.2.4.2 skrll #include <machine/powerpc.h>
77 1.2.4.2 skrll
78 1.2.4.2 skrll /*
79 1.2.4.2 skrll * Global variables used here and there
80 1.2.4.2 skrll */
81 1.2.4.5 skrll #define MEMREGIONS (8)
82 1.2.4.2 skrll struct mem_region physmemr[MEMREGIONS]; /* Hard code memory */
83 1.2.4.2 skrll struct mem_region availmemr[MEMREGIONS];/* Who's supposed to set these up? */
84 1.2.4.2 skrll
85 1.2.4.2 skrll void
86 1.2.4.5 skrll ibm40x_memsize_init(u_int memsize, u_int startkernel)
87 1.2.4.2 skrll {
88 1.2.4.2 skrll
89 1.2.4.5 skrll /* Initialize cache info for memcpy, etc. */
90 1.2.4.5 skrll cpu_probe_cache();
91 1.2.4.2 skrll
92 1.2.4.2 skrll memset(physmemr, 0, sizeof physmemr);
93 1.2.4.2 skrll memset(availmemr, 0, sizeof availmemr);
94 1.2.4.2 skrll
95 1.2.4.5 skrll /* Setup physical memory */
96 1.2.4.5 skrll physmemr[0].start = 0;
97 1.2.4.5 skrll physmemr[0].size = memsize & ~PGOFSET;
98 1.2.4.2 skrll
99 1.2.4.5 skrll /* Setup availabl memory, lower memory reserved by evb-BIOS */
100 1.2.4.5 skrll availmemr[0].start = startkernel;
101 1.2.4.5 skrll availmemr[0].size = memsize - availmemr[0].start;
102 1.2.4.2 skrll }
103 1.2.4.2 skrll
104 1.2.4.2 skrll void
105 1.2.4.2 skrll mem_regions(struct mem_region **mem, struct mem_region **avail)
106 1.2.4.2 skrll {
107 1.2.4.2 skrll *mem = physmemr;
108 1.2.4.2 skrll *avail = availmemr;
109 1.2.4.2 skrll }
110