Module Name: src
Committed By: thorpej
Date: Wed Dec 27 19:47:00 UTC 2023
Modified Files:
src/sys/arch/next68k/include: pmap.h
src/sys/arch/next68k/next68k: genassym.cf locore.s
Log Message:
Define the values for the 68040 TT registers in terms of the definitions in
<m68k/mmu_40.h> rather than using magic numbers.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/next68k/include/pmap.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/next68k/next68k/genassym.cf
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/next68k/next68k/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/next68k/include/pmap.h
diff -u src/sys/arch/next68k/include/pmap.h:1.15 src/sys/arch/next68k/include/pmap.h:1.16
--- src/sys/arch/next68k/include/pmap.h:1.15 Sun Nov 3 19:56:33 2002
+++ src/sys/arch/next68k/include/pmap.h Wed Dec 27 19:47:00 2023
@@ -1,3 +1,25 @@
-/* $NetBSD: pmap.h,v 1.15 2002/11/03 19:56:33 chs Exp $ */
+/* $NetBSD: pmap.h,v 1.16 2023/12/27 19:47:00 thorpej Exp $ */
+
+#ifndef _NEXT68K_PMAP_H_
+#define _NEXT68K_PMAP_H_
#include <m68k/pmap_motorola.h>
+#include <m68k/mmu_30.h>
+
+/*
+ * Transparent translation register values for IO space and the
+ * kernel text/data. These are only used temporarily during
+ * early boot.
+ *
+ * XXX BOTH? Really? But that matches the historical value. But
+ * just SUPER should be sufficient.
+ */
+#define NEXT68K_TT40_IO (0x02000000 | \
+ TTR40_E | TTR40_BOTH | \
+ PTE40_CM_NC_SER)
+
+#define NEXT68K_TT40_KERN (0x04000000 | \
+ __SHIFTIN(0x03,TTR40_LAM) | \
+ TTR40_E | TTR40_BOTH)
+
+#endif /* _NEXT68K_PMAP_H_ */
Index: src/sys/arch/next68k/next68k/genassym.cf
diff -u src/sys/arch/next68k/next68k/genassym.cf:1.31 src/sys/arch/next68k/next68k/genassym.cf:1.32
--- src/sys/arch/next68k/next68k/genassym.cf:1.31 Wed Dec 27 17:35:36 2023
+++ src/sys/arch/next68k/next68k/genassym.cf Wed Dec 27 19:47:00 2023
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.31 2023/12/27 17:35:36 thorpej Exp $
+# $NetBSD: genassym.cf,v 1.32 2023/12/27 19:47:00 thorpej Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -117,6 +117,10 @@ export MMU51_CRP_BITS
export MMU51_TCR_BITS
export MMU40_TCR_BITS
+# Transparent translation register values (from pmap.h)
+export NEXT68K_TT40_IO
+export NEXT68K_TT40_KERN
+
# lwp & proc fields and values
define L_PCB offsetof(struct lwp, l_addr)
define L_PROC offsetof(struct lwp, l_proc)
Index: src/sys/arch/next68k/next68k/locore.s
diff -u src/sys/arch/next68k/next68k/locore.s:1.76 src/sys/arch/next68k/next68k/locore.s:1.77
--- src/sys/arch/next68k/next68k/locore.s:1.76 Wed Dec 27 03:03:42 2023
+++ src/sys/arch/next68k/next68k/locore.s Wed Dec 27 19:47:00 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.76 2023/12/27 03:03:42 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.77 2023/12/27 19:47:00 thorpej Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
@@ -361,17 +361,17 @@ Lstploaddone:
| This is a hack to get PA=KVA when turning on MMU as mentioned above.
| Currently this will only work on 68040's. We should also provide
| %tt0 and %tt1 settings to boot 68030's later.
- movel #0x0200c040,%d0 | intio devices are at 0x02000000
+ movel #NEXT68K_TT40_IO,%d0 | see pmap.h
.long 0x4e7b0004 | movc %d0,%itt0
.long 0x4e7b0006 | movc %d0,%dtt0
- movel #0x0403c000,%d0 | kernel text and data at 0x04000000
+ movel #NEXT68K_TT40_KERN,%d0 | see pmap.h
.long 0x4e7b0005 | movc %d0,%itt1
.long 0x4e7b0007 | movc %d0,%dtt1
.word 0xf4d8 | cinva bc
.word 0xf518 | pflusha
- movl #0x8000,%d0
- .long 0x4e7b0003 | movc %d0,tc
+ movl #MMU40_TCR_BITS,%d0
+ .long 0x4e7b0003 | movc %d0,%tc
movl #0x80008000,%d0
movc %d0,%cacr | turn on both caches