From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Graf <alexander.graf@ilr.tu-berlin.de>,
Peter Maydell <peter.maydell@linaro.org>,
Alexander Graf <graf@campus.tu-berlin.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] hw/arm: add Lego NXT board
Date: Tue, 15 Jul 2014 12:53:17 +0200 [thread overview]
Message-ID: <53C5081D.20408@redhat.com> (raw)
In-Reply-To: <53C501DD.3090805@ilr.tu-berlin.de>
Il 15/07/2014 12:26, Alexander Graf ha scritto:
> Thanks for the idea. I still don't get why it should be better to fake
> an I2C device rather than a universal memory IO.
Because this would not be fake, the idea was to emulate the actual
sensor/actuator outside QEMU. Which makes sense for much more than
bypassing the GPL. You listed some uses (test oracles), I added more
(passthrough using the same chardev-based interface), and on top of this
the devices are usually so stupid that there's not much point in
bypassing the GPL in the first place.
> I don't want to emulate
> the controllers hardware, but only communicate the abstract
> sensor/actuator values. In addition not all Sensors are I2C devices, so
> there is no value in doing it via an I2C bus. Even the simple I2C
> protocol mentioned in the data sheet is more complex than mine.
That datasheet also has some GPIO pins, whether you need that depends on
the I2C sensors and actuators you care about. In the end it's just two
commands (start and stop).
SSI is even simpler, it's just write a byte to the chardev, read a byte
from the chardev.
In any case yeah, that's why I asked what protocol do the devices use in
the actual hardware.
If the hardware is really using memory-mapped registers, the external
program can talk to QEMU via QMP and set QOM properties and qom-set.
There is an example in hw/misc/tmp105.c and tests/tmp105-test.c
Of course you could do that for all sensors instead of going to I2C (as
you are doing now). However, QEMU already has I2C and SSI emulation so
I don't see much value in paravirtualization.
> Could you point me to the code where the chardev devices are defined in
> qemu?
Not sure I understand the question so -> irc. :)
Paolo
next prev parent reply other threads:[~2014-07-15 10:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 14:20 [Qemu-devel] hw/arm: add Lego NXT board Alexander Graf
2014-07-14 11:23 ` Peter Crosthwaite
2014-07-14 11:46 ` Paolo Bonzini
2014-07-14 18:09 ` Alexander Graf
2014-07-14 20:37 ` Paolo Bonzini
2014-07-14 21:10 ` Alexander Graf
2014-07-14 22:48 ` Peter Maydell
2014-07-15 7:06 ` Paolo Bonzini
2014-07-15 10:26 ` Alexander Graf
2014-07-15 10:53 ` Paolo Bonzini [this message]
2014-07-15 18:55 ` Alexander Graf
2014-07-15 20:09 ` Paolo Bonzini
2014-07-16 8:40 ` Alexander Graf
2014-07-16 8:50 ` Paolo Bonzini
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=53C5081D.20408@redhat.com \
--to=pbonzini@redhat.com \
--cc=alexander.graf@ilr.tu-berlin.de \
--cc=graf@campus.tu-berlin.de \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.