qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Qemu GPIO support
@ 2009-09-01 12:46 bifferos
  0 siblings, 0 replies; only message in thread
From: bifferos @ 2009-09-01 12:46 UTC (permalink / raw)
  To: qemu-devel

Greetings,

I thought I should probably announce here my work on GPIO support for Qemu. I've favoured correctness of operation and flexibility over speed, since I'm generally emulating embedded devices anyhow.

Here are the requirements:

1) Multiple peripherals can be connected to the same pins
2) Multiple machines (Qemu instances) can be connected to the same pins
3) The system must arbitrate to determine pin state, and take into account pull-up resistors, and signal when pins are in contention
4) Peripherals can be unplugged at any time
5) Machines can be unplugged at any time
6) The system should be as efficient as possible given the above requirements.
7) The system should be portable (Windows, Linux)
8) The system should allow writing peripherals in any programming language

The approach I've adopted was to write a tcp socket server to which Qemu and other peripherals can connect to.  The closest analogy is that it behaves as a terminal block.  Clients connect, inform the server which pins they are connecting to, and whether they are passively pulled high, actively driven high, or actively driven low.  The server then arbitrates and tells the clients what the pins values are when asked.  They can be either logic '1', '0' or in contention.  Clients can subscribe to pin changes (useful for peripherals), or they can simply poll (the Qemu client(s) will generally do this)

For the moment, I have implemented the server, a Qemu patch to access 
some gpio pins via PCI northbridge (this is how RDC chips do it, other
x86 systems will just use basic IO ports), and also a trivial LED emulation client.

All this stuff can be seen in action over here:
http://sites.google.com/site/bifferboard/Home/howto/qemu

It is currently heavily biased towards the Bifferboard, which is a 
1W x86-compatible controller, but can easily be adapted to other x86 machines, probably other architectures can use the same approach.

I will be adding MMC/HD47780/i2c/button emulation and so on as time permits.

cheers,
Biff.







^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-01 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-01 12:46 [Qemu-devel] Qemu GPIO support bifferos

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).