aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2018-04-03 00:45:38 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2018-04-03 00:45:38 +0000
commit9f5b999acafbe8936206ecdc10be2f0e4dd0a536 (patch)
treeeace9542c12f4e363419176bbc0e4545d2a971f3 /sys
parent271ce40239ec643af1264c36b73ea1563f4263ba (diff)
downloadsrc-9f5b999acafbe8936206ecdc10be2f0e4dd0a536.tar.gz
src-9f5b999acafbe8936206ecdc10be2f0e4dd0a536.zip
Add support for a pmap direct map for 64-bit Book-E
As with AIM64, map the DMAP at the beginning of the fourth "quadrant" of memory, and move the KERNBASE to the the start of KVA. Eventually we may run the kernel out of the DMAP, but for now, continue booting as it has been.
Notes
Notes: svn path=/head/; revision=331900
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/booke/pmap.c13
-rw-r--r--sys/powerpc/include/vmparam.h9
2 files changed, 15 insertions, 7 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index f5f1b2082b84..c9c9d15f9f26 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -1724,7 +1724,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
debugf("mmu_booke_bootstrap: entered\n");
/* Set interesting system properties */
+#ifdef __powerpc64__
+ hw_direct_map = 1;
+#else
hw_direct_map = 0;
+#endif
#if defined(COMPAT_FREEBSD32) || !defined(__powerpc64__)
elf32_nxstack = 1;
#endif
@@ -1971,6 +1975,15 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
debugf("physsz = 0x%09jx physmem = %jd (0x%09jx)\n",
(uintmax_t)physsz, (uintmax_t)physmem, (uintmax_t)physmem);
+#ifdef __powerpc64__
+ /*
+ * Map the physical memory contiguously in TLB1.
+ * Round so it fits into a single mapping.
+ */
+ tlb1_mapin_region(DMAP_BASE_ADDRESS, 0,
+ phys_avail[i + 1]);
+#endif
+
/*******************************************************/
/* Initialize (statically allocated) kernel pmap. */
/*******************************************************/
diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h
index 60119cfc25d8..4d3b069c5db7 100644
--- a/sys/powerpc/include/vmparam.h
+++ b/sys/powerpc/include/vmparam.h
@@ -106,13 +106,8 @@
#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE
#ifdef __powerpc64__
-#ifdef AIM
#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL
#define VM_MAX_KERNEL_ADDRESS 0xe0000001c7ffffffUL
-#else
-#define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL
-#define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL
-#endif
#define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS
#endif
@@ -135,9 +130,9 @@
#ifdef __powerpc64__
#ifndef LOCORE
-#define KERNBASE 0xc000000000000100UL /* start of kernel virtual */
+#define KERNBASE 0xe000000000000100UL /* start of kernel virtual */
#else
-#define KERNBASE 0xc000000000000100 /* start of kernel virtual */
+#define KERNBASE 0xe000000000000100 /* start of kernel virtual */
#endif
#else
#define KERNBASE 0xc0000000 /* start of kernel virtual */