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 If a /chosen/framebuffer node is found, ...



details:   https://anonhg.NetBSD.org/src/rev/2207627b47a3
branches:  trunk
changeset: 994276:2207627b47a3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 29 21:05:58 2018 +0000

description:
If a /chosen/framebuffer node is found, reserve physical memory claimed
by it.

diffstat:

 sys/arch/evbarm/fdt/fdt_machdep.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 7c4be17d6297 -r 2207627b47a3 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Mon Oct 29 21:04:18 2018 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Mon Oct 29 21:05:58 2018 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        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) {



Home | Main Index | Thread Index | Old Index