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 Use fdt_open_into instead of fdt_move to...



details:   https://anonhg.NetBSD.org/src/rev/f52837448b38
branches:  trunk
changeset: 836013:f52837448b38
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 22 11:58:19 2018 +0000

description:
Use fdt_open_into instead of fdt_move to load the DTB since we may make
changes to the tree after loading it. When we are done making changes,
call fdt_pack.

diffstat:

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

diffs (39 lines):

diff -r 7c3160477786 -r f52837448b38 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Sat Sep 22 05:24:22 2018 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Sat Sep 22 11:58:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.37 2018/09/16 11:24:29 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.38 2018/09/22 11:58:19 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.37 2018/09/16 11:24:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.38 2018/09/22 11:58:19 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -372,7 +372,7 @@
        /* Load FDT */
        int error = fdt_check_header(fdt_addr_r);
        if (error == 0) {
-               error = fdt_move(fdt_addr_r, fdt_data, sizeof(fdt_data));
+               error = fdt_open_into(fdt_addr_r, fdt_data, sizeof(fdt_data));
                if (error != 0)
                        panic("fdt_move failed: %s", fdt_strerror(error));
                fdtbus_set_data(fdt_data);
@@ -413,6 +413,11 @@
         */
        fdt_update_stdout_path();
 
+       /*
+        * Done making changes to the FDT.
+        */
+       fdt_pack(fdt_data);
+
        VPRINTF("consinit ");
        consinit();
        VPRINTF("ok\n");



Home | Main Index | Thread Index | Old Index