diff options
| author | tsubai <tsubai@NetBSD.org> | 1998-09-21 17:16:26 +0000 |
|---|---|---|
| committer | tsubai <tsubai@NetBSD.org> | 1998-09-21 17:16:26 +0000 |
| commit | bd8b85cdd8d3414ab4bd7f8400aa4879fa94dea9 (patch) | |
| tree | ce20670e2cfbfb2576b95337ebc32b9a7b9a7f5e /sys | |
| parent | c6b24f68f030561999470f4792ccd60e4bc13ce0 (diff) | |
Correct battable[] usage.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/macppc/macppc/locore.S | 28 | ||||
| -rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 48 |
2 files changed, 36 insertions, 40 deletions
diff --git a/sys/arch/macppc/macppc/locore.S b/sys/arch/macppc/macppc/locore.S index c7586b809d6..7070d7e71ee 100644 --- a/sys/arch/macppc/macppc/locore.S +++ b/sys/arch/macppc/macppc/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.7 1998/09/13 09:15:51 thorpej Exp $ */ +/* $NetBSD: locore.S,v 1.8 1998/09/21 17:16:26 tsubai Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -74,6 +74,9 @@ GLOBAL(intrcnt) .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 GLOBAL(eintrcnt) +GLOBAL(ofbat) + .long 0,0 /* batu, batl */ + /* * File-scope for locore.S */ @@ -81,8 +84,8 @@ idle_u: .long 0 /* fake uarea during idle after exit */ openfirmware_entry: .long 0 /* openfirmware entry point */ -ofw_msr: - .long 0 /* msr used in OpenFirmware */ +ofmsr: + .long 0 /* msr used in Open Firmware */ /* * This symbol is here for the benefit of kvm_mkdb, and is supposed to @@ -108,8 +111,8 @@ __start: 1: #endif mfmsr 0 - lis 9,ofw_msr@ha - stw 0,ofw_msr@l(9) + lis 9,ofmsr@ha + stw 0,ofmsr@l(9) li 0,0 mtmsr 0 /* Disable FPU/MMU/exceptions */ @@ -163,12 +166,21 @@ ENTRY(openfirmware) lwz 4,openfirmware_entry@l(4) mtlr 4 - lis 4,ofw_msr@ha /* OpenFirmware msr */ - lwz 4,ofw_msr@l(4) + lis 4,_C_LABEL(ofbat)@ha /* map Open Firmware work area */ + lwz 4,_C_LABEL(ofbat)@l(4) + mtibatu 2,4 + mtdbatu 2,4 + lis 4,_C_LABEL(ofbat)+4@ha + lwz 4,_C_LABEL(ofbat)+4@l(4) + mtibatl 2,4 + mtdbatl 2,4 + + lis 4,ofmsr@ha /* Open Firmware msr */ + lwz 4,ofmsr@l(4) mtmsr 4 isync - blrl /* call OpenFirmware */ + blrl /* call Open Firmware */ lwz 4,8(1) /* restore msr */ mtmsr 4 diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index c043529850e..ab467314f13 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.18 1998/09/13 11:58:00 mycroft Exp $ */ +/* $NetBSD: machdep.c,v 1.19 1998/09/21 17:16:27 tsubai Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -135,8 +135,7 @@ int bufpages = 0; caddr_t allocsys __P((caddr_t)); void install_extint __P((void (*)(void))); -extern u_int openfirmware_entry; -static u_int ofw_pa; +extern struct bat ofbat; int cold = 1; @@ -165,6 +164,7 @@ initppc(startkernel, endkernel, args) int exc, scratch; int chosen, mmu, mode, exists; + u_int32_t ofw_pa; /* * Read translations for Openfirmware call. @@ -213,26 +213,6 @@ initppc(startkernel, endkernel, args) battable[0].batu = BATU(0x00000000); /* - * BAT1 maps Openfirmware working area - */ - battable[1].batl = ofw_pa | 0x02; - battable[1].batu = 0xff80001e; /* 1MB */ - - /* - * BAT2 maps most I/O devices - * 0xf0000000-0xf7ffffff (128MB) --> 0xf0000000- - */ - battable[2].batl = 0xf0000002 | BAT_I; - battable[2].batu = 0xf0000ffe; - - /* - * BAT3 maps video ram - * (XXX upper half slots only...) - */ - battable[3].batl = BATL(0x80000000, BAT_I); - battable[3].batu = BATU(0x80000000); - - /* * Now setup fixed bat registers * * Note that we still run in real mode, and the BAT @@ -242,16 +222,20 @@ initppc(startkernel, endkernel, args) asm volatile ("mtibatl 0,%0; mtibatu 0,%1;" "mtdbatl 0,%0; mtdbatu 0,%1;" :: "r"(battable[0].batl), "r"(battable[0].batu)); - /* BAT1 Openfirmware */ - asm volatile ("mtdbatl 1,%0; mtdbatu 1,%1;" - "mtibatl 1,%0; mtibatu 1,%1;" - :: "r"(battable[1].batl), "r"(battable[1].batu)); - /* BAT2 obio devices */ - asm volatile ("mtdbatl 2,%0; mtdbatu 2,%1" - :: "r"(battable[2].batl), "r"(battable[2].batu)); - /* BAT3 video ram */ + + /* BAT1 statically maps obio devices */ + /* 0xf0000000-0xf7ffffff (128MB) --> 0xf0000000- */ + asm volatile ("mtdbatl 1,%0; mtdbatu 1,%1" + :: "r"(0xf0000002 | BAT_I), "r"(0xf0000ffe)); + + /* BAT3 used temporarily for mapping video ram */ + /* (XXX upper half slots only...) */ asm volatile ("mtdbatl 3,%0; mtdbatu 3,%1" - :: "r"(battable[3].batl), "r"(battable[3].batu)); + :: "r"(BATL(0x80000000, BAT_I)), "r"(BATU(0x80000000))); + + /* Open Firmware working area */ + ofbat.batl = ofw_pa | 0x02; + ofbat.batu = 0xff80001e; /* 1MB */ /* * Set up trap vectors |
