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

2015-12-19 Thread Peter Crosthwaite
On Fri, Dec 18, 2015 at 9:55 AM, Paolo Bonzini wrote: > > > On 18/12/2015 18:17, Alistair Francis wrote: >> Does anyone have any ideas on how we can do this? >> >> AFAIK there is no way to currently do this, so we need to add >> something. What is the preferred way to expose the buses? > > For now

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

2015-12-18 Thread Paolo Bonzini
On 18/12/2015 18:17, Alistair Francis wrote: > Does anyone have any ideas on how we can do this? > > AFAIK there is no way to currently do this, so we need to add > something. What is the preferred way to expose the buses? For now, what you're doing is okay for me, just moving the funky code in

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

2015-12-18 Thread Alistair Francis
On Thu, Dec 17, 2015 at 3:12 AM, Paolo Bonzini wrote: > > > On 17/12/2015 12:11, Peter Maydell wrote: >> > It's a hack and I don't want it to become a sanctioned way to do it. >> > It's already messing around pretty heavily with qdev internals, see the >> > line right after QLIST_INSERT_HEAD: >> >

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

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 12:11, Peter Maydell wrote: > > It's a hack and I don't want it to become a sanctioned way to do it. > > It's already messing around pretty heavily with qdev internals, see the > > line right after QLIST_INSERT_HEAD: > > > > QLIST_INSERT_HEAD(&dev->child_bus, spi_bus, siblin

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

2015-12-17 Thread Peter Maydell
On 17 December 2015 at 10:28, Paolo Bonzini wrote: > > > On 17/12/2015 09:26, Peter Maydell wrote: >>> > 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

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

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 09:26, Peter Maydell wrote: >> > 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 p

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

2015-12-17 Thread Peter Maydell
On 16 December 2015 at 23:24, Paolo Bonzini 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(DE

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

2015-12-16 Thread Alistair Francis
On Wed, Dec 16, 2015 at 3:24 PM, Paolo Bonzini 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

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

2015-12-16 Thread Paolo Bonzini
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, "

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

2015-12-16 Thread Alistair Francis
Connect the Xilinx SPI devices to the ZynqMP model. Signed-off-by: Alistair Francis --- V5: - Use the bus renaming function V4: - Rename the SPI busses so that they can all be accessed from the SoC - Don't set the num-busses property V3: - Expose the SPI Bus as part of the SoC device V2: - D