* [Qemu-devel] spidev with omap3 running on qemu
[not found] <SNT124-W3021E1A4EA649E3A4FE1F7A47E0@phx.gbl>
@ 2012-10-26 19:03 ` johan marx
2012-10-27 1:06 ` Peter Crosthwaite
0 siblings, 1 reply; 6+ messages in thread
From: johan marx @ 2012-10-26 19:03 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
Hi,
I have been trying to get the spi working on an emulated omap3 with qemu but so far I wasn't able to complete the cycle. I decided to use spidev in order to ease things. Here is what I currently did:
I changed the kernel so everything is working on the real overo board. So it is definitely a qemu problem.I put logging messages into the qemu code to see where I was stucked at: it is transmitting the spi messages but it gets stuck in the spi.c at the line if ((dev = bus->device[channel])).From that I think the bit I'm missing is the initialisation of the spidev device on the qemu side. I don't know if that has to be defined when launching qemu or if that has to be created in qemu source code (then where and how?). I haven't been able to find anything on that subject so I hope someone here can give me a hint.
Thank you for your help,
Johan
[-- Attachment #2: Type: text/html, Size: 1439 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] spidev with omap3 running on qemu
2012-10-26 19:03 ` [Qemu-devel] spidev with omap3 running on qemu johan marx
@ 2012-10-27 1:06 ` Peter Crosthwaite
2012-10-27 9:24 ` johan marx
0 siblings, 1 reply; 6+ messages in thread
From: Peter Crosthwaite @ 2012-10-27 1:06 UTC (permalink / raw)
To: johan marx; +Cc: Peter Maydell, qemu-devel
Hi Johan,
On Sat, Oct 27, 2012 at 5:03 AM, johan marx <pasjoma@hotmail.com> wrote:
> Hi,
> I have been trying to get the spi working on an emulated omap3 with qemu but
> so far I wasn't able to complete the cycle. I decided to use spidev in order
> to ease things. Here is what I currently did:
>
What tree are you building QEMU from and what's your command line invocation?
> I changed the kernel so everything is working on the real overo board. So it
> is definitely a qemu problem.
> I put logging messages into the qemu code to see where I was stucked at: it
> is transmitting the spi messages but it gets stuck in the spi.c at the line
> if ((dev = bus->device[channel])).
>
> From that I think the bit I'm missing is the initialisation of the spidev
> device on the qemu side. I don't know if that has to be defined when
> launching qemu or if that has to be created in qemu source code (then where
> and how?).
I know there is some OMAP SPI stuff in qemu but its not QOMified (the
frawework that lets you command line create devices) so you will have
to change source code if this is the case (assuming it is a device
creation problem). I recently did some work apadting hw/ssi.c for spi
and that is QOMified so may be worthwhile bringing you SPI devices
into that framework so you can command line create attached SPI
devices. If you can point me at a tree and the device models that are
your spi controller and devices (im guessing hw/omap_spi,c), then Ill
be able to give an idea of the effort involved.
I may be able to help you contribute here, the biggest obstacle for me
however is testing. If you can provide tests that exercise the omap
SPI then I may be able to help with a OMAP SPI QOMification effort
(and you bug will hopefully come out in the wash).
Regards,
Peter
I haven't been able to find anything on that subject so I hope
> someone here can give me a hint.
>
> Thank you for your help,
> Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] spidev with omap3 running on qemu
2012-10-27 1:06 ` Peter Crosthwaite
@ 2012-10-27 9:24 ` johan marx
2012-11-01 6:22 ` Peter Crosthwaite
0 siblings, 1 reply; 6+ messages in thread
From: johan marx @ 2012-10-27 9:24 UTC (permalink / raw)
To: peter.crosthwaite; +Cc: peter.maydell, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 3065 bytes --]
Hi Peter,
Thanks for the quick reply. I'm building with qemu-linaro and launching qemu with "qemu-system-arm -M overo -m 512M -sd sd-image.img -clock unix -display none -serial stdio".
For the spi device, I thought of using the omap_spi. I have been playing around last night with the spi_create_device function and I was able to have data going through. I used the tsc2005 device as the omap_spi device reported "Property '.channel' not found".
My final aim being to use qemu in a simulator, I would have to send the spi data to the PC linux side where the emulated hardware will be. I'm therefore not yet sure if it is not easier for me to develop my own spi device directly instead of putting another layer on top of the omap_spi.
Regards,
Johan
> Date: Sat, 27 Oct 2012 11:06:07 +1000
> Subject: Re: [Qemu-devel] spidev with omap3 running on qemu
> From: peter.crosthwaite@xilinx.com
> To: pasjoma@hotmail.com
> CC: qemu-devel@nongnu.org; peter.maydell@linaro.org
>
> Hi Johan,
>
> On Sat, Oct 27, 2012 at 5:03 AM, johan marx <pasjoma@hotmail.com> wrote:
> > Hi,
> > I have been trying to get the spi working on an emulated omap3 with qemu but
> > so far I wasn't able to complete the cycle. I decided to use spidev in order
> > to ease things. Here is what I currently did:
> >
>
> What tree are you building QEMU from and what's your command line invocation?
>
> > I changed the kernel so everything is working on the real overo board. So it
> > is definitely a qemu problem.
> > I put logging messages into the qemu code to see where I was stucked at: it
> > is transmitting the spi messages but it gets stuck in the spi.c at the line
> > if ((dev = bus->device[channel])).
> >
> > From that I think the bit I'm missing is the initialisation of the spidev
> > device on the qemu side. I don't know if that has to be defined when
> > launching qemu or if that has to be created in qemu source code (then where
> > and how?).
>
> I know there is some OMAP SPI stuff in qemu but its not QOMified (the
> frawework that lets you command line create devices) so you will have
> to change source code if this is the case (assuming it is a device
> creation problem). I recently did some work apadting hw/ssi.c for spi
> and that is QOMified so may be worthwhile bringing you SPI devices
> into that framework so you can command line create attached SPI
> devices. If you can point me at a tree and the device models that are
> your spi controller and devices (im guessing hw/omap_spi,c), then Ill
> be able to give an idea of the effort involved.
>
> I may be able to help you contribute here, the biggest obstacle for me
> however is testing. If you can provide tests that exercise the omap
> SPI then I may be able to help with a OMAP SPI QOMification effort
> (and you bug will hopefully come out in the wash).
>
> Regards,
> Peter
>
> I haven't been able to find anything on that subject so I hope
> > someone here can give me a hint.
> >
> > Thank you for your help,
> > Johan
[-- Attachment #2: Type: text/html, Size: 3821 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] spidev with omap3 running on qemu
2012-10-27 9:24 ` johan marx
@ 2012-11-01 6:22 ` Peter Crosthwaite
2012-11-03 23:16 ` johan marx
2012-11-03 23:59 ` Peter Maydell
0 siblings, 2 replies; 6+ messages in thread
From: Peter Crosthwaite @ 2012-11-01 6:22 UTC (permalink / raw)
To: johan marx; +Cc: peter.maydell, qemu-devel
On Sat, Oct 27, 2012 at 7:24 PM, johan marx <pasjoma@hotmail.com> wrote:
> Hi Peter,
>
> Thanks for the quick reply. I'm building with qemu-linaro
Hi Johan,
Sorry about the delay.
Ive had a quick browse of this tree. The OMAP spi work there is ahead
of whats in mainline, but is still divergent from the the ssi based in
mainline that I have been working on. Should be a fairly mechanical
conversion to bring what PMM has done there over to SSI so there is
only one SPI bus implementation that can all the devices. That
something of a long term goal though.
and launching qemu
> with "qemu-system-arm -M overo -m 512M -sd sd-image.img -clock unix -display
> none -serial stdio".
> For the spi device, I thought of using the omap_spi. I have been playing
> around last night with the spi_create_device function and I was able to have
> data going through. I used the tsc2005 device as the omap_spi device
> reported "Property '.channel' not found".
Thats sounds like a bug in QEMU, probably in the Linaro tree SPI framework.
> My final aim being to use qemu in a simulator, I would have to send the spi
> data to the PC linux side where the emulated hardware will be. I'm therefore
> not yet sure if it is not easier for me to develop my own spi device
My guess is fixing the bugs you have encountered in the OMAP spi
controller is the path of least resistance.
> directly instead of putting another layer on top of the omap_spi.
Shouldn't be a layer onto of OMAP spi, rather a SPI device definition.
You should be able to do it in a self contained way without having to
worry about what spi controller (OMAP or otherwise) is driving your
device.
Regards,
Peter
> Regards,
> Johan
>
>> Date: Sat, 27 Oct 2012 11:06:07 +1000
>> Subject: Re: [Qemu-devel] spidev with omap3 running on qemu
>> From: peter.crosthwaite@xilinx.com
>> To: pasjoma@hotmail.com
>> CC: qemu-devel@nongnu.org; peter.maydell@linaro.org
>
>>
>> Hi Johan,
>>
>> On Sat, Oct 27, 2012 at 5:03 AM, johan marx <pasjoma@hotmail.com> wrote:
>> > Hi,
>> > I have been trying to get the spi working on an emulated omap3 with qemu
>> > but
>> > so far I wasn't able to complete the cycle. I decided to use spidev in
>> > order
>> > to ease things. Here is what I currently did:
>> >
>>
>> What tree are you building QEMU from and what's your command line
>> invocation?
>>
>> > I changed the kernel so everything is working on the real overo board.
>> > So it
>> > is definitely a qemu problem.
>> > I put logging messages into the qemu code to see where I was stucked at:
>> > it
>> > is transmitting the spi messages but it gets stuck in the spi.c at the
>> > line
>> > if ((dev = bus->device[channel])).
>> >
>> > From that I think the bit I'm missing is the initialisation of the
>> > spidev
>> > device on the qemu side. I don't know if that has to be defined when
>> > launching qemu or if that has to be created in qemu source code (then
>> > where
>> > and how?).
>>
>> I know there is some OMAP SPI stuff in qemu but its not QOMified (the
>> frawework that lets you command line create devices) so you will have
>> to change source code if this is the case (assuming it is a device
>> creation problem). I recently did some work apadting hw/ssi.c for spi
>> and that is QOMified so may be worthwhile bringing you SPI devices
>> into that framework so you can command line create attached SPI
>> devices. If you can point me at a tree and the device models that are
>> your spi controller and devices (im guessing hw/omap_spi,c), then Ill
>> be able to give an idea of the effort involved.
>>
>> I may be able to help you contribute here, the biggest obstacle for me
>> however is testing. If you can provide tests that exercise the omap
>> SPI then I may be able to help with a OMAP SPI QOMification effort
>> (and you bug will hopefully come out in the wash).
>>
>> Regards,
>> Peter
>>
>> I haven't been able to find anything on that subject so I hope
>> > someone here can give me a hint.
>> >
>> > Thank you for your help,
>> > Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] spidev with omap3 running on qemu
2012-11-01 6:22 ` Peter Crosthwaite
@ 2012-11-03 23:16 ` johan marx
2012-11-03 23:59 ` Peter Maydell
1 sibling, 0 replies; 6+ messages in thread
From: johan marx @ 2012-11-03 23:16 UTC (permalink / raw)
To: peter.crosthwaite; +Cc: peter.maydell, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 5167 bytes --]
Hi Peter,
I had a closer look at the omap_spi. It is indeed not supposed to be a spi device (which is why it failed when treated like one).
omap_spi makes the connection between the different spi registers and the spi.c.
The way I see it is the following:
omap_spi<->spi<->my_device
I would therefore need to create my device and add it to the spi bus using spi_create_device (which does make sense since if there is nothing plugged in the spi bus, how can it communicate).
I still have to look at the complete communication cycle, especially the receiving part.
Regards,
Johan
> Date: Thu, 1 Nov 2012 16:22:31 +1000
> Subject: Re: [Qemu-devel] spidev with omap3 running on qemu
> From: peter.crosthwaite@xilinx.com
> To: pasjoma@hotmail.com
> CC: peter.maydell@linaro.org; qemu-devel@nongnu.org
>
> On Sat, Oct 27, 2012 at 7:24 PM, johan marx <pasjoma@hotmail.com> wrote:
> > Hi Peter,
> >
> > Thanks for the quick reply. I'm building with qemu-linaro
>
> Hi Johan,
>
> Sorry about the delay.
>
> Ive had a quick browse of this tree. The OMAP spi work there is ahead
> of whats in mainline, but is still divergent from the the ssi based in
> mainline that I have been working on. Should be a fairly mechanical
> conversion to bring what PMM has done there over to SSI so there is
> only one SPI bus implementation that can all the devices. That
> something of a long term goal though.
>
> and launching qemu
> > with "qemu-system-arm -M overo -m 512M -sd sd-image.img -clock unix -display
> > none -serial stdio".
> > For the spi device, I thought of using the omap_spi. I have been playing
> > around last night with the spi_create_device function and I was able to have
> > data going through. I used the tsc2005 device as the omap_spi device
> > reported "Property '.channel' not found".
>
> Thats sounds like a bug in QEMU, probably in the Linaro tree SPI framework.
>
> > My final aim being to use qemu in a simulator, I would have to send the spi
> > data to the PC linux side where the emulated hardware will be. I'm therefore
> > not yet sure if it is not easier for me to develop my own spi device
>
> My guess is fixing the bugs you have encountered in the OMAP spi
> controller is the path of least resistance.
>
> > directly instead of putting another layer on top of the omap_spi.
>
> Shouldn't be a layer onto of OMAP spi, rather a SPI device definition.
> You should be able to do it in a self contained way without having to
> worry about what spi controller (OMAP or otherwise) is driving your
> device.
>
> Regards,
> Peter
>
> > Regards,
> > Johan
> >
> >> Date: Sat, 27 Oct 2012 11:06:07 +1000
> >> Subject: Re: [Qemu-devel] spidev with omap3 running on qemu
> >> From: peter.crosthwaite@xilinx.com
> >> To: pasjoma@hotmail.com
> >> CC: qemu-devel@nongnu.org; peter.maydell@linaro.org
> >
> >>
> >> Hi Johan,
> >>
> >> On Sat, Oct 27, 2012 at 5:03 AM, johan marx <pasjoma@hotmail.com> wrote:
> >> > Hi,
> >> > I have been trying to get the spi working on an emulated omap3 with qemu
> >> > but
> >> > so far I wasn't able to complete the cycle. I decided to use spidev in
> >> > order
> >> > to ease things. Here is what I currently did:
> >> >
> >>
> >> What tree are you building QEMU from and what's your command line
> >> invocation?
> >>
> >> > I changed the kernel so everything is working on the real overo board.
> >> > So it
> >> > is definitely a qemu problem.
> >> > I put logging messages into the qemu code to see where I was stucked at:
> >> > it
> >> > is transmitting the spi messages but it gets stuck in the spi.c at the
> >> > line
> >> > if ((dev = bus->device[channel])).
> >> >
> >> > From that I think the bit I'm missing is the initialisation of the
> >> > spidev
> >> > device on the qemu side. I don't know if that has to be defined when
> >> > launching qemu or if that has to be created in qemu source code (then
> >> > where
> >> > and how?).
> >>
> >> I know there is some OMAP SPI stuff in qemu but its not QOMified (the
> >> frawework that lets you command line create devices) so you will have
> >> to change source code if this is the case (assuming it is a device
> >> creation problem). I recently did some work apadting hw/ssi.c for spi
> >> and that is QOMified so may be worthwhile bringing you SPI devices
> >> into that framework so you can command line create attached SPI
> >> devices. If you can point me at a tree and the device models that are
> >> your spi controller and devices (im guessing hw/omap_spi,c), then Ill
> >> be able to give an idea of the effort involved.
> >>
> >> I may be able to help you contribute here, the biggest obstacle for me
> >> however is testing. If you can provide tests that exercise the omap
> >> SPI then I may be able to help with a OMAP SPI QOMification effort
> >> (and you bug will hopefully come out in the wash).
> >>
> >> Regards,
> >> Peter
> >>
> >> I haven't been able to find anything on that subject so I hope
> >> > someone here can give me a hint.
> >> >
> >> > Thank you for your help,
> >> > Johan
[-- Attachment #2: Type: text/html, Size: 6522 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] spidev with omap3 running on qemu
2012-11-01 6:22 ` Peter Crosthwaite
2012-11-03 23:16 ` johan marx
@ 2012-11-03 23:59 ` Peter Maydell
1 sibling, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2012-11-03 23:59 UTC (permalink / raw)
To: Peter Crosthwaite; +Cc: johan marx, qemu-devel
On 1 November 2012 07:22, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> On Sat, Oct 27, 2012 at 7:24 PM, johan marx <pasjoma@hotmail.com> wrote:
>> Hi Peter,
>>
>> Thanks for the quick reply. I'm building with qemu-linaro
>
> Hi Johan,
>
> Sorry about the delay.
>
> Ive had a quick browse of this tree. The OMAP spi work there is ahead
> of whats in mainline, but is still divergent from the the ssi based in
> mainline that I have been working on. Should be a fairly mechanical
> conversion to bring what PMM has done there over to SSI so there is
> only one SPI bus implementation that can all the devices. That
> something of a long term goal though.
Yeah, I'm not particularly attached to any of the SPI OMAP3 code
in that tree (not having written it myself :-)). However I haven't
had much time to do omap3 related work for some time now, so mostly
my rebases of that tree have been mechanical + smoke test. It's
possible I missed something I should have changed...
In general, yes, we should get upstream's SSI framework into good
shape and then bring the omap3 stuff into line with it (possibly
even managing to upstream omap3?).
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-11-03 23:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <SNT124-W3021E1A4EA649E3A4FE1F7A47E0@phx.gbl>
2012-10-26 19:03 ` [Qemu-devel] spidev with omap3 running on qemu johan marx
2012-10-27 1:06 ` Peter Crosthwaite
2012-10-27 9:24 ` johan marx
2012-11-01 6:22 ` Peter Crosthwaite
2012-11-03 23:16 ` johan marx
2012-11-03 23:59 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).