Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/macppc Add all RAM regions to battable.
details: https://anonhg.NetBSD.org/src/rev/bac3837bfa10
branches: trunk
changeset: 487569:bac3837bfa10
user: tsubai <tsubai%NetBSD.org@localhost>
date: Fri Jun 09 10:54:48 2000 +0000
description:
Add all RAM regions to battable.
This should support > 512MB memory. (untested, though)
diffstat:
sys/arch/macppc/macppc/machdep.c | 36 +++++++++++++++++++++++++++---------
1 files changed, 27 insertions(+), 9 deletions(-)
diffs (72 lines):
diff -r cfd746d660f0 -r bac3837bfa10 sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c Fri Jun 09 10:47:25 2000 +0000
+++ b/sys/arch/macppc/macppc/machdep.c Fri Jun 09 10:54:48 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.73 2000/05/26 21:19:54 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.74 2000/06/09 10:54:48 tsubai Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -153,6 +153,7 @@
extern void callback __P((void *));
extern void ext_intr __P((void));
int exc, scratch;
+ struct mem_region *allmem, *availmem, *mp;
/*
* Initialize BAT registers to unmapped to not generate
@@ -176,11 +177,14 @@
/*
* Map PCI memory space.
*/
- battable[8].batl = BATL(0x80000000, BAT_I, BAT_PP_RW);
- battable[8].batu = BATU(0x80000000, BAT_BL_256M, BAT_Vs);
+ battable[0x8].batl = BATL(0x80000000, BAT_I, BAT_PP_RW);
+ battable[0x8].batu = BATU(0x80000000, BAT_BL_256M, BAT_Vs);
- battable[9].batl = BATL(0x90000000, BAT_I, BAT_PP_RW);
- battable[9].batu = BATU(0x90000000, BAT_BL_256M, BAT_Vs);
+ battable[0x9].batl = BATL(0x90000000, BAT_I, BAT_PP_RW);
+ battable[0x9].batu = BATU(0x90000000, BAT_BL_256M, BAT_Vs);
+
+ battable[0xa].batl = BATL(0xa0000000, BAT_I, BAT_PP_RW);
+ battable[0xa].batu = BATU(0xa0000000, BAT_BL_256M, BAT_Vs);
/*
* Map obio devices.
@@ -199,6 +203,24 @@
"mtdbatl 0,%0; mtdbatu 0,%1;"
:: "r"(battable[0].batl), "r"(battable[0].batu));
+ /*
+ * Set up battable to map all RAM regions.
+ * This is here because mem_regions() call needs bat0 set up.
+ */
+ mem_regions(&allmem, &availmem);
+ for (mp = allmem; mp->size; mp++) {
+ paddr_t pa = mp->start & 0xf0000000;
+ paddr_t end = mp->start + mp->size;
+
+ do {
+ u_int n = pa >> 28;
+
+ battable[n].batl = BATL(pa, BAT_M, BAT_PP_RW);
+ battable[n].batu = BATU(pa, BAT_BL_256M, BAT_Vs);
+ pa += 0x10000000;
+ } while (pa < end);
+ }
+
chosen = OF_finddevice("/chosen");
save_ofw_mapping();
@@ -337,10 +359,6 @@
pmap_bootstrap(startkernel, endkernel);
restore_ofw_mapping();
- battable[msgbuf_paddr >> 28].batl = BATL(msgbuf_paddr, BAT_M,
- BAT_PP_RW);
- battable[msgbuf_paddr >> 28].batu = BATU(msgbuf_paddr, BAT_BL_256M,
- BAT_Vs);
}
static int N_mapping;
Home |
Main Index |
Thread Index |
Old Index