qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] spidev with omap3 running on qemu


From: johan marx
Subject: Re: [Qemu-devel] spidev with omap3 running on qemu
Date: Sat, 3 Nov 2012 23:16:44 +0000

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: address@hidden
> To: address@hidden
> CC: address@hidden; address@hidden
>
> On Sat, Oct 27, 2012 at 7:24 PM, johan marx <address@hidden> 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: address@hidden
> >> To: address@hidden
> >> CC: address@hidden; address@hidden
> >
> >>
> >> Hi Johan,
> >>
> >> On Sat, Oct 27, 2012 at 5:03 AM, johan marx <address@hidden> 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

reply via email to

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