Source-Changes-HG archive

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

[src/trunk]: src/sys/stand/efiboot Only set #address-cells and #size-cells pr...



details:   https://anonhg.NetBSD.org/src/rev/8e3319927278
branches:  trunk
changeset: 453880:8e3319927278
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Aug 30 00:01:33 2019 +0000

description:
Only set #address-cells and #size-cells properties on /chosen if we are
fabricating a devicetree (ACPI mode). Fixes PR# 54494

diffstat:

 sys/stand/efiboot/efifdt.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (37 lines):

diff -r 0a92a71bd854 -r 8e3319927278 sys/stand/efiboot/efifdt.c
--- a/sys/stand/efiboot/efifdt.c        Thu Aug 29 17:54:32 2019 +0000
+++ b/sys/stand/efiboot/efifdt.c        Fri Aug 30 00:01:33 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.18 2019/08/01 13:11:16 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.19 2019/08/30 00:01:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -292,8 +292,15 @@
                        continue;
                }
 
+               fdt_setprop_u32(fdt_data,
+                   fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "#address-cells", 2);
+               fdt_setprop_u32(fdt_data,
+                   fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "#size-cells", 2);
+               fdt_setprop_empty(fdt_data,
+                   fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), "ranges");
+
                snprintf(buf, sizeof(buf), "framebuffer@%" PRIx64, mode->FrameBufferBase);
-               fb = fdt_add_subnode(fdt_data, fdt_path_offset(fdt_data, "/chosen"), buf);
+               fb = fdt_add_subnode(fdt_data, fdt_path_offset(fdt_data, FDT_CHOSEN_NODE_PATH), buf);
                if (fb < 0)
                        panic("FDT: Failed to create framebuffer node");
 
@@ -327,10 +334,6 @@
        if (chosen < 0)
                panic("FDT: Failed to create " FDT_CHOSEN_NODE_PATH " node");
 
-       fdt_setprop_u32(fdt_data, chosen, "#address-cells", 2);
-       fdt_setprop_u32(fdt_data, chosen, "#size-cells", 2);
-       fdt_setprop_empty(fdt_data, chosen, "ranges");
-
        if (*bootargs)
                fdt_setprop_string(fdt_data, chosen, "bootargs", bootargs);
 



Home | Main Index | Thread Index | Old Index