qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clegoate@redhat.com>
To: minyard@acm.org, Paz Offer <poffer@nvidia.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: Trying to write data to i2c bus
Date: Mon, 19 Feb 2024 19:26:24 +0100	[thread overview]
Message-ID: <9db64273-d7e6-445c-bfe4-dcf7d90ee892@redhat.com> (raw)
In-Reply-To: <ZdOMZKTd+tZqVpcC@mail.minyard.net>

On 2/19/24 18:14, Corey Minyard wrote:
> On Mon, Feb 19, 2024 at 04:53:47PM +0000, Paz Offer wrote:
>> Thank you very much Corey,
>>
>> I am simulating an external module that wants to communicate with the board management controller (BMC).
>> The real device will be connected to the board using i2c bus, and could initiate communication at any time, by sending bytes over the bus.
> 
> And you have a simulated BMC that can do this?  Or is the system running
> in qemu the BMC.
> 
>>
>> I am not sure whether the 'Master-side' (the side the initiating communication) needs to simulate a full i2c-master device, or whether my code could 'simply' write directly to the appropriate registers of the guest OS.
>> Are there some examples or documentation on how to implement something like this?
> 
> The aspeed i2c controller is capable of having another bus master on an
> I2C but, but it is the only host that can currently do it.
> 
> It is doable, the code is ther for multiple bus masters, but there is no
> device currently that does it.  I assume that is coming at some point,
> but no documentation exists on how to do it.
> 
> You can look at the git commits in hw/i2c around 37fa5ca42623 "hw/i2c:
> support multiple masters" for the changes that were done to support
> this.


There is an i2c-echo device implementing an I2C slave  and a test,
test_arm_ast2600_evb_buildroot in tests/avocado/ machine_aspeed.py,
using it on the ast2600-evb.


Thanks,

C.





  reply	other threads:[~2024-02-19 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 13:49 Trying to write data to i2c bus Paz Offer
2024-02-19 16:32 ` Corey Minyard
2024-02-19 16:53   ` Paz Offer
2024-02-19 17:14     ` Corey Minyard
2024-02-19 18:26       ` Cédric Le Goater [this message]
2024-02-25  8:29       ` Paz Offer

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=9db64273-d7e6-445c-bfe4-dcf7d90ee892@redhat.com \
    --to=clegoate@redhat.com \
    --cc=minyard@acm.org \
    --cc=poffer@nvidia.com \
    --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).