[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device
From: |
Blue Swirl |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically |
Date: |
Tue, 19 Jun 2012 18:39:25 +0000 |
On Tue, Jun 19, 2012 at 12:54 PM, Alexander Graf <address@hidden> wrote:
>
> On 07.06.2012, at 23:09, Blue Swirl wrote:
>
>> On Tue, Jun 5, 2012 at 11:52 PM, Alexander Graf <address@hidden> wrote:
>>> Today we have two separate places where we keep information which device
>>> is where:
>>>
>>> - hw/ppce500_mpc8544ds.c to instantiate all devices
>>> - pc-bios/mpc8544ds.dtb as device tree to tell the guest about devices
>>>
>>> Every time we split crucial information, things can go terribly wrong. If
>>> you update one file, but not the other, you can screw things up without
>>> realizing it quickly.
>>>
>>> The redundancy is also unnecessary, because QEMU already knows all the
>>> information at which addresses its devices live. So we can generate the
>>> device tree from the same variables - and even have the device tree adjust
>>> if something changes in there.
>>>
>>> The one functionality we lose with this approach is the ability to manually
>>> patch the device tree to contain additional devices. To still be able to do
>>> so easily, we introduce a new option -machine dumpdtb=<file> that creates a
>>> dtb output file which can be used with -machine dtb=<file> later. In between
>>> these 2 executions of QEMU, the dtb can be modified however much you like.
>>>
>>> A lot of bits in this patch set are still hardcoded. We also don't
>>> accomodate
>>> for dynamic creation of device tree nodes when -device is used. This
>>> requires
>>> a bit more QOM'ification for us to be able to loop through all devices, so
>>> we
>>> can dynamically create the device tree nodes for them. The basic concept
>>> should
>>> still hold as is though.
>>>
>>>
>>> Alex
>>
>> Please use snprintf() instead of sprintf().
>
> Oh how much I would love to be able to just call asprintf() and call it a day
> :).
There's g_vasprintf(), which could be used to implement qemu_asprintf().
By the way, what is your plan about PPC patch queue, for example AREG0
patches? There may be some need for rebasing already.
>
>
> Alex
>
- [Qemu-ppc] [PATCH 26/31] PPC: e500: Use new MPIC dt format, (continued)
- [Qemu-ppc] [PATCH 26/31] PPC: e500: Use new MPIC dt format, Alexander Graf, 2012/06/05
- [Qemu-ppc] [PATCH 27/31] PPC: e500: Use new SOC dt format, Alexander Graf, 2012/06/05
- [Qemu-ppc] [PATCH 04/31] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/05
- [Qemu-ppc] [PATCH 08/31] dt: add helper for 64bit cell adds, Alexander Graf, 2012/06/05
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically, Blue Swirl, 2012/06/07
- [Qemu-ppc] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 06/31] dt: add helper for empty dt creation, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 09/31] PPC: e500: require libfdt, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 03/31] dt: add helper for phandle references, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 05/31] dt: add helper for phandle enumeration, Alexander Graf, 2012/06/19
- [Qemu-ppc] [PATCH 02/31] dt: add helpers for multi-cell adds, Alexander Graf, 2012/06/19