Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/stand/efiboot Add full UEFI memory map to the /chosen node.



details:   https://anonhg.NetBSD.org/src/rev/f16a536abda3
branches:  trunk
changeset: 453045:f16a536abda3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Aug 01 13:11:16 2019 +0000

description:
Add full UEFI memory map to the /chosen node.

diffstat:

 sys/stand/efiboot/efiacpi.c |   4 ++--
 sys/stand/efiboot/efifdt.c  |  12 ++++++------
 sys/stand/efiboot/version   |   3 ++-
 3 files changed, 10 insertions(+), 9 deletions(-)

diffs (61 lines):

diff -r 41d0ff327f82 -r f16a536abda3 sys/stand/efiboot/efiacpi.c
--- a/sys/stand/efiboot/efiacpi.c       Thu Aug 01 13:11:03 2019 +0000
+++ b/sys/stand/efiboot/efiacpi.c       Thu Aug 01 13:11:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.c,v 1.3 2018/10/28 10:17:47 jmcneill Exp $ */
+/* $NetBSD: efiacpi.c,v 1.4 2019/08/01 13:11:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <libfdt.h>
 
-#define        ACPI_FDT_SIZE   (64 * 1024)
+#define        ACPI_FDT_SIZE   (128 * 1024)
 
 static EFI_GUID Acpi20TableGuid = ACPI_20_TABLE_GUID;
 static EFI_GUID Smbios3TableGuid = SMBIOS3_TABLE_GUID;
diff -r 41d0ff327f82 -r f16a536abda3 sys/stand/efiboot/efifdt.c
--- a/sys/stand/efiboot/efifdt.c        Thu Aug 01 13:11:03 2019 +0000
+++ b/sys/stand/efiboot/efifdt.c        Thu Aug 01 13:11:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.17 2019/07/25 11:44:14 skrll Exp $ */
+/* $NetBSD: efifdt.c,v 1.18 2019/08/01 13:11:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -206,14 +206,14 @@
 
        memmap = LibMemoryMap(&nentries, &mapkey, &descsize, &descver);
        for (n = 0, md = memmap; n < nentries; n++, md = NextMemoryDescriptor(md, descsize)) {
+               fdt_appendprop_u32(fdt_data, fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "netbsd,uefi-memmap", md->Type);
+               fdt_appendprop_u64(fdt_data, fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "netbsd,uefi-memmap", md->PhysicalStart);
+               fdt_appendprop_u64(fdt_data, fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "netbsd,uefi-memmap", md->NumberOfPages);
+               fdt_appendprop_u64(fdt_data, fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "netbsd,uefi-memmap", md->Attribute);
+
                if ((md->Attribute & EFI_MEMORY_RUNTIME) != 0)
                        continue;
 
-               fdt_appendprop_u32(fdt_data, chosen, "netbsd,uefi-memory-map", md->Type);
-               fdt_appendprop_u64(fdt_data, chosen, "netbsd,uefi-memory-map", md->PhysicalStart);
-               fdt_appendprop_u64(fdt_data, chosen, "netbsd,uefi-memory-map", md->NumberOfPages);
-               fdt_appendprop_u64(fdt_data, chosen, "netbsd,uefi-memory-map", md->Attribute);
-
                if ((md->Attribute & EFI_MEMORY_WB) == 0)
                        continue;
                if (!FDT_MEMORY_USABLE(md))
diff -r 41d0ff327f82 -r f16a536abda3 sys/stand/efiboot/version
--- a/sys/stand/efiboot/version Thu Aug 01 13:11:03 2019 +0000
+++ b/sys/stand/efiboot/version Thu Aug 01 13:11:16 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.11 2019/07/24 11:40:36 jmcneill Exp $
+$NetBSD: version,v 1.12 2019/08/01 13:11:16 jmcneill Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -15,3 +15,4 @@
 1.8:   Add support for "bootargs" environment variable.
 1.9:   Add support for efiboot.plist and loading device tree overlays.
 1.10:  Add support for EFI GOP framebuffers in ACPI mode.
+1.11:  Add full UEFI memory map to /chosen node.



Home | Main Index | Thread Index | Old Index