qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 19/25] PPC: e500: dt: create pci node dynamicall


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 19/25] PPC: e500: dt: create pci node dynamically
Date: Wed, 6 Jun 2012 00:17:09 +0200

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 <address@hidden>
>> ---
>> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]