Do not allocate NuBus space at boot time. Do allocate enough space for

the console video, though.
This commit is contained in:
briggs 1996-05-06 01:04:58 +00:00
parent f194862b11
commit 333d8a1deb
1 changed files with 22 additions and 38 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.21 1996/05/05 06:54:21 briggs Exp $ */ /* $NetBSD: pmap_bootstrap.c,v 1.22 1996/05/06 01:04:58 briggs Exp $ */
/* /*
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -83,10 +83,14 @@ extern int nbnumranges;
extern u_long nbphys[]; extern u_long nbphys[];
extern u_long nblog[]; extern u_long nblog[];
extern signed long nblen[]; extern signed long nblen[];
#define VIDMAPSIZE btoc(mac68k_round_page(mac68k_vidlen)) #define VIDMAPSIZE btoc(mac68k_round_page(vidlen))
extern u_int32_t mac68k_vidlen;
extern u_int32_t mac68k_vidlog; extern u_int32_t mac68k_vidlog;
extern u_int32_t mac68k_vidphys; extern u_int32_t mac68k_vidphys;
extern u_int32_t videoaddr;
extern u_int32_t videorowbytes;
extern u_int32_t videosize;
static int vidlen;
static u_int32_t newvideoaddr;
extern caddr_t ROMBase; extern caddr_t ROMBase;
@ -113,13 +117,14 @@ pmap_bootstrap(nextpa, firstpa)
vm_offset_t nextpa; vm_offset_t nextpa;
register vm_offset_t firstpa; register vm_offset_t firstpa;
{ {
vm_offset_t kstpa, kptpa, vidpa, iiopa, nbpa, rompa; vm_offset_t kstpa, kptpa, vidpa, iiopa, rompa;
vm_offset_t kptmpa, lkptpa, p0upa; vm_offset_t kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize; u_int nptpages, kstsize;
int i; int i;
register st_entry_t protoste, *ste; register st_entry_t protoste, *ste;
register pt_entry_t protopte, *pte, *epte; register pt_entry_t protopte, *pte, *epte;
vidlen = ((videosize >> 16) & 0xffff) * videorowbytes;
/* /*
* Calculate important physical addresses: * Calculate important physical addresses:
* *
@ -132,9 +137,6 @@ pmap_bootstrap(nextpa, firstpa)
* vidpa internal video space for some machines * vidpa internal video space for some machines
* PT pages VIDMAPSIZE pages * PT pages VIDMAPSIZE pages
* *
* nbpa NuBus IO space
* PT pages NBMAPSIZE pages
*
* rompa ROM space * rompa ROM space
* PT pages ROMMAPSIZE pages * PT pages ROMMAPSIZE pages
* *
@ -160,12 +162,10 @@ pmap_bootstrap(nextpa, firstpa)
nextpa += kstsize * NBPG; nextpa += kstsize * NBPG;
kptpa = nextpa; kptpa = nextpa;
nptpages = Sysptsize + nptpages = Sysptsize +
(IIOMAPSIZE + NBMAPSIZE + ROMMAPSIZE + VIDMAPSIZE (IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE + NPTEPG - 1) / NPTEPG;
+ NPTEPG - 1) / NPTEPG;
nextpa += nptpages * NBPG; nextpa += nptpages * NBPG;
vidpa = nextpa - VIDMAPSIZE * sizeof(pt_entry_t); vidpa = nextpa - VIDMAPSIZE * sizeof(pt_entry_t);
nbpa = vidpa - NBMAPSIZE * sizeof(pt_entry_t); rompa = vidpa - ROMMAPSIZE * sizeof(pt_entry_t);
rompa = nbpa - ROMMAPSIZE * sizeof(pt_entry_t);
iiopa = rompa - IIOMAPSIZE * sizeof(pt_entry_t); iiopa = rompa - IIOMAPSIZE * sizeof(pt_entry_t);
kptmpa = nextpa; kptmpa = nextpa;
nextpa += NBPG; nextpa += NBPG;
@ -377,22 +377,14 @@ pmap_bootstrap(nextpa, firstpa)
} }
pte = PA2VA(rompa, u_int *); pte = PA2VA(rompa, u_int *);
epte = PA2VA(nbpa, u_int *); epte = PA2VA(vidpa, u_int *);
protopte = ((u_int) ROMBase) | PG_RO | PG_V; protopte = ((u_int) ROMBase) | PG_RO | PG_V;
while (pte < epte) { while (pte < epte) {
*pte++ = protopte; *pte++ = protopte;
protopte += NBPG; protopte += NBPG;
} }
pte = PA2VA(nbpa, u_int *); if (vidlen) {
epte = pte + NBMAPSIZE;
protopte = NBBASE | PG_RW | PG_V | PG_CI;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
if (mac68k_vidlog) {
pte = PA2VA(vidpa, u_int *); pte = PA2VA(vidpa, u_int *);
epte = pte + VIDMAPSIZE; epte = pte + VIDMAPSIZE;
protopte = mac68k_vidphys | PG_RW | PG_V | PG_CI; protopte = mac68k_vidphys | PG_RW | PG_V | PG_CI;
@ -420,18 +412,17 @@ pmap_bootstrap(nextpa, firstpa)
Sysmap = (pt_entry_t *)mac68k_ptob(nptpages * NPTEPG); Sysmap = (pt_entry_t *)mac68k_ptob(nptpages * NPTEPG);
IOBase = (u_long)mac68k_ptob(nptpages*NPTEPG - IOBase = (u_long)mac68k_ptob(nptpages*NPTEPG -
(IIOMAPSIZE + ROMMAPSIZE + NBMAPSIZE + VIDMAPSIZE)); (IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE));
ROMBase = (char *)mac68k_ptob(nptpages*NPTEPG - ROMBase = (char *)mac68k_ptob(nptpages*NPTEPG -
(ROMMAPSIZE + NBMAPSIZE + VIDMAPSIZE)); (ROMMAPSIZE + VIDMAPSIZE));
NuBusBase = (u_long)mac68k_ptob(nptpages*NPTEPG - if (vidlen) {
(NBMAPSIZE + VIDMAPSIZE)); newvideoaddr =
if (mac68k_vidlog)
mac68k_vidlog = (u_int32_t) mac68k_vidlog = (u_int32_t)
mac68k_ptob(nptpages*NPTEPG - VIDMAPSIZE) mac68k_ptob(nptpages*NPTEPG - VIDMAPSIZE)
+ (mac68k_vidphys & PGOFSET); + (mac68k_vidphys & PGOFSET);
}
/* /*
* Setup u-area for process 0. * Setup u-area for process 0.
@ -562,11 +553,9 @@ void
bootstrap_mac68k(tc) bootstrap_mac68k(tc)
int tc; int tc;
{ {
extern u_long videoaddr;
extern caddr_t esym; extern caddr_t esym;
vm_offset_t nextpa; vm_offset_t nextpa;
caddr_t oldROMBase; caddr_t oldROMBase;
u_long newvideoaddr;
if (mac68k_machine.do_graybars) if (mac68k_machine.do_graybars)
printf("Bootstrapping NetBSD/mac68k.\n"); printf("Bootstrapping NetBSD/mac68k.\n");
@ -612,14 +601,8 @@ bootstrap_mac68k(tc)
if (mac68k_machine.do_graybars) if (mac68k_machine.do_graybars)
printf("Pmap bootstrapped.\n"); printf("Pmap bootstrapped.\n");
if (mac68k_vidlog) if (!vidlen)
newvideoaddr = mac68k_vidlog;
else {
if (NBBASE <= videoaddr && videoaddr <= NBTOP)
newvideoaddr = videoaddr - NBBASE + NuBusBase;
else
panic("Don't know how to relocate video!\n"); panic("Don't know how to relocate video!\n");
}
if (mac68k_machine.do_graybars) if (mac68k_machine.do_graybars)
printf("Moving ROMBase from %p to %p.\n", printf("Moving ROMBase from %p to %p.\n",
@ -629,7 +612,8 @@ bootstrap_mac68k(tc)
if (mac68k_machine.do_graybars) if (mac68k_machine.do_graybars)
printf("Video address 0x%lx -> 0x%lx.\n", printf("Video address 0x%lx -> 0x%lx.\n",
videoaddr, newvideoaddr); (unsigned long) videoaddr,
(unsigned long) newvideoaddr);
mac68k_set_io_offsets(IOBase); mac68k_set_io_offsets(IOBase);
videoaddr = newvideoaddr; videoaddr = newvideoaddr;