From: bifferos <bifferos@yahoo.co.uk>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Qemu GPIO support
Date: Tue, 1 Sep 2009 05:46:56 -0700 (PDT) [thread overview]
Message-ID: <348599.74411.qm@web27002.mail.ukl.yahoo.com> (raw)
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.
reply other threads:[~2009-09-01 12:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=348599.74411.qm@web27002.mail.ukl.yahoo.com \
--to=bifferos@yahoo.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).