qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices
Date: Thu, 17 Dec 2015 08:26:39 +0000

On 16 December 2015 at 23:24, Paolo Bonzini <address@hidden> wrote:
>
>
> On 16/12/2015 22:45, Alistair Francis wrote:
>> +
>> +        /* Rename each SPI bus after the SPI device to allow the board
>> +         * to access all of the busses from the SoC.
>> +         */
>> +        spi_bus = qdev_get_child_bus(DEVICE(&s->spi[i]), "spi0");
>> +        snprintf(bus_name, 6, "spi%d", i);
>> +        qdev_bus_rename(spi_bus, bus_name);
>> +
>> +        /* Add the SPI buses to the SoC child bus */
>> +        /* FIXME: This causes the later buses to be duplicated in
>> +         * the SPI devices printout when running qtre.
>> +         */
>> +        QLIST_INSERT_HEAD(&dev->child_bus, spi_bus, sibling);
>
> Isn't the SPI bus accessible with something similar to spi[0-5]/spi0,
> even without this hack?
>
> In any case, I would prefer qdev_bus_rename to stay in xlnx-zynqmp.c.

I disagree that it should be in xlnx-zynqmp.c. Either
(a) qdev already provides some reasonable mechanism for
SoC container like this to allow their users to get at
buses provided by their child objects, in which case we
should use it
(b) qdev doesn't provide such a mechanism, in which case
we need to provide one (either qdev_bus_rename or something
else if you have a better idea)

But we definitely shouldn't have the SoC container code
messing around with the internals of the qdev objects.

thanks
-- PMM



reply via email to

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