qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Modular hardware emulation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Modular hardware emulation
Date: Tue, 11 Jul 2017 11:00:37 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Wed, Jul 05, 2017 at 05:56:51PM +0000, Tom Cook wrote:
> I'm using qemu to emulate a certain fruit-flavoured single-board computer -
> which is fantastic for testing changes configuration, by the way.
> 
> We have a bit of custom hardware attached to that single-board computer -
> essentially an SPI-slave 8-channel ADC with some analog electronics
> attached.
> 
> I'm trying to get a feel for the level of effort involved in writing an
> emulation of this custom hardware that will work with qemu.  I can see two
> extremes:  At one end of the scale, there might be a nice Python interface
> already in place for writing SPI device emulations and all I need to do is
> point a command-line parameter at a suitable script and away it goes.  At
> the other end, I need to hack around in the qemu source, understand about
> 3/4 of it and create a custom build of the whole emulator.
> 
> Can someone give me some sort of idea what level of effort is involved, and
> perhaps a pointer in the right direction, please?

Emulated devices are part of the QEMU codebase.  They live in hw/.  You
would have to learn about QEMU internals to add a custom device.

I'm not an ARM expert or familiar with SPI, but the starting point would
be looking at the machine type (board) you are using and locating the
SPI controller (BCM2835 SPI0?).  See if that is emulated in QEMU and if
there are any existing devices for you to study.

git grep -i '\<spi\>' doesn't show much evidence of true SPI support.
There is SSI and I2C support though, so at least those would give you an
idea of how to add SPI.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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