qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 8/8] vexpress: Add virtio-mmio transports


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 8/8] vexpress: Add virtio-mmio transports
Date: Mon, 15 Jul 2013 10:40:00 +0100

On 15 July 2013 01:17, Peter Crosthwaite <address@hidden> wrote:
> On Sat, Jul 13, 2013 at 6:37 AM, Peter Maydell <address@hidden> wrote:
>> +static int add_virtio_mmio_node(void *fdt, uint32_t acells, uint32_t scells,
>> +                                hwaddr addr, hwaddr size, uint32_t intc,
>> +                                int irq)
>
> This seems pretty general to me and maybe belongs in the device tree API. Some
> of the PPC machines could make good use of this. From e500:
>
> snprintf(mpic, sizeof(mpic), "%s/address@hidden", soc, 
> MPC8544_MPIC_REGS_OFFSET);
>     qemu_devtree_add_subnode(fdt, mpic);
>     qemu_devtree_setprop_string(fdt, mpic, "device_type", "open-pic");
>     qemu_devtree_setprop_string(fdt, mpic, "compatible", "fsl,mpic");
>     qemu_devtree_setprop_cells(fdt, mpic, "reg", MPC8544_MPIC_REGS_OFFSET,
>                                0x40000);
>     qemu_devtree_setprop_cell(fdt, mpic, "#address-cells", 0);
>     qemu_devtree_setprop_cell(fdt, mpic, "#interrupt-cells", 2);
>
> The nasty intc specific stuff is a problem, but perhaps at least the
> boiler plate
> creation+reg+compatibile can be factored out for all to use?

Doesn't really seem worth doing to me -- all we're doing is
setting some string properties, and the reg property is tricky
because it's only the right thing in some cases (ie where you
know you're not putting the node inside some other container
that messes with ranges). The setprop_sized_cells is the part
I felt really merited being factored out.

thanks
-- PMM



reply via email to

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