Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mac68k Added DJMEMCMAX option for recognizing 128 m...
details: https://anonhg.NetBSD.org/src/rev/1c51e449186f
branches: trunk
changeset: 787939:1c51e449186f
user: jklos <jklos%NetBSD.org@localhost>
date: Tue Jul 16 07:31:40 2013 +0000
description:
Added DJMEMCMAX option for recognizing 128 meg SIMMs in Centris and Quadra
610, 650 and 800 systems. From Rob Braun,
http://synack.net/~bbraun/netbsdmac2.html
diffstat:
sys/arch/mac68k/conf/GENERIC | 8 +-
sys/arch/mac68k/mac68k/genassym.cf | 9 ++-
sys/arch/mac68k/mac68k/locore.s | 113 +++++++++++++++++++++++++++++++-
sys/arch/mac68k/mac68k/machdep.c | 7 +-
sys/arch/mac68k/mac68k/pmap_bootstrap.c | 20 ++++-
5 files changed, 146 insertions(+), 11 deletions(-)
diffs (269 lines):
diff -r 9ca1f7da2a22 -r 1c51e449186f sys/arch/mac68k/conf/GENERIC
--- a/sys/arch/mac68k/conf/GENERIC Tue Jul 16 02:58:19 2013 +0000
+++ b/sys/arch/mac68k/conf/GENERIC Tue Jul 16 07:31:40 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.214 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: GENERIC,v 1.215 2013/07/16 07:31:40 jklos Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.214 $"
+#ident "GENERIC-$Revision: 1.215 $"
maxusers 16 # estimated number of users
@@ -35,6 +35,10 @@
options FPSP
options FPU_EMULATE
+# Support for 128 meg SIMMs in Centris / Quadra 610, 650 and 800 machines.
+# You need to set the total memory in the MacOS Booter.
+#options DJMEMCMAX
+
# Standard system options
options INSECURE # disable kernel security levels
diff -r 9ca1f7da2a22 -r 1c51e449186f sys/arch/mac68k/mac68k/genassym.cf
--- a/sys/arch/mac68k/mac68k/genassym.cf Tue Jul 16 02:58:19 2013 +0000
+++ b/sys/arch/mac68k/mac68k/genassym.cf Tue Jul 16 07:31:40 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.36 2011/01/14 02:06:28 rmind Exp $
+# $NetBSD: genassym.cf,v 1.37 2013/07/16 07:31:40 jklos Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
@@ -169,6 +169,13 @@
define EFAULT EFAULT
define ENAMETOOLONG ENAMETOOLONG
+# machine ids
+define MACH_MACC610 MACH_MACC610
+define MACH_MACQ610 MACH_MACQ610
+define MACH_MACC650 MACH_MACC650
+define MACH_MACQ650 MACH_MACQ650
+define MACH_MACQ800 MACH_MACQ800
+
# SVR4 binary compatibility
ifdef COMPAT_SVR4
define SVR4_SIGF_HANDLER offsetof(struct svr4_sigframe, sf_handler)
diff -r 9ca1f7da2a22 -r 1c51e449186f sys/arch/mac68k/mac68k/locore.s
--- a/sys/arch/mac68k/mac68k/locore.s Tue Jul 16 02:58:19 2013 +0000
+++ b/sys/arch/mac68k/mac68k/locore.s Tue Jul 16 07:31:40 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.166 2011/12/22 15:33:29 tsutsui Exp $ */
+/* $NetBSD: locore.s,v 1.167 2013/07/16 07:31:40 jklos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -273,6 +273,117 @@
movl %a1,%d1
.word 0xf518 | pflusha
.long 0x4e7b1807 | movc %d1,%srp
+
+#if defined(DJMEMCMAX)
+ movl %a3,%sp@-
+ cmp #MACH_MACC610,_C_LABEL(machineid)
+ jra Ldjmemc610
+ cmp #MACH_MACQ610,_C_LABEL(machineid)
+ jra Ldjmemc610
+ cmp #MACH_MACC650,_C_LABEL(machineid)
+ jra Ldjmemccfg
+ cmp #MACH_MACQ650,_C_LABEL(machineid)
+ jra Ldjmemccfg
+ cmp #MACH_MACQ800,_C_LABEL(machineid)
+ jra Ldjmemccfg
+
+ jra Lnodjmemc
+
+Ldjmemccfg:
+ movl #0x50f0e00c,%a0
+ movl %a0@,%d0 | determine where RAM SIMMs start
+ andl #0x000000FF,%d0
+ addl #0x10,%d0 | bank 3 start
+ addl #0x10,%d0 | bank 4 start
+
+ movl #0x50f0e014,%a0
+ movl %d0,%a0@+ | bank 4
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 5
+ addl #0x10,%d0
+
+ movl %d0,%a0@+ | bank 6
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 7
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 8
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 9
+ addl #0x10,%d0
+ jra Ldjmemctop
+
+Ldjmemc610:
+ movl #0x50f0e00c,%a0
+ movl %a0@,%d0 | determine where RAM SIMMs start
+ andl #0x000000FF,%d0
+ addl #0x10,%d0 | bank 3 start
+
+ movl #0x50f0e014,%a0
+ movl %d0,%a0@+ | bank 4
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 5
+ movl %d0,%a0@+ | bank 6
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 7
+ movl %d0,%a0@+ | bank 8
+ addl #0x10,%d0
+ movl %d0,%a0@+ | bank 9
+
+Ldjmemctop:
+ movl #0x50F0E02C,%a0
+ movl %d0,%a0@ | memtop
+
+ | preserve ~512KB beyond 4MB just in case
+ movl #0x400000,%a0
+ movl #0x9000000,%a2
+ movl #0xFFFF,%d0
+L1stbankcopy1:
+ movl %a0@+,%a2@+
+ dbra %d0,L1stbankcopy1
+ movl #0xFFFF,%d0
+L1stbankcopy2:
+ movl %a0@+,%a2@+
+ dbra %d0,L1stbankcopy2
+
+ lea _ASM_LABEL(Lsetup1stbank),%a0
+ movl #0x8800000,%a2 | Pick a location that should be in bank 4
+ movl #0x64,%d0
+Ldjcopy:
+ movl %a0@+,%a2@+
+ dbra %d0,Ldjcopy
+
+ movl #0x8800000,%a0
+ lea _ASM_LABEL(Ldjmemcdone),%a2
+ jmp %a0@
+
+Lsetup1stbank:
+ | now configure banks 2 & 3
+ movl #0x50f0e00c,%a0
+ movl %a0@,%d0 | determine where RAM SIMMs start
+ andl #0x000000FF,%d0
+ movl %d0,%a0@+
+ addl #0x10,%d0 | bank 3 start
+ movl %d0,%a0@
+
+ | and return to where we came from.
+ jmp %a2@
+
+Ldjmemcdone:
+ movl #0x400000,%a2
+ movl #0x9000000,%a0
+ movl #0xFFFF,%d0
+Lcopyback1:
+ movl %a0@+,%a2@+
+ dbra %d0,Lcopyback1
+ movl #0xFFFF,%d0
+Lcopyback2:
+ movl %a0@+,%a2@+
+ dbra %d0,Lcopyback2
+
+Lnodjmemc:
+ movl %sp@+,%a3
+#endif
+
#if PGSHIFT == 13
movl #0xc000,%d0
#else
diff -r 9ca1f7da2a22 -r 1c51e449186f sys/arch/mac68k/mac68k/machdep.c
--- a/sys/arch/mac68k/mac68k/machdep.c Tue Jul 16 02:58:19 2013 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c Tue Jul 16 07:31:40 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.345 2012/08/04 17:18:38 martin Exp $ */
+/* $NetBSD: machdep.c,v 1.346 2013/07/16 07:31:40 jklos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.345 2012/08/04 17:18:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346 2013/07/16 07:31:40 jklos Exp $");
#include "opt_adb.h"
#include "opt_ddb.h"
@@ -172,6 +172,7 @@
extern int numranges;
extern u_long low[8];
extern u_long high[8];
+extern int machineid;
/* These are used to map NuBus space: */
#define NBMAXRANGES 16
@@ -899,7 +900,7 @@
/*
* More misc stuff from booter.
*/
- mac68k_machine.machineid = getenv("MACHINEID");
+ mac68k_machine.machineid = machineid = getenv("MACHINEID");
mac68k_machine.mach_processor = getenv("PROCESSOR");
mac68k_machine.mach_memsize = getenv("MEMSIZE");
mac68k_machine.do_graybars = getenv("GRAYBARS");
diff -r 9ca1f7da2a22 -r 1c51e449186f sys/arch/mac68k/mac68k/pmap_bootstrap.c
--- a/sys/arch/mac68k/mac68k/pmap_bootstrap.c Tue Jul 16 02:58:19 2013 +0000
+++ b/sys/arch/mac68k/mac68k/pmap_bootstrap.c Tue Jul 16 07:31:40 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_bootstrap.c,v 1.93 2012/02/10 04:49:45 mhitch Exp $ */
+/* $NetBSD: pmap_bootstrap.c,v 1.94 2013/07/16 07:31:40 jklos Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.93 2012/02/10 04:49:45 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.94 2013/07/16 07:31:40 jklos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -166,6 +166,7 @@
for (i = 0; i < numranges; i++)
mem_size += high[i] - low[i];
nptpages += howmany(m68k_btop(mem_size), NPTEPG);
+ nptpages++;
nextpa += nptpages * PAGE_SIZE;
for (i = 0; i < numranges; i++)
@@ -534,6 +535,17 @@
extern int *esym;
paddr_t nextpa;
void *oldROMBase;
+ char use_bootmem = 0;
+
+#ifdef DJMEMCMAX
+ if(mac68k_machine.machineid == MACH_MACC650 ||
+ mac68k_machine.machineid == MACH_MACQ650 ||
+ mac68k_machine.machineid == MACH_MACQ610 ||
+ mac68k_machine.machineid == MACH_MACC610 ||
+ mac68k_machine.machineid == MACH_MACQ800) {
+ use_bootmem = 1;
+ }
+#endif
if (mac68k_machine.do_graybars)
printf("Bootstrapping NetBSD/mac68k.\n");
@@ -541,8 +553,8 @@
oldROMBase = ROMBase;
mac68k_video.mv_phys = mac68k_video.mv_kvaddr;
- if (((tc & 0x80000000) && (mmutype == MMU_68030)) ||
- ((tc & 0x8000) && (mmutype == MMU_68040))) {
+ if ((!use_bootmem) && (((tc & 0x80000000) && (mmutype == MMU_68030)) ||
+ ((tc & 0x8000) && (mmutype == MMU_68040)))) {
if (mac68k_machine.do_graybars)
printf("Getting mapping from MMU.\n");
(void) get_mapping();
Home |
Main Index |
Thread Index |
Old Index