[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 21/31] dt: Add -machine dumpdtb optio
From: |
Alexander Graf |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 21/31] dt: Add -machine dumpdtb option to dump the current dtb |
Date: |
Tue, 19 Jun 2012 23:02:40 +0200 |
On 19.06.2012, at 22:51, Peter Maydell wrote:
> On 19 June 2012 20:15, Alexander Graf <address@hidden> wrote:
>> Now that we are dynamically creating the dtb, it's really useful to
>> be able to dump the created blob for debugging.
>
>> @@ -300,6 +302,22 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
>> qemu_devtree_setprop_cell(fdt, pci, "#address-cells", 3);
>> qemu_devtree_setprop_string(fdt, "/aliases", "pci0", pci);
>>
>> + machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
>> + if (machine_opts) {
>> + dumpdtb = qemu_opt_get(machine_opts, "dumpdtb");
>> + }
>> + if (dumpdtb) {
>> + /* Dump the dtb to a file and quit */
>> + FILE *f = fopen(dumpdtb, "wb");
>> + size_t len;
>> + len = fwrite(fdt, fdt_size, 1, f);
>> + fclose(f);
>> + if (len != fdt_size) {
>> + exit(1);
>> + }
>> + exit(0);
>> + }
>> +
>
> Maybe this should be abstracted out into a subfunction somewhere?
> I'm guessing there might be more than one machine in the future
> that wants a dumpable device tree.
Yup, that should be done with the second machine that allows this option.
Basically the second one that implements dynamic device tree generation. If you
beat me to it, that'd mean you generalize it. Otherwise I'd do it on bamboo :).
Alex
- [Qemu-ppc] [PATCH 02/31] dt: add helpers for multi-cell adds, (continued)
- [Qemu-ppc] [PATCH 02/31] dt: add helpers for multi-cell adds, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 12/31] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 04/31] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 22/31] PPC: e500: dt: use 64bit cell helper, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 18/31] PPC: e500: dt: create global-utils node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 07/31] dt: add helper for phandle allocation, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 01/31] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 21/31] dt: Add -machine dumpdtb option to dump the current dtb, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 17/31] PPC: e500: dt: create mpic node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 13/31] PPC: e500: dt: create / node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 11/31] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 23/31] PPC: e500: dt: use target_phys_addr_t for ramsize, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 20/31] PPC: e500: dt: start with empty device tree, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 25/31] Revert "dt: temporarily disable subtree creation failure check", Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 29/31] PPC: e500: Extend address/size of / to 64bit, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 16/31] PPC: e500: dt: create serial nodes dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 10/31] PPC: e500: dt: create memory node dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 26/31] PPC: e500: Use new MPIC dt format, Alexander Graf, 2012/06/19