Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm/fdt Provide some KVA layout #defines in arm3...
details: https://anonhg.NetBSD.org/src/rev/07570e974655
branches: trunk
changeset: 935662:07570e974655
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Jul 08 09:50:45 2020 +0000
description:
Provide some KVA layout #defines in arm32/vmparam.h and simplify
fdt/platform.h as a nice side effect
diffstat:
sys/arch/arm/include/arm32/vmparam.h | 29 ++++++++++++++++++++++++++++-
sys/arch/evbarm/fdt/platform.h | 20 ++++----------------
2 files changed, 32 insertions(+), 17 deletions(-)
diffs (80 lines):
diff -r 44685bfde15d -r 07570e974655 sys/arch/arm/include/arm32/vmparam.h
--- a/sys/arch/arm/include/arm32/vmparam.h Wed Jul 08 08:20:05 2020 +0000
+++ b/sys/arch/arm/include/arm32/vmparam.h Wed Jul 08 09:50:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.48 2020/07/08 07:59:49 skrll Exp $ */
+/* $NetBSD: vmparam.h,v 1.49 2020/07/08 09:50:45 skrll Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -94,4 +94,31 @@
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t) KERNEL_BASE)
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t) -(PAGE_SIZE+1))
+#ifdef ARM_MMU_EXTENDED
+/*
+ * kernel virtual space layout without direct map (common case)
+ *
+ * 0x8000_0000 - 256MB kernel text/data/bss
+ * 0x9000_0000 - 1536MB Kernel VM Space
+ * 0xf000_0000 - 256MB IO
+ *
+ * kernel virtual space layout with direct map (1GB limited)
+ * 0x8000_0000 - 1024MB kernel text/data/bss and direct map start
+ * 0xc000_0000 - 768MB Kernel VM Space
+ * 0xf000_0000 - 256MB IO
+ *
+ */
+#define VM_KERNEL_IO_ADDRESS 0xf0000000
+#define VM_KERNEL_IO_SIZE (VM_MAX_KERNEL_ADDRESS - VM_KERNEL_IO_ADDRESS)
+
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+#define KERNEL_VM_BASE 0xc0000000
+#else
+#define KERNEL_VM_BASE 0x90000000
+#endif
+
+#define KERNEL_VM_SIZE (KERNEL_IO_VBASE - KERNEL_VM_BASE)
+
+#endif
+
#endif /* _ARM_ARM32_VMPARAM_H_ */
diff -r 44685bfde15d -r 07570e974655 sys/arch/evbarm/fdt/platform.h
--- a/sys/arch/evbarm/fdt/platform.h Wed Jul 08 08:20:05 2020 +0000
+++ b/sys/arch/evbarm/fdt/platform.h Wed Jul 08 09:50:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.h,v 1.5 2019/01/21 07:49:45 skrll Exp $ */
+/* $NetBSD: platform.h,v 1.6 2020/07/08 09:50:45 skrll Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,26 +33,14 @@
void fdt_add_reserved_memory_range(uint64_t, uint64_t);
#endif
-#ifdef __aarch64__
+#define KERNEL_IO_VBASE VM_KERNEL_IO_ADDRESS
+#define KERNEL_IO_VSIZE (KERNEL_IO_VBASE - VM_MAX_KERNEL_ADDRESS)
-#define KERNEL_IO_VBASE VM_KERNEL_IO_ADDRESS
+#ifdef __aarch64__
#define KERNEL_VM_BASE VM_MIN_KERNEL_ADDRESS
#define KERNEL_VM_SIZE (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS)
-#else /* __aarch64__ */
-
-#define KERNEL_IO_VBASE 0xf0000000
-#define KERNEL_IO_VSIZE (KERNEL_IO_VBASE - VM_MAX_KERNEL_ADDRESS)
-
-#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
-#define KERNEL_VM_BASE 0xc0000000
-#else
-#define KERNEL_VM_BASE 0x90000000
-#endif
-
-#define KERNEL_VM_SIZE (KERNEL_IO_VBASE - KERNEL_VM_BASE)
-
#endif /* !__aarch64 */
#endif /* _EVBARM_FDT_PLATFORM_H */
Home |
Main Index |
Thread Index |
Old Index