Module Name: src
Committed By: jmcneill
Date: Mon Oct 29 21:05:58 UTC 2018
Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c
Log Message:
If a /chosen/framebuffer node is found, reserve physical memory claimed
by it.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/evbarm/fdt/fdt_machdep.c
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/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.46 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.47
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.46 Sun Oct 28 10:21:42 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c Mon Oct 29 21:05:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.46 2018/10/28 10:21:42 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.47 2018/10/29 21:05:58 jmcneill Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.46 2018/10/28 10:21:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.47 2018/10/29 21:05:58 jmcneill Exp $");
#include "opt_machdep.h"
#include "opt_bootconfig.h"
@@ -298,6 +298,15 @@ fdt_build_bootconfig(uint64_t mem_start,
if (initrd_size > 0)
fdt_add_reserved_memory_range(initrd_start, initrd_size);
+ const int framebuffer = OF_finddevice("/chosen/framebuffer");
+ if (framebuffer >= 0) {
+ for (index = 0;
+ fdtbus_get_reg64(framebuffer, index, &addr, &size) == 0;
+ index++) {
+ fdt_add_reserved_memory_range(addr, size);
+ }
+ }
+
VPRINTF("Usable memory:\n");
bc->dramblocks = 0;
LIST_FOREACH(er, &fdt_memory_ext->ex_regions, er_link) {