diff mbox

spapr: add dumpdtb support

Message ID 1437398364-2066-1-git-send-email-drjones@redhat.com
State New
Headers show

Commit Message

Andrew Jones July 20, 2015, 1:19 p.m. UTC
dumpdtb (-machine dumpdtb=<file>) allows one to inspect the generated
device tree of machine types that generate device trees. This is
useful for a) seeing what's there b) debugging/testing device tree
generator patches. It can be used as follows

$QEMU_CMDLINE -machine dumpdtb=dtb
dtc -I dtb -O dts dtb

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 hw/ppc/spapr.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alexander Graf July 20, 2015, 1:47 p.m. UTC | #1
On 07/20/15 15:19, Andrew Jones wrote:
> dumpdtb (-machine dumpdtb=<file>) allows one to inspect the generated
> device tree of machine types that generate device trees. This is
> useful for a) seeing what's there b) debugging/testing device tree
> generator patches. It can be used as follows
>
> $QEMU_CMDLINE -machine dumpdtb=dtb
> dtc -I dtb -O dts dtb
>
> Signed-off-by: Andrew Jones <drjones@redhat.com>

Glad to see that it's useful for others too :).

Reviewed-by: Alexander Graf <agraf@suse.de>


Alex
David Gibson July 21, 2015, 5:05 a.m. UTC | #2
On Mon, Jul 20, 2015 at 03:19:24PM +0200, Andrew Jones wrote:
> dumpdtb (-machine dumpdtb=<file>) allows one to inspect the generated
> device tree of machine types that generate device trees. This is
> useful for a) seeing what's there b) debugging/testing device tree
> generator patches. It can be used as follows
> 
> $QEMU_CMDLINE -machine dumpdtb=dtb
> dtc -I dtb -O dts dtb
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>

Merged into spapr-next, thanks.
diff mbox

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a6f19473cf278..c1cbf3387ae0c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -30,6 +30,7 @@ 
 #include "hw/fw-path-provider.h"
 #include "elf.h"
 #include "net/net.h"
+#include "sysemu/device_tree.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
@@ -822,6 +823,7 @@  static void spapr_finalize_fdt(sPAPRMachineState *spapr,
         exit(1);
     }
 
+    qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
     cpu_physical_memory_write(fdt_addr, fdt, fdt_totalsize(fdt));
 
     g_free(bootlist);