qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board


From: Max Filippov
Subject: Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board
Date: Wed, 20 Jun 2012 16:57:11 +0400

On Wed, Jun 20, 2012 at 1:42 PM, Jia Liu <address@hidden> wrote:
> Hi Max,
>
> On Wed, Jun 20, 2012 at 2:29 PM, Max Filippov <address@hidden> wrote:
>> On 06/18/2012 05:02 AM, Jia Liu wrote:
>>> Add a dummy board for IIS.
>>>
>>> Signed-off-by: Jia Liu<address@hidden>
>>
>> [...]
>>
>>
>>> +    if (nd_table[0].vlan) {
>>> +        isa_ne2000_init(isa_bus, 0x92000000, 4,&nd_table[0]);
>>> +    }
>>
>> I have noticed that the kernel you provided expects OpenCores ethernet
>> device.
>> We have a model for it (: You can look at lx60_net_init() in the
>> hw/xtensa_lx60.c
>> to see how it may be connected.
>>
>
> Thank you very much for remind me!
>
> Is this code OK?
>
> static void or1200_net_init(MemoryRegion *address_space,
>                            target_phys_addr_t base,
>                            target_phys_addr_t buffers,
>                            qemu_irq irq, NICInfo *nd)
> {
>    DeviceState *dev;
>    SysBusDevice *s;
>    MemoryRegion *ram;
>
>    dev = qdev_create(NULL, "open_eth");
>    qdev_set_nic_properties(dev, nd);
>    qdev_init_nofail(dev);
>
>    s = sysbus_from_qdev(dev);
>    sysbus_connect_irq(s, 0, irq);
>    memory_region_add_subregion(get_system_memory(), base,
>                                sysbus_mmio_get_region(s, 0));
>
>    ram = g_malloc(sizeof(*ram));
>    memory_region_init_ram(ram, "open_eth.ram", 0x100);
>    vmstate_register_ram_global(ram);
>    memory_region_add_subregion(address_space, buffers, ram);
> }

You haven't mapped descriptors window. Seems to me it should look like this:

static void or1200_net_init(MemoryRegion *address_space,
        target_phys_addr_t base,
        target_phys_addr_t descriptors,
        qemu_irq irq, NICInfo *nd)
{
    DeviceState *dev;
    SysBusDevice *s;

    dev = qdev_create(NULL, "open_eth");
    qdev_set_nic_properties(dev, nd);
    qdev_init_nofail(dev);

    s = sysbus_from_qdev(dev);
    sysbus_connect_irq(s, 0, irq);
    memory_region_add_subregion(address_space, base,
            sysbus_mmio_get_region(s, 0));
    memory_region_add_subregion(address_space, descriptors,
            sysbus_mmio_get_region(s, 1));
}

>
>    if (nd_table[0].vlan) {
>        or1200_net_init(get_system_memory(), 0x92000000,
>                        0x92100000, env->irq[4], nd_table);
>    }
>

Also I haven't found where 0x92100000 comes from.
Is there a memory map documentation for this machine?

-- 
Thanks.
-- Max



reply via email to

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