qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 06/25] dt: add helper for empty dt creation
       [not found]   ` <20120531105555.GF11455@truffala.fritz.box>
@ 2012-06-05 14:07     ` Alexander Graf
  2012-06-05 17:00       ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2012-06-05 14:07 UTC (permalink / raw)
  To: David Gibson; +Cc: Scott Wood, qemu-ppc, qemu-devel Developers


On 31.05.2012, at 12:55, David Gibson wrote:

> On Wed, May 30, 2012 at 01:00:27PM +0200, Alexander Graf wrote:
>> We want to get rid of the concept of loading an external device tree and instead
>> generate our own. However, to do this we need to also create a device tree
>> template programatically.
>> 
>> This patch adds a helper to create an empty device tree in memory.
> 
> Hm, this make-an-empty-template thing is common enough that I'll make
> a helper for it in libfdt.

Very cool :). That would still mean that we need the in-QEMU helper for a while though, until we can reasonably expect people to have newer versions of libfdt on their systems, right? :)


Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 06/25] dt: add helper for empty dt creation
  2012-06-05 14:07     ` [Qemu-devel] [Qemu-ppc] [PATCH 06/25] dt: add helper for empty dt creation Alexander Graf
@ 2012-06-05 17:00       ` David Gibson
  0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2012-06-05 17:00 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Scott Wood, qemu-ppc, qemu-devel Developers

On Tue, Jun 05, 2012 at 04:07:23PM +0200, Alexander Graf wrote:
> 
> On 31.05.2012, at 12:55, David Gibson wrote:
> 
> > On Wed, May 30, 2012 at 01:00:27PM +0200, Alexander Graf wrote:
> >> We want to get rid of the concept of loading an external device tree and instead
> >> generate our own. However, to do this we need to also create a device tree
> >> template programatically.
> >> 
> >> This patch adds a helper to create an empty device tree in memory.
> > 
> > Hm, this make-an-empty-template thing is common enough that I'll make
> > a helper for it in libfdt.
> 
> Very cool :). That would still mean that we need the in-QEMU helper
> for a while though, until we can reasonably expect people to have
> newer versions of libfdt on their systems, right? :)

True.  The helper is in upstream libfdt git now, btw.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 19/25] PPC: e500: dt: create pci node dynamically
       [not found]   ` <4FC7ECE6.40407@freescale.com>
@ 2012-06-05 22:17     ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2012-06-05 22:17 UTC (permalink / raw)
  To: Scott Wood; +Cc: qemu-ppc, qemu-devel Developers


On 01.06.2012, at 00:12, Scott Wood wrote:

> On 05/30/2012 06:00 AM, Alexander Graf wrote:
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> hw/ppce500_mpc8544ds.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++++
>> pc-bios/mpc8544ds.dtb  |  Bin 1810 -> 72 bytes
>> pc-bios/mpc8544ds.dts  |   46 --------------------------------------------
>> 3 files changed, 50 insertions(+), 46 deletions(-)
>> 
>> diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
>> index 3f6c6e3..d9a3d50 100644
>> --- a/hw/ppce500_mpc8544ds.c
>> +++ b/hw/ppce500_mpc8544ds.c
>> @@ -62,6 +62,27 @@ struct boot_info
>>     uint32_t entry;
>> };
>> 
>> +static void pci_map_create(void *fdt, uint32_t *pci_map, uint32_t mpic)
>> +{
>> +    int i;
>> +    const uint32_t tmp[] = {
>> +                             /* IDSEL 0x11 J17 Slot 1 */
>> +                             0x8800, 0x0, 0x0, 0x1, mpic, 0x2, 0x1,
>> +                             0x8800, 0x0, 0x0, 0x2, mpic, 0x3, 0x1,
>> +                             0x8800, 0x0, 0x0, 0x3, mpic, 0x4, 0x1,
>> +                             0x8800, 0x0, 0x0, 0x4, mpic, 0x1, 0x1,
>> +
>> +                             /* IDSEL 0x12 J16 Slot 2 */
>> +                             0x9000, 0x0, 0x0, 0x1, mpic, 0x3, 0x1,
>> +                             0x9000, 0x0, 0x0, 0x2, mpic, 0x4, 0x1,
>> +                             0x9000, 0x0, 0x0, 0x3, mpic, 0x2, 0x1,
>> +                             0x9000, 0x0, 0x0, 0x4, mpic, 0x1, 0x1,
>> +                           };
>> +    for (i = 0; i < (7 * 8); i++) {
>> +        pci_map[i] = cpu_to_be32(tmp[i]);
>> +    }
>> +}
>> +
>> static int mpc8544_load_device_tree(CPUPPCState *env,
>>                                     target_phys_addr_t addr,
>>                                     uint32_t ramsize,
>> @@ -86,6 +107,11 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
>>     char mpic[128];
>>     uint32_t mpic_ph;
>>     char gutil[128];
>> +    char pci[128];
>> +    uint32_t pci_map[7 * 8];
>> +    uint32_t pci_ranges[12] = { 0x2000000, 0x0, 0xc0000000, 0xc0000000, 0x0,
>> +                                0x20000000, 0x1000000, 0x0, 0x0, 0xe1000000,
>> +                                0x0, 0x10000 };
> 
> At least put in a FIXME for dynamically generating this from the actual
> data QEMU uses.

There's a big fat FIXME for that all over the place throughout the dynamic dt generation. We need to do that for interrupt lines, every time we see an address encoded, heck, even above in the map creation we want to be able to support more than 2 slots depending on the pci controller we're using, no? :)

So I don't think a FIXME here will help. Let's just keep in mind that all of this dt generation code needs quite some more love.


Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-06  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1338375646-15064-1-git-send-email-agraf@suse.de>
     [not found] ` <1338375646-15064-7-git-send-email-agraf@suse.de>
     [not found]   ` <20120531105555.GF11455@truffala.fritz.box>
2012-06-05 14:07     ` [Qemu-devel] [Qemu-ppc] [PATCH 06/25] dt: add helper for empty dt creation Alexander Graf
2012-06-05 17:00       ` David Gibson
     [not found] ` <1338375646-15064-20-git-send-email-agraf@suse.de>
     [not found]   ` <4FC7ECE6.40407@freescale.com>
2012-06-05 22:17     ` [Qemu-devel] [PATCH 19/25] PPC: e500: dt: create pci node dynamically Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).