Source-Changes-HG archive

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

[src/trunk]: src/sys/stand/efiboot Print FDT model and compatible strings wit...



details:   https://anonhg.NetBSD.org/src/rev/64bb49df1e01
branches:  trunk
changeset: 366569:64bb49df1e01
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 03 00:17:00 2018 +0000

description:
Print FDT model and compatible strings with "version" command

diffstat:

 sys/stand/efiboot/boot.c   |   5 ++++-
 sys/stand/efiboot/efifdt.c |  23 ++++++++++++++++++++++-
 sys/stand/efiboot/efifdt.h |   3 ++-
 3 files changed, 28 insertions(+), 3 deletions(-)

diffs (78 lines):

diff -r 2c15b03c5d83 -r 64bb49df1e01 sys/stand/efiboot/boot.c
--- a/sys/stand/efiboot/boot.c  Mon Sep 03 00:04:02 2018 +0000
+++ b/sys/stand/efiboot/boot.c  Mon Sep 03 00:17:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.4 2018/09/03 00:04:02 jmcneill Exp $        */
+/*     $NetBSD: boot.c,v 1.5 2018/09/03 00:17:00 jmcneill Exp $        */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -29,6 +29,7 @@
 
 #include "efiboot.h"
 #include "efiblock.h"
+#include "efifdt.h"
 
 #include <sys/bootblock.h>
 #include <sys/boot_flag.h>
@@ -131,6 +132,8 @@
                    ST->FirmwareRevision & 0xffff);
                FreePool(ufirmware);
        }
+
+       efi_fdt_show();
 }
 
 void
diff -r 2c15b03c5d83 -r 64bb49df1e01 sys/stand/efiboot/efifdt.c
--- a/sys/stand/efiboot/efifdt.c        Mon Sep 03 00:04:02 2018 +0000
+++ b/sys/stand/efiboot/efifdt.c        Mon Sep 03 00:17:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.6 2018/09/02 23:54:25 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.7 2018/09/03 00:17:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -78,6 +78,27 @@
 }
 
 void
+efi_fdt_show(void)
+{
+       const char *model, *compat;
+       int n, ncompat;
+
+       if (fdt_data == NULL)
+               return;
+
+       model = fdt_getprop(fdt_data, fdt_path_offset(fdt_data, "/"), "model", NULL);
+       if (model)
+               printf("FDT: %s [", model);
+       ncompat = fdt_stringlist_count(fdt_data, fdt_path_offset(fdt_data, "/"), "compatible");
+       for (n = 0; n < ncompat; n++) {
+               compat = fdt_stringlist_get(fdt_data, fdt_path_offset(fdt_data, "/"),
+                   "compatible", n, NULL);
+               printf("%s%s", n == 0 ? "" : ", ", compat);
+       }
+       printf("]\n");
+}
+
+void
 efi_fdt_memory_map(void)
 {
        UINTN nentries = 0, mapkey, descsize;
diff -r 2c15b03c5d83 -r 64bb49df1e01 sys/stand/efiboot/efifdt.h
--- a/sys/stand/efiboot/efifdt.h        Mon Sep 03 00:04:02 2018 +0000
+++ b/sys/stand/efiboot/efifdt.h        Mon Sep 03 00:17:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.h,v 1.1 2018/08/24 02:01:06 jmcneill Exp $ */
+/* $NetBSD: efifdt.h,v 1.2 2018/09/03 00:17:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -30,4 +30,5 @@
 void efi_fdt_memory_map(void);
 void *efi_fdt_data(void);
 int efi_fdt_size(void);
+void efi_fdt_show(void);
 void efi_fdt_bootargs(const char *);



Home | Main Index | Thread Index | Old Index