summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2022-11-04 10:51:16 +0000
committerjmcneill <jmcneill@NetBSD.org>2022-11-04 10:51:16 +0000
commit1b9ecf2f5f48ebf786044ea2e6749fd26232eeb9 (patch)
treeb3cc433e84b2ee94acc684366f76801136307a11 /sys/dev/fdt
parentd1901be670ff24ed069ab3cd545cd70961997857 (diff)
Size boot_physmem with FDT_MEMORY_RANGES.
This effectively increases the size from 64 to 256 entries for Arm kernels. It turns out on large systems that memory can be quite fragmented by UEFI. Increasing the size of this just kicks the can down the road, we need a better solution to deal with boot_physmem/fdt_memory/bootparams.dram sizing.
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/fdt_memory.c8
-rw-r--r--sys/dev/fdt/fdt_memory.h8
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/fdt/fdt_memory.c b/sys/dev/fdt/fdt_memory.c
index 61cc08736bc..5cf2344d526 100644
--- a/sys/dev/fdt/fdt_memory.c
+++ b/sys/dev/fdt/fdt_memory.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_memory.c,v 1.7 2022/10/20 11:38:21 skrll Exp $ */
+/* $NetBSD: fdt_memory.c,v 1.8 2022/11/04 10:51:16 jmcneill Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "opt_fdt.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.7 2022/10/20 11:38:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.8 2022/11/04 10:51:16 jmcneill Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -41,10 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.7 2022/10/20 11:38:21 skrll Exp $")
#include <dev/fdt/fdtvar.h>
#include <dev/fdt/fdt_memory.h>
-#ifndef FDT_MEMORY_RANGES
-#define FDT_MEMORY_RANGES 256
-#endif
-
struct fdt_memory_range {
struct fdt_memory mr_mem;
bool mr_used;
diff --git a/sys/dev/fdt/fdt_memory.h b/sys/dev/fdt/fdt_memory.h
index 9fd69ca4bd0..4e7cfaa688f 100644
--- a/sys/dev/fdt/fdt_memory.h
+++ b/sys/dev/fdt/fdt_memory.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_memory.h,v 1.1 2020/12/12 09:27:31 skrll Exp $ */
+/* $NetBSD: fdt_memory.h,v 1.2 2022/11/04 10:51:16 jmcneill Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,6 +32,12 @@
#ifndef _DEV_FDT_FDT_MEMORY_H_
#define _DEV_FDT_FDT_MEMORY_H_
+#include "opt_fdt.h"
+
+#ifndef FDT_MEMORY_RANGES
+#define FDT_MEMORY_RANGES 256
+#endif
+
struct fdt_memory {
uint64_t start;
uint64_t end;